@font-face { font-family: Time2Love System; src: local("Segoe UI"); font-display: swap; }
:root {
    color-scheme: light;
    font-family: Time2Love System, system-ui, sans-serif;
    color: #24233a;
    background: #f8f8f5;
    font-synthesis: none;
    --ink: #24233a;
    --muted: #625f73;
    --accent: #4936a1;
    --line: #e6e3eb;
    --surface: #fff;
    --error: #9b263e;
    --width: 46rem;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.45; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled, input:disabled { cursor: default; opacity: .62; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid #765dd4; outline-offset: 3px; }
p { margin: .5rem 0 1rem; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.12; margin: 0; letter-spacing: -.025em; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.85rem, 5vw, 2.8rem); }
h2 { font-size: 1.27rem; }
h3 { font-size: 1.04rem; margin-top: 1rem; }
ul, ol { padding: 0; }
.icon { width: 1.3rem; height: 1.3rem; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.page-header, main {
    width: min(calc(100% - 2rem), var(--width));
    margin-inline: auto;
}
.page-header { display: flex; align-items: center; justify-content: space-between; padding-block: 1.25rem 1rem; }
.brand { display: inline-flex; align-items: center; font-size: 1.25rem; font-weight: 760; color: var(--ink); text-decoration: none; letter-spacing: -.045em; }
.brand-two { color: var(--accent); }
.brand-mark { display: grid; place-items: center; margin-right: .62rem; width: 2.35rem; height: 2.35rem; border-radius: .76rem; background: var(--accent); color: #fff; }
.header-actions, .button-row { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
.icon-button { display: inline-grid; place-items: center; flex: 0 0 auto; min-width: 2.75rem; height: 2.75rem; padding: .45rem; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: .75rem; text-decoration: none; }
.header-actions .icon-button { background: var(--surface); border-color: var(--line); }
.icon-button:hover { background: #eeeaf9; }
main { min-height: 50vh; padding-bottom: calc(6.3rem + env(safe-area-inset-bottom)); }
.guest main { padding-bottom: 2rem; }
.auth-card { margin: min(8vh, 4rem) auto 0; max-width: 27rem; padding: clamp(1.25rem, 5vw, 2rem); border: 1px solid var(--line); border-radius: 1.15rem; background: var(--surface); }
.auth-card p { color: var(--muted); }
.fields, #dialog-fields { display: grid; gap: .9rem; margin-block: 1rem; }
.fields label, #dialog-fields label { display: grid; gap: .3rem; }
label { font-weight: 600; }
input:not([type="checkbox"]), textarea, select { border: 1px solid #dcd8e7; border-radius: .65rem; background: #fff; padding: .65rem .8rem; color: var(--ink); min-height: 2.75rem; width: 100%; }
input:not([type="checkbox"]), textarea { font-size: 1rem; }
textarea { resize: vertical; min-height: 4.25rem; }
input[type="checkbox"] { accent-color: var(--accent); min-width: 1.25rem; width: 1.25rem; height: 1.25rem; flex: 0 0 auto; }
.button { min-height: 2.75rem; display: inline-flex; justify-content: center; align-items: center; gap: .4rem; padding: .55rem .95rem; border: 1px solid transparent; border-radius: .7rem; background: var(--accent); color: #fff; font-weight: 650; text-align: center; text-decoration: none; overflow-wrap: anywhere; }
.button:hover, .send-button:hover { background: #382480; }
.button.secondary, .button.danger-outline { color: var(--accent); background: #fff; border-color: var(--line); }
.button.secondary:hover { background: #f1ecff; }
.button.danger-outline { color: var(--error); }
.button.danger-outline:hover { background: #fff0f2; }
.button.danger { background: var(--error); }
.voice-hero { display: flex; align-items: center; justify-content: space-between; gap: .8rem; min-height: 13.1rem; position: relative; isolation: isolate; overflow: hidden; border-radius: 1.25rem; padding: clamp(1.15rem, 5vw, 2.4rem); color: #fff; background: #342376; }
.voice-hero::before, .voice-hero::after { position: absolute; pointer-events: none; z-index: -1; content: ""; width: 28rem; height: 28rem; border-radius: 50%; border: 1px solid #d0bfff47; right: -13.5rem; top: -8.6rem; }
.voice-hero::after { width: 32.5rem; height: 32.5rem; right: -15.6rem; top: -10.8rem; }
.voice-copy { min-width: 0; }
.voice-copy p { margin: .45rem 0 0; color: #e3dafa; }
.voice-copy .error { color: #ffe2e8; }
#voice-state { font-weight: 650; }
.mic-controls { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.mic-button { display: grid; place-items: center; width: clamp(4rem, 17vw, 6rem); height: clamp(4rem, 17vw, 6rem); flex: 0 0 auto; border-radius: 50%; border: 6px solid #cbbaff; background: #fff; color: #4936a1; box-shadow: 0 0 0 7px #a88af44a; }
.mic-button .icon { width: 44%; height: 44%; }
.mic-button:hover { background: #f4eeff; }
.mic-button[aria-pressed="true"] { background: #eadfff; animation: listening 1.65s ease-in-out infinite alternate; }
@keyframes listening { to { box-shadow: 0 0 0 14px #a88af44a; } }
.voice-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .15rem .4rem; }
.voice-actions button { min-height: 2.75rem; padding: .2rem; color: white; border: 0; background: transparent; text-decoration: underline; text-underline-offset: .15rem; }
.command-form { display: flex; gap: .35rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: .9rem; padding: .36rem; margin-top: .75rem; }
.command-form input { width: 0; flex: 1 1 auto; min-width: 0; border-color: transparent; }
.command-form:focus-within { border-color: #b0a2d4; }
.send-button { display: grid; place-items: center; background: var(--accent); color: #fff; border: 0; width: 2.75rem; height: 2.75rem; flex: 0 0 auto; border-radius: .65rem; }
.command-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; font-size: .8rem; color: var(--muted); margin: .55rem .2rem 0; }
.command-meta a { margin-left: auto; color: var(--muted); }
.transcript { color: var(--muted); margin: .55rem 0 0; }
.command-result, .notice, .page-message { background: #eeeafa; border: 1px solid #dfd6f7; border-radius: .75rem; padding: .75rem .95rem; margin: .75rem 0; }
.command-result[data-status="error"], .notice, .page-message.error { background: #fff2f2; color: var(--error); border-color: #f4d0d8; }
.result-title { margin: 0; font-weight: 650; }
.command-result .button-row { margin-top: .65rem; }
.lists-section { margin-top: 1.6rem; }
.section-heading, .page-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .45rem .75rem; margin-bottom: .65rem; }
.page-title { margin-block: .75rem 1.05rem; }
.lists-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.list-card { min-width: 0; min-height: 5.15rem; display: flex; align-items: center; gap: .78rem; padding: .75rem; border: 1px solid var(--line); border-radius: .92rem; background: #fff; color: var(--ink); text-decoration: none; text-align: left; }
.list-card:hover { border-color: #bab0d5; background: #fefcff; }
.list-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .75rem; flex: 0 0 auto; color: #4f389d; background: #eeebfa; }
.tone-green { color: #216344; background: #e5f3e9; }
.tone-rose { color: #94385c; background: #f9e5ee; }
.tone-violet { color: #613d9d; background: #efe6fa; }
.tone-blue { color: #275f97; background: #e5f0fd; }
.tone-amber { color: #815319; background: #fcf0d9; }
.tone-teal { color: #21665a; background: #e1f2ed; }
.tone-slate { color: #4a5e77; background: #edf1f6; }
.card-text { display: grid; min-width: 0; overflow-wrap: anywhere; }
.card-text strong { font-size: 1rem; line-height: 1.2; }
.card-text small { color: var(--muted); font-size: .82rem; margin-top: .2rem; }
.card-arrow { display: grid; color: #746d87; margin-left: auto; }
.card-arrow .icon { width: 1rem; height: 1rem; }
.add-card { border-style: dashed; color: var(--accent); font-weight: 650; }
.bottom-nav { z-index: 2; position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center; background: #fff; border-top: 1px solid var(--line); padding: .35rem .5rem max(.4rem, env(safe-area-inset-bottom)); }
.bottom-nav a { width: min(33%, 9rem); min-height: 3.3rem; display: grid; place-items: center; align-content: center; gap: .2rem; padding: .25rem .2rem; color: var(--muted); font-size: .76rem; font-weight: 650; border-radius: .75rem; text-decoration: none; }
.bottom-nav a[aria-current="page"] { color: var(--accent); background: #f0ecfc; }
.bottom-nav a:hover { color: var(--accent); }
.back-link { display: inline-flex; gap: .4rem; align-items: center; min-height: 2.75rem; text-decoration: none; font-weight: 650; }
.list-head { display: flex; flex-wrap: wrap; gap: .6rem .8rem; align-items: center; margin: .45rem 0 .65rem; }
.list-head > div { flex: 1 1 10rem; }
.list-head p { margin: .18rem 0; color: var(--muted); }
.list-head .list-icon { width: 3.25rem; height: 3.25rem; }
#item-form { margin-bottom: 1.2rem; }
.item-list { list-style: none; margin: 0 0 1rem; }
.item-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; background: #fff; margin-bottom: .35rem; border: 1px solid var(--line); border-radius: .7rem; padding-inline: .55rem; }
.item-check { display: flex; align-items: center; gap: .55rem; min-height: 3rem; min-width: 0; padding: .3rem .25rem; cursor: pointer; font-weight: 500; }
.item-check span { overflow-wrap: anywhere; white-space: pre-wrap; }
.completed { margin: .8rem 0 1rem; }
.completed .item-check span { text-decoration: line-through; color: var(--muted); }
.completed summary { padding: .7rem .2rem; cursor: pointer; font-weight: 650; }
.count { background: #eee9f9; color: var(--accent); padding: .1rem .45rem; margin-left: .3rem; border-radius: 1rem; }
.compact .voice-hero { min-height: 7rem; }
.compact .mic-button { width: 3.85rem; height: 3.85rem; }
#delete-list { margin-top: 1.35rem; }
.empty, .help { color: var(--muted); }
.help { font-size: .88rem; }
.error, .form-error { color: var(--error); }
.filter-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.history-list, .result-list { list-style: none; }
.history-entry, .settings-panel { background: #fff; border: 1px solid var(--line); border-radius: .9rem; padding: .85rem 1rem; margin-bottom: .6rem; }
.history-entry p { margin: .25rem 0; }
.history-entry strong, .result-list a { overflow-wrap: anywhere; }
.history-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .65rem; color: var(--muted); font-size: .82rem; margin-bottom: .35rem; }
.status { padding: .13rem .45rem; background: #efedf5; border-radius: .4rem; }
.status-executed { color: #245e42; background: #e9f5ed; }
.status-error { color: var(--error); background: #fdf0f1; }
.status-clarification_required, .status-confirmation_required { color: #774b1c; background: #fcf1db; }
.result-list { padding: 0; margin: .35rem 0 .55rem; }
.result-list a { display: block; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.result-list small { display: block; color: var(--muted); }
.settings-panel { padding: 1rem; }
.settings-panel h2 { margin-bottom: .35rem; }
.settings-toggle { display: flex; justify-content: space-between; align-items: center; gap: .55rem; min-height: 2.85rem; border-bottom: 1px solid var(--line); }
.settings-panel .button-row { margin-top: .65rem; }
.settings-toggle input { margin: .45rem; cursor: pointer; }
.toast { position: fixed; z-index: 3; inset: auto 1rem calc(4.7rem + env(safe-area-inset-bottom)) 1rem; max-width: min(var(--width), calc(100% - 2rem)); margin-inline: auto; display: flex; gap: .45rem; align-items: center; padding: .5rem .6rem .5rem 1rem; border-radius: .8rem; color: #fff; background: #302453; box-shadow: 0 .45rem 1rem #31205036; }
.toast span { flex: 1; overflow-wrap: anywhere; }
.toast button { color: #fff; min-height: 2.75rem; }
#undo-action { border: 0; border-radius: .45rem; padding: .35rem .65rem; color: #342376; background: #ece3ff; font-weight: 650; }
dialog { border: 1px solid var(--line); border-radius: 1rem; width: min(calc(100% - 2rem), 28rem); max-height: calc(100% - 2rem); overflow: auto; padding: 1rem; color: var(--ink); }
dialog::backdrop { background: #24193b77; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: .45rem; }
dialog .button-row { justify-content: flex-end; }
@media (max-width: 30rem) {
    .card-arrow { display: none; }
    .list-card { gap: .48rem; padding: .55rem; }
    .list-card .list-icon { width: 2rem; height: 2rem; }
    .list-card .list-icon .icon { width: 1.1rem; height: 1.1rem; }
    .list-head .button { font-size: .88rem; }
}
@media (max-width: 21rem) { .lists-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; } }
