/*
 * Tool pages: one tool each, on the same night stage as the showcase. Loaded after site.css,
 * whose tokens, navigation, buttons, labels and footer these pages share; this file adds the head
 * of a tool page and the few controls every tool is built from. The light is the tools' own blue.
 */

/* The tools show and hide parts with the hidden attribute; a display set below must not undo it. */
[hidden] { display: none !important; }

/* ---------- Moving between the tools ---------- */

.nav__links--tools a[aria-current="page"] { background: color-mix(in srgb, var(--tone) 14%, transparent); color: var(--ink); }
/* Five names need more room than the showcase's three; narrower, the way back to the toolbox is enough. */
@media (max-width: 1080px) { .nav__links--tools { display: none; } }

/* ---------- The head of a tool page ---------- */

.tool { padding-top: 68px; }
.tool__head { padding-block: clamp(48px, 7vw, 96px) clamp(28px, 4vw, 44px); }
.tool__name { margin-top: 20px; font-size: clamp(2.5rem, 5.2vw, 4.5rem); font-weight: 700; line-height: 1.08; letter-spacing: -.02em; }
.tool__pitch { max-width: 34em; margin-top: 16px; color: var(--ink-soft); font-size: clamp(1rem, 1.35vw, 1.1875rem); line-height: 1.75; text-wrap: balance; }
.tool__note { display: flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--ink-faint); font-size: .8125rem; }
.tool__note .icon { width: 1.1em; height: 1.1em; color: var(--tone); }
.tool__app { padding-bottom: clamp(80px, 11vw, 150px); }
.tool__fallback { padding: 40px 24px; border-radius: 26px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-soft); text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Panels ---------- */

.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; align-items: start; }
.panel { position: relative; display: grid; gap: 20px; align-content: start; min-width: 0; padding: clamp(20px, 2.4vw, 30px); border-radius: 26px; background: radial-gradient(560px circle at 0 0, color-mix(in srgb, var(--tone) 8%, transparent), transparent 70%), rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.panel__title { font-size: 1.0625rem; font-weight: 650; letter-spacing: .02em; }
.panel__title small { margin-left: 10px; color: var(--ink-faint); font: 500 .75rem var(--font-mono); letter-spacing: .04em; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 16px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hint { color: var(--ink-faint); font-size: .8125rem; line-height: 1.75; }
.empty { padding: 44px 12px; color: var(--ink-faint); font-size: .875rem; text-align: center; }

/* ---------- Buttons ---------- */

button.button { border: 0; cursor: pointer; font-family: inherit; }
.button--small { min-height: 46px; padding: 0 1.35em; font-size: .875rem; }
.button:disabled { opacity: .36; cursor: not-allowed; transform: none; box-shadow: none; }
.button--ghost:disabled { box-shadow: inset 0 0 0 1px var(--line-strong); }
/* A quiet action that lives in a panel's head: an icon and a word. */
.chip-button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 13px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .05); color: var(--ink-soft); font: 600 .8125rem var(--font-sans); white-space: nowrap; cursor: pointer; transition: background-color .2s, color .2s; }
.chip-button .icon { width: 1.05em; height: 1.05em; }
.chip-button:disabled { opacity: .4; cursor: not-allowed; }
@media (hover: hover) { .chip-button:hover:not(:disabled) { background: color-mix(in srgb, var(--tone) 16%, transparent); color: var(--ink); } }

/* ---------- Fields ---------- */

.field { display: grid; gap: 8px; min-width: 0; }
.field__label { color: var(--ink-soft); font-size: .8125rem; letter-spacing: .04em; }
.field__label output { margin-left: 6px; color: var(--tone); font: 600 .8125rem var(--font-mono); }
.input { width: 100%; min-height: 50px; padding: 13px 16px; border: 0; border-radius: 14px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink); font: 400 .9375rem/1.6 var(--font-sans); transition: box-shadow .2s, background-color .2s; }
.input::placeholder { color: var(--ink-faint); }
.input:focus { outline: none; background: rgba(255, 255, 255, .06); box-shadow: inset 0 0 0 1px var(--tone), 0 0 0 4px color-mix(in srgb, var(--tone) 16%, transparent); }
textarea.input { min-height: 240px; resize: vertical; font: 400 .875rem/1.75 var(--font-mono); word-break: break-all; }
textarea.input[readonly] { background: rgba(0, 0, 0, .2); }
select.input { appearance: none; padding-right: 44px; background: rgba(255, 255, 255, .04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(241,245,247,.66)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center / 14px; cursor: pointer; }
select.input option { background: #0d141c; color: var(--ink); }
input[type="range"] { width: 100%; height: 50px; margin: 0; accent-color: var(--tone); cursor: pointer; }
input[type="range"]:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- A row of choices, one of them on ---------- */

.segmented { display: inline-flex; flex-wrap: wrap; justify-self: start; gap: 4px; padding: 4px; border-radius: 24px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px var(--line); }
.segmented button { min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: none; color: var(--ink-soft); font: 600 .875rem var(--font-sans); white-space: nowrap; cursor: pointer; transition: background-color .25s, color .25s; }
.segmented button[aria-pressed="true"] { background: var(--tone); color: var(--tone-ink); }
@media (hover: hover) { .segmented button:hover:not([aria-pressed="true"]) { background: rgba(255, 255, 255, .06); color: var(--ink); } }

/* ---------- Dropping files in ---------- */

/* The whole zone is the label of its file input: a click opens the picker, the input keeps the focus. */
.drop { position: relative; display: grid; place-items: center; align-content: center; gap: 10px; min-height: 210px; padding: 32px 24px; border: 1.5px dashed color-mix(in srgb, var(--tone) 36%, transparent); border-radius: 22px; background: color-mix(in srgb, var(--tone) 4%, transparent); text-align: center; cursor: pointer; transition: background-color .25s, border-color .25s; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop.is-over { border-color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent); }
.drop:has(input:focus-visible) { outline: 2px solid var(--tone); outline-offset: 4px; }
.drop__icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 4px; border-radius: 18px; background: color-mix(in srgb, var(--tone) 14%, transparent); color: var(--tone); }
.drop__icon .icon { width: 26px; height: 26px; }
.drop strong { font-size: 1.0625rem; font-weight: 650; }
.drop > span:last-child { color: var(--ink-faint); font-size: .8125rem; }
@media (hover: hover) { .drop:hover { border-color: color-mix(in srgb, var(--tone) 70%, transparent); background: color-mix(in srgb, var(--tone) 8%, transparent); } }

/* ---------- Lists of results ---------- */

.queue, .results { display: grid; }
.queue li, .results li { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 12px 0; border-top: 1px solid var(--line); }
.queue li:first-child, .results li:first-child { border-top: 0; }
.queue__thumb { flex: none; width: 46px; height: 46px; border-radius: 11px; background: rgba(255, 255, 255, .05); object-fit: cover; }
.queue__thumb--none { display: grid; place-items: center; color: var(--ink-faint); }
.queue__text, .results__name { flex: 1; min-width: 0; }
.queue__text { display: grid; gap: 2px; }
.queue__name { overflow: hidden; font-size: .9375rem; text-overflow: ellipsis; white-space: nowrap; }
.queue__meta { color: var(--ink-faint); font: 500 .75rem var(--font-mono); }
.status { display: inline-flex; flex: none; align-items: center; gap: 6px; padding: .35em .85em; border: 0; border-radius: 999px; background: none; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink-soft); font: 500 .75rem var(--font-sans); white-space: nowrap; }
.status .icon { width: 1.1em; height: 1.1em; }
.status--work { color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 40%, transparent); }
.status--done { color: var(--tone); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 50%, transparent); cursor: pointer; transition: background-color .2s; }
.status--error { color: #ff9c78; box-shadow: inset 0 0 0 1px rgba(255, 156, 120, .42); white-space: normal; text-align: right; }
@media (hover: hover) { .status--done:hover { background: color-mix(in srgb, var(--tone) 14%, transparent); } }
.summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; padding: 14px 18px; border-radius: 16px; background: color-mix(in srgb, var(--tone) 7%, transparent); color: var(--ink-soft); font-size: .875rem; }
.summary b { color: var(--ink); font: 600 1rem var(--font-mono); font-variant-numeric: tabular-nums; }
.summary em { color: var(--tone); font-style: normal; font-weight: 650; }
.results__index { flex: none; min-width: 2.4em; color: var(--ink-faint); font: 500 .75rem var(--font-mono); }
.results__name { overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.results__tag { flex: none; padding: .25em .7em; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-faint); font: 500 .6875rem var(--font-mono); }

/* ---------- An image shown back ---------- */

.preview { display: grid; place-items: center; gap: 10px; margin: 0; padding: 18px; border-radius: 18px; background: repeating-conic-gradient(rgba(255, 255, 255, .045) 0 25%, transparent 0 50%) 0 0 / 22px 22px; }
.preview img { max-width: 100%; max-height: 360px; border-radius: 8px; }
.preview figcaption { color: var(--ink-faint); font: 500 .75rem var(--font-mono); }

/* ---------- Settings in a row ---------- */

.settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* ---------- The life list ---------- */

.life-head { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 20px 32px; }
.life-head .meter { grid-column: 1 / -1; }
.stats { display: flex; align-items: baseline; gap: 10px; white-space: nowrap; }
.stats b { font: 650 clamp(2.4rem, 4.2vw, 3.25rem)/1 var(--font-sans); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stats span { color: var(--ink-soft); font-size: .875rem; }
.meter { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .07); }
.meter span { display: block; width: var(--done, 0%); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--tone)); transition: width .6s var(--ease); }
.life-groups { margin-block: 28px 16px; }
.goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.goal { position: relative; display: flex; align-items: center; min-height: 58px; border-radius: 16px; background: rgba(255, 255, 255, .025); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-soft); transition: background-color .25s, box-shadow .25s, color .25s; }
.goal__check { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; align-self: stretch; padding: 12px 14px 12px 16px; cursor: pointer; }
.goal input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.goal:has(input:focus-visible) { outline: 2px solid var(--tone); outline-offset: 2px; }
.goal__mark { display: grid; flex: none; place-items: center; width: 24px; height: 24px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); color: transparent; transition: background-color .25s, box-shadow .25s, color .25s; }
.goal__mark .icon { width: 14px; height: 14px; stroke-width: 2.8; }
.goal__text { flex: 1; min-width: 0; font-size: .9375rem; line-height: 1.5; }
.goal__remove { display: grid; flex: none; place-items: center; width: 32px; height: 32px; margin-right: 10px; border: 0; border-radius: 50%; background: none; color: var(--ink-faint); cursor: pointer; }
.goal__remove .icon { width: 15px; height: 15px; }
.goal.is-done { background: color-mix(in srgb, var(--tone) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tone) 45%, transparent); color: var(--ink); }
.goal.is-done .goal__mark { background: var(--tone); box-shadow: none; color: var(--tone-ink); }
@media (hover: hover) {
    .goal:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
    .goal.is-done:hover { box-shadow: inset 0 0 0 1px var(--tone); }
    .goal__remove:hover { background: rgba(255, 255, 255, .08); color: var(--ink); }
}
.add-goal { display: flex; gap: 10px; margin-top: 16px; }
.add-goal .input { flex: 1; }
.life-save { margin-top: 32px; }
/* A file input dressed as a button: the label is what shows; the input keeps the focus. */
.file-button { position: relative; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-button:has(input:focus-visible) { outline: 2px solid var(--tone); outline-offset: 4px; }

/* ---------- The status toast ---------- */

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 120; max-width: min(92vw, 540px); padding: 12px 20px; border-radius: 999px; background: rgba(14, 20, 28, .92); box-shadow: 0 20px 50px -14px rgba(0, 0, 0, .8), inset 0 0 0 1px var(--line-strong); color: var(--ink); font-size: .875rem; line-height: 1.5; text-align: center; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); opacity: 0; translate: -50% 14px; pointer-events: none; transition: opacity .3s, translate .45s var(--ease); }
.toast.is-shown { opacity: 1; translate: -50% 0; }
.toast.is-error { box-shadow: 0 20px 50px -14px rgba(0, 0, 0, .8), inset 0 0 0 1px rgba(255, 156, 120, .5); color: #ffc0a8; }

/* ---------- Phones ---------- */

@media (max-width: 720px) {
    .tool { padding-top: 58px; }
    .panel { border-radius: 22px; }
    textarea.input { min-height: 180px; }
    .settings { grid-template-columns: 1fr 1fr; }
    .settings .field:last-child { grid-column: 1 / -1; }
    /* One row that scrolls sideways, rather than a pill broken over two lines. */
    .segmented { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
    .segmented::-webkit-scrollbar { display: none; }
    .segmented button { flex: none; padding: 0 13px; }
    .life-head { grid-template-columns: 1fr; }
    /* Two to a row: sixty goals in one column is a very long scroll. */
    .goals { grid-template-columns: 1fr 1fr; gap: 8px; }
    .goal__check { gap: 9px; padding: 10px 8px 10px 11px; }
    .goal__text { font-size: .875rem; }
    .goal__remove { margin-right: 4px; }
    .add-goal { flex-direction: column; }
    .toast { border-radius: 18px; }
}
