/* Анти-вина: тёплая палитра, ничего кричащего, ноль красного укора */
:root {
    --bg: #faf7f2;
    --card: #ffffff;
    --ink: #3d3a34;
    --muted: #a09a8e;
    --accent: #e8804f;      /* тёплый — «край близко», давит мягко */
    --soft: #7fa88b;        /* зелёный — «хорошо бы начать» */
    --line: #eee9df;
    --shadow: 0 2px 10px rgba(80, 70, 50, .07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    height: 100%;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: env(safe-area-inset-top) 16px calc(110px + env(safe-area-inset-bottom));
}

.top { padding: 18px 0 12px; }

.tabs { display: flex; gap: 8px; }

.tab {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 22px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
}

.tab.active { color: var(--ink); background: var(--card); box-shadow: var(--shadow); }

.screen { flex: 1; }

.cards { display: flex; flex-direction: column; gap: 12px; }

.card {
    background: var(--card);
    border-radius: 18px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.card .title { font-size: 17px; font-weight: 600; line-height: 1.35; }

.card .goal { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.card .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.chip {
    font-size: 12px;
    color: var(--muted);
    background: var(--bg);
    border-radius: 999px;
    padding: 3px 10px;
}

.chip.deadline { color: #fff; background: var(--accent); }
.chip.start { color: #fff; background: var(--soft); }
.chip.waiting { color: var(--ink); background: var(--line); }

.card .actions { display: flex; gap: 8px; margin-top: 12px; }

.btn {
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
    font-size: 14px;
    padding: 9px 16px;
    border-radius: 12px;
    cursor: pointer;
}

.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }

.btn.ghost { border: none; background: transparent; color: var(--muted); }

.btn.small { font-size: 18px; padding: 6px; }

.btn.done-btn {
    flex: 1;
    background: var(--soft);
    border-color: var(--soft);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}

.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 17px; }
.empty .sub { margin-top: 6px; font-size: 14px; }

.done-today { margin-top: 28px; }
.done-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.done-item { color: var(--muted); font-size: 14.5px; padding: 5px 0; }
.done-item::before { content: "✓ "; color: var(--soft); }

/* «показать всё» — категории-линзы, чанкование */
.cat { margin-bottom: 22px; }
.cat-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.all-item {
    background: var(--card);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
}
.all-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.all-item .t { font-size: 15px; }
.all-item .meta { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Захват */
.bottom {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 480px;
    margin: 0 auto;
    padding: 14px 24px calc(18px + env(safe-area-inset-bottom));
    pointer-events: none;
}

.bottom > * { pointer-events: auto; }

.bottom-spacer { width: 34px; }

.record {
    width: 84px; height: 84px;
    border-radius: 50%;
    border: none;
    background: var(--ink);
    color: #fff;
    font-size: 34px;
    box-shadow: 0 6px 22px rgba(60, 50, 30, .25);
    cursor: pointer;
    transition: transform .15s, background .2s;
}

.record:active { transform: scale(.94); }

.record.recording {
    background: var(--accent);
    animation: pulse 1.4s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(232, 128, 79, .45); }
    70% { box-shadow: 0 0 0 22px rgba(232, 128, 79, 0); }
    100% { box-shadow: 0 0 0 0 rgba(232, 128, 79, 0); }
}

.text-capture {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--line);
}

.text-capture input, .sheet input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 16px;
    background: var(--card);
    color: var(--ink);
    outline: none;
}

/* Шторка разбора */
.sheet {
    position: fixed;
    inset: 0;
    background: rgba(60, 55, 45, .35);
    display: flex;
    align-items: flex-end;
    z-index: 10;
}

.sheet-inner {
    background: var(--bg);
    border-radius: 22px 22px 0 0;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sheet-status { font-size: 15px; color: var(--muted); }

.sheet-transcript { font-size: 14px; color: var(--muted); font-style: italic; }

.question { font-size: 17px; font-weight: 600; }

.row { display: flex; gap: 8px; }

.step-options { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }

.step-options .btn { text-align: left; padding: 12px 14px; font-size: 15px; }

/* Раскрытая карточка: контекст захвата */
.details { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ctx { font-size: 13.5px; color: var(--muted); font-style: italic; margin-top: 8px; white-space: pre-line; }
.ctx-goal { font-size: 13.5px; color: var(--muted); margin-top: 8px; }
.ctx-date { font-size: 11.5px; color: var(--muted); margin-top: 8px; opacity: .7; }

/* Барабаны дат: iOS-стиль на scroll-snap */
.wheels { display: flex; gap: 14px; margin: 4px 0 8px; }
.wheel-col { flex: 1; min-width: 0; }
.wheel-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    text-align: center;
    margin-bottom: 6px;
}
.wheel {
    height: 160px;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    position: relative;
    border-radius: 14px;
    background: var(--card);
    box-shadow: var(--shadow);
    -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
    mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent);
}
.wheel::-webkit-scrollbar { display: none; }
.wheel .pad { height: 60px; }
.wheel .opt {
    height: 40px;
    line-height: 40px;
    text-align: center;
    scroll-snap-align: center;
    font-size: 15px;
    color: var(--muted);
    transition: color .12s, transform .12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 6px;
}
.wheel .opt.sel { color: var(--ink); font-weight: 650; transform: scale(1.06); }

/* Результаты разбора в шторке */
.result-item { margin-bottom: 10px; }
.result-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
#result-card .card { box-shadow: none; border: 1px solid var(--line); }

.hidden { display: none !important; }

.spin {
    display: inline-block;
    animation: rot 1s linear infinite;
}

@keyframes rot { to { transform: rotate(360deg); } }
