:root {
    --paper: #f6f1e9;
    --paper-deep: #ece5d8;
    --ink: #2b2a26;
    --muted: #756f66;
    --line: #dcd4c7;
    --white: #fffdf8;
    --accent: #9a5b3c;
    --accent-dark: #7d4730;
    --accent-soft: #f3e6dd;
    --sage: #5f8a6a;
    --sage-soft: #e4eee6;
    --amber: #c2892f;
    --amber-soft: #f7ecd6;
    --plum: #7d5a86;
    --plum-soft: #ede4ef;
    --danger: #a83b3b;
    --radius: 18px;
    --tabbar-height: 64px;
    color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); height: 100%; }

body {
    margin: 0;
    min-height: 100%;
    background:
        radial-gradient(circle at 8% -4%, rgba(154, 91, 60, .12), transparent 30rem),
        radial-gradient(circle at 95% 4%, rgba(95, 138, 106, .12), transparent 28rem),
        var(--paper);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; touch-action: manipulation; }
h1, h2, h3 { margin: 0; font-family: Poppins, ui-sans-serif, system-ui, sans-serif; font-weight: 600; letter-spacing: -.01em; }

.eyebrow {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.hint { margin: 6px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.55; }

/* ------------------------------------------------------------------ shell */

.app-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 1040px;
    margin: 0 auto;
    padding: 14px 18px calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px) + 12px);
    gap: 14px;
}

.app-topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.brand h1 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1; letter-spacing: -.02em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }

.stage { flex: 1; min-height: 0; }
.view { display: flex; flex-direction: column; gap: 14px; animation: view-in .18s ease; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } }

/* ------------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 4px; }
.tabs button {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 14px; border: 0; border-radius: 11px;
    background: transparent; cursor: pointer;
    color: var(--muted); font-size: .86rem; font-weight: 750;
}
.tabs button.active { color: var(--accent); background: var(--accent-soft); }
.tabs button:hover { color: var(--ink); }
.tab-icon { font-size: 1.05rem; line-height: 1; }
.tab-badge {
    display: inline-grid; place-items: center;
    min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: 999px; background: var(--accent); color: #fff;
    font-size: .68rem; font-weight: 800;
}
.tabs-top { padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.tabs-top .tab-badge { position: static; }
.tabs-bottom { display: none; }

@media (max-width: 760px) {
    .app-shell { padding-left: 14px; padding-right: 14px; }
    .tabs-top, .topbar-right { display: none; }
    .tabs-bottom {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
        display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
        height: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px));
        padding: 6px 8px env(safe-area-inset-bottom, 0px);
        border-top: 1px solid var(--line);
        background: rgba(255, 253, 248, .94);
        backdrop-filter: blur(10px);
    }
    .tabs-bottom button { flex-direction: column; gap: 3px; padding: 6px 2px; font-size: .66rem; border-radius: 10px; }
    .tabs-bottom .tab-icon { font-size: 1.25rem; }
    .tabs-bottom .tab-badge { position: absolute; top: 2px; right: calc(50% - 22px); min-width: 18px; height: 18px; font-size: .62rem; }
}
@media (min-width: 761px) {
    .app-shell { padding-bottom: 24px; }
}

/* ------------------------------------------------------------------ cards */

.card {
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 12px 34px rgba(57, 55, 46, .06);
}
.card h3 { font-size: 1.05rem; }
.card.hero h2 { font-size: 1.6rem; margin-top: 2px; }
.card.empty { text-align: center; padding: 44px 24px; }
.empty-icon { margin: 0 0 8px; font-size: 2rem; color: var(--line); }
.card.cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.card.cta strong { display: block; font-family: Poppins, ui-sans-serif, system-ui, sans-serif; font-size: 1.3rem; }
.card.cta span { color: var(--muted); font-size: .9rem; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat {
    padding: 16px 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--white);
}
.stat .stat-num { display: block; font-family: Poppins, ui-sans-serif, system-ui, sans-serif; font-size: 1.7rem; line-height: 1.1; }
.stat .stat-label { display: block; margin-top: 4px; color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.stat.size-small .stat-num { color: var(--sage); }
.stat.size-medium .stat-num { color: var(--amber); }
.stat.size-large .stat-num { color: var(--plum); }
@media (max-width: 480px) { .stat-grid { gap: 8px; } .stat { padding: 12px 12px; } .stat .stat-num { font-size: 1.4rem; } }

/* ---------------------------------------------------------------- buttons */

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 9px 16px;
    border: 1px solid transparent; border-radius: 12px; cursor: pointer;
    font-size: .88rem; font-weight: 750;
    transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .5; cursor: default; transform: none; }
.button-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(154, 91, 60, .22); }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { border-color: var(--line); background: var(--white); }
.button-danger-quiet { color: var(--danger); background: #faeded; }
.button.full { width: 100%; margin-top: 10px; }
.text-button { border: 0; background: none; padding: 4px 2px; color: var(--accent); font-weight: 750; font-size: .82rem; cursor: pointer; }
.text-button:hover { color: var(--accent-dark); }
.icon-button { width: 34px; height: 34px; padding: 0 0 3px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; color: var(--muted); font-size: 1.5rem; line-height: 1; }
.icon-button:hover { background: var(--paper-deep); }

/* ---------------------------------------------------------- chips & tags */

.toolbar { display: flex; gap: 10px; align-items: center; }
.toolbar input[type=search] {
    flex: 1; min-width: 0; min-height: 42px; padding: 9px 14px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--white); color: var(--ink); outline: 0;
}
.toolbar input[type=search]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(154, 91, 60, .12); }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px;
    background: var(--white); cursor: pointer; color: var(--muted); font-size: .8rem; font-weight: 700;
}
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.chip.size-small.active { border-color: var(--sage); background: var(--sage-soft); color: var(--sage); }
.chip.size-medium.active { border-color: var(--amber); background: var(--amber-soft); color: var(--amber); }
.chip.size-large.active { border-color: var(--plum); background: var(--plum-soft); color: var(--plum); }

.tag {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 999px;
    background: var(--paper-deep); color: var(--muted); font-size: .7rem; font-weight: 700;
}
.tag.size-small { background: var(--sage-soft); color: var(--sage); }
.tag.size-medium { background: var(--amber-soft); color: var(--amber); }
.tag.size-large { background: var(--plum-soft); color: var(--plum); }
.tag.weather { background: #e3edf5; color: #3e6c8f; }
.tag-row { display: flex; gap: 5px; flex-wrap: wrap; }

/* --------------------------------------------------------------- library */

.item-groups { display: flex; flex-direction: column; gap: 18px; }
.item-group-title { display: flex; align-items: center; gap: 10px; margin: 4px 2px 8px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.item-group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.item-group-title .count { color: var(--ink); }
.item-list { display: flex; flex-direction: column; gap: 8px; }
.item-row {
    display: grid; grid-template-columns: 6px 1fr auto; gap: 14px; align-items: center;
    width: 100%; text-align: left; padding: 12px 14px 12px 12px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--white); cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}
.item-row:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(57, 55, 46, .08); }
.item-bar { width: 6px; height: 100%; min-height: 36px; border-radius: 3px; background: var(--line); }
.item-row.size-small .item-bar { background: var(--sage); }
.item-row.size-medium .item-bar { background: var(--amber); }
.item-row.size-large .item-bar { background: var(--plum); }
.item-main { min-width: 0; }
.item-title { display: block; font-weight: 700; font-size: .95rem; }
.item-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.item-side .duration { font-weight: 800; color: var(--ink); }
.empty-list { padding: 30px; text-align: center; color: var(--muted); }

/* ---------------------------------------------------------------- review */

.review-progress { display: flex; align-items: center; gap: 12px; }
.progress-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--paper-deep); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .3s ease; }
.progress-text { color: var(--muted); font-size: .78rem; font-weight: 700; white-space: nowrap; }

.review-stack { position: relative; min-height: 380px; }
.review-card {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; gap: 14px;
    padding: 26px 26px 22px;
    border: 1px solid var(--line); border-radius: 22px;
    background: var(--white);
    box-shadow: 0 18px 50px rgba(57, 55, 46, .12);
    touch-action: pan-y;
    user-select: none;
    will-change: transform;
}
.review-card.behind { transform: scale(.96) translateY(10px); opacity: .6; box-shadow: none; pointer-events: none; }
.review-card.behind-2 { transform: scale(.92) translateY(20px); opacity: .3; box-shadow: none; pointer-events: none; }
.review-card.dragging { transition: none; }
.review-card.leaving { transition: transform .32s ease, opacity .32s ease; opacity: 0; pointer-events: none; }
.review-card .review-size { align-self: flex-start; font-size: .74rem; padding: 5px 11px; }
.review-card h2 { font-size: 1.55rem; line-height: 1.2; }
.review-card .review-desc { margin: 0; color: var(--muted); line-height: 1.6; font-size: .98rem; flex: 1; }
.review-card .review-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.review-fact { display: flex; flex-direction: column; gap: 2px; }
.review-fact small { color: var(--muted); font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.review-fact span { font-weight: 700; font-size: .9rem; }
.review-stamp {
    position: absolute; top: 22px; padding: 6px 12px; border: 3px solid; border-radius: 10px;
    font-family: Poppins, ui-sans-serif, system-ui, sans-serif; font-size: 1.2rem; font-weight: 700; text-transform: uppercase;
    opacity: 0; transform: rotate(-12deg);
}
.review-stamp.yes { right: 22px; color: var(--sage); border-color: var(--sage); transform: rotate(12deg); }
.review-stamp.no { left: 22px; color: var(--danger); border-color: var(--danger); }

.review-actions { display: flex; justify-content: center; gap: 22px; }
.review-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    width: 76px; height: 76px; border-radius: 50%; border: 1px solid var(--line);
    background: var(--white); cursor: pointer; box-shadow: 0 8px 22px rgba(57, 55, 46, .1);
    transition: transform .12s ease;
}
.review-btn:hover { transform: translateY(-2px); }
.review-btn:active { transform: scale(.96); }
.review-btn span { font-size: 1.6rem; line-height: 1; }
.review-btn small { font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.review-btn.reject span { color: var(--danger); }
.review-btn.accept { width: 88px; height: 88px; border-color: var(--sage); background: var(--sage); }
.review-btn.accept span, .review-btn.accept small { color: #fff; }
.review-btn.edit span { color: var(--accent); }
.review-hint { margin: 0; text-align: center; color: var(--muted); font-size: .76rem; }
@media (max-width: 480px) { .review-hint { display: none; } .review-stack { min-height: 400px; } }

.review-done { text-align: center; padding: 44px 24px; }
.review-done h2 { margin-bottom: 6px; }

/* --------------------------------------------------------------- dialogs */

dialog {
    width: min(560px, calc(100% - 28px));
    padding: 0; border: 0; border-radius: 20px;
    background: var(--white); color: var(--ink);
    box-shadow: 0 30px 90px rgba(26, 33, 31, .28);
}
dialog::backdrop { background: rgba(43, 42, 38, .5); backdrop-filter: blur(3px); }
.app-dialog form { padding: 26px; max-height: calc(100dvh - 60px); overflow-y: auto; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.dialog-heading h2 { font-size: 1.4rem; letter-spacing: -.02em; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field-wide { grid-column: 1 / -1; }
.field > span { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.field input, .field select, .field textarea {
    width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 10px;
    outline: 0; background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; min-height: 60px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(154, 91, 60, .12); }

.seg-choice { display: flex; gap: 8px; }
.seg-choice label { flex: 1; }
.seg-choice input { position: absolute; opacity: 0; pointer-events: none; }
.seg-choice span { display: block; text-align: center; padding: 11px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 700; background: #fff; }
.seg-choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.toggle-row { display: flex; gap: 6px; flex-wrap: wrap; }
.toggle-row label { position: relative; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row span { display: inline-block; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--muted); }
.toggle-row input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.form-error { min-height: 20px; margin: 12px 0 0; color: var(--danger); font-size: .8rem; }
.dialog-hint { margin: 14px 0 4px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.dialog-actions-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 0; margin-left: auto; }
.form-grid .dialog-actions-right { margin-top: 6px; }

.toast-region { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px) + 16px); display: grid; gap: 8px; pointer-events: none; }
@media (min-width: 761px) { .toast-region { left: auto; transform: none; right: 20px; bottom: 20px; } }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, .2); font-size: .84rem; animation: toast-in .2s ease; }
.toast.error { background: var(--danger); }
.toast.undo { pointer-events: auto; display: flex; gap: 14px; align-items: center; }
.toast.undo button { border: 0; background: rgba(255,255,255,.16); color: #fff; padding: 5px 10px; border-radius: 7px; font-weight: 800; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* --------------------------------------------------------------- passkey */

.auth-gate {
    position: fixed; inset: 0; z-index: 300;
    display: grid; place-items: center; padding: 24px;
    background:
        radial-gradient(circle at 15% 0%, rgba(154, 91, 60, .16), transparent 30rem),
        radial-gradient(circle at 85% 10%, rgba(95, 138, 106, .14), transparent 28rem),
        var(--paper);
}
.auth-card {
    width: min(420px, 100%); padding: 40px 34px; text-align: center;
    border: 1px solid var(--line); border-radius: 22px; background: var(--white);
    box-shadow: 0 24px 70px rgba(57, 55, 46, .14);
}
.auth-card h1 { font-size: 2rem; margin: 2px 0 8px; }
.auth-sub { margin: 0 0 24px; color: var(--muted); line-height: 1.5; font-size: .92rem; }
.auth-big { width: 100%; min-height: 52px; font-size: 1rem; border-radius: 14px; }
.auth-card .text-button { margin-top: 18px; display: inline-block; }
.auth-card .form-error { text-align: center; }

.user-chip { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 6px 0 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-size: .86rem; font-weight: 700; }
.user-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.user-logout { border: 0; background: var(--paper-deep); color: var(--muted); padding: 6px 11px; border-radius: 999px; cursor: pointer; font-size: .74rem; font-weight: 700; }
.user-logout:hover { background: var(--line); color: var(--ink); }

.cred-list { margin: 10px 0 2px; display: flex; flex-direction: column; gap: 3px; }
.cred-head { color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 3px; }
.cred-row { display: flex; align-items: center; gap: 9px; padding: 3px 2px; }
.cred-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--accent); }
.cred-name { flex: 1; min-width: 0; font-size: .82rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cred-name small { color: var(--muted); font-weight: 500; }
.cal-mini { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--muted); font-size: .9rem; line-height: 1; }
.cal-mini:hover { background: var(--paper-deep); color: var(--ink); }

.settings-logout { margin-top: 8px; }
@media (max-width: 560px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .card { padding: 16px 16px; }
    .review-card { padding: 22px 20px 18px; }
    .review-card h2 { font-size: 1.35rem; }
}

/* ----------------------------------------------------------------- today */

.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.weather-chip {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 8px 14px 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
}
.weather-icon { font-size: 1.5rem; line-height: 1; }
.weather-main { display: flex; flex-direction: column; line-height: 1.1; }
.weather-main strong { font-family: Poppins, ui-sans-serif, system-ui, sans-serif; font-size: 1.05rem; }
.weather-main small { color: var(--muted); font-size: .7rem; font-weight: 600; }
.hero-bottom { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 18px; }

.quota-row { display: flex; gap: 18px; flex-wrap: wrap; }
.quota { display: flex; flex-direction: column; gap: 5px; }
.quota small { color: var(--muted); font-size: .66rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.quota-dots { display: flex; gap: 5px; align-items: center; }
.quota-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--sage); background: transparent; }
.quota-dot.filled { background: var(--sage); }
.quota-dot.optional { border-style: dashed; opacity: .6; }
.quota-dot.week { border-color: var(--plum); border-radius: 4px; }
.quota-dot.week.filled { background: var(--plum); }
.quota-dot.week.planned { background: repeating-linear-gradient(45deg, var(--plum) 0 2px, transparent 2px 4px); }
.quota-text { font-size: .78rem; font-weight: 700; color: var(--muted); margin-left: 4px; }

.seg-mini { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); }
.seg-mini button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-size: .78rem; font-weight: 750; color: var(--muted); cursor: pointer; }
.seg-mini button.active { background: var(--white); color: var(--accent); box-shadow: 0 2px 8px rgba(57, 55, 46, .1); }

.occ-list { display: flex; flex-direction: column; gap: 12px; }
.occ-card {
    display: grid; grid-template-columns: 6px 1fr; gap: 16px;
    padding: 18px 20px 16px 16px;
    border: 1px solid var(--line); border-radius: var(--radius); background: var(--white);
    box-shadow: 0 12px 34px rgba(57, 55, 46, .06);
    animation: view-in .2s ease;
}
.occ-card .item-bar { align-self: stretch; }
.occ-card.size-small .item-bar { background: var(--sage); }
.occ-card.size-medium .item-bar { background: var(--amber); }
.occ-card.size-large .item-bar { background: var(--plum); }
.occ-card.done { background: var(--paper); box-shadow: none; }
.occ-card.done .occ-title { text-decoration: line-through; color: var(--muted); }
.occ-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.occ-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.occ-when { color: var(--muted); font-size: .76rem; font-weight: 700; }
.occ-title { margin: 0; font-size: 1.2rem; line-height: 1.25; }
.occ-desc { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.occ-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.occ-actions .button { min-height: 38px; padding: 6px 13px; font-size: .82rem; }
.button-done { background: var(--sage); color: #fff; box-shadow: 0 6px 16px rgba(95, 138, 106, .25); }
.button-done:hover { background: #4e7458; }
.button-quiet { border-color: transparent; background: var(--paper); color: var(--muted); }
.button-quiet:hover { background: var(--paper-deep); color: var(--ink); }
.occ-accepted-badge { font-size: .7rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }

.today-footer { display: flex; justify-content: center; }
.skipped-box { padding: 4px 6px; }
.skipped-box summary { cursor: pointer; color: var(--muted); font-size: .8rem; font-weight: 700; list-style: none; text-align: center; }
.skipped-box summary::-webkit-details-marker { display: none; }
.skipped-box[open] summary { margin-bottom: 8px; }
.skipped-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--paper); margin-bottom: 6px; font-size: .84rem; }
.skipped-row .skipped-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skipped-row .skipped-reason { color: var(--muted); font-size: .72rem; }

.reason-list { display: grid; gap: 8px; }
.reason-list button { text-align: left; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-weight: 700; }
.reason-list button:hover { border-color: var(--accent); background: var(--accent-soft); }
.reason-list button.dislike { color: var(--danger); }

.log-results { display: flex; flex-direction: column; gap: 4px; max-height: 190px; overflow-y: auto; }
.log-results:empty { display: none; }
.log-result { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; text-align: left; font-size: .86rem; }
.log-result.selected { border-color: var(--accent); background: var(--accent-soft); }
.log-result .tag { margin-left: auto; }

/* ------------------------------------------------------------------ week */

.week-head { display: flex; align-items: center; gap: 12px; }
.week-title { flex: 1; text-align: center; }
.week-title h2 { font-size: 1.15rem; }
.icon-nav { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--white); cursor: pointer; font-size: 1.3rem; line-height: 1; }
.points-row { display: flex; justify-content: center; align-items: center; gap: 5px; margin-top: 6px; }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.week-day { padding: 12px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); min-height: 120px; display: flex; flex-direction: column; gap: 6px; }
.week-day.today { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(154, 91, 60, .1); }
.week-day.past { background: var(--paper); }
.week-day-head { display: flex; align-items: baseline; justify-content: space-between; }
.week-day-head .dow { color: var(--muted); font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.week-day-head .dom { font-family: Poppins, ui-sans-serif, system-ui, sans-serif; font-size: 1rem; }
.week-day.today .dom { color: var(--accent); }
.week-occ { display: flex; align-items: flex-start; gap: 6px; font-size: .74rem; line-height: 1.3; padding: 4px 6px; border-radius: 7px; background: var(--paper); }
.week-occ .mark { flex: 0 0 auto; width: 14px; text-align: center; font-weight: 800; }
.week-occ.done .mark { color: var(--sage); }
.week-occ.open .mark { color: var(--muted); }
.week-occ.size-medium { border-left: 3px solid var(--amber); }
.week-occ.size-large { border-left: 3px solid var(--plum); }
.week-occ.size-small { border-left: 3px solid var(--sage); }
.week-occ.expired, .week-occ.skipped { opacity: .45; }
.week-empty { color: var(--line); font-size: .8rem; text-align: center; margin: auto 0; }
@media (max-width: 760px) {
    .week-grid { grid-template-columns: 1fr; }
    .week-day { min-height: 0; }
    .week-day.past:not(:has(.week-occ)) { display: none; }
    .hero-bottom { flex-direction: column; align-items: stretch; }
    .seg-mini { justify-content: stretch; }
    .seg-mini button { flex: 1; }
    .weather-chip { padding: 6px 10px 6px 8px; }
    .card.hero h2 { font-size: 1.3rem; }
}

/* --------------------------------------------------------------- planning */

.slot-list { display: flex; gap: 6px; flex-wrap: wrap; }
.slot-chip { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: .8rem; font-weight: 700; }
.slot-chip small { color: var(--muted); font-weight: 600; margin-left: 4px; }
.slot-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.slot-none { color: var(--muted); font-size: .82rem; }
.occ-planned-badge { font-size: .74rem; font-weight: 800; color: var(--plum); }
.occ-card.planned { border-color: color-mix(in srgb, var(--plum), var(--line) 60%); }
.occ-cal-link { color: var(--muted); font-size: .74rem; text-decoration: none; font-weight: 700; }
.occ-cal-link:hover { color: var(--accent); }
.status-ok { color: var(--sage); font-weight: 700; }
.status-bad { color: var(--danger); font-weight: 700; }
.week-occ .time { color: var(--muted); font-size: .68rem; display: block; }
