:root {
    color-scheme: dark;
    --bg: #050914;
    --bg-deep: #091426;
    --surface: rgba(10, 21, 38, 0.82);
    --surface-strong: rgba(12, 26, 47, 0.96);
    --text: #e8f3ff;
    --muted: #8ea7bd;
    --brand: #22d3ee;
    --brand-strong: #67e8f9;
    --accent: #8b5cf6;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #fb7185;
    --line: rgba(103, 232, 249, 0.14);
    --line-strong: rgba(103, 232, 249, 0.32);
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    --glow: 0 0 36px rgba(34, 211, 238, 0.12);
    --radius-lg: 24px;
    --radius-md: 16px;
    --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

html {
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    color: var(--text);
    font-family: "Aptos", "Segoe UI Variable", "PingFang SC", "Microsoft YaHei UI", sans-serif;
    background:
        radial-gradient(circle at 12% 8%, rgba(34, 211, 238, 0.105), transparent 28rem),
        radial-gradient(circle at 86% 24%, rgba(139, 92, 246, 0.11), transparent 32rem),
        linear-gradient(145deg, #050914 0%, #07111f 46%, #091426 100%);
}

::selection {
    color: #03111a;
    background: rgba(103, 232, 249, 0.82);
}

a,
button,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 50%;
    z-index: 1000;
    padding: 10px 16px;
    border-radius: 10px;
    color: #03111a;
    background: var(--brand-strong);
    font-weight: 800;
    text-decoration: none;
    transform: translate(-50%, -180%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translate(-50%, 0);
}

.site-bg {
    filter: blur(70px);
    opacity: 0.7;
}

.site-bg-one {
    top: -180px;
    left: -180px;
    width: 520px;
    height: 520px;
    background: rgba(34, 211, 238, 0.14);
}

.site-bg-two {
    top: 24%;
    right: -200px;
    width: 520px;
    height: 520px;
    background: rgba(139, 92, 246, 0.13);
}

.site-grid {
    opacity: 0.58;
    background-image:
        linear-gradient(rgba(103, 232, 249, 0.036) 1px, transparent 1px),
        linear-gradient(90deg, rgba(103, 232, 249, 0.036) 1px, transparent 1px),
        radial-gradient(circle at center, rgba(103, 232, 249, 0.12) 1px, transparent 1.5px);
    background-size: 42px 42px, 42px 42px, 126px 126px;
    mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.58) 58%, transparent 100%);
}

.topbar,
.page-shell {
    width: min(1380px, calc(100% - 40px));
}

.topbar {
    position: sticky;
    top: 12px;
    z-index: 30;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(103, 232, 249, 0.13);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(7, 17, 31, 0.94), rgba(11, 25, 44, 0.88));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.018) inset;
    backdrop-filter: blur(22px) saturate(130%);
}

.topbar::after {
    content: "";
    position: absolute;
    right: 24px;
    bottom: -1px;
    left: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.55), rgba(139, 92, 246, 0.45), transparent);
}

.brand-block {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    border-color: transparent;
    border-radius: 16px;
    background: transparent;
    box-shadow: none;
}

.brand-block::before,
.brand-block::after {
    display: none;
}

.brand-block .eyebrow {
    position: absolute;
    top: 3px;
    left: 78px;
    color: rgba(103, 232, 249, 0.56);
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.58rem;
    letter-spacing: 0.12em;
    white-space: nowrap;
}

.brand-link {
    gap: 12px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 14px;
    background: transparent;
    box-shadow: 0 0 26px rgba(34, 211, 238, 0.2);
}

.brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
}

.brand-link > span:last-child {
    gap: 0;
    padding-top: 8px;
}

h2,
h3,
.brand-name {
    font-family: "Bahnschrift", "Aptos Display", "Segoe UI Variable Display", "PingFang SC", sans-serif;
    letter-spacing: -0.025em;
}

.brand-name {
    color: #f2f8ff;
    font-size: 1.25rem;
    font-weight: 720;
    line-height: 1;
}

.brand-subtitle {
    margin-top: 5px;
    color: #7894aa;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
}

.top-actions {
    gap: 5px;
    padding: 5px;
    border-color: rgba(103, 232, 249, 0.08);
    border-radius: 16px;
    background: rgba(1, 7, 17, 0.28);
}

.top-actions > * {
    flex: 0 0 auto;
}

.system-indicator,
.command-trigger {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    border-radius: 10px;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
}

.system-indicator {
    gap: 7px;
    padding: 7px 10px;
    color: #82a0b8;
    border: 1px solid rgba(52, 211, 153, 0.16);
    background: rgba(52, 211, 153, 0.055);
}

.system-indicator time {
    color: #c8f8e6;
    font-variant-numeric: tabular-nums;
}

.system-indicator-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.09), 0 0 14px rgba(52, 211, 153, 0.72);
    animation: system-pulse 2.4s ease-in-out infinite;
}

.command-trigger {
    gap: 8px;
    padding: 7px 10px;
    color: #a9bfd1;
    border: 1px solid rgba(103, 232, 249, 0.12);
    background: rgba(103, 232, 249, 0.045);
    box-shadow: none;
}

.command-trigger kbd,
.command-palette kbd {
    padding: 3px 6px;
    border: 1px solid rgba(103, 232, 249, 0.16);
    border-radius: 6px;
    color: var(--brand-strong);
    background: rgba(2, 8, 18, 0.66);
    box-shadow: inset 0 -1px 0 rgba(103, 232, 249, 0.12);
    font: inherit;
}

.nav-link,
.nav-logout-btn {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 10px;
    color: #94aec2;
    font-size: 0.79rem;
    white-space: nowrap;
}

.nav-link:hover,
.nav-logout-btn:hover,
.command-trigger:hover {
    color: #e8fbff;
    border-color: rgba(103, 232, 249, 0.18);
    background: rgba(34, 211, 238, 0.075);
    box-shadow: none;
}

.nav-link-active {
    color: #dffbff;
    border-color: rgba(34, 211, 238, 0.22);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(139, 92, 246, 0.1));
    box-shadow: inset 0 0 16px rgba(34, 211, 238, 0.035), 0 0 18px rgba(34, 211, 238, 0.06);
}

.nav-link-active::before {
    content: "";
    width: 5px;
    height: 5px;
    margin-right: 6px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 9px rgba(34, 211, 238, 0.85);
}

.nav-logout-btn {
    color: #839caf;
    border: 1px solid transparent;
    background: transparent;
}

.page-shell {
    gap: 22px;
    margin-top: 22px;
    padding-bottom: 60px;
}

.hero-card,
.stat-card,
.next-steps,
.auth-card,
.auth-showcase,
.page-header-card,
.form-card,
.task-card,
.empty-card,
.chart-card,
.workspace-card,
.flash-message,
.config-card,
.log-card {
    position: relative;
    border-color: rgba(103, 232, 249, 0.12);
    background: linear-gradient(145deg, rgba(12, 26, 47, 0.9), rgba(7, 17, 31, 0.84));
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px) saturate(120%);
}

.hero-card::before,
.page-header-card::before,
.form-card::before,
.auth-card::before,
.auth-showcase::before,
.next-steps::before,
.empty-card::before,
.chart-card::before,
.workspace-card::before {
    content: "";
    position: absolute;
    top: -1px;
    right: 22px;
    left: 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(103, 232, 249, 0.48), rgba(139, 92, 246, 0.38), transparent);
}

.hero-card {
    min-height: 290px;
    align-items: center;
    padding: 34px;
    overflow: hidden;
    border-color: rgba(103, 232, 249, 0.18);
    background:
        radial-gradient(circle at 84% 22%, rgba(139, 92, 246, 0.18), transparent 28%),
        radial-gradient(circle at 8% 92%, rgba(34, 211, 238, 0.12), transparent 33%),
        linear-gradient(135deg, rgba(11, 27, 48, 0.98), rgba(6, 16, 30, 0.92));
    box-shadow: var(--shadow), var(--glow);
}

.hero-card::after {
    content: "EA / GROWTH SYSTEM";
    position: absolute;
    right: -18px;
    bottom: 20px;
    color: rgba(103, 232, 249, 0.035);
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: clamp(2.8rem, 7vw, 6.6rem);
    font-weight: 800;
    letter-spacing: -0.08em;
    white-space: nowrap;
    pointer-events: none;
}

.hero-copy-block,
.hero-actions {
    position: relative;
    z-index: 1;
}

.eyebrow,
.section-kicker {
    color: var(--brand-strong);
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.eyebrow {
    font-size: 0.69rem;
}

.section-kicker {
    color: #688aa4;
    font-size: 0.64rem;
}

h2 {
    max-width: 900px;
    color: #f3f8ff;
    font-size: clamp(2rem, 3.4vw, 3.7rem);
    line-height: 1.1;
}

h3 {
    color: #e8f3ff;
}

.hero-copy,
.task-meta,
.task-note,
.empty-chart-text,
.field-help,
.config-meta,
.config-subline,
.section-meta,
.chart-header span,
.category-head span,
.summary-row span,
.stat-card span,
.hero-metric span {
    color: var(--muted);
}

.hero-metric,
.task-date-metric {
    border-color: rgba(103, 232, 249, 0.11);
    background: rgba(2, 9, 20, 0.46);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.hero-metric strong,
.task-date-metric strong {
    color: #dffaff;
    font-variant-numeric: tabular-nums;
}

.stat-card {
    min-height: 176px;
    padding: 24px;
    overflow: hidden;
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.stat-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 94px;
    height: 94px;
    background: radial-gradient(circle at top right, rgba(34, 211, 238, 0.12), transparent 68%);
    pointer-events: none;
}

.stat-card:nth-child(3)::after {
    background: radial-gradient(circle at top right, rgba(139, 92, 246, 0.18), transparent 68%);
}

.stat-card:nth-child(4)::after {
    background: radial-gradient(circle at top right, rgba(52, 211, 153, 0.13), transparent 68%);
}

.stat-card:hover {
    border-color: rgba(103, 232, 249, 0.25);
    box-shadow: var(--shadow), 0 0 30px rgba(34, 211, 238, 0.07);
    transform: translateY(-3px);
}

.stat-card strong {
    color: #f1f7ff;
    font-family: "Bahnschrift", "Aptos Display", sans-serif;
    font-variant-numeric: tabular-nums;
}

.accent-card {
    border-color: rgba(34, 211, 238, 0.3);
    color: #effcff;
    background:
        linear-gradient(135deg, rgba(8, 65, 83, 0.86), rgba(17, 34, 68, 0.9)),
        var(--surface);
    box-shadow: var(--shadow), 0 0 36px rgba(34, 211, 238, 0.1);
}

.accent-card span,
.accent-card p {
    color: #9bc4d3;
}

.primary-link,
button {
    color: #03141e;
    background: linear-gradient(135deg, #67e8f9, #22d3ee 58%, #38bdf8);
    box-shadow: 0 12px 26px rgba(34, 211, 238, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.primary-link:hover,
button:hover {
    filter: brightness(1.06);
    box-shadow: 0 16px 32px rgba(34, 211, 238, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.secondary-link,
.ghost-btn {
    color: var(--brand-strong);
    border-color: rgba(103, 232, 249, 0.2);
    background: rgba(34, 211, 238, 0.055);
    box-shadow: none;
}

.ghost-link {
    color: var(--brand-strong);
}

.danger-button {
    color: #fff;
    background: linear-gradient(135deg, #e11d48, var(--danger));
    box-shadow: 0 12px 26px rgba(251, 113, 133, 0.16);
}

.danger-link,
.error-text {
    color: #fda4af;
}

.task-card,
.config-card,
.log-card {
    border-color: rgba(103, 232, 249, 0.1);
    background: linear-gradient(145deg, rgba(12, 25, 44, 0.88), rgba(7, 16, 30, 0.82));
}

.task-card:hover,
.config-card:hover,
.log-card:hover {
    border-color: rgba(103, 232, 249, 0.2);
}

.task-card-done {
    opacity: 0.58;
}

.badge {
    border: 1px solid currentColor;
    border-color: color-mix(in srgb, currentColor 24%, transparent);
    background: color-mix(in srgb, currentColor 10%, transparent);
}

.badge-status {
    color: #7dd3fc;
    background: rgba(56, 189, 248, 0.08);
}

.badge-low,
.badge-ingredient-available {
    color: var(--success);
    background: rgba(52, 211, 153, 0.08);
}

.badge-medium {
    color: var(--warning);
    background: rgba(251, 191, 36, 0.08);
}

.badge-high,
.badge-ingredient-missing {
    color: var(--danger);
    background: rgba(251, 113, 133, 0.08);
}

.badge-study-tag {
    color: #c4b5fd;
    border-color: rgba(167, 139, 250, 0.22);
    background: rgba(139, 92, 246, 0.09);
}

.task-date-rail,
.watch-plan-card,
.finance-upload-card,
.study-insight-card,
.study-request-card,
.watch-progress-panel,
.watch-plan-builder,
.exercise-quick-form {
    border-color: rgba(103, 232, 249, 0.12);
    background: linear-gradient(160deg, rgba(9, 22, 40, 0.9), rgba(4, 13, 26, 0.76));
}

.task-date-nav,
.task-date-nav-emphasis {
    color: #b9d3e6;
    border-color: rgba(103, 232, 249, 0.14);
    background: rgba(34, 211, 238, 0.05);
}

.task-date-pill-today {
    color: #a5f3fc;
    background: rgba(34, 211, 238, 0.12);
}

.task-date-pill-future {
    color: #fde68a;
    background: rgba(251, 191, 36, 0.1);
}

.field-block input,
.field-block select,
.field-block textarea,
.auth-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.checkbox-wrap,
.permission-option,
.editor-shell #id_note,
.editor-preview,
.markdown-toolbar,
.watch-plan-row,
.wp-picker-panel,
.wp-item-card {
    color: var(--text);
    border-color: rgba(103, 232, 249, 0.13);
    background: rgba(2, 10, 22, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.field-block input::placeholder,
.field-block textarea::placeholder,
.auth-form input::placeholder,
.command-palette input::placeholder {
    color: #5f788e;
}

.field-block input:focus,
.field-block select:focus,
.field-block textarea:focus,
.auth-form input:focus,
.editor-shell #id_note:focus {
    border-color: rgba(34, 211, 238, 0.55);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.09), 0 0 22px rgba(34, 211, 238, 0.07);
}

select option {
    color: var(--text);
    background: #091426;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(0.8) sepia(1) saturate(2) hue-rotate(150deg);
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 12px;
    border: 1px solid rgba(103, 232, 249, 0.18);
    border-radius: 9px;
    color: var(--brand-strong);
    background: rgba(34, 211, 238, 0.08);
}

.errorlist,
.form-error-summary {
    color: #fecdd3;
    border-color: rgba(251, 113, 133, 0.22);
    background: rgba(190, 18, 60, 0.1);
}

.auth-showcase {
    border-color: rgba(103, 232, 249, 0.2);
    background:
        radial-gradient(circle at 20% 16%, rgba(34, 211, 238, 0.22), transparent 36%),
        radial-gradient(circle at 92% 88%, rgba(139, 92, 246, 0.22), transparent 38%),
        linear-gradient(145deg, rgba(9, 35, 60, 0.97), rgba(11, 19, 40, 0.96));
}

.auth-showcase .eyebrow,
.auth-showcase .hero-copy,
.auth-showcase .hero-metric span {
    color: #a1c2d5;
}

.focus-console {
    position: relative;
    margin-top: 22px;
    padding: 26px;
    overflow: hidden;
    border: 1px solid rgba(34, 211, 238, 0.2);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(8, 27, 47, 0.98), rgba(8, 15, 33, 0.95)),
        radial-gradient(circle at 10% 0%, rgba(34, 211, 238, 0.16), transparent 36%);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.focus-console::after {
    position: absolute;
    top: -110px;
    right: -80px;
    width: 260px;
    height: 260px;
    border: 1px solid rgba(34, 211, 238, 0.13);
    border-radius: 50%;
    box-shadow: 0 0 80px rgba(34, 211, 238, 0.09);
    content: "";
    pointer-events: none;
}

.focus-console-head,
.focus-task,
.focus-stale-session,
.focus-empty-state {
    position: relative;
    z-index: 1;
}

.focus-console-head,
.focus-task-title-row,
.focus-timer-row,
.focus-stale-session,
.focus-empty-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.focus-console-head h3 {
    margin: 4px 0 0;
    font-size: clamp(1.35rem, 2vw, 1.9rem);
}

.focus-console-copy {
    max-width: 690px;
    margin: 8px 0 0;
    color: var(--muted);
}

.focus-slot-meter {
    display: grid;
    min-width: 104px;
    padding: 14px 18px;
    border: 1px solid rgba(103, 232, 249, 0.18);
    border-radius: 16px;
    text-align: center;
    background: rgba(2, 10, 22, 0.52);
}

.focus-slot-meter strong {
    color: var(--brand-strong);
    font-family: var(--font-mono);
    font-size: 1.5rem;
}

.focus-slot-meter span,
.focus-timer-row span {
    color: var(--muted);
    font-size: 0.8rem;
}

.focus-task-grid {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.focus-task {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid rgba(103, 232, 249, 0.1);
    border-radius: 17px;
    background: rgba(2, 10, 22, 0.58);
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.focus-task:hover {
    border-color: rgba(103, 232, 249, 0.22);
    transform: translateX(2px);
}

.focus-task-active {
    border-color: rgba(34, 211, 238, 0.38);
    background: linear-gradient(90deg, rgba(8, 47, 70, 0.72), rgba(7, 18, 35, 0.72));
    box-shadow: inset 3px 0 0 var(--brand), 0 0 26px rgba(34, 211, 238, 0.08);
}

.focus-task-done {
    opacity: 0.72;
}

.focus-task-index {
    width: 48px;
    color: rgba(103, 232, 249, 0.56);
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.focus-task-title-row h4 {
    margin: 0;
    color: var(--text);
    font-size: 1.02rem;
}

.focus-task-meta {
    margin: 5px 0 12px;
    color: var(--muted);
    font-size: 0.84rem;
}

.focus-live-badge,
.focus-done-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.focus-live-badge {
    color: #a5f3fc;
    background: rgba(34, 211, 238, 0.11);
}

.focus-done-badge {
    color: #a7f3d0;
    background: rgba(52, 211, 153, 0.1);
}

.focus-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.9);
    animation: systemPulse 1.8s ease-in-out infinite;
}

.focus-timer-row {
    justify-content: flex-start;
    gap: 10px;
}

.focus-timer {
    color: #e6fbff;
    font-family: var(--font-mono);
    font-size: 1.24rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.focus-progress-track {
    height: 5px;
    margin-top: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(103, 232, 249, 0.08);
}

.focus-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22d3ee, #8b5cf6);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.42);
    transition: width 450ms ease;
}

.focus-task-actions,
.focus-empty-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.focus-task-actions form,
.focus-empty-actions form {
    margin: 0;
}

.focus-start-button,
.focus-pause-button,
.focus-secondary-button,
.focus-quiet-button {
    padding: 9px 13px;
    font-size: 0.82rem;
}

.focus-start-button {
    color: #032432;
    background: linear-gradient(135deg, #67e8f9, #22d3ee);
    box-shadow: 0 7px 18px rgba(34, 211, 238, 0.2);
}

.focus-pause-button {
    color: #fef3c7;
    border: 1px solid rgba(251, 191, 36, 0.26);
    background: rgba(251, 191, 36, 0.11);
    box-shadow: none;
}

.focus-secondary-button,
.focus-quiet-button {
    color: #bceef6;
    border: 1px solid rgba(103, 232, 249, 0.15);
    background: rgba(34, 211, 238, 0.07);
    box-shadow: none;
}

.focus-quiet-button {
    color: var(--muted);
    border-color: transparent;
    background: transparent;
}

.focus-order-badge {
    color: #a5f3fc;
    border: 1px solid rgba(34, 211, 238, 0.18);
    background: rgba(34, 211, 238, 0.09);
}

.focus-empty-state,
.focus-stale-session {
    padding: 18px;
    border: 1px dashed rgba(103, 232, 249, 0.18);
    border-radius: 16px;
    background: rgba(2, 10, 22, 0.4);
}

.focus-empty-state p,
.focus-stale-session p {
    margin: 5px 0 0;
    color: var(--muted);
}

.focus-stale-session {
    margin-top: 16px;
    border-style: solid;
    border-color: rgba(251, 191, 36, 0.2);
    background: rgba(120, 53, 15, 0.1);
}

.workspace-card {
    border-color: rgba(103, 232, 249, 0.1);
    background: linear-gradient(160deg, rgba(11, 24, 43, 0.92), rgba(6, 15, 29, 0.86));
    transition: transform 180ms ease, border-color 180ms ease;
}

.workspace-card:hover {
    border-color: rgba(103, 232, 249, 0.21);
    transform: translateY(-2px);
}

.workspace-card-feature,
.spotlight-card {
    background: linear-gradient(160deg, rgba(12, 28, 49, 0.96), rgba(6, 17, 31, 0.88));
}

.workspace-card-feature::after {
    opacity: 0.28;
    filter: blur(20px);
}

.workspace-card-reading {
    border-top-color: rgba(34, 211, 238, 0.36);
}

.workspace-card-exercise {
    border-top-color: rgba(52, 211, 153, 0.34);
}

.workspace-card-watch {
    border-top-color: rgba(167, 139, 250, 0.38);
}

.workspace-item,
.summary-row,
.reminder-guide-item,
.channel-hint,
.workspace-empty-panel {
    border-color: rgba(103, 232, 249, 0.09);
    background: rgba(2, 10, 22, 0.48);
}

.workspace-item {
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.workspace-item:hover {
    border-color: rgba(103, 232, 249, 0.2);
    background: rgba(11, 31, 52, 0.72);
    transform: translateX(2px);
}

.workspace-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.42), rgba(139, 92, 246, 0.34));
}

.workspace-list::before {
    background: linear-gradient(180deg, rgba(7, 17, 31, 0.98), transparent);
}

.workspace-list::after {
    background: linear-gradient(0deg, rgba(7, 17, 31, 0.98), transparent);
}

.workspace-link {
    box-shadow: 0 10px 24px rgba(34, 211, 238, 0.13);
}

.bar-track,
.category-track,
.watch-progress-track {
    background: rgba(103, 232, 249, 0.07);
}

.bar-fill-study,
.mini-bar-fill,
.category-fill,
.watch-progress-fill {
    background: linear-gradient(180deg, #a78bfa 0%, #22d3ee 100%);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.16);
}

.finance-income-fill {
    background: linear-gradient(90deg, #059669, var(--success));
}

.finance-expense-fill,
.finance-quarter-fill {
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
}

.finance-channel-fill {
    background: linear-gradient(90deg, #0891b2, var(--brand));
}

.finance-ledger-row,
.watch-item-card,
.ingredient-card,
.recipe-card,
.study-status-row {
    border-color: rgba(103, 232, 249, 0.1);
    background: rgba(2, 10, 22, 0.46);
}

.watch-item-card-ready,
.watch-progress-panel-ready {
    border-color: rgba(52, 211, 153, 0.2);
    background: rgba(52, 211, 153, 0.055);
}

.wp-item-card:hover {
    border-color: rgba(103, 232, 249, 0.25);
    background: rgba(11, 31, 52, 0.78);
}

.note-markdown pre,
.note-markdown code {
    border-color: rgba(103, 232, 249, 0.12);
    color: #b8f4ff;
    background: rgba(1, 7, 17, 0.78);
}

.flash-message {
    background: rgba(8, 22, 40, 0.94);
}

.flash-success {
    color: #a7f3d0;
    border-color: rgba(52, 211, 153, 0.22);
}

.flash-error {
    color: #fecdd3;
    border-color: rgba(251, 113, 133, 0.22);
}

.image-lightbox {
    background: rgba(1, 5, 13, 0.94);
    backdrop-filter: blur(18px);
}

.image-lightbox-dialog {
    border-color: rgba(103, 232, 249, 0.18);
    background: #07111f;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), 0 0 34px rgba(34, 211, 238, 0.09);
}

.command-palette {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: start center;
    padding: min(14vh, 120px) 18px 24px;
}

.command-palette[hidden] {
    display: none;
}

.command-palette-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(1, 6, 15, 0.76);
    box-shadow: none;
    backdrop-filter: blur(12px);
}

.command-palette-dialog {
    position: relative;
    width: min(680px, 100%);
    max-height: min(690px, 76vh);
    overflow: hidden;
    border: 1px solid rgba(103, 232, 249, 0.22);
    border-radius: 22px;
    background: linear-gradient(155deg, rgba(12, 28, 49, 0.99), rgba(5, 14, 28, 0.99));
    box-shadow: 0 36px 100px rgba(0, 0, 0, 0.6), 0 0 48px rgba(34, 211, 238, 0.1);
}

.command-palette-dialog::before {
    content: "";
    position: absolute;
    top: 0;
    right: 10%;
    left: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brand), var(--accent), transparent);
}

.command-palette-search {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-bottom: 1px solid rgba(103, 232, 249, 0.1);
    background: rgba(2, 9, 20, 0.42);
}

.command-symbol {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(103, 232, 249, 0.2);
    border-radius: 12px;
    color: var(--brand-strong);
    background: rgba(34, 211, 238, 0.08);
    box-shadow: 0 0 22px rgba(34, 211, 238, 0.08);
    font-size: 1.1rem;
}

.command-palette-search div {
    display: grid;
    gap: 5px;
}

.command-palette-search p,
.command-group-label {
    color: #6f8ca4;
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.command-palette-search input {
    width: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    color: #eef9ff;
    background: transparent;
    font: inherit;
    font-size: 1.08rem;
}

.command-palette-list {
    display: grid;
    gap: 6px;
    max-height: calc(min(690px, 76vh) - 100px);
    padding: 14px;
    overflow-y: auto;
}

.command-group-label {
    padding: 8px 8px 3px;
}

.command-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 13px;
    color: var(--text);
    text-decoration: none;
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.command-item:hover,
.command-item:focus-visible {
    border-color: rgba(103, 232, 249, 0.18);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.085), rgba(139, 92, 246, 0.055));
    transform: translateX(2px);
}

.command-item > span:nth-child(2) {
    display: grid;
    gap: 3px;
}

.command-item small {
    color: #7793aa;
}

.command-index {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(103, 232, 249, 0.12);
    border-radius: 9px;
    color: var(--brand-strong);
    background: rgba(34, 211, 238, 0.055);
    font-family: "Cascadia Code", Consolas, monospace;
    font-size: 0.68rem;
}

.command-arrow {
    color: #527089;
}

.command-empty {
    padding: 36px 18px;
    color: var(--muted);
    text-align: center;
}

.command-palette-open,
.image-lightbox-open {
    overflow: hidden;
}

@keyframes system-pulse {
    0%, 100% { opacity: 0.72; transform: scale(0.88); }
    50% { opacity: 1; transform: scale(1); }
}

@media (max-width: 1400px) {
    .system-indicator {
        display: none;
    }
}

@media (max-width: 1180px) {

    .topbar {
        align-items: flex-start;
    }

    .top-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 1080px) {
    .topbar {
        position: relative;
        top: auto;
    }

    .brand-block {
        width: 100%;
    }

    .top-actions {
        width: 100%;
    }

    .hero-card {
        min-height: auto;
    }
}

@media (max-width: 720px) {
    .topbar,
    .page-shell {
        width: min(100%, calc(100% - 24px));
    }

    .topbar {
        padding: 9px;
        border-radius: 18px;
    }

    .brand-block {
        padding: 7px 8px;
    }

    .brand-block .eyebrow {
        left: 72px;
    }

    .brand-mark {
        width: 44px;
        height: 44px;
    }

    .top-actions {
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: 100%;
        padding: 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .top-actions::-webkit-scrollbar {
        display: none;
    }

    .command-trigger kbd {
        display: none;
    }

    .hero-card,
    .page-header-card,
    .form-card,
    .auth-card,
    .auth-showcase,
    .next-steps,
    .empty-card,
    .chart-card,
    .workspace-card {
        padding: 22px;
    }

    .focus-console {
        padding: 20px;
    }

    .focus-console-head,
    .focus-stale-session,
    .focus-empty-state {
        align-items: flex-start;
        flex-direction: column;
    }

    .focus-slot-meter {
        grid-auto-flow: column;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    .focus-task {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .focus-task-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-left: 66px;
    }

    h2 {
        font-size: clamp(1.8rem, 9vw, 2.7rem);
    }

    .hero-card::after {
        display: none;
    }

    .hero-metrics {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 12px;
    }

    .hero-metric {
        min-width: 0;
    }

    .command-palette {
        padding: 8vh 10px 18px;
    }

    .command-palette-dialog {
        border-radius: 18px;
    }

    .command-palette-search {
        gap: 10px;
        padding: 14px;
    }

    .command-symbol {
        width: 36px;
        height: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Visual refinement system: typography, icon rhythm and fast actions */
:root {
    --font-sans: "MiSans", "HarmonyOS Sans SC", "Segoe UI Variable", "PingFang SC", "Microsoft YaHei UI", sans-serif;
    --font-display: "Segoe UI Variable Display", "MiSans", "HarmonyOS Sans SC", "Microsoft YaHei UI", sans-serif;
    --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    --surface-edge: rgba(153, 246, 255, 0.18);
    --surface-highlight: rgba(255, 255, 255, 0.055);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
    font-family: var(--font-sans);
    font-size: 15px;
    font-optical-sizing: auto;
    font-synthesis: none;
    font-variant-numeric: proportional-nums;
    letter-spacing: -0.008em;
    line-height: 1.62;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-name,
.stat-card strong,
.hero-metric strong {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    text-wrap: balance;
}

h2 {
    font-weight: 760;
    letter-spacing: -0.055em;
}

h3 {
    font-weight: 700;
    letter-spacing: -0.035em;
}

p {
    text-wrap: pretty;
}

.ui-icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

.ui-icon {
    display: block;
    width: 1.12em;
    height: 1.12em;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.primary-link,
.secondary-link,
.ghost-link,
.ghost-btn,
button,
.badge,
.system-indicator,
.command-trigger,
.nav-link,
.nav-logout-btn {
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.primary-link,
.secondary-link,
.ghost-link,
.ghost-btn,
button {
    gap: 8px;
}

.focus-start-button,
.focus-pause-button,
.focus-secondary-button,
.focus-quiet-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.primary-link,
.secondary-link,
.ghost-btn,
button {
    min-height: 42px;
}

.primary-link,
.secondary-link {
    padding-inline: 17px;
}

.nav-link,
.nav-logout-btn,
.command-trigger {
    display: inline-flex;
    min-height: 38px;
    padding: 8px 11px;
}

.nav-link .ui-icon,
.nav-logout-btn .ui-icon,
.command-trigger .ui-icon {
    width: 15px;
    height: 15px;
    opacity: 0.82;
    transition: opacity 180ms ease, transform 180ms var(--ease-out);
}

.nav-link:hover .ui-icon,
.nav-link-active .ui-icon,
.command-trigger:hover .ui-icon {
    opacity: 1;
    transform: translateY(-1px);
}

.nav-link-active::before {
    display: none;
}

.brand-name {
    font-size: 1.28rem;
    font-weight: 780;
    letter-spacing: -0.045em;
}

.brand-subtitle {
    font-weight: 520;
    letter-spacing: 0.015em;
}

.hero-card,
.page-header-card,
.workspace-card,
.stat-card,
.focus-console,
.task-card,
.form-card,
.chart-card,
.delete-card {
    border-color: var(--surface-edge);
    box-shadow:
        0 26px 72px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 var(--surface-highlight),
        0 0 0 1px rgba(3, 9, 20, 0.45);
}

.workspace-card,
.stat-card,
.task-card{
    transition:
        transform 220ms var(--ease-out),
        border-color 220ms ease,
        box-shadow 220ms ease,
        background 220ms ease;
}

.workspace-card:hover,
.stat-card:hover,
.task-card:hover{
    border-color: rgba(103, 232, 249, 0.3);
    box-shadow:
        0 30px 78px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.075),
        0 0 34px rgba(34, 211, 238, 0.075);
    transform: translateY(-3px);
}

.page-header-card {
    overflow: hidden;
    background:
        radial-gradient(circle at 88% 12%, rgba(139, 92, 246, 0.15), transparent 27%),
        linear-gradient(145deg, rgba(12, 28, 50, 0.96), rgba(7, 17, 31, 0.9));
}

.page-header-card::after {
    position: absolute;
    right: -34px;
    bottom: -66px;
    width: 190px;
    height: 190px;
    border: 1px solid rgba(103, 232, 249, 0.1);
    border-radius: 50%;
    box-shadow: 0 0 70px rgba(34, 211, 238, 0.06);
    content: "";
    pointer-events: none;
}

.hero-title-kicker {
    display: block;
    color: #a9bdcf;
    font-size: 0.5em;
    font-weight: 580;
    letter-spacing: -0.025em;
    line-height: 1.35;
}

.hero-title-gradient {
    color: #eafdff;
    background: linear-gradient(100deg, #ffffff 5%, #a5f3fc 47%, #c4b5fd 95%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.hero-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid rgba(103, 232, 249, 0.12);
    border-radius: 9px;
    color: #9eb8cb;
    background: rgba(2, 9, 20, 0.38);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.025em;
}

.hero-status-chip strong {
    color: #e5faff;
    font-weight: 650;
}

.hero-actions .primary-link,
.hero-actions .secondary-link {
    justify-content: flex-start;
}

.hero-actions .ui-icon,
.workspace-link .ui-icon,
.focus-task-actions .ui-icon {
    width: 17px;
    height: 17px;
}

.stats-grid {
    gap: 14px;
}

.stat-card {
    display: grid;
    align-content: start;
    min-height: 184px;
}

.stat-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.stat-card-icon,
.section-icon,
.delete-icon,
.delete-warning-icon,
.streak-icon{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    line-height: 0;
}

.stat-card-icon,
.section-icon {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(103, 232, 249, 0.16);
    border-radius: 12px;
    color: #8debf7;
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.12), rgba(139, 92, 246, 0.08));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 22px rgba(34, 211, 238, 0.06);
}

.stat-card-icon .ui-icon,
.section-icon .ui-icon {
    width: 18px;
    height: 18px;
}

.accent-card .stat-card-icon {
    color: #d9fbff;
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
}

.stat-card strong {
    margin-top: 12px;
    font-weight: 740;
    letter-spacing: -0.055em;
}

.stat-card strong small {
    color: #7894aa;
    font-family: var(--font-sans);
    font-size: 0.34em;
    font-weight: 520;
    letter-spacing: 0;
}

.study-goal-inline {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
}

.study-goal-inline input {
    width: 66px;
    min-height: 34px;
    padding: 5px 8px;
    border: 1px solid rgba(103, 232, 249, 0.18);
    border-radius: 9px;
    color: var(--text);
    text-align: center;
    background: rgba(2, 10, 22, 0.55);
}

.study-goal-inline button {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 9px;
    color: #a5f3fc;
    background: rgba(34, 211, 238, 0.08);
    box-shadow: none;
    font-size: 0.78rem;
}

.study-progress-track {
    height: 6px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(103, 232, 249, 0.09);
}

.study-progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #22d3ee, #8b5cf6);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.32);
}

.study-progress-copy {
    margin-top: 7px;
    color: #8faabe;
    font-size: 0.8rem;
}

.section-title-with-icon {
    display: flex;
    align-items: center;
    gap: 11px;
}

.section-title-with-icon > div {
    min-width: 0;
}

.workspace-link {
    gap: 8px;
}

.command-item-active {
    border-color: rgba(103, 232, 249, 0.26) !important;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.12), rgba(139, 92, 246, 0.07)) !important;
    transform: translateX(3px);
}

.command-item-active .command-arrow {
    color: var(--brand-strong);
    transform: translateX(2px);
}

.quick-dock {
    position: fixed;
    right: max(20px, env(safe-area-inset-right));
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 26;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px;
    border: 1px solid rgba(103, 232, 249, 0.2);
    border-radius: 16px;
    background: rgba(5, 14, 28, 0.86);
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 0 26px rgba(34, 211, 238, 0.08);
    backdrop-filter: blur(22px) saturate(145%);
}

.quick-dock-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #9db6c9;
    text-decoration: none;
    background: transparent;
    box-shadow: none;
    font: 650 0.78rem/1 var(--font-sans);
    transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms var(--ease-out);
}

.quick-dock-item:hover {
    color: #e6fbff;
    border-color: rgba(103, 232, 249, 0.16);
    background: rgba(34, 211, 238, 0.07);
    box-shadow: none;
    filter: none;
    transform: translateY(-2px);
}

.quick-dock-primary {
    color: #03141e;
    background: linear-gradient(135deg, #67e8f9, #22d3ee 58%, #38bdf8);
    box-shadow: 0 10px 22px rgba(34, 211, 238, 0.18);
}

.quick-dock-primary:hover {
    color: #03141e;
    background: linear-gradient(135deg, #a5f3fc, #22d3ee 62%, #60a5fa);
}

.quick-dock-item kbd {
    color: #66849a;
    font: 600 0.58rem/1 var(--font-mono);
}

.quick-dock-primary kbd {
    color: rgba(3, 20, 30, 0.62);
}
.delete-card{
    color: var(--text);
    border-color: rgba(103, 232, 249, 0.15);
    background: linear-gradient(145deg, rgba(12, 26, 47, 0.94), rgba(7, 17, 31, 0.88));
}
.delete-icon,
.delete-warning-icon,
.streak-icon {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(103, 232, 249, 0.16);
    border-radius: 14px;
    color: #8feef8;
    background: linear-gradient(145deg, rgba(34, 211, 238, 0.13), rgba(139, 92, 246, 0.09));
}
.delete-icon .ui-icon,
.streak-icon .ui-icon {
    width: 23px;
    height: 23px;
}

.delete-warning-icon {
    width: 32px;
    height: 32px;
    color: #fda4af;
}

.delete-warning-icon .ui-icon{
    width: 18px;
    height: 18px;
}
.delete-template-info,
.delete-warning,
.delete-card-actions {
    color: var(--text);
    border-color: rgba(103, 232, 249, 0.11);
    background: rgba(2, 10, 22, 0.5);
}
.delete-card-header {
    border-color: rgba(103, 232, 249, 0.1);
}
.delete-card-actions > * {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

@media (max-width: 860px) {
    .top-actions {
        gap: 4px;
    }

    .quick-dock {
        right: 50%;
        bottom: max(12px, env(safe-area-inset-bottom));
        width: max-content;
        max-width: calc(100vw - 20px);
        transform: translateX(50%);
    }

    .quick-dock-item {
        min-width: 78px;
    }

    .page-shell {
        padding-bottom: 104px;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 14px;
    }

    .nav-link,
    .nav-logout-btn {
        min-height: 40px;
        padding-inline: 11px;
    }

    .system-indicator span:nth-child(2) {
        display: none;
    }

    .quick-dock-item {
        min-width: 0;
        padding-inline: 10px;
    }

    .quick-dock-item kbd {
        display: none;
    }

    .hero-title-kicker {
        font-size: 0.56em;
    }

    .hero-status-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-status-chip {
        justify-content: center;
    }

    .stat-card-icon,
    .section-icon {
        width: 36px;
        height: 36px;
    }
}

/* Finance cockpit: explicit contrast instead of generic gray surfaces */
body:has(.finance-hero) .page-shell {
    --finance-ink: #f7fbff;
    --finance-muted: #b9c9d8;
}

.finance-hero {
    border-color: rgba(56, 189, 248, 0.24);
    background:
        radial-gradient(circle at 82% 18%, rgba(16, 185, 129, 0.16), transparent 25%),
        radial-gradient(circle at 12% 80%, rgba(14, 165, 233, 0.12), transparent 30%),
        linear-gradient(135deg, rgba(7, 24, 40, 0.98), rgba(7, 17, 31, 0.96));
}

body:has(.finance-hero) .chart-card,
body:has(.finance-hero) .form-card {
    color: var(--finance-ink);
    border-color: rgba(125, 211, 252, 0.18);
    background:
        linear-gradient(150deg, rgba(12, 31, 50, 0.97), rgba(4, 15, 28, 0.98));
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body:has(.finance-hero) .summary-row,
body:has(.finance-hero) .dual-bar-row,
body:has(.finance-hero) .finance-quarter-row,
body:has(.finance-hero) .finance-ledger-row {
    border: 1px solid rgba(125, 211, 252, 0.12);
    background: rgba(6, 24, 40, 0.82);
}

body:has(.finance-hero) .summary-row span,
body:has(.finance-hero) .dual-bar-meta,
body:has(.finance-hero) .dual-bar-head span,
body:has(.finance-hero) .task-meta,
body:has(.finance-hero) .section-meta,
body:has(.finance-hero) .category-head span {
    color: var(--finance-muted);
}

body:has(.finance-hero) .summary-row strong,
body:has(.finance-hero) .dual-bar-head strong,
body:has(.finance-hero) .category-head strong,
body:has(.finance-hero) .finance-ledger-row strong {
    color: #f8fbff;
}

.finance-stat {
    isolation: isolate;
    min-height: 168px;
    overflow: hidden;
    border-width: 1px;
}

.finance-stat::before {
    position: absolute;
    z-index: -1;
    right: -24px;
    bottom: -32px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    content: "";
    filter: blur(2px);
}

.finance-stat strong {
    color: #fff;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 24px currentColor;
}

.finance-stat-income { border-color: rgba(52, 211, 153, 0.28); background: linear-gradient(145deg, rgba(6, 58, 52, 0.92), rgba(5, 25, 37, 0.98)); }
.finance-stat-income::before { background: rgba(52, 211, 153, 0.15); box-shadow: 0 0 48px rgba(52, 211, 153, 0.25); }
.finance-stat-expense { border-color: rgba(251, 113, 133, 0.25); background: linear-gradient(145deg, rgba(68, 24, 45, 0.92), rgba(25, 16, 33, 0.98)); }
.finance-stat-expense::before { background: rgba(251, 113, 133, 0.14); box-shadow: 0 0 48px rgba(251, 113, 133, 0.22); }
.finance-stat-net { border-color: rgba(167, 139, 250, 0.28); background: linear-gradient(145deg, rgba(45, 32, 83, 0.92), rgba(18, 18, 39, 0.98)); }
.finance-stat-net::before { background: rgba(167, 139, 250, 0.15); box-shadow: 0 0 48px rgba(167, 139, 250, 0.24); }
.finance-stat-count { border-color: rgba(56, 189, 248, 0.28); background: linear-gradient(145deg, rgba(10, 47, 71, 0.92), rgba(5, 22, 36, 0.98)); }
.finance-stat-count::before { background: rgba(56, 189, 248, 0.15); box-shadow: 0 0 48px rgba(56, 189, 248, 0.24); }

/* Reading log: actual output, no daily-plan pressure */
.reading-today-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

body:has(.reading-today-summary) .page-header-card > .primary-link {
    min-width: 112px;
    white-space: nowrap;
}

.reading-metric {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 3px 10px;
    min-height: 130px;
    padding: 22px;
    overflow: hidden;
    border: 1px solid rgba(103, 232, 249, 0.16);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(11, 31, 52, 0.94), rgba(4, 15, 28, 0.96));
}

.reading-metric span { grid-column: 1 / -1; color: #b8ccdc; font-size: .82rem; font-weight: 700; letter-spacing: .08em; }
.reading-metric strong { color: #fff; font-size: clamp(2.4rem, 5vw, 4rem); line-height: .95; }
.reading-metric small { color: #67e8f9; font-weight: 800; }
.reading-metric-time { border-color: rgba(167, 139, 250, 0.2); }
.reading-metric-time small { color: #c4b5fd; }
.reading-metric-books { border-color: rgba(52, 211, 153, 0.2); }
.reading-metric-books small { color: #6ee7b7; }

.reading-record-form {
    display: grid;
    grid-template-columns: minmax(130px, .65fr) minmax(130px, .65fr) minmax(220px, 1.5fr) auto;
    align-items: end;
    gap: 12px;
    margin-top: 18px;
    padding: 16px;
    border: 1px solid rgba(103, 232, 249, 0.13);
    border-radius: 18px;
    background: rgba(3, 14, 27, 0.7);
}

.reading-record-form label { display: grid; gap: 7px; color: #b8ccdc; font-size: .78rem; font-weight: 700; }
.reading-record-form input { width: 100%; min-height: 44px; }
.reading-record-form button { min-height: 44px; white-space: nowrap; }
.reading-log-grid { display: grid; gap: 10px; }
.reading-log-row { display: grid; grid-template-columns: 58px 1fr; gap: 14px; padding: 14px 16px; border: 1px solid rgba(103, 232, 249, 0.1); border-radius: 16px; background: rgba(2, 12, 24, .58); }
.reading-log-row time { color: #67e8f9; font-weight: 800; font-variant-numeric: tabular-nums; }
.reading-log-row p, .reading-log-row small { margin: 4px 0 0; color: #9fb4c5; }

/* Daily watch progress: the same low-friction pattern as reading logs */
.watch-today-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

body:has(.watch-today-summary) .page-header-card > .primary-link {
    min-width: 112px;
    white-space: nowrap;
}

.watch-metric {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 3px 10px;
    min-height: 122px;
    padding: 20px;
    overflow: hidden;
    border: 1px solid rgba(103, 232, 249, 0.16);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(8, 30, 48, 0.96), rgba(4, 14, 27, 0.98));
}

.watch-metric span { grid-column: 1 / -1; color: #b8ccdc; font-size: .8rem; font-weight: 700; letter-spacing: .08em; }
.watch-metric strong { color: #fff; font-size: clamp(2.15rem, 4vw, 3.5rem); line-height: .95; font-variant-numeric: tabular-nums; }
.watch-metric small { color: #67e8f9; font-weight: 800; }
.watch-metric-episodes { border-color: rgba(167, 139, 250, .22); }
.watch-metric-episodes small { color: #c4b5fd; }
.watch-metric-minutes { border-color: rgba(52, 211, 153, .2); }
.watch-metric-minutes small { color: #6ee7b7; }
.watch-metric-time { border-color: rgba(251, 191, 36, .2); }
.watch-metric-time small { color: #fcd34d; }

.watch-record-form {
    display: grid;
    grid-template-columns: minmax(100px, .55fr) minmax(125px, .72fr) minmax(110px, .62fr) minmax(180px, 1.25fr) minmax(112px, .62fr) auto;
    align-items: end;
    gap: 12px;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid rgba(103, 232, 249, .14);
    border-radius: 18px;
    background: rgba(3, 14, 27, .76);
}

.watch-record-form label:not(.watch-finished-check) { display: grid; gap: 7px; color: #b8ccdc; font-size: .76rem; font-weight: 700; }
.watch-record-form input:not([type="checkbox"]), .watch-record-form select { width: 100%; min-height: 44px; }
.watch-record-form button { min-height: 44px; white-space: nowrap; }
.watch-note-field { min-width: 190px; }
.watch-finished-check { display: flex; align-items: center; gap: 8px; min-height: 44px; color: #dceaf4; font-size: .78rem; font-weight: 700; }
.watch-finished-check input { width: 18px; height: 18px; }
.watch-log-grid { display: grid; gap: 10px; }
.watch-log-row { display: grid; grid-template-columns: 58px 1fr; gap: 14px; padding: 14px 16px; border: 1px solid rgba(103, 232, 249, .1); border-radius: 16px; background: rgba(2, 12, 24, .58); }
.watch-log-row time { color: #67e8f9; font-weight: 800; font-variant-numeric: tabular-nums; }
.watch-log-row p, .watch-log-row small { margin: 4px 0 0; color: #9fb4c5; }

.watch-item-card { flex-direction: column; }
.watch-item-card > .task-main { width: 100%; }
.watch-item-card > .task-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 14px;
    border-top: 1px solid rgba(103, 232, 249, .1);
}
.watch-item-card > .task-actions a,
.watch-item-card > .task-actions button { white-space: nowrap; }
.watch-metadata-refresh-link {
    border-color: rgba(167, 139, 250, .28) !important;
    color: #d8ccff !important;
    background: rgba(74, 46, 126, .2) !important;
}
.watch-metadata-refresh-link-hot {
    border-color: rgba(52, 211, 153, .38) !important;
    color: #d1fae5 !important;
    background: rgba(6, 95, 70, .34) !important;
    box-shadow: 0 0 20px rgba(52, 211, 153, .09);
}
.watch-update-badge { border-color: rgba(52, 211, 153, .32); color: #a7f3d0; background: rgba(6, 95, 70, .3); }
.watch-update-inbox {
    display: grid;
    grid-template-columns: minmax(260px, .78fr) minmax(320px, 1.22fr);
    gap: 22px;
    margin: 18px 0 22px;
    padding: 21px;
    overflow: hidden;
    border: 1px solid rgba(52, 211, 153, .26);
    border-radius: 22px;
    background:
        radial-gradient(circle at 8% 10%, rgba(52, 211, 153, .14), transparent 34%),
        linear-gradient(135deg, rgba(4, 42, 42, .94), rgba(5, 17, 34, .98));
    box-shadow: 0 22px 55px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(167, 243, 208, .06);
}
.watch-update-inbox-head { display: flex; align-items: flex-start; gap: 14px; }
.watch-update-inbox-head h3 { margin: 3px 0 7px; color: #ecfdf5; font-size: 1.18rem; }
.watch-update-inbox-head p:last-child { margin: 0; color: #9bbeb7; font-size: .8rem; line-height: 1.55; }
.watch-update-orbit { display: grid; flex: 0 0 auto; width: 42px; height: 42px; place-items: center; border: 1px solid rgba(52, 211, 153, .3); border-radius: 14px; color: #6ee7b7; background: rgba(6, 78, 68, .4); box-shadow: 0 0 28px rgba(52, 211, 153, .12); }
.watch-update-orbit .ui-icon { width: 21px; height: 21px; }
.watch-update-inbox-list { display: grid; gap: 9px; }
.watch-update-inbox-list a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid rgba(110, 231, 183, .14);
    border-radius: 14px;
    color: #d9fff1;
    background: rgba(2, 24, 30, .6);
}
.watch-update-inbox-list a:hover { border-color: rgba(110, 231, 183, .3); transform: translateY(-1px); }
.watch-update-inbox-list a > div { display: grid; min-width: 0; gap: 3px; }
.watch-update-inbox-list small { overflow: hidden; color: #96bcb4; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.watch-update-inbox-list a > span:last-child { color: #80e6c0; font-size: .73rem; font-weight: 800; white-space: nowrap; }
.watch-update-pulse { width: 9px; height: 9px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 5px rgba(52, 211, 153, .1), 0 0 18px rgba(52, 211, 153, .55); }
.watch-decision-lab {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
    margin: 20px 0 22px;
    overflow: hidden;
    border: 1px solid rgba(103, 232, 249, .2);
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(7, 27, 47, .98), rgba(12, 14, 39, .98));
    box-shadow: 0 26px 70px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.watch-decision-console { min-width: 0; padding: 22px; border-right: 1px solid rgba(103, 232, 249, .12); }
.watch-decision-title { display: flex; align-items: flex-start; gap: 14px; }
.watch-decision-title h3 { margin: 3px 0 6px; color: #f5fbff; font-size: 1.28rem; }
.watch-decision-title p:last-child { margin: 0; color: #93aabd; font-size: .8rem; }
.watch-decision-icon { display: grid; flex: 0 0 auto; width: 44px; height: 44px; place-items: center; border: 1px solid rgba(103, 232, 249, .25); border-radius: 15px; color: #67e8f9; background: rgba(8, 74, 94, .32); box-shadow: 0 0 30px rgba(34, 211, 238, .1); }
.watch-decision-icon .ui-icon { width: 22px; height: 22px; }
.watch-decision-form { display: grid; gap: 15px; margin-top: 19px; }
.watch-decision-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.watch-decision-form legend { margin-bottom: 8px; color: #c7d8e4; font-size: .74rem; font-weight: 800; }
.watch-decision-options { display: flex; flex-wrap: wrap; gap: 8px; }
.watch-decision-options label { position: relative; cursor: pointer; }
.watch-decision-options input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.watch-decision-options span { display: inline-flex; align-items: center; justify-content: center; min-height: 35px; padding: 7px 11px; border: 1px solid rgba(126, 161, 184, .18); border-radius: 11px; color: #a8bdcc; background: rgba(2, 12, 24, .52); font-size: .74rem; font-weight: 750; transition: .18s ease; }
.watch-decision-options label:hover span { border-color: rgba(103, 232, 249, .32); color: #d9faff; }
.watch-decision-options input:focus-visible + span { outline: 2px solid #67e8f9; outline-offset: 2px; }
.watch-decision-options input:checked + span { border-color: rgba(103, 232, 249, .52); color: #e9fcff; background: linear-gradient(135deg, rgba(10, 107, 129, .62), rgba(31, 59, 114, .58)); box-shadow: 0 8px 24px rgba(34, 211, 238, .1), inset 0 1px 0 rgba(255, 255, 255, .08); }
.watch-decision-generate { display: inline-flex; width: fit-content; align-items: center; gap: 8px; min-height: 43px; padding: 9px 16px; }
.watch-decision-generate .ui-icon { width: 17px; height: 17px; }
.watch-decision-result { display: grid; min-width: 0; min-height: 310px; padding: 22px; background: radial-gradient(circle at 78% 20%, rgba(139, 92, 246, .12), transparent 42%), rgba(2, 10, 23, .48); }
.watch-decision-result-ready { align-content: start; }
.watch-decision-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #8da6b9; font-size: .7rem; }
.watch-decision-provider { display: inline-flex; padding: 5px 9px; border: 1px solid rgba(167, 139, 250, .28); border-radius: 999px; color: #d8ccff; background: rgba(76, 45, 135, .28); font-weight: 850; }
.watch-decision-pick { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 16px; margin-top: 17px; }
.watch-decision-pick img,
.watch-decision-poster-fallback { width: 84px; height: 118px; border: 1px solid rgba(103, 232, 249, .15); border-radius: 14px; object-fit: cover; background: rgba(5, 24, 40, .76); }
.watch-decision-poster-fallback { display: grid; place-items: center; color: #5e879b; }
.watch-decision-poster-fallback .ui-icon { width: 28px; height: 28px; }
.watch-decision-pick h3 { margin: 5px 0 8px; color: #f8fbff; font-size: 1.16rem; line-height: 1.35; }
.watch-decision-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.watch-decision-meta span { padding: 4px 7px; border: 1px solid rgba(103, 232, 249, .12); border-radius: 999px; color: #9fc4d2; font-size: .66rem; background: rgba(7, 39, 55, .45); }
.watch-decision-reason { margin: 11px 0 0; color: #b8cbd8; font-size: .8rem; line-height: 1.58; }
.watch-decision-feedback { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.watch-decision-feedback button { min-height: 37px; padding: 7px 12px; font-size: .74rem; }
.watch-decision-accept { border-color: rgba(52, 211, 153, .42); color: #052e27; background: linear-gradient(135deg, #6ee7b7, #22d3ee); box-shadow: 0 10px 28px rgba(45, 212, 191, .15); }
.watch-decision-dislike { color: #b7a7b1 !important; }
.watch-decision-learning { margin: 10px 0 0; color: #6f8799; font-size: .67rem; }
.watch-decision-idle { display: grid; align-self: center; justify-items: center; text-align: center; }
.watch-decision-idle strong { margin-top: 17px; color: #d9e9f3; }
.watch-decision-idle p { max-width: 320px; margin: 7px 0 0; color: #8299aa; font-size: .78rem; line-height: 1.55; }
.watch-decision-radar { position: relative; width: 96px; height: 96px; border: 1px solid rgba(103, 232, 249, .2); border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 20px, rgba(103, 232, 249, .08) 21px 22px); }
.watch-decision-radar::before,
.watch-decision-radar::after { content: ""; position: absolute; background: rgba(103, 232, 249, .1); }
.watch-decision-radar::before { top: 0; bottom: 0; left: 50%; width: 1px; }
.watch-decision-radar::after { top: 50%; right: 0; left: 0; height: 1px; }
.watch-decision-radar i { position: absolute; inset: 10px; border-radius: 50%; background: conic-gradient(from 20deg, rgba(103, 232, 249, .22), transparent 32%); animation: watch-radar-spin 4s linear infinite; }
.watch-decision-radar span { position: absolute; z-index: 1; width: 6px; height: 6px; border-radius: 50%; background: #67e8f9; box-shadow: 0 0 13px #67e8f9; }
.watch-decision-radar span:nth-child(1) { top: 25px; left: 59px; }
.watch-decision-radar span:nth-child(2) { top: 57px; left: 27px; }
.watch-decision-radar span:nth-child(3) { top: 68px; left: 65px; }
@keyframes watch-radar-spin { to { transform: rotate(360deg); } }

.watch-refresh-safety {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
    padding: 17px 19px;
    border: 1px solid rgba(52, 211, 153, .24);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(5, 54, 47, .52), rgba(3, 21, 34, .86));
}
.watch-refresh-safety .ui-icon { flex: 0 0 auto; width: 23px; height: 23px; color: #6ee7b7; }
.watch-refresh-safety strong { color: #ecfdf5; }
.watch-refresh-safety p { margin: 4px 0 0; color: #a7cfc4; font-size: .84rem; line-height: 1.55; }
.watch-refresh-table-wrap { overflow-x: auto; border: 1px solid rgba(103, 232, 249, .12); border-radius: 16px; }
.watch-refresh-table { width: 100%; min-width: 660px; border-collapse: collapse; }
.watch-refresh-table th,
.watch-refresh-table td { padding: 14px 16px; border-bottom: 1px solid rgba(103, 232, 249, .09); text-align: left; }
.watch-refresh-table th { color: #809caf; background: rgba(2, 12, 24, .72); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.watch-refresh-table td { color: #d8e7f1; font-size: .84rem; }
.watch-refresh-table tbody tr:last-child td { border-bottom: 0; }
.watch-refresh-table tbody tr:hover { background: rgba(18, 75, 99, .16); }
.watch-refresh-status { display: inline-flex; padding: 5px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.watch-refresh-status-new,
.watch-refresh-status-increase { color: #a7f3d0; background: rgba(6, 95, 70, .34); }
.watch-refresh-status-protected { color: #fde68a; background: rgba(120, 75, 12, .3); }
.watch-refresh-status-same { color: #a9bdcb; background: rgba(49, 66, 82, .46); }
.watch-refresh-metadata-list { display: grid; min-width: 0; gap: 10px; }
.watch-refresh-metadata-list article {
    display: grid;
    min-width: 0;
    grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    padding: 15px 16px;
    border: 1px solid rgba(103, 232, 249, .11);
    border-radius: 15px;
    background: rgba(2, 13, 25, .54);
}
.watch-refresh-metadata-list article > div { min-width: 0; }
.watch-refresh-metadata-list article > span { color: #83e8f4; font-size: .78rem; font-weight: 800; }
.watch-refresh-metadata-list small { color: #7893a7; font-size: .68rem; }
.watch-refresh-metadata-list p { margin: 4px 0 0; overflow-wrap: anywhere; color: #d5e5ef; font-size: .8rem; line-height: 1.5; }
.watch-refresh-confirm {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
    border: 1px solid rgba(167, 139, 250, .22);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(47, 33, 91, .5), rgba(3, 17, 31, .94));
}
.watch-refresh-confirm strong { color: #f3efff; }
.watch-refresh-confirm p { margin: 5px 0 0; color: #a8b9cb; font-size: .8rem; }
.watch-refresh-confirm a:not(.ghost-link) { color: #8de8f3; }
.watch-refresh-confirm form { margin: 0; }

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

.watch-ai-flow article {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    padding: 18px;
    border: 1px solid rgba(103, 232, 249, .14);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(8, 28, 47, .94), rgba(4, 14, 27, .98));
}

.watch-ai-flow article > span { grid-row: 1 / 3; color: #67e8f9; font-size: .78rem; font-weight: 900; letter-spacing: .12em; }
.watch-ai-flow strong { color: #f8fbff; }
.watch-ai-flow p { color: #a8bdcd; font-size: .84rem; line-height: 1.6; }
.watch-ai-prompt-form input[type="text"] { min-height: 58px; font-size: 1rem; }
.watch-ai-example-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.watch-ai-example-strip .ghost-btn { min-height: 36px; padding: 7px 12px; font-size: .78rem; }
.watch-ai-generate { justify-self: start; min-width: 190px; }
.watch-ai-preview { border-color: rgba(167, 139, 250, .22); }

.watch-ai-result-help { margin: -4px 0 16px; }
.watch-ai-candidate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.watch-ai-candidate {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    min-height: 210px;
    overflow: hidden;
    border: 1px solid rgba(103, 232, 249, .16);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(8, 28, 47, .96), rgba(4, 14, 27, .99));
}
.watch-ai-candidate-poster { min-height: 100%; background: rgba(2, 12, 23, .8); }
.watch-ai-candidate-poster img { width: 100%; height: 100%; min-height: 210px; object-fit: cover; }
.watch-ai-candidate-poster span { display: grid; height: 100%; place-items: center; color: #60798d; font-size: .68rem; letter-spacing: .14em; }
.watch-ai-candidate-body { display: flex; min-width: 0; flex-direction: column; gap: 10px; padding: 16px; }
.watch-ai-candidate-body h3 { color: #f8fbff; font-size: 1.02rem; }
.watch-ai-genre-list { display: flex; flex-wrap: wrap; gap: 6px; }
.watch-ai-genre-list span { padding: 4px 8px; border: 1px solid rgba(103, 232, 249, .15); border-radius: 999px; color: #a9eaf3; font-size: .7rem; }
.watch-ai-match-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.watch-ai-match-reasons span { padding: 4px 8px; border: 1px solid rgba(74, 222, 128, .16); border-radius: 8px; color: #9ee8b7; background: rgba(34, 197, 94, .06); font-size: .68rem; font-weight: 650; }
.watch-ai-summary { color: #a8bdcd; font-size: .78rem; line-height: 1.55; }
.watch-ai-candidate-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.watch-ai-candidate-actions a { color: #87ddec; font-size: .74rem; }
.watch-ai-candidate-actions form { margin: 0; }
.watch-ai-candidate-actions button { min-height: 36px; padding: 7px 13px; font-size: .76rem; }
.watch-ai-attribution { margin: 15px 0 0; color: #7791a5; font-size: .72rem; }
.watch-ai-attribution a, .watch-ai-source-line a { color: #8de8f3; }
.watch-ai-source-line { margin: 0 0 16px; color: #8ea7ba; font-size: .78rem; }

.watch-ai-warning-list {
    display: grid;
    gap: 8px;
    margin: 12px 0 18px;
}

.watch-ai-warning-list p {
    display: flex;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid rgba(251, 191, 36, .18);
    border-radius: 14px;
    background: rgba(83, 56, 13, .2);
    color: #dce8f1;
    font-size: .84rem;
}

.watch-ai-warning-list strong { flex: 0 0 auto; color: #fcd34d; }
.watch-ai-confirm-grid { display: grid; grid-template-columns: 1.4fr .8fr .8fr; gap: 14px; }
.watch-ai-confirm-grid-wide { grid-template-columns: 1.25fr 1fr .55fr .7fr; }
.watch-ai-note-field { grid-column: span 2; }
.watch-ai-detail-grid { display: grid; grid-template-columns: minmax(220px, .75fr) minmax(280px, 1.25fr); gap: 14px; }
.watch-ai-detail-grid textarea { min-height: 140px; }
.watch-ai-metadata-fields { display: grid; gap: 14px; }
.watch-ai-server-step {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(103, 232, 249, .16);
    border-radius: 16px;
    background: rgba(5, 35, 51, .4);
}
.watch-ai-server-step > div:first-child { display: grid; gap: 5px; }
.watch-ai-server-step > div:first-child > span { color: #effbff; font-weight: 900; }
.watch-ai-server-step > div:first-child > small { color: #92aabd; }
.watch-ai-save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 16px;
    border: 1px solid rgba(52, 211, 153, .16);
    border-radius: 16px;
    background: rgba(6, 52, 45, .24);
}
.watch-ai-save-bar p { color: #b8ccdc; font-size: .84rem; }
.watch-ai-save-bar button { white-space: nowrap; }

@media (max-width: 1180px) {
    .watch-today-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .watch-record-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .watch-record-form button { width: 100%; }
    .watch-ai-confirm-grid { grid-template-columns: 1fr 1fr; }
    .watch-ai-candidate-grid { grid-template-columns: 1fr; }
    .watch-update-inbox { grid-template-columns: 1fr; }
    .watch-decision-lab { grid-template-columns: 1fr; }
    .watch-decision-console { border-right: 0; border-bottom: 1px solid rgba(103, 232, 249, .12); }
}

@media (max-width: 640px) {
    .watch-today-summary, .watch-record-form { grid-template-columns: 1fr; }
    .watch-metric { min-height: 108px; }
    .watch-ai-flow, .watch-ai-confirm-grid, .watch-ai-detail-grid { grid-template-columns: 1fr; }
    .watch-ai-candidate { grid-template-columns: 88px minmax(0, 1fr); }
    .watch-ai-candidate-poster img { min-height: 190px; }
    .watch-ai-note-field { grid-column: auto; }
    .watch-ai-candidate-actions { align-items: flex-start; flex-direction: column; }
    .watch-ai-candidate-actions button { width: 100%; }
    .watch-ai-save-bar { align-items: stretch; flex-direction: column; }
    .watch-ai-save-bar button { width: 100%; }
    .watch-update-inbox { padding: 17px; }
    .watch-update-inbox-list a { grid-template-columns: auto minmax(0, 1fr); }
    .watch-update-inbox-list a > span:last-child { grid-column: 2; }
    .watch-decision-console, .watch-decision-result { padding: 17px; }
    .watch-decision-result { min-height: 260px; }
    .watch-decision-pick { grid-template-columns: 68px minmax(0, 1fr); gap: 12px; }
    .watch-decision-pick img, .watch-decision-poster-fallback { width: 68px; height: 98px; }
    .watch-decision-result-head { align-items: flex-start; flex-direction: column; }
    .watch-decision-feedback button { flex: 1 1 auto; }
    .watch-refresh-metadata-list article { grid-template-columns: 1fr; gap: 8px; }
    .watch-refresh-confirm { align-items: stretch; flex-direction: column; }
    .watch-refresh-confirm .form-actions,
    .watch-refresh-confirm .form-actions a,
    .watch-refresh-confirm .form-actions form,
    .watch-refresh-confirm .form-actions button { width: 100%; }
}

/* Emby retention radar and explainable smart queue */
.retention-status {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 5px 12px;
    margin-top: 14px;
    padding: 13px 15px;
    border: 1px solid rgba(148, 184, 205, .13);
    border-radius: 16px;
    background: rgba(2, 12, 24, .62);
    color: #dbeafe;
}
.retention-status div { display: flex; align-items: center; gap: 8px; }
.retention-status small { grid-column: 1 / -1; color: #91a8ba; }
.retention-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 12px currentColor; }
.retention-status-safe { border-color: rgba(52, 211, 153, .22); }
.retention-status-safe .retention-dot { color: #34d399; background: #34d399; }
.retention-status-warning { border-color: rgba(251, 191, 36, .28); background: rgba(55, 36, 5, .32); }
.retention-status-warning .retention-dot { color: #fbbf24; background: #fbbf24; }
.retention-status-danger { border-color: rgba(251, 113, 133, .3); background: rgba(62, 14, 30, .34); }
.retention-status-danger .retention-dot { color: #fb7185; background: #fb7185; animation: retention-pulse 1.8s ease-in-out infinite; }
@keyframes retention-pulse { 50% { opacity: .45; transform: scale(.72); } }

.smart-schedule-panel, .smart-recommendation-list {
    display: grid;
    gap: 11px;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid rgba(167, 139, 250, .22);
    border-radius: 18px;
    background: radial-gradient(circle at 100% 0, rgba(139, 92, 246, .14), transparent 36%), rgba(5, 16, 31, .8);
}
.smart-schedule-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.smart-schedule-head h4 { margin: 3px 0 0; font-size: 1.05rem; }
.smart-apply-button { width: 100%; }
.smart-recommendation-row { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding-top: 10px; border-top: 1px solid rgba(167, 139, 250, .1); }
.smart-recommendation-row p { margin: 4px 0 0; color: #9fb4c5; font-size: .82rem; }
.smart-rank { color: #c4b5fd; font-weight: 900; letter-spacing: .08em; }
.sync-path-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sync-path-grid article { padding: 17px; border: 1px solid rgba(103, 232, 249, .11); border-radius: 17px; background: rgba(2, 12, 24, .56); }
.sync-path-grid p { margin: 8px 0 0; color: #a7b9c8; line-height: 1.7; }

@media (max-width: 900px) {
    .reading-record-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reading-note-field { grid-column: 1 / -1; }
    .reading-record-form button { grid-column: 1 / -1; }
    .sync-path-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .reading-today-summary { grid-template-columns: 1fr; }
    .reading-metric { min-height: 105px; }
    .reading-record-form { grid-template-columns: 1fr; }
    .reading-note-field, .reading-record-form button { grid-column: auto; }
    .retention-status { grid-template-columns: 1fr; }
}

/* App shell v2: calmer surfaces and a dedicated desktop sidebar */
:root {
    --sidebar-width: 252px;
    --app-gutter: clamp(18px, 2.5vw, 38px);
    --card-bg: rgba(10, 20, 35, 0.88);
    --card-border: rgba(148, 184, 205, 0.12);
}

@media (min-width: 1101px) {
    body:has(.app-sidebar) {
        padding-left: var(--sidebar-width);
        background:
            radial-gradient(circle at 74% 0%, rgba(91, 74, 180, 0.1), transparent 32rem),
            radial-gradient(circle at 24% 86%, rgba(17, 144, 168, 0.07), transparent 34rem),
            #050b14;
    }

    body:has(.app-sidebar) .site-grid {
        left: var(--sidebar-width);
        opacity: 0.3;
        background-size: 56px 56px, 56px 56px, 168px 168px;
    }

    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 40;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: var(--sidebar-width);
        min-height: 100vh;
        margin: 0;
        padding: 24px 16px 18px;
        border: 0;
        border-right: 1px solid rgba(148, 184, 205, 0.11);
        border-radius: 0;
        background: rgba(6, 13, 24, 0.94);
        box-shadow: 18px 0 48px rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(26px) saturate(120%);
    }

    .app-sidebar::after {
        top: 0;
        right: -1px;
        bottom: 0;
        left: auto;
        width: 1px;
        height: auto;
        background: linear-gradient(180deg, transparent 4%, rgba(34, 211, 238, 0.26) 22%, rgba(139, 92, 246, 0.16) 68%, transparent 96%);
    }

    .app-sidebar .brand-block {
        min-width: 0;
        padding: 0 6px 22px;
        border-bottom: 1px solid rgba(148, 184, 205, 0.09);
    }

    .app-sidebar .brand-link {
        width: 100%;
    }

    .app-sidebar .brand-mark {
        width: 46px;
        height: 46px;
        border-radius: 14px;
        box-shadow: 0 0 22px rgba(34, 211, 238, 0.13);
    }

    .app-sidebar .brand-copy,
    .app-sidebar .brand-link > span:last-child {
        min-height: 46px;
    }

    .app-sidebar .brand-name {
        font-size: 1.18rem;
    }

    .app-sidebar .brand-subtitle {
        margin-top: 5px;
        color: #72899c;
        font-size: 0.66rem;
    }

    .sidebar-quick-actions {
        display: grid;
        gap: 8px;
        margin-top: 20px;
    }

    .sidebar-create-action,
    .app-sidebar .command-trigger {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        width: 100%;
        min-height: 42px;
        padding: 10px 12px;
        border-radius: 11px;
        text-decoration: none;
        font-size: 0.84rem;
        font-weight: 650;
        line-height: 1;
    }

    .sidebar-create-action {
        color: #03141e;
        background: linear-gradient(135deg, #78e9f3, #35cbe2);
        box-shadow: 0 10px 24px rgba(34, 211, 238, 0.13);
    }

    .sidebar-create-action:hover {
        transform: translateY(-1px);
    }

    .sidebar-create-action kbd,
    .app-sidebar .command-trigger kbd {
        margin-left: auto;
        font: 600 0.62rem/1 var(--font-mono);
    }

    .sidebar-create-action kbd {
        color: rgba(3, 20, 30, 0.58);
    }

    .app-sidebar .command-trigger {
        color: #a9bdce;
        border: 1px solid rgba(148, 184, 205, 0.1);
        background: rgba(148, 184, 205, 0.035);
        box-shadow: none;
    }

    .app-sidebar .command-trigger:hover {
        color: #e5f7fb;
        border-color: rgba(103, 232, 249, 0.18);
        background: rgba(34, 211, 238, 0.06);
        box-shadow: none;
    }

    .sidebar-label {
        margin: 24px 10px 8px;
        color: #576d7f;
        font: 650 0.62rem/1 var(--font-mono);
        letter-spacing: 0.13em;
        text-transform: uppercase;
    }

    .app-sidebar .top-actions {
        display: grid;
        flex: 0 1 auto;
        align-content: start;
        justify-content: stretch;
        gap: 3px;
        width: 100%;
        min-height: 0;
        padding: 0 2px 14px;
        overflow-y: auto;
        border: 0;
        border-radius: 0;
        background: transparent;
        scrollbar-width: thin;
        scrollbar-color: rgba(103, 232, 249, 0.16) transparent;
    }

    .app-sidebar .nav-link {
        justify-content: flex-start;
        gap: 11px;
        width: 100%;
        min-height: 39px;
        padding: 9px 11px;
        border: 1px solid transparent;
        border-radius: 10px;
        color: #8399aa;
        font-size: 0.84rem;
        font-weight: 590;
    }

    .app-sidebar .nav-link .ui-icon {
        width: 17px;
        height: 17px;
        color: #6f899d;
    }

    .app-sidebar .nav-link:hover {
        color: #d6e8ef;
        border-color: rgba(148, 184, 205, 0.08);
        background: rgba(148, 184, 205, 0.04);
    }

    .app-sidebar .nav-link-active {
        color: #dffaff;
        border-color: rgba(34, 211, 238, 0.16);
        background: linear-gradient(90deg, rgba(34, 211, 238, 0.12), rgba(34, 211, 238, 0.035));
        box-shadow: inset 3px 0 0 rgba(34, 211, 238, 0.82);
    }

    .app-sidebar .nav-link-active .ui-icon {
        color: #67e8f9;
    }

    .sidebar-footer {
        display: grid;
        gap: 10px;
        margin-top: auto;
        padding: 14px 4px 0;
        border-top: 1px solid rgba(148, 184, 205, 0.09);
    }

    .app-sidebar .system-indicator {
        display: flex;
        justify-content: flex-start;
        width: 100%;
        min-height: 32px;
        padding: 6px 9px;
        border: 0;
        color: #6f8799;
        background: transparent;
        font-size: 0.65rem;
    }

    .app-sidebar .system-indicator time {
        margin-left: auto;
    }

    .sidebar-account-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-width: 0;
    }

    .sidebar-user {
        display: flex;
        align-items: center;
        gap: 9px;
        min-width: 0;
    }

    .sidebar-avatar {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        flex: 0 0 auto;
        border: 1px solid rgba(103, 232, 249, 0.16);
        border-radius: 10px;
        color: #c7f7fb;
        background: linear-gradient(145deg, rgba(34, 211, 238, 0.12), rgba(139, 92, 246, 0.08));
        font: 700 0.8rem/1 var(--font-display);
    }

    .sidebar-user > span:last-child {
        display: grid;
        gap: 3px;
        min-width: 0;
    }

    .sidebar-user strong {
        overflow: hidden;
        color: #c8d9e2;
        font-size: 0.78rem;
        font-weight: 620;
        line-height: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar-user small {
        color: #5e7588;
        font-size: 0.66rem;
        line-height: 1;
    }

    .app-sidebar .sidebar-account-row form {
        margin: 0;
    }

    .app-sidebar .nav-logout-btn {
        width: 34px;
        height: 34px;
        min-height: 34px;
        padding: 0;
        border: 1px solid rgba(148, 184, 205, 0.08);
        border-radius: 10px;
        color: #70899c;
        background: rgba(148, 184, 205, 0.035);
    }

    .app-sidebar .nav-logout-btn:hover {
        color: #fda4af;
        border-color: rgba(251, 113, 133, 0.16);
        background: rgba(251, 113, 133, 0.06);
    }

    body:has(.app-sidebar) .page-shell {
        width: min(1480px, calc(100% - (var(--app-gutter) * 2)));
        margin: var(--app-gutter) auto 0;
        gap: 20px;
        padding-bottom: 70px;
    }

    body:has(.app-sidebar) .quick-dock {
        display: none;
    }

    body:has(.app-sidebar) .back-to-top {
        bottom: 24px;
    }
}

@media (max-width: 1100px) {
    .sidebar-quick-actions,
    .sidebar-label,
    .sidebar-footer {
        display: none;
    }

    .app-sidebar {
        position: sticky;
        top: 8px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: min(1380px, calc(100% - 40px));
        min-height: 68px;
        padding: 8px 12px;
    }

    .app-sidebar .brand-block {
        width: auto;
        min-width: 0;
        padding: 0;
    }

    .app-sidebar .brand-link {
        min-height: 48px;
    }

    .app-sidebar .top-actions {
        display: none;
    }
}

/* Reduce visual noise across content surfaces */
.hero-card,
.page-header-card,
.focus-console,
.form-card,
.workspace-card,
.stat-card,
.task-card,
.meal-plan-card,
.chart-card,
.next-steps,
.empty-card,
.config-card,
.log-card {
    border-color: var(--card-border);
    background-color: var(--card-bg);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(16px) saturate(110%);
}

.hero-card::before,
.page-header-card::before,
.form-card::before,
.next-steps::before,
.empty-card::before,
.chart-card::before,
.workspace-card::before {
    right: 32px;
    left: 32px;
    opacity: 0.48;
}

.hero-card {
    min-height: 260px;
    background:
        radial-gradient(circle at 82% 14%, rgba(110, 91, 196, 0.13), transparent 28%),
        linear-gradient(140deg, rgba(12, 27, 46, 0.96), rgba(7, 16, 29, 0.94));
}

.hero-card::after {
    opacity: 0.65;
}

.workspace-card:hover,
.stat-card:hover,
.task-card:hover,
.meal-plan-card:hover{
    border-color: rgba(103, 232, 249, 0.21);
    box-shadow: 0 20px 52px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}

.primary-link,
button:not(.command-palette-backdrop):not(.quick-dock-item):not(.back-to-top) {
    box-shadow: 0 8px 20px rgba(34, 211, 238, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.focus-task,
.workspace-item,
.summary-row,
.tag-choice,
.watch-plan-row,
.wp-item-card {
    border-color: rgba(148, 184, 205, 0.1);
}

@media (max-width: 720px) {
    .app-sidebar {
        top: 5px;
        width: calc(100% - 20px);
        min-height: 62px;
        padding: 6px 10px;
    }

    .hero-card,
    .page-header-card,
    .focus-console,
    .form-card,
    .workspace-card,
    .next-steps,
    .empty-card,
    .chart-card {
        border-radius: 18px;
    }

    .quick-dock {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: calc(100vw - 20px);
    }

    .quick-dock-item {
        display: grid;
        justify-items: center;
        gap: 5px;
        min-width: 0;
        min-height: 52px;
        padding: 7px 5px;
        font-size: 0.68rem;
    }

    .quick-dock-item .ui-icon {
        width: 18px;
        height: 18px;
    }
}

/* Readability pass: compact navigation, centered brand and task-page controls */
:root {
    --muted: #a4b7c8;
}

body {
    font-size: 16px;
}

.topbar {
    align-items: center;
    gap: 16px;
    min-height: 76px;
    padding: 9px 12px;
}

.brand-block {
    min-width: 238px;
    padding: 5px 10px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 50px;
}

.brand-mark {
    width: 50px;
    height: 50px;
    border-radius: 15px;
}

.brand-copy,
.brand-link > span:last-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 50px;
    padding-top: 0;
}

.brand-name {
    font-size: 1.3rem;
    line-height: 1.1;
}

.brand-subtitle {
    margin-top: 6px;
    font-size: 0.73rem;
    line-height: 1.15;
}

.top-actions {
    flex-wrap: nowrap;
    gap: 5px;
    min-width: 0;
}

.system-indicator,
.command-trigger,
.nav-link,
.nav-logout-btn {
    min-height: 40px;
    font-size: 0.84rem;
}

.nav-link,
.nav-logout-btn {
    padding-inline: 12px;
}

.command-trigger {
    padding-inline: 11px;
}

.task-meta,
.field-help,
.section-meta,
.hero-copy {
    color: #a4b7c8;
}

.meal-plan-card {
    border-color: rgba(103, 232, 249, 0.16);
    background:
        radial-gradient(circle at 100% 0%, rgba(34, 211, 238, 0.055), transparent 28%),
        linear-gradient(150deg, rgba(10, 24, 43, 0.96), rgba(5, 15, 29, 0.92));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 44px rgba(0, 0, 0, 0.2);
}

.meal-plan-card > .section-head {
    align-items: center;
}

.meal-plan-form .field-block > span {
    color: #dbe9f4;
    font-size: 0.86rem;
    font-weight: 680;
}

.meal-recipe-picker {
    gap: 8px;
}

.meal-ingredient-picker,
.ingredient-picker {
    gap: 8px;
    padding: 8px;
    border-color: rgba(103, 232, 249, 0.11);
    background: rgba(1, 8, 19, 0.58);
    scrollbar-color: rgba(103, 232, 249, 0.28) rgba(2, 10, 22, 0.5);
    scrollbar-width: thin;
}

.meal-ingredient-picker::-webkit-scrollbar,
.ingredient-picker::-webkit-scrollbar {
    width: 8px;
}

.meal-ingredient-picker::-webkit-scrollbar-track,
.ingredient-picker::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(2, 10, 22, 0.55);
}

.meal-ingredient-picker::-webkit-scrollbar-thumb,
.ingredient-picker::-webkit-scrollbar-thumb {
    border: 2px solid rgba(2, 10, 22, 0.55);
    border-radius: 999px;
    background: rgba(103, 232, 249, 0.3);
}

.tag-choice {
    min-height: 42px;
    padding: 9px 12px;
    border-color: rgba(103, 232, 249, 0.13);
    border-radius: 12px;
    color: #b9d7e6;
    background: rgba(9, 25, 43, 0.78);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
    font-size: 0.86rem;
    font-weight: 620;
    line-height: 1.25;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms var(--ease-out);
}

.tag-choice:hover {
    color: #e6fbff;
    border-color: rgba(103, 232, 249, 0.3);
    background: rgba(15, 42, 63, 0.88);
    transform: translateY(-1px);
}

.tag-choice:has(input:checked) {
    color: #d9fbff;
    border-color: rgba(34, 211, 238, 0.42);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(139, 92, 246, 0.1));
}

.tag-choice input[type="checkbox"] {
    appearance: none;
    display: inline-grid;
    place-content: center;
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    margin: 0;
    border: 1px solid rgba(148, 187, 207, 0.46);
    border-radius: 5px;
    background: rgba(1, 8, 19, 0.76);
}

.tag-choice input[type="checkbox"]::before {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: linear-gradient(135deg, #67e8f9, #8b5cf6);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
    content: "";
    transform: scale(0);
    transition: transform 120ms ease;
}

.tag-choice input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.tag-choice input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.back-to-top {
    position: fixed;
    right: max(24px, env(safe-area-inset-right));
    bottom: max(92px, calc(env(safe-area-inset-bottom) + 92px));
    z-index: 27;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 70px;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid rgba(103, 232, 249, 0.2);
    border-radius: 12px;
    color: #bfeff6;
    background: rgba(5, 17, 31, 0.9);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 22px rgba(34, 211, 238, 0.07);
    backdrop-filter: blur(18px) saturate(135%);
    font-size: 0.78rem;
    transition: transform 180ms var(--ease-out), border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.back-to-top[hidden] {
    display: none;
}

.back-to-top:hover {
    color: #ffffff;
    border-color: rgba(103, 232, 249, 0.4);
    background: rgba(10, 35, 52, 0.95);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.4), 0 0 26px rgba(34, 211, 238, 0.1);
    filter: none;
    transform: translateY(-2px);
}

@media (max-width: 1180px) {
    .system-indicator {
        display: none;
    }

    .brand-block {
        min-width: 220px;
    }
}

@media (max-width: 860px) {
    body {
        font-size: 15px;
    }

    .topbar {
        gap: 7px;
    }

    .brand-block {
        min-width: 0;
        width: 100%;
    }

    .top-actions {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .back-to-top {
        right: 14px;
        bottom: max(82px, calc(env(safe-area-inset-bottom) + 82px));
        min-width: 44px;
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 14px;
    }

    .back-to-top span {
        display: none;
    }
}

@media (max-width: 560px) {
    .brand-mark {
        width: 46px;
        height: 46px;
    }

    .brand-copy,
    .brand-link > span:last-child {
        min-height: 46px;
    }

    .brand-name {
        font-size: 1.18rem;
    }

    .brand-subtitle {
        font-size: 0.7rem;
    }
}

/* Contrast pass: keep secondary information subdued without letting it fade into gray. */
:root {
    --muted: #bfd0de;
    --muted-soft: #a9bfd0;
    --card-border: rgba(139, 224, 239, 0.22);
    --surface-divider: rgba(139, 224, 239, 0.18);
}

.hero-copy,
.task-meta,
.focus-task-meta,
.field-help,
.section-meta,
.empty-chart-text,
.reading-log-row p,
.reading-log-row small,
.smart-recommendation-row p,
.sync-path-grid p,
.retention-status small,
.wp-item-card-meta,
.wp-ep-shift-hint,
.meal-plan-card .field-help {
    color: var(--muted);
}

.brand-subtitle,
.sidebar-label,
.app-sidebar .system-indicator,
.sidebar-user small {
    color: var(--muted-soft);
}

.app-sidebar .nav-link {
    color: #b8cad8;
}

.app-sidebar .nav-link .ui-icon,
.app-sidebar .nav-logout-btn {
    color: #9fb8ca;
}

.app-sidebar .nav-link:hover,
.app-sidebar .command-trigger:hover {
    color: #f2fbff;
}

.app-sidebar .command-trigger {
    color: #c1d4e1;
    border-color: rgba(139, 224, 239, 0.2);
    background: rgba(21, 49, 68, 0.48);
}

.hero-card,
.page-header-card,
.focus-console,
.form-card,
.workspace-card,
.stat-card,
.task-card,
.meal-plan-card,
.chart-card,
.next-steps,
.empty-card,
.config-card,
.log-card,
.reading-metric,
.reading-record-form,
.retention-status,
.smart-recommendation-card,
.sync-path-grid article {
    border-color: var(--card-border);
}

.focus-task,
.workspace-item,
.summary-row,
.watch-plan-row,
.wp-item-card,
.reading-log-row {
    border-color: var(--surface-divider);
    background-color: rgba(8, 25, 42, 0.78);
}

.summary-row > span,
.stat-card p,
.workspace-card p,
.empty-card p,
.config-card p,
.log-card p {
    color: var(--muted);
}

.badge-status {
    color: #c8f7ff;
    border-color: rgba(103, 232, 249, 0.28);
    background: rgba(34, 211, 238, 0.13);
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    color: #f1f8ff;
    border-color: rgba(139, 224, 239, 0.25);
    background: rgba(2, 12, 25, 0.9);
}

input::placeholder,
textarea::placeholder {
    color: #91aabd;
    opacity: 1;
}

input:disabled,
select:disabled,
textarea:disabled {
    color: #aabecd;
    border-color: rgba(139, 224, 239, 0.15);
    background: rgba(10, 24, 40, 0.82);
    opacity: 1;
}

table th {
    color: #d7e7f2;
}

table td {
    color: #c2d3df;
}

hr,
.section-head,
.sidebar-footer,
.app-sidebar .brand-block {
    border-color: var(--surface-divider);
}

/* Daily review: turn activity data into a small, actionable feedback loop. */
.daily-review-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    background:
        radial-gradient(circle at 82% 20%, rgba(139, 92, 246, 0.19), transparent 30%),
        radial-gradient(circle at 18% 100%, rgba(34, 211, 238, 0.12), transparent 38%),
        linear-gradient(140deg, rgba(12, 29, 51, 0.98), rgba(7, 16, 31, 0.96));
}

.daily-review-title {
    display: flex;
    flex-wrap: wrap;
    column-gap: 0.24em;
    row-gap: 0;
}

.daily-review-title span {
    white-space: nowrap;
}

.daily-review-date-nav,
.daily-review-apply {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.daily-review-date-nav {
    padding: 5px;
    border: 1px solid rgba(139, 224, 239, 0.14);
    border-radius: 15px;
    background: rgba(3, 14, 27, 0.56);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.daily-review-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 9px 13px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #a9c3d3;
    font-size: 0.82rem;
    font-weight: 720;
    text-decoration: none;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.daily-review-nav-link:hover {
    color: #ecfbff;
    border-color: rgba(103, 232, 249, 0.16);
    background: rgba(34, 211, 238, 0.07);
    transform: translateY(-1px);
}

.daily-review-nav-link .ui-icon {
    width: 14px;
    height: 14px;
}

.daily-review-arrow-back {
    transform: rotate(180deg);
}

.daily-review-nav-today {
    color: #d6fbff;
    border-color: rgba(103, 232, 249, 0.22);
    background: rgba(34, 211, 238, 0.09);
}

.daily-review-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(250px, 0.65fr);
    gap: 20px;
}

.daily-review-control,
.daily-review-state {
    min-height: 100%;
}

.daily-review-engine-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.ai-engine-option {
    position: relative;
    display: block;
    cursor: pointer;
}

.ai-engine-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.ai-engine-option > span {
    display: grid;
    align-content: center;
    gap: 7px;
    min-height: 104px;
    padding: 16px 17px;
    border: 1px solid rgba(139, 224, 239, 0.2);
    border-radius: 17px;
    color: #e8f6ff;
    background: rgba(4, 17, 32, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.ai-engine-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ai-engine-heading strong {
    line-height: 1.25;
}

.ai-engine-heading i {
    position: relative;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    border: 1px solid rgba(139, 224, 239, 0.32);
    border-radius: 50%;
    background: rgba(3, 14, 27, 0.64);
}

.ai-engine-heading i::after {
    position: absolute;
    inset: 4px;
    border-radius: inherit;
    background: #67e8f9;
    box-shadow: 0 0 10px rgba(103, 232, 249, 0.7);
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 160ms ease, transform 160ms ease;
    content: "";
}

.ai-engine-option > span small {
    color: var(--muted);
    line-height: 1.55;
}

.ai-engine-option:hover > span {
    border-color: rgba(103, 232, 249, 0.38);
    transform: translateY(-2px);
}

.ai-engine-option input:checked + span {
    border-color: rgba(103, 232, 249, 0.58);
    background: linear-gradient(145deg, rgba(18, 67, 86, 0.82), rgba(38, 27, 73, 0.72));
    box-shadow: inset 0 0 0 1px rgba(103, 232, 249, 0.14), 0 0 30px rgba(34, 211, 238, 0.09);
}

.ai-engine-option input:checked + span .ai-engine-heading i::after {
    opacity: 1;
    transform: scale(1);
}

.ai-engine-option input:focus-visible + span {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.ai-engine-disabled {
    cursor: not-allowed;
}

.ai-engine-disabled > span {
    opacity: 0.58;
}

.daily-review-generate {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    justify-content: stretch;
    gap: 13px;
    min-height: 62px;
    margin-top: 2px;
    padding: 10px 14px;
    border: 1px solid rgba(178, 250, 255, 0.26);
    border-radius: 16px;
    text-align: left;
}

.daily-review-action-icon,
.daily-review-action-bar-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid rgba(3, 20, 30, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.34);
}

.daily-review-action-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.daily-review-action-copy strong {
    font-size: 0.94rem;
    line-height: 1.15;
}

.daily-review-action-copy small {
    color: rgba(3, 20, 30, 0.68);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1.3;
}

.daily-review-action-arrow {
    padding: 6px;
    font-size: 1rem;
    transition: transform 160ms ease;
}

.daily-review-generate:hover .daily-review-action-arrow {
    transform: translate(2px, -2px);
}

.daily-review-generate.is-loading .daily-review-action-icon .ui-icon {
    animation: daily-review-pulse 900ms ease-in-out infinite alternate;
}

.daily-review-config-tip,
.daily-review-fallback {
    margin: 14px 0 0;
    padding: 12px 14px;
    border: 1px solid rgba(251, 191, 36, 0.25);
    border-radius: 13px;
    color: #fde9a8;
    background: rgba(77, 49, 8, 0.28);
    line-height: 1.6;
}

.daily-review-config-tip code {
    color: #a5f3fc;
}

.daily-review-state {
    display: grid;
    align-content: center;
    background: radial-gradient(circle at 100% 0, rgba(139, 92, 246, 0.16), transparent 42%), rgba(6, 18, 34, 0.9);
}

.daily-review-state-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.daily-review-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #9ee8c6;
    font: 700 0.64rem/1 var(--font-mono);
    letter-spacing: 0.1em;
}

.daily-review-live i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.72);
}

.daily-review-provider {
    display: block;
    margin: 8px 0;
    color: #fff;
    font: 760 clamp(1.8rem, 4vw, 3rem)/1.05 var(--font-display);
}

.daily-review-result,
.daily-review-insights {
    display: grid;
    gap: 20px;
}

.daily-review-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.daily-review-summary {
    margin: 20px 0 0;
    max-width: 980px;
    color: #f0f8ff;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    font-weight: 620;
    line-height: 1.85;
}

.daily-review-list {
    display: grid;
    gap: 11px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.daily-review-list li {
    display: grid;
    grid-template-columns: 38px 1fr;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--surface-divider);
    border-radius: 14px;
    background: rgba(8, 25, 42, 0.72);
}

.daily-review-list li > span {
    color: #67e8f9;
    font: 700 0.72rem/1.6 var(--font-mono);
}

.daily-review-list p {
    margin: 0;
    color: #d8e7f1;
    line-height: 1.7;
}

.daily-review-blockers .daily-review-list li > span {
    color: #fde68a;
}

.daily-review-suggestion-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 20px 0;
}

.daily-review-suggestion {
    position: relative;
    display: grid;
    align-content: start;
    gap: 16px;
    min-height: 220px;
    padding: 20px;
    overflow: hidden;
    border: 1px solid rgba(139, 224, 239, 0.24);
    border-radius: 19px;
    background:
        radial-gradient(circle at 100% 0, rgba(34, 211, 238, 0.1), transparent 38%),
        rgba(5, 19, 35, 0.86);
}

.daily-review-suggestion-index {
    color: #67e8f9;
    font: 750 0.75rem/1 var(--font-mono);
    letter-spacing: 0.12em;
}

.daily-review-suggestion h3 {
    margin: 0 0 9px;
    color: #f4f9ff;
}

.daily-review-suggestion p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.daily-review-suggestion-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.daily-review-suggestion-meta span {
    padding: 6px 9px;
    border: 1px solid rgba(103, 232, 249, 0.2);
    border-radius: 999px;
    color: #c8f7ff;
    background: rgba(34, 211, 238, 0.08);
    font-size: 0.72rem;
    font-weight: 700;
}

.daily-review-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-top: 6px;
    padding: 17px;
    border: 1px solid rgba(139, 224, 239, 0.16);
    border-radius: 18px;
    background:
        radial-gradient(circle at 10% 100%, rgba(34, 211, 238, 0.08), transparent 42%),
        rgba(3, 14, 27, 0.68);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.daily-review-action-bar-copy {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.daily-review-action-bar-icon {
    color: #67e8f9;
    border-color: rgba(103, 232, 249, 0.18);
    background: rgba(34, 211, 238, 0.07);
}

.daily-review-action-bar-copy > div {
    display: grid;
    gap: 4px;
}

.daily-review-action-bar-copy strong {
    color: #effaff;
    line-height: 1.2;
}

.daily-review-action-bar-copy small {
    color: var(--muted);
    line-height: 1.45;
}

.daily-review-action-buttons {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex: 0 0 auto;
}

.daily-review-action-buttons form {
    display: flex;
    margin: 0;
}

.daily-review-apply-button,
.daily-review-task-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 11px 16px;
    border-radius: 14px;
    font-size: 0.84rem;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
}

.daily-review-apply-button {
    border: 1px solid rgba(178, 250, 255, 0.28);
}

.daily-review-apply-button.is-complete,
.daily-review-apply-button:disabled {
    color: #9ee8c6;
    border-color: rgba(52, 211, 153, 0.2);
    background: rgba(52, 211, 153, 0.08);
    box-shadow: none;
    cursor: default;
    opacity: 1;
}

.daily-review-task-link {
    color: #c7e8f3;
    border: 1px solid rgba(139, 224, 239, 0.16);
    background: rgba(34, 211, 238, 0.045);
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.daily-review-task-link:hover {
    color: #f2fdff;
    border-color: rgba(103, 232, 249, 0.32);
    background: rgba(34, 211, 238, 0.09);
    transform: translateY(-1px);
}

.daily-review-task-arrow {
    width: 14px;
    height: 14px;
    margin-left: 2px;
    opacity: 0.65;
}

@keyframes daily-review-pulse {
    from { opacity: 0.45; transform: scale(0.88) rotate(-8deg); }
    to { opacity: 1; transform: scale(1.08) rotate(8deg); }
}

@media (max-width: 900px) {
    .daily-review-hero,
    .daily-review-layout {
        display: grid;
        grid-template-columns: 1fr;
    }

    .daily-review-suggestion-grid {
        grid-template-columns: 1fr;
    }

    .daily-review-insights {
        grid-template-columns: 1fr;
    }

    .ai-engine-option > span {
        min-height: 88px;
    }

    .daily-review-suggestion {
        min-height: 0;
    }
}

@media (max-width: 720px) {
    .daily-review-title {
        font-size: clamp(1.8rem, 9vw, 2.35rem);
        letter-spacing: -0.045em;
    }

    .daily-review-date-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .daily-review-nav-link {
        padding-inline: 8px;
    }

    .daily-review-engine-form {
        grid-template-columns: 1fr;
    }

    .daily-review-action-bar {
        align-items: stretch;
        flex-direction: column;
        padding: 14px;
    }

    .daily-review-action-buttons {
        display: grid;
        grid-template-columns: 1fr;
    }

    .daily-review-action-buttons form,
    .daily-review-apply-button,
    .daily-review-task-link {
        width: 100%;
    }
}

/* Emby sync bridge: local parsing, explicit confirmation, auditable writes. */
.emby-sync-workspace {
    display: grid;
    grid-template-columns: minmax(320px, 1.15fr) minmax(300px, 0.85fr);
    gap: 18px;
    margin-top: 18px;
}

.emby-server-actions { align-items: stretch; }
.emby-server-actions form { margin: 0; }

.emby-watched-today {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 15px;
    border: 1px solid rgba(52, 211, 153, 0.42);
    border-radius: 12px;
    color: #d8fff1;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(6, 182, 212, 0.2));
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 10px 25px rgba(5, 150, 105, 0.12);
}

.emby-watched-today:hover {
    border-color: rgba(103, 232, 249, 0.7);
    transform: translateY(-1px);
}

.emby-account-snapshot,
.emby-account-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.emby-account-snapshot > div,
.emby-account-preview > div {
    display: grid;
    gap: 5px;
    padding: 12px 14px;
    border: 1px solid rgba(103, 232, 249, 0.16);
    border-radius: 13px;
    background: rgba(4, 21, 38, 0.82);
}

.emby-account-snapshot small,
.emby-account-preview span { color: #9db5c7; font-size: 0.76rem; }
.emby-account-snapshot strong,
.emby-account-preview strong { color: #e8fbff; overflow-wrap: anywhere; }
.emby-account-preview { margin: 16px 0; }
.emby-account-preview .section-kicker { grid-column: 1 / -1; margin: 0; }

.emby-sync-simple-flow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.emby-sync-simple-flow article {
    display: flex;
    gap: 12px;
    padding: 15px;
    border: 1px solid rgba(103, 232, 249, 0.15);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(6, 27, 48, 0.82), rgba(4, 16, 32, 0.82));
}

.emby-sync-simple-flow article > span {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 10px;
    color: #67e8f9;
    background: rgba(34, 211, 238, 0.1);
    font: 800 0.75rem/1 var(--font-mono, monospace);
}

.emby-sync-simple-flow p { margin: 5px 0 0; color: #a9bdcc; font-size: 0.84rem; line-height: 1.55; }

.emby-manual-import {
    margin-top: 16px;
    padding: 0 16px 16px;
    border: 1px solid rgba(103, 232, 249, 0.14);
    border-radius: 16px;
    background: rgba(2, 12, 24, 0.52);
}

.emby-manual-import > summary { padding: 15px 0; cursor: pointer; color: #bceff5; font-weight: 750; }
.emby-manual-import[open] > summary { margin-bottom: 4px; border-bottom: 1px solid rgba(103, 232, 249, 0.1); }

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

.collector-setup-hero .ghost-link {
    flex: 0 0 auto;
    white-space: nowrap;
}

.collector-safety-grid article {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid rgba(103, 232, 249, 0.16);
    border-radius: 17px;
    background: linear-gradient(145deg, rgba(7, 29, 50, 0.9), rgba(3, 15, 29, 0.88));
}

.collector-safety-grid article > span { color: #67e8f9; font: 800 0.76rem/1 var(--font-mono); }
.collector-safety-grid p { margin: 0; color: #afc5d4; line-height: 1.65; }

.collector-token-reveal {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 15px;
    background: rgba(63, 40, 4, 0.28);
}

.collector-token-reveal > strong { grid-column: 1 / -1; color: #fde68a; }
.collector-token-reveal code,
.collector-setup-steps code,
.collector-config-grid code { padding: 10px 12px; border-radius: 10px; color: #bdf7ff; background: rgba(1, 10, 22, 0.8); overflow-wrap: anywhere; }
.collector-credential-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.collector-credential-row form { margin: 0; }
.collector-setup-steps { display: grid; gap: 13px; padding-left: 24px; }
.collector-setup-steps li { padding-left: 6px; color: #d9eef5; }
.collector-setup-steps p { margin: 5px 0; color: #afc5d4; }
.collector-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.collector-config-grid > div { display: grid; gap: 6px; padding: 14px; border: 1px solid rgba(103, 232, 249, 0.13); border-radius: 13px; background: rgba(3, 16, 30, 0.68); }
.collector-config-grid small { color: #9db5c7; }

.emby-sync-form,
.emby-sync-recent {
    min-width: 0;
    padding: 18px;
    border: 1px solid rgba(103, 232, 249, 0.13);
    border-radius: 17px;
    background: rgba(2, 12, 24, 0.58);
}

.emby-sync-form textarea {
    min-height: 142px;
    resize: vertical;
}

.emby-sync-parse {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(103, 232, 249, 0.28);
    border-radius: 11px;
    color: #03141e;
    background: linear-gradient(135deg, #78e9f3, #35cbe2 62%, #60a5fa);
    font-size: 0.8rem;
    font-weight: 750;
}

.emby-sync-recent {
    display: grid;
    align-content: start;
    gap: 8px;
}

.emby-sync-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid rgba(125, 211, 252, 0.1);
    border-radius: 12px;
    background: rgba(4, 17, 33, 0.72);
}

.emby-sync-row strong,
.emby-sync-row small {
    display: block;
}

.emby-sync-row strong {
    color: #ecfaff;
    font-size: 0.78rem;
}

.emby-sync-row small,
.emby-sync-confidence {
    margin-top: 3px;
    color: #91adbf;
    font-size: 0.68rem;
}

.emby-sync-row a {
    color: #67e8f9;
    font-size: 0.72rem;
    font-weight: 700;
}

.emby-sync-status {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 0.66rem;
    font-weight: 730;
}

.emby-sync-status-pending {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.11);
}

.emby-sync-status-applied {
    color: #99f6e4;
    background: rgba(16, 185, 129, 0.11);
}

.emby-sync-status-rejected {
    color: #afc2d0;
    background: rgba(148, 163, 184, 0.1);
}

.emby-sync-empty {
    padding: 18px;
    border: 1px dashed rgba(103, 232, 249, 0.14);
    border-radius: 13px;
    color: #c7dae7;
    text-align: center;
}

.emby-sync-empty p {
    margin: 6px 0 0;
    color: #91adbf;
    font-size: 0.74rem;
    line-height: 1.6;
}

.emby-sync-review-hero {
    align-items: center;
}

.sync-confidence-ring {
    position: relative;
    display: grid;
    width: 96px;
    height: 96px;
    flex: 0 0 96px;
    place-content: center;
    border-radius: 50%;
    text-align: center;
    background: conic-gradient(#34d399 calc(var(--sync-confidence) * 1%), rgba(103, 232, 249, 0.12) 0);
}

.sync-confidence-ring::before {
    position: absolute;
    inset: 6px;
    border-radius: inherit;
    background: #071525;
    content: "";
}

.sync-confidence-ring strong,
.sync-confidence-ring small {
    position: relative;
    z-index: 1;
    display: block;
}

.sync-confidence-ring strong {
    color: #efffff;
    font: 750 1.65rem/1 var(--font-display);
}

.sync-confidence-ring small {
    margin-top: 4px;
    color: #9eb8ca;
    font-size: 0.62rem;
}

.emby-sync-review-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    gap: 20px;
}

.emby-sync-raw {
    max-height: 280px;
    margin: 14px 0;
    overflow: auto;
    padding: 16px;
    border: 1px solid rgba(103, 232, 249, 0.13);
    border-radius: 13px;
    color: #d9f6fb;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: rgba(1, 8, 19, 0.74);
    font: 500 0.78rem/1.7 var(--font-mono);
}

.emby-sync-warnings {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
}

.emby-sync-warnings p {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    color: #f7d78a;
    font-size: 0.76rem;
}

.emby-sync-next-steps {
    grid-template-columns: 1fr;
}

.emby-sync-episode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.emby-sync-review-actions {
    align-items: center;
}

.emby-sync-review-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.emby-sync-ignore-form {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(103, 232, 249, 0.1);
}

@media (max-width: 980px) {
    .emby-sync-workspace,
    .emby-sync-review-grid {
        grid-template-columns: 1fr;
    }

    .emby-sync-simple-flow { grid-template-columns: 1fr; }
    .collector-safety-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .emby-sync-form,
    .emby-sync-recent {
        padding: 14px;
    }

    .emby-sync-review-hero {
        align-items: flex-start;
    }

    .sync-confidence-ring {
        width: 82px;
        height: 82px;
        flex-basis: 82px;
    }

    .emby-sync-episode-grid {
        grid-template-columns: 1fr;
    }

    .collector-token-reveal,
    .collector-config-grid { grid-template-columns: 1fr; }
}

/* Growth hub and accessibility pass: hierarchy through color, never whole-card opacity. */
:root {
    --muted: #c3d5e1;
    --muted-soft: #adc4d4;
    --text-secondary: #c3d5e1;
    --text-tertiary: #adc4d4;
}

.page-shell {
    grid-template-columns: minmax(0, 1fr);
}

.page-shell > * {
    min-width: 0;
}

.task-card-done,
.focus-task-done {
    opacity: 1;
    border-color: rgba(52, 211, 153, 0.22);
    background: linear-gradient(145deg, rgba(8, 38, 43, 0.82), rgba(7, 20, 34, 0.88));
}

.task-card-done .task-main,
.focus-task-done .focus-task-main {
    color: #bcd8d2;
}

.ai-engine-disabled > span {
    color: #c0cfda;
    border-color: rgba(173, 196, 212, 0.16);
    background: rgba(12, 25, 42, 0.74);
    opacity: 1;
}

.ai-engine-disabled > span small {
    color: #9fb6c7;
}

@media (min-width: 1101px) {
    .app-sidebar .top-actions {
        gap: 2px;
    }

    .app-sidebar .nav-link {
        min-height: 37px;
        padding-block: 8px;
        color: #bfd0dc;
    }

    .app-sidebar .nav-link .ui-icon {
        color: #9eb8ca;
    }

    .app-sidebar .brand-subtitle,
    .sidebar-user small,
    .app-sidebar .system-indicator,
    .sidebar-label {
        color: #9db4c5;
    }
}

.insight-toolbox {
    padding: clamp(18px, 2.5vw, 28px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 8% 0%, rgba(34, 211, 238, 0.1), transparent 30%),
        radial-gradient(circle at 92% 100%, rgba(139, 92, 246, 0.1), transparent 32%),
        rgba(7, 19, 35, 0.9);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.insight-tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.insight-tool {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 12px;
    min-height: 88px;
    padding: 15px;
    border: 1px solid rgba(139, 224, 239, 0.18);
    border-radius: 16px;
    color: #eef8ff;
    background: rgba(8, 26, 44, 0.78);
    text-decoration: none;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms var(--ease-out), box-shadow 160ms ease;
}

.insight-tool:hover {
    border-color: rgba(103, 232, 249, 0.38);
    background: rgba(13, 43, 62, 0.88);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22), 0 0 24px rgba(34, 211, 238, 0.06);
    transform: translateY(-2px);
}

.insight-tool-primary {
    border-color: rgba(103, 232, 249, 0.34);
    background: linear-gradient(145deg, rgba(18, 67, 86, 0.78), rgba(39, 29, 73, 0.7));
}

.insight-tool-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(103, 232, 249, 0.2);
    border-radius: 13px;
    color: #8debf7;
    background: rgba(34, 211, 238, 0.08);
}

.insight-tool > span:nth-child(2) {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.insight-tool strong {
    font-size: 0.9rem;
    line-height: 1.2;
}

.insight-tool small {
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1.45;
}

.insight-tool-arrow {
    width: 15px;
    height: 15px;
    color: #8ca8bb;
}

.ach-summary {
    display: flex;
    align-items: baseline;
    gap: 20px;
    margin: 16px 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.ach-summary strong {
    color: var(--brand-strong);
    font-size: 1.5rem;
}

.ach-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

.ach-card {
    position: relative;
    padding: 17px;
    overflow: hidden;
    border: 1px solid rgba(173, 196, 212, 0.2);
    border-radius: var(--radius-md);
    color: #d7e4ed;
    background: linear-gradient(145deg, rgba(18, 30, 46, 0.96), rgba(10, 20, 34, 0.94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    opacity: 1;
    transition: border-color 180ms ease, transform 180ms var(--ease-out), background 180ms ease;
}

.ach-card::after {
    position: absolute;
    inset: auto -28px -28px auto;
    width: 80px;
    height: 80px;
    border: 1px solid rgba(173, 196, 212, 0.08);
    border-radius: 50%;
    content: "";
}

.ach-card:hover {
    border-color: rgba(173, 217, 231, 0.34);
    transform: translateY(-2px);
}

.ach-card.unlocked {
    color: #f1fbff;
    border-color: rgba(103, 232, 249, 0.4);
    background:
        radial-gradient(circle at 100% 0%, rgba(34, 211, 238, 0.14), transparent 38%),
        linear-gradient(145deg, rgba(11, 43, 58, 0.94), rgba(25, 22, 57, 0.9));
    box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.ach-icon {
    font-size: 1.8rem;
    line-height: 1;
    filter: grayscale(0.25) saturate(0.72);
}

.ach-card.unlocked .ach-icon {
    filter: drop-shadow(0 0 8px var(--brand));
}

.ach-name {
    margin: 8px 0 3px;
    color: inherit;
    font-weight: 760;
}

.ach-desc {
    min-height: 36px;
    color: #b8cad7;
    font-size: 0.8rem;
    line-height: 1.55;
}

.ach-bar {
    height: 7px;
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid rgba(173, 196, 212, 0.12);
    border-radius: 999px;
    background: rgba(1, 9, 20, 0.7);
}

.ach-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #36c9e1, #8b5cf6);
}

.ach-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    color: #adc3d2;
    font-size: 0.74rem;
}

.ach-card.unlocked .ach-meta .done {
    color: #8cf0c1;
    font-weight: 750;
}

.heatmap-wrap {
    padding: 5px 2px 10px;
    overflow-x: auto;
    scrollbar-color: rgba(103, 232, 249, 0.32) rgba(2, 10, 22, 0.5);
    scrollbar-width: thin;
}

.heatmap {
    display: flex;
    width: max-content;
    gap: 4px;
}

.heatmap-week {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.heatmap-cell {
    display: block;
    width: 14px;
    height: 14px;
    border: 1px solid rgba(173, 196, 212, 0.12);
    border-radius: 4px;
    background: rgba(173, 196, 212, 0.08);
}

.heatmap-cell.l1 { border-color: rgba(34, 211, 238, 0.25); background: rgba(34, 211, 238, 0.3); }
.heatmap-cell.l2 { border-color: rgba(34, 211, 238, 0.42); background: rgba(34, 211, 238, 0.52); }
.heatmap-cell.l3 { border-color: rgba(103, 232, 249, 0.62); background: rgba(34, 211, 238, 0.76); }
.heatmap-cell.l4 { border-color: rgba(207, 250, 254, 0.88); background: #67e8f9; box-shadow: 0 0 9px rgba(34, 211, 238, 0.32); }
.heatmap-cell.out { border-color: transparent; background: transparent; pointer-events: none; }
.heatmap-cell:hover { outline: 2px solid var(--brand-strong); outline-offset: 1px; }

.heatmap-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
}

.heatmap-stats .metric {
    display: flex;
    flex: 1 1 150px;
    flex-direction: column;
    min-height: 92px;
    padding: 16px;
    border: 1px solid var(--card-border);
    border-radius: 15px;
    background: rgba(8, 25, 42, 0.78);
}

.heatmap-stats .metric strong { color: var(--brand-strong); font-size: 1.8rem; }
.heatmap-stats .metric small { margin-left: 2px; color: var(--text-secondary); font-size: 0.85rem; }
.heatmap-stats .metric span { margin-top: 3px; color: var(--text-secondary); font-size: 0.8rem; }

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.heatmap-legend .heatmap-cell {
    width: 12px;
    height: 12px;
}

.week-nav-actions {
    flex: 0 0 auto;
}

@media (max-width: 980px) {
    .insight-tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .week-page-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .week-nav-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .week-nav-actions .ghost-link {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .insight-tool-grid {
        grid-template-columns: 1fr;
    }

    .insight-toolbox .section-head {
        align-items: flex-start;
    }

    .week-nav-actions {
        grid-template-columns: 1fr;
    }
}

/* Automatic daily review: visible schedule, bounded retries, user-confirmed tasks. */
.daily-review-automation {
    display: grid;
    grid-template-columns: minmax(270px, 1fr) minmax(430px, 1.35fr) minmax(180px, 0.55fr);
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid rgba(139, 224, 239, 0.22);
    border-radius: 19px;
    background:
        radial-gradient(circle at 0% 50%, rgba(34, 211, 238, 0.08), transparent 34%),
        linear-gradient(145deg, rgba(7, 24, 41, 0.94), rgba(12, 19, 38, 0.92));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.daily-review-automation-copy {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.daily-review-automation-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid rgba(103, 232, 249, 0.24);
    border-radius: 14px;
    color: #8debf7;
    background: rgba(34, 211, 238, 0.09);
    box-shadow: 0 0 22px rgba(34, 211, 238, 0.07);
}

.daily-review-automation-copy h3,
.daily-review-automation-copy p {
    margin: 0;
}

.daily-review-automation-copy h3 {
    color: #f1f9ff;
    font-size: 0.95rem;
    line-height: 1.35;
}

.daily-review-automation-copy p:last-child {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 0.76rem;
    line-height: 1.55;
}

.daily-review-automation-form {
    display: grid;
    grid-template-columns: auto minmax(120px, 0.7fr) minmax(175px, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin: 0;
}

.automation-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.automation-field > span {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 720;
    letter-spacing: 0.06em;
}

.automation-field input,
.automation-field select {
    width: 100%;
    min-height: 42px;
    padding: 8px 10px;
    border-radius: 11px;
    font-size: 0.8rem;
}

.automation-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 10px;
    cursor: pointer;
}

.automation-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.automation-switch > span {
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 auto;
    border: 1px solid rgba(173, 196, 212, 0.3);
    border-radius: 999px;
    background: rgba(2, 11, 23, 0.82);
    transition: border-color 160ms ease, background 160ms ease;
}

.automation-switch > span::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #91aabd;
    transition: transform 160ms var(--ease-out), background 160ms ease, box-shadow 160ms ease;
    content: "";
}

.automation-switch input:checked + span {
    border-color: rgba(103, 232, 249, 0.52);
    background: rgba(34, 211, 238, 0.16);
}

.automation-switch input:checked + span::after {
    background: #67e8f9;
    box-shadow: 0 0 10px rgba(103, 232, 249, 0.6);
    transform: translateX(16px);
}

.automation-switch input:focus-visible + span {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.automation-switch strong {
    color: #d9e8f2;
    font-size: 0.78rem;
}

.automation-save {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding-inline: 12px;
    border-radius: 11px;
    white-space: nowrap;
}

.daily-review-automation-status {
    display: grid;
    justify-items: start;
    gap: 6px;
    min-width: 0;
    padding-left: 16px;
    border-left: 1px solid var(--surface-divider);
}

.daily-review-automation-status small {
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.4;
}

.automation-offline {
    color: #b7c9d6;
    font-size: 0.76rem;
    font-weight: 720;
}

.daily-review-automation-status .automation-error {
    color: #f7d78a;
}

@media (max-width: 1180px) {
    .daily-review-automation {
        grid-template-columns: 1fr;
    }

    .daily-review-automation-form {
        grid-template-columns: auto minmax(120px, 0.7fr) minmax(180px, 1fr) auto;
    }

    .daily-review-automation-status {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        padding: 12px 0 0;
        border-top: 1px solid var(--surface-divider);
        border-left: 0;
    }
}

@media (max-width: 720px) {
    .daily-review-automation-form {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .automation-switch {
        padding-inline: 2px;
    }

    .automation-save {
        width: 100%;
    }
}

/* Weekly growth coach: turn a passive report into three deliberate next actions. */
.growth-coach {
    display: grid;
    grid-template-columns: minmax(250px, 0.82fr) minmax(300px, 1fr) minmax(330px, 1.05fr);
    gap: 1px;
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid rgba(103, 232, 249, 0.22);
    border-radius: 22px;
    background: rgba(103, 232, 249, 0.14);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28), 0 0 42px rgba(34, 211, 238, 0.05);
}

.growth-coach > div {
    min-width: 0;
    padding: 24px;
    background: linear-gradient(150deg, rgba(9, 27, 46, 0.98), rgba(6, 14, 29, 0.98));
}

.growth-coach-score {
    display: flex;
    align-items: center;
    gap: 18px;
}

.growth-coach-score h2,
.growth-coach-score p {
    margin: 0;
}

.growth-coach-score h2 {
    margin: 5px 0 8px;
    color: #f3fbff;
    font-size: 1.35rem;
}

.growth-coach-score > div > p:last-of-type {
    color: #b3c9d9;
    font-size: 0.82rem;
    line-height: 1.65;
}

.growth-score-ring {
    position: relative;
    display: grid;
    width: 108px;
    height: 108px;
    flex: 0 0 108px;
    place-content: center;
    border-radius: 50%;
    text-align: center;
    background: conic-gradient(#36d7e7 calc(var(--growth-score) * 1%), rgba(103, 232, 249, 0.11) 0);
    box-shadow: 0 0 34px rgba(34, 211, 238, 0.12);
}

.growth-score-ring::before {
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(103, 232, 249, 0.12);
    border-radius: inherit;
    background: #071525;
    content: "";
}

.growth-score-ring strong,
.growth-score-ring span {
    position: relative;
    z-index: 1;
}

.growth-score-ring strong {
    color: #eaffff;
    font: 760 2.1rem/1 var(--font-display);
}

.growth-score-ring span {
    margin-top: 4px;
    color: #9bb7c9;
    font-size: 0.68rem;
}

.growth-active-days {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    color: #99f6e4;
    font-size: 0.75rem;
    font-weight: 680;
}

.growth-active-days i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.7);
}

.growth-coach-insights {
    display: grid;
    align-content: center;
    gap: 12px;
}

.growth-coach-insights article {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
    border: 1px solid rgba(125, 211, 252, 0.12);
    border-radius: 14px;
    background: rgba(2, 11, 24, 0.48);
}

.growth-coach-insights p {
    margin: 0;
    color: #bdd0de;
    font-size: 0.76rem;
    line-height: 1.5;
}

.growth-coach-insights p + p {
    margin-top: 4px;
}

.growth-coach-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
}

.growth-coach-icon-good {
    color: #67e8f9;
    background: rgba(34, 211, 238, 0.1);
}

.growth-coach-icon-watch {
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.1);
}

.growth-coach-actions ol {
    display: grid;
    gap: 8px;
    margin: 14px 0;
    padding: 0;
    list-style: none;
}

.growth-coach-actions li {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(103, 232, 249, 0.1);
    border-radius: 12px;
    background: rgba(5, 18, 34, 0.72);
}

.growth-coach-actions li > span {
    color: #5ee8f5;
    font: 650 0.68rem/1 var(--font-mono);
}

.growth-coach-actions li strong,
.growth-coach-actions li small {
    display: block;
}

.growth-coach-actions li strong {
    color: #edfaff;
    font-size: 0.8rem;
}

.growth-coach-actions li small {
    margin-top: 3px;
    color: #9fb9ca;
    font-size: 0.68rem;
    line-height: 1.4;
}

.growth-coach-apply {
    display: inline-flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(103, 232, 249, 0.3);
    border-radius: 11px;
    color: #03141e;
    background: linear-gradient(135deg, #78e9f3, #35cbe2);
    font-size: 0.8rem;
    font-weight: 740;
}

.growth-coach-disclaimer {
    display: block;
    margin-top: 8px;
    color: #8da8bb;
    text-align: center;
    font-size: 0.66rem;
}

/* One capture surface for AI-assisted and manual daily records. */
.quick-capture[hidden] {
    display: none;
}

.quick-capture {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: grid;
    place-items: center;
    padding: 20px;
}

.quick-capture-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: rgba(1, 5, 13, 0.76);
    backdrop-filter: blur(12px);
}

.quick-capture-dialog {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    max-height: calc(100dvh - 40px);
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(103, 232, 249, 0.27);
    border-radius: 22px;
    background: linear-gradient(155deg, rgba(10, 29, 49, 0.99), rgba(5, 13, 27, 0.99));
    box-shadow: 0 36px 100px rgba(0, 0, 0, 0.58), 0 0 48px rgba(34, 211, 238, 0.08);
}

.quick-capture-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid rgba(103, 232, 249, 0.12);
}

.quick-capture-head h2,
.quick-capture-head p,
.quick-capture-head small {
    margin: 0;
}

.quick-capture-head h2 {
    margin: 4px 0 5px;
    color: #f1fbff;
    font-size: 1.35rem;
}

.quick-capture-head small {
    color: #a8c0d1;
}

.quick-capture-close {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(103, 232, 249, 0.15);
    border-radius: 11px;
    color: #aac4d5;
    background: rgba(3, 13, 27, 0.62);
}

.quick-capture form {
    display: grid;
    gap: 14px;
    padding: 20px 24px 24px;
}

.quick-capture form[hidden] {
    display: none;
}

.quick-capture-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 16px 24px 0;
}

.quick-capture-mode-switch:has(button:only-child) {
    grid-template-columns: 1fr;
}

.quick-capture-mode-switch button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(103, 232, 249, 0.13);
    border-radius: 12px;
    color: #91aec2;
    background: rgba(2, 11, 24, 0.58);
    box-shadow: none;
    font-size: 0.78rem;
}

.quick-capture-mode-switch button.is-active {
    color: #ecfeff;
    border-color: rgba(103, 232, 249, 0.42);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(99, 102, 241, 0.16));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 24px rgba(34, 211, 238, 0.08);
}

.quick-capture-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.quick-capture-tabs button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px;
    border: 1px solid rgba(103, 232, 249, 0.12);
    border-radius: 11px;
    color: #9eb8ca;
    background: rgba(3, 13, 27, 0.62);
    box-shadow: none;
    font-size: 0.78rem;
}

.quick-capture-tabs button.is-active {
    color: #e9fdff;
    border-color: rgba(103, 232, 249, 0.38);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.19), rgba(59, 130, 246, 0.12));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 20px rgba(34, 211, 238, 0.06);
}

.quick-capture-field {
    display: grid;
    gap: 7px;
}

.quick-capture-field[hidden] {
    display: none;
}

.quick-capture-field > span {
    color: #c8dae6;
    font-size: 0.74rem;
    font-weight: 690;
}

.quick-capture-field input,
.quick-capture-field select,
.quick-capture-field textarea {
    width: 100%;
    min-height: 46px;
    border-color: rgba(125, 211, 252, 0.2);
    color: #eefaff;
    background: rgba(2, 10, 22, 0.78);
}

.quick-capture-field textarea {
    min-height: 112px;
    resize: vertical;
    padding: 13px 14px;
    line-height: 1.65;
}

.ai-capture-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.ai-capture-hints span {
    padding: 5px 9px;
    border: 1px solid rgba(103, 232, 249, 0.13);
    border-radius: 999px;
    color: #8fadc1;
    background: rgba(5, 18, 33, 0.66);
    font: 650 0.65rem/1 var(--font-mono);
}

.ai-capture-privacy {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    color: #91adbf;
    font-size: 0.7rem;
    line-height: 1.55;
}

.ai-capture-privacy .ui-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    margin-top: 1px;
    color: #67e8f9;
}

.ai-capture-preview {
    display: grid;
    gap: 12px;
    padding-top: 4px;
}

.ai-capture-preview[hidden] {
    display: none;
}

.ai-capture-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(103, 232, 249, 0.13);
}

.ai-capture-preview-head p,
.ai-capture-preview-head strong {
    margin: 0;
}

.ai-capture-preview-head strong {
    color: #effcff;
    font-size: 0.9rem;
}

.ai-capture-preview-head > span {
    padding: 5px 9px;
    border: 1px solid rgba(167, 139, 250, 0.28);
    border-radius: 999px;
    color: #d8ccff;
    background: rgba(109, 40, 217, 0.12);
    font: 650 0.64rem/1 var(--font-mono);
}

.ai-capture-items {
    display: grid;
    gap: 8px;
    max-height: min(310px, 36vh);
    overflow-y: auto;
    padding-right: 3px;
}

.ai-capture-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    padding: 11px 12px;
    border: 1px solid rgba(103, 232, 249, 0.13);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(8, 27, 45, 0.86), rgba(9, 16, 36, 0.82));
    cursor: pointer;
}

.ai-capture-item:has(input:checked) {
    border-color: rgba(103, 232, 249, 0.34);
    box-shadow: inset 3px 0 0 rgba(34, 211, 238, 0.72);
}

.ai-capture-item input {
    width: 17px;
    height: 17px;
    accent-color: #38d4e8;
}

.ai-capture-item > span,
.ai-capture-item-top {
    display: grid;
    min-width: 0;
}

.ai-capture-item-top {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.ai-capture-item-top i {
    padding: 3px 6px;
    border-radius: 6px;
    color: #77edf4;
    background: rgba(34, 211, 238, 0.11);
    font: 700 0.6rem/1 var(--font-mono);
    font-style: normal;
}

.ai-capture-item strong {
    overflow: hidden;
    color: #edfaff;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-capture-item small {
    margin-top: 5px;
    color: #89a7bb;
    font-size: 0.68rem;
}

.ai-capture-warnings {
    padding: 9px 11px;
    border: 1px solid rgba(251, 191, 36, 0.18);
    border-radius: 10px;
    color: #f6d681;
    background: rgba(120, 53, 15, 0.1);
    font-size: 0.68rem;
}

.ai-capture-warnings[hidden] {
    display: none;
}

.ai-capture-warnings p {
    margin: 0;
}

.ai-capture-warnings p + p {
    margin-top: 4px;
}

.quick-capture-numbers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.quick-capture-error {
    margin: 0;
    color: #fecaca;
    font-size: 0.76rem;
}

.quick-capture-submit {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 0;
    border-radius: 12px;
    color: #03141e;
    background: linear-gradient(135deg, #78e9f3, #35cbe2 62%, #60a5fa);
    font-size: 0.84rem;
    font-weight: 760;
}

.quick-capture-submit kbd {
    margin-left: auto;
    color: rgba(3, 20, 30, 0.58);
    font: 650 0.64rem/1 var(--font-mono);
}

.capture-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 100;
    max-width: min(90vw, 520px);
    padding: 12px 18px;
    border: 1px solid rgba(103, 232, 249, 0.24);
    border-radius: 12px;
    color: #eaffff;
    background: rgba(6, 22, 39, 0.96);
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.4);
    transform: translateX(-50%);
    font-size: 0.8rem;
}

body.quick-capture-open {
    overflow: hidden;
}

@media (max-width: 1180px) {
    .growth-coach {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .growth-coach-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .growth-coach {
        grid-template-columns: 1fr;
    }

    .growth-coach-actions {
        grid-column: auto;
    }

    .growth-coach > div {
        padding: 18px;
    }

    .growth-coach-score {
        align-items: flex-start;
    }

    .growth-score-ring {
        width: 90px;
        height: 90px;
        flex-basis: 90px;
    }

    .quick-capture {
        align-items: end;
        padding: 0;
    }

    .quick-capture-dialog {
        width: 100%;
        max-height: calc(100dvh - 20px);
        overflow-y: auto;
        border-radius: 22px 22px 0 0;
    }

    .quick-capture-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .quick-capture-numbers {
        grid-template-columns: 1fr;
    }
}

/* Study learning loop: make outcomes and application more prominent than passive time tracking. */
.study-learning-loop {
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid rgba(103, 232, 249, 0.22);
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0%, rgba(167, 139, 250, 0.12), transparent 38%),
        linear-gradient(145deg, rgba(8, 29, 48, 0.92), rgba(13, 20, 43, 0.9));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.study-learning-loop-fields {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    gap: 14px;
}

.study-learning-loop .field-block {
    align-content: start;
    margin: 0;
}

.study-learning-loop textarea,
.study-learning-loop input {
    border-color: rgba(139, 224, 239, 0.24);
    background: rgba(2, 14, 28, 0.76);
}

.study-loop-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.study-loop-item {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid rgba(139, 224, 239, 0.18);
    border-radius: 14px;
    background: rgba(5, 20, 36, 0.78);
}

.study-loop-item > span {
    color: #78e8f5;
    font: 720 0.66rem/1.2 var(--font-mono);
    letter-spacing: 0.08em;
}

.study-loop-item p {
    margin: 0;
    color: #e5f3fb;
    font-size: 0.82rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.study-loop-next {
    border-color: rgba(167, 139, 250, 0.26);
    background: linear-gradient(145deg, rgba(17, 30, 52, 0.9), rgba(36, 25, 63, 0.72));
}

.study-next-action-form {
    margin: 2px 0 0;
}

.study-next-action-button,
.study-next-action-linked {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid rgba(103, 232, 249, 0.28);
    border-radius: 10px;
    color: #a9f5ff;
    background: rgba(34, 211, 238, 0.09);
    font-size: 0.72rem;
    font-weight: 720;
    line-height: 1.2;
}

.study-next-action-button:hover,
.study-next-action-linked:hover {
    border-color: rgba(103, 232, 249, 0.54);
    color: #effdff;
    background: rgba(34, 211, 238, 0.16);
}

.study-next-action-button .ui-icon {
    width: 15px;
    height: 15px;
}

@media (max-width: 720px) {
    .study-learning-loop-fields,
    .study-loop-summary {
        grid-template-columns: 1fr;
    }

    .study-learning-loop {
        padding: 16px;
    }

    .study-next-action-button,
    .study-next-action-linked {
        width: 100%;
    }
}

/* Exercise record choices */
.exercise-choice {
    color: #b9d7e6;
    border-color: rgba(103, 232, 249, 0.15);
    background: linear-gradient(145deg, rgba(8, 25, 43, 0.9), rgba(4, 15, 29, 0.82));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    font-size: 0.88rem;
    font-weight: 680;
    transition: transform 160ms var(--ease-out), border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.exercise-choice:hover {
    color: #effcff;
    border-color: rgba(103, 232, 249, 0.36);
    background: linear-gradient(145deg, rgba(12, 38, 59, 0.94), rgba(8, 22, 41, 0.88));
    transform: translateY(-1px);
}

.exercise-choice-indicator {
    border-color: rgba(148, 187, 207, 0.52);
    background: rgba(1, 8, 19, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.exercise-choice:has(input:checked) {
    color: #e8fdff;
    border-color: rgba(34, 211, 238, 0.46);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.17), rgba(139, 92, 246, 0.11));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 8px 22px rgba(0, 0, 0, 0.18);
}

.exercise-choice:has(input:checked) .exercise-choice-indicator {
    border-color: #67e8f9;
    background: linear-gradient(135deg, #22d3ee, #8b5cf6);
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.34);
}

.exercise-custom-action {
    margin-top: -2px;
    padding: 14px;
    border: 1px solid rgba(103, 232, 249, 0.16);
    border-radius: 14px;
    background: rgba(5, 19, 35, 0.72);
}

.exercise-custom-action > span::before {
    margin-right: 7px;
    color: #67e8f9;
    content: "+";
}

@media (max-width: 540px) {
    .exercise-choice-grid {
        gap: 8px;
    }

    .exercise-choice {
        min-height: 50px;
        padding: 10px 11px;
    }
}
