:root {
    --bg: #f5efe4;
    --bg-deep: #e2eef4;
    --surface: rgba(255, 251, 245, 0.82);
    --surface-strong: rgba(255, 248, 240, 0.94);
    --text: #17242d;
    --muted: #5d6d77;
    --brand: #0f6c78;
    --brand-strong: #0d4f63;
    --accent: #c46d2d;
    --success: #2f7d58;
    --warning: #9a6828;
    --danger: #b5493f;
    --shadow: 0 24px 60px rgba(32, 44, 53, 0.12);
    --radius-lg: 28px;
    --radius-md: 20px;
}

* { box-sizing: border-box; }
html { font-size: 17px; }
body {
    position: relative;
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Aptos", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", sans-serif;
    background: linear-gradient(180deg, #f8f1e8 0%, #eef5f6 100%);
    overflow-x: hidden;
}
body::selection { background: rgba(15, 108, 120, 0.16); }
.site-bg { position: fixed; border-radius: 999px; filter: blur(16px); pointer-events: none; z-index: 0; }
.site-bg-one { top: -140px; left: -60px; width: 420px; height: 420px; background: rgba(196, 109, 45, 0.18); }
.site-bg-two { right: -120px; top: 160px; width: 360px; height: 360px; background: rgba(15, 108, 120, 0.14); }
.site-grid {
    position: fixed; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.14) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.14) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.18), transparent 80%);
    pointer-events: none; z-index: 0;
}
.topbar, .page-shell {
    position: relative; z-index: 1;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.68);
    background: linear-gradient(135deg, rgba(255, 252, 247, 0.72), rgba(245, 251, 252, 0.62));
    box-shadow: 0 22px 44px rgba(23, 36, 45, 0.08);
    backdrop-filter: blur(18px);
}
h1, h2, h3, h4, p { margin: 0; }
h2, h3, .brand-name { font-family: "Georgia", "Times New Roman", serif; letter-spacing: -0.03em; }
h2 { font-size: clamp(2rem, 2.2vw, 3.25rem); line-height: 1.08; }
h3 { font-size: 1.28rem; }
.eyebrow {
    margin-bottom: 10px; font-size: 0.78rem; letter-spacing: 0.2em;
    text-transform: uppercase; color: var(--brand-strong);
}
.section-kicker {
    margin-bottom: 8px; font-size: 0.74rem; letter-spacing: 0.12em;
    text-transform: none; color: #6f8088; font-weight: 700;
}
.brand-block {
    position: relative;
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 12px 14px;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(15, 108, 120, 0.08);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.5), rgba(247, 251, 252, 0.34));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}
.brand-block::before,
.brand-block::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
}
.brand-block::before {
    top: -28px;
    right: -18px;
    width: 96px;
    height: 96px;
    background: radial-gradient(circle, rgba(196, 109, 45, 0.18) 0%, rgba(196, 109, 45, 0) 72%);
}
.brand-block::after {
    left: 10px;
    bottom: -62px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(15, 108, 120, 0.14) 0%, rgba(15, 108, 120, 0) 72%);
}
.brand-block .eyebrow {
    position: relative;
    z-index: 1;
    margin-bottom: 0;
}
.brand-link {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}
.brand-link > span:last-child {
    display: grid;
    gap: 2px;
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--brand-strong), var(--accent));
    box-shadow: 0 14px 24px rgba(15, 108, 120, 0.14);
}
.brand-name {
    display: block;
    font-size: clamp(1.56rem, 2vw, 1.92rem);
    font-weight: 700;
    line-height: 0.98;
}
.brand-subtitle {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
}
.page-shell { display: grid; gap: 24px; padding-bottom: 48px; }
.top-actions {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    padding: 6px;
    border-radius: 24px;
    border: 1px solid rgba(15, 108, 120, 0.08);
    background: rgba(255, 255, 255, 0.34);
}
.top-actions form { margin: 0; }
.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 {
    border: 1px solid rgba(255, 255, 255, 0.65); border-radius: var(--radius-lg); box-shadow: var(--shadow); background: var(--surface); backdrop-filter: blur(16px);
}
.hero-card, .page-header-card, .form-card, .auth-card, .auth-showcase, .next-steps, .empty-card, .chart-card, .workspace-card { padding: 28px; }
.hero-card, .page-header-card, .task-card, .workspace-item, .summary-row, .category-head, .chart-header, .section-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
}
.hero-copy-block { max-width: 760px; }
.hero-copy { margin-top: 14px; line-height: 1.75; color: var(--muted); max-width: 780px; }
.hero-actions { display: grid; gap: 12px; min-width: 220px; }
.hero-link { padding-left: 6px; }
.hero-metrics { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; }
.hero-metric {
    min-width: 150px; padding: 14px 16px; border-radius: 18px;
    background: rgba(255, 255, 255, 0.55); border: 1px solid rgba(15, 108, 120, 0.08);
}
.hero-metric span, .stat-card span, .chart-header span, .section-meta, .category-head span, .summary-row span, .task-meta, .task-note, .empty-chart-text, .field-help, .config-meta, .config-subline { color: var(--muted); }
.hero-metric span { display: block; margin-bottom: 6px; font-size: 0.85rem; }
.hero-metric strong { font-size: 1.35rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.stats-grid-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card { padding: 24px; }
.stat-card strong { display: block; margin: 6px 0 8px; font-size: clamp(2rem, 3vw, 3rem); line-height: 1; }
.stat-card p { font-size: 0.92rem; color: var(--muted); }
.accent-card { background: linear-gradient(135deg, rgba(15, 108, 120, 0.96), rgba(17, 85, 93, 0.92)); color: #fefdf9; }
.accent-card span, .accent-card p { color: rgba(255, 255, 255, 0.76); }
.next-steps ul { margin: 6px 0 0; padding-left: 20px; line-height: 1.9; color: var(--muted); }
.ghost-link, .primary-link, .secondary-link, .brand-link { font-weight: 700; }
.ghost-link, .secondary-link, .primary-link {
    display: inline-flex; align-items: center; justify-content: center; min-height: 46px; border-radius: 999px; text-decoration: none;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.ghost-link { color: var(--brand-strong); }
.nav-link {
    min-height: 38px; padding: 8px 13px; border: 1px solid transparent;
}
.nav-link:hover, .nav-btn:hover {
    background: rgba(255, 255, 255, 0.56);
    border-color: rgba(15, 108, 120, 0.08);
}
.ghost-link:hover, .secondary-link:hover, .primary-link:hover, button:hover { transform: translateY(-1px); }
.primary-link, button {
    padding: 12px 18px; border: 0; color: #fff; background: linear-gradient(135deg, var(--brand), var(--accent)); box-shadow: 0 14px 26px rgba(15, 108, 120, 0.18);
}
.secondary-link { padding: 12px 18px; color: var(--brand-strong); border: 1px solid rgba(15, 108, 120, 0.16); background: rgba(255, 255, 255, 0.5); }
button, .ghost-btn { border-radius: 999px; font: inherit; font-weight: 700; cursor: pointer; }
.ghost-btn { padding: 10px 14px; border: 1px solid rgba(15, 108, 120, 0.08); color: var(--brand-strong); background: rgba(255, 255, 255, 0.62); box-shadow: 0 10px 20px rgba(15, 108, 120, 0.08); }
.nav-btn { min-height: 40px; }
.danger-button { background: linear-gradient(135deg, var(--danger), #d36f64); }
.task-list, .config-list, .log-list, .workspace-list, .summary-list, .category-list, .reminder-guide, .message-stack { display: grid; gap: 16px; }
.task-card { padding: 22px 24px; scroll-margin-top: 24px; }
.task-card-done { opacity: 0.78; }
.task-main, .config-main { flex: 1; }
.task-topline h3 { font-size: 1.32rem; }
.task-badges, .form-actions, .task-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 999px; font-size: 0.84rem; font-weight: 700; }
.badge-status { color: #365a64; background: rgba(54, 90, 100, 0.12); }
.badge-low { color: var(--success); background: rgba(47, 125, 88, 0.14); }
.badge-medium { color: var(--warning); background: rgba(154, 104, 40, 0.14); }
.badge-high { color: var(--danger); background: rgba(181, 73, 63, 0.14); }
.task-meta, .task-note { margin-top: 10px; line-height: 1.7; }
.danger-link, .error-text { color: var(--danger); }
.page-header-card { align-items: center; }
.task-planning-shell {
    align-items: stretch;
    gap: 24px;
}
.task-planning-headline {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.task-date-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}
.task-date-metric {
    min-width: 140px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(15, 108, 120, 0.1);
    background: rgba(255, 255, 255, 0.56);
}
.task-date-metric span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.82rem;
}
.task-date-metric strong {
    font-size: 1rem;
}
.task-date-pill {
    padding: 8px 14px;
}
.task-date-pill-today {
    color: var(--brand-strong);
    background: rgba(15, 108, 120, 0.14);
}
.task-date-pill-future {
    color: var(--warning);
    background: rgba(154, 104, 40, 0.14);
}
.task-date-pill-past {
    color: #5d6d77;
    background: rgba(93, 109, 119, 0.14);
}
.task-date-rail {
    display: grid;
    gap: 14px;
    align-content: start;
    min-width: 300px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid rgba(15, 108, 120, 0.1);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 252, 252, 0.6));
}
.task-date-shortcuts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.task-date-nav {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid rgba(15, 108, 120, 0.12);
    background: rgba(255, 255, 255, 0.72);
}
.task-date-nav-emphasis {
    border-color: rgba(196, 109, 45, 0.24);
    background: rgba(255, 246, 237, 0.9);
}
.task-date-form {
    gap: 12px;
}
.task-date-form .field-block {
    gap: 6px;
}
.task-date-form .field-block span,
.task-date-caption {
    color: var(--muted);
}
.task-date-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.task-date-actions .primary-link,
.task-date-actions button {
    width: 100%;
}
.task-date-caption {
    margin: 0;
    line-height: 1.7;
    font-size: 0.92rem;
}
.form-card { display: grid; gap: 20px; }
.task-form, .auth-form, .permission-form { display: grid; gap: 16px; }
.field-block, .auth-form label { display: grid; gap: 8px; font-weight: 700; }
.field-block input, .field-block select, .field-block textarea, .auth-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
    width: 100%; padding: 14px 16px; border: 1px solid rgba(23, 36, 45, 0.14); border-radius: 16px; background: rgba(255, 255, 255, 0.9); color: var(--text); font: inherit;
}
.field-block textarea { min-height: 120px; resize: vertical; }
.checkbox-row { gap: 10px; }
.checkbox-wrap { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid rgba(23, 36, 45, 0.14); border-radius: 16px; background: rgba(255, 255, 255, 0.9); }
.checkbox-wrap input[type="checkbox"] { width: auto; margin: 0; transform: scale(1.1); }
.permission-field-block { display: grid; gap: 14px; }
.permission-field-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.permission-field-label { margin: 0; font-weight: 700; }
.permission-bulk-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.permission-bulk-btn { padding: 10px 16px; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.permission-option { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid rgba(23, 36, 45, 0.14); border-radius: 16px; background: rgba(255, 255, 255, 0.9); font-weight: 700; line-height: 1.5; }
.permission-option input[type="checkbox"] { width: auto; margin: 2px 0 0; flex: none; transform: scale(1.1); }
.permission-help { margin-top: 0; max-width: none; }
.field-hidden { display: none; }
.auth-layout { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 22px; }
.auth-showcase { display: grid; align-content: end; min-height: 420px; background: linear-gradient(145deg, rgba(15, 108, 120, 0.94), rgba(196, 109, 45, 0.85)); color: #fff; }
.auth-showcase .eyebrow, .auth-showcase .hero-copy, .auth-showcase .hero-metric span { color: rgba(255, 255, 255, 0.8); }
.auth-showcase .hero-metric { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.18); }
.auth-card { display: grid; gap: 20px; align-content: start; }
.chart-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 20px; }
.chart-grid-bottom { grid-template-columns: 1.08fr 0.92fr; }
.chart-header, .section-head { margin-bottom: 18px; }
.section-head-tight { margin-bottom: 16px; }
.bar-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 14px; min-height: 260px; }
.bar-item, .mini-bar-item { display: grid; justify-items: center; gap: 8px; }
.bar-value, .mini-bar-item span, .bar-label { font-size: 0.82rem; }
.bar-track { width: 100%; max-width: 48px; height: 196px; display: flex; align-items: end; justify-content: center; border-radius: 999px; background: rgba(15, 108, 120, 0.08); }
.bar-fill-study, .mini-bar-fill, .category-fill { background: linear-gradient(180deg, var(--accent) 0%, var(--brand) 100%); }
.bar-fill-study { width: 100%; border-radius: 999px; }
.mini-chart { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px; align-items: end; min-height: 226px; }
.mini-bar-fill { width: 100%; min-width: 12px; border-radius: 10px 10px 0 0; }
.category-row, .workspace-summary { display: grid; gap: 10px; }
.category-track { width: 100%; height: 12px; border-radius: 999px; background: rgba(15, 108, 120, 0.08); overflow: hidden; }
.category-fill { height: 100%; border-radius: 999px; }
.workspace-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.workspace-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 420px;
    overflow: hidden;
}
.workspace-item, .log-card, .config-card { padding: 16px 18px; border-radius: var(--radius-md); background: rgba(255, 255, 255, 0.64); border: 1px solid rgba(15, 108, 120, 0.08); }
.config-card { scroll-margin-top: 24px; }
.workspace-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
    position: relative;
}

.workspace-list::-webkit-scrollbar {
    width: 8px;
}

.workspace-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(15, 108, 120, 0.18);
}

.workspace-list::-webkit-scrollbar-track {
    background: transparent;
}

.workspace-list-compact {
    gap: 12px;
}

.workspace-list .empty-chart-text {
    padding-right: 8px;
}

.workspace-list::before,
.workspace-list::after {
    content: "";
    position: sticky;
    left: 0;
    right: 0;
    display: block;
    height: 18px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 180ms ease;
    z-index: 2;
}

.workspace-list::before {
    top: 0;
    margin-bottom: -18px;
    background: linear-gradient(180deg, rgba(248, 250, 249, 0.98) 0%, rgba(248, 250, 249, 0) 100%);
}

.workspace-list::after {
    bottom: 0;
    margin-top: -18px;
    background: linear-gradient(0deg, rgba(248, 250, 249, 0.98) 0%, rgba(248, 250, 249, 0) 100%);
}

.workspace-list.workspace-scrollable:not(.workspace-scroll-top)::before,
.workspace-list.workspace-scrollable:not(.workspace-scroll-end)::after {
    opacity: 1;
}

.workspace-card-feature {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 250, 244, 0.96), rgba(245, 251, 252, 0.9));
}

.workspace-card-feature::after {
    content: "";
    position: absolute;
    inset: auto -40px -60px auto;
    width: 160px;
    height: 160px;
    border-radius: 999px;
    opacity: 0.16;
    pointer-events: none;
    filter: blur(6px);
}

.workspace-card-reading::after {
    background: radial-gradient(circle, rgba(15, 108, 120, 0.85) 0%, rgba(15, 108, 120, 0) 70%);
}

.workspace-card-exercise::after {
    background: radial-gradient(circle, rgba(47, 125, 88, 0.78) 0%, rgba(47, 125, 88, 0) 70%);
}
.workspace-card-watch::after {
    background: radial-gradient(circle, rgba(196, 109, 45, 0.78) 0%, rgba(196, 109, 45, 0) 70%);
}

.workspace-empty-panel {
    display: grid;
    gap: 10px;
    align-content: start;
    min-height: 128px;
    padding: 18px;
    border-radius: 22px;
    border: 1px dashed rgba(15, 108, 120, 0.18);
    background: rgba(255, 255, 255, 0.54);
}

.workspace-empty-panel strong {
    font-size: 1.02rem;
}

.workspace-inline-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
}

.workspace-link {
    width: auto;
    align-self: flex-start;
    margin-top: auto;
    min-height: 42px;
    padding: 10px 16px;
    box-shadow: 0 10px 20px rgba(15, 108, 120, 0.12);
}
.spotlight-card { background: linear-gradient(180deg, rgba(255, 249, 242, 0.94), rgba(249, 253, 252, 0.86)); }
.config-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.config-subline { margin-top: 6px; font-size: 0.95rem; }
.reminder-guide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reminder-guide-item, .channel-hint { padding: 18px; border-radius: var(--radius-md); border: 1px solid rgba(15, 108, 120, 0.1); background: rgba(255, 255, 255, 0.62); }
.channel-hint strong, .reminder-guide-item strong { color: var(--brand-strong); }
.empty-card p { margin: 10px 0 18px; }
.flash-message { padding: 14px 18px; font-weight: 700; }
.flash-success { color: var(--success); border-color: rgba(47, 125, 88, 0.16); }
.flash-error { color: var(--danger); border-color: rgba(181, 73, 63, 0.16); }
.danger-panel { border-color: rgba(181, 73, 63, 0.12); }
.page-enter { animation: fadeSlideUp 420ms ease both; }
.page-enter-delay-1 { animation-delay: 70ms; }
.page-enter-delay-2 { animation-delay: 140ms; }
.page-enter-delay-3 { animation-delay: 210ms; }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1080px) {
    .stats-grid, .stats-grid-compact, .workspace-grid, .chart-grid, .chart-grid-bottom, .reminder-guide, .auth-layout { grid-template-columns: 1fr 1fr; }
    .topbar, .hero-card, .page-header-card { flex-direction: column; align-items: flex-start; }
    .workspace-card { height: 400px; }
    .task-date-rail {
        width: 100%;
        min-width: 0;
    }
}
@media (max-width: 720px) {
    html { font-size: 16px; }
    .topbar, .page-shell { width: min(100%, calc(100% - 24px)); }
    .stats-grid, .stats-grid-compact, .workspace-grid, .chart-grid, .chart-grid-bottom, .reminder-guide, .auth-layout, .mini-chart { grid-template-columns: 1fr; }
    .hero-card, .task-card, .workspace-item, .task-topline, .summary-row, .category-head, .section-head, .chart-header, .config-head { flex-direction: column; align-items: flex-start; }
    .permission-field-head { flex-direction: column; align-items: flex-start; }
    .bar-chart { grid-template-columns: repeat(7, minmax(36px, 1fr)); overflow-x: auto; }
    .hero-actions { width: 100%; min-width: 0; }
    .workspace-card { height: auto; }
    .workspace-list { overflow: visible; }
    .task-date-shortcuts,
    .task-date-actions {
        grid-template-columns: 1fr;
    }
}

.note-markdown {
    margin-top: 14px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(15, 108, 120, 0.08);
}

.note-markdown > *:first-child {
    margin-top: 0;
}

.note-markdown > *:last-child {
    margin-bottom: 0;
}

.note-markdown h1,
.note-markdown h2,
.note-markdown h3 {
    margin: 1rem 0 0.65rem;
    font-size: 1.1rem;
}

.note-markdown p,
.note-markdown ul,
.note-markdown ol,
.note-markdown blockquote {
    margin: 0.75rem 0;
}

.note-markdown pre {
    margin: 0.9rem 0;
    padding: 14px 16px;
    overflow-x: auto;
    border-radius: 16px;
    background: #11222b;
    color: #eef8fb;
}

.note-markdown code {
    padding: 0.15rem 0.4rem;
    border-radius: 8px;
    background: rgba(15, 108, 120, 0.08);
    font-family: "Cascadia Code", "Consolas", monospace;
    font-size: 0.92em;
}

.note-markdown pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

.note-markdown blockquote {
    padding-left: 14px;
    border-left: 3px solid rgba(15, 108, 120, 0.24);
    color: #4a5e67;
}

.nav-link {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 0.98rem;
}

.nav-btn {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 0.96rem;
}

.task-actions form {
    margin: 0;
}

.task-actions button,
.task-actions .ghost-link {
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.95rem;
}

.editor-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.92fr);
    gap: 20px;
    align-items: start;
}

.editor-panel {
    display: grid;
    gap: 16px;
    padding: 22px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 252, 247, 0.7), rgba(247, 251, 252, 0.62));
    border: 1px solid rgba(15, 108, 120, 0.1);
}

.editor-preview-panel {
    align-content: start;
}

.editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px;
    border-radius: 20px;
    border: 1px solid rgba(15, 108, 120, 0.1);
    background: rgba(255, 255, 255, 0.64);
}

.editor-chip {
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid rgba(15, 108, 120, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--brand-strong);
    box-shadow: 0 10px 20px rgba(15, 108, 120, 0.06);
    white-space: nowrap;
}

.field-block-wide {
    gap: 10px;
}

.editor-shell #id_note {
    min-height: 520px;
    padding: 18px 20px;
    border-radius: 22px;
    border: 1px solid rgba(15, 108, 120, 0.12);
    background: rgba(255, 253, 250, 0.94);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
    font-family: "Cascadia Code", "Consolas", monospace;
    line-height: 1.65;
    white-space: pre-wrap;
}

.note-preview {
    min-height: 520px;
    padding: 20px 22px;
    border-radius: 22px;
    border: 1px solid rgba(15, 108, 120, 0.08);
    background: rgba(255, 255, 255, 0.8);
    overflow: auto;
}

@media (max-width: 1080px) {
    .editor-shell {
        grid-template-columns: 1fr;
    }
}

.editor-help {
    margin: -2px 0 0;
    color: var(--muted);
    line-height: 1.7;
    font-size: 0.95rem;
}

.editor-help code {
    padding: 0.12rem 0.38rem;
    border-radius: 8px;
    background: rgba(15, 108, 120, 0.08);
    font-family: "Cascadia Code", "Consolas", monospace;
}

.note-markdown img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 18px;
    border: 1px solid rgba(15, 108, 120, 0.08);
    box-shadow: 0 18px 28px rgba(23, 36, 45, 0.12);
    cursor: zoom-in;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.note-markdown img:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 36px rgba(23, 36, 45, 0.18);
}

.editor-chip,
.editor-chip-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    white-space: nowrap;
}

.editor-upload-status {
    margin: -4px 0 2px;
    color: var(--muted);
    line-height: 1.7;
    font-size: 0.95rem;
}

.editor-upload-status[data-state="error"] {
    color: var(--danger);
}

.badge-study-tag {
    color: var(--brand-strong);
    background: rgba(15, 108, 120, 0.12);
}

.study-filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(180px, 0.8fr)) auto;
    gap: 14px;
    align-items: end;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tag-filter-strip,
.tag-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-filter-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(15, 108, 120, 0.12);
    color: var(--brand-strong);
    background: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-weight: 700;
}

.tag-filter-chip-active {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    box-shadow: 0 12px 22px rgba(15, 108, 120, 0.16);
}

.tag-choice {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 16px;
    border: 1px solid rgba(15, 108, 120, 0.12);
    background: rgba(255, 255, 255, 0.76);
    cursor: pointer;
    color: var(--brand-strong);
    font-weight: 700;
}

.tag-choice input {
    width: auto;
    margin: 0;
    accent-color: var(--brand);
}

.ingredient-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid rgba(15, 108, 120, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.5);
}

.ingredient-picker .tag-choice {
    width: 100%;
}

.filter-summary {
    color: var(--muted);
    line-height: 1.7;
}

@media (max-width: 720px) {
    .study-filter-form {
        grid-template-columns: 1fr;
    }
}

.image-lightbox-open {
    overflow: hidden;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(13, 21, 27, 0.82);
    backdrop-filter: blur(10px);
}

.image-lightbox[hidden] {
    display: none;
}

.image-lightbox-dialog {
    display: grid;
    gap: 14px;
    width: min(1100px, 100%);
    max-height: calc(100vh - 56px);
    justify-items: center;
}

.image-lightbox-media {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    border-radius: 24px;
    box-shadow: 0 28px 56px rgba(0, 0, 0, 0.28);
    background: rgba(255, 255, 255, 0.98);
}

.image-lightbox-caption {
    max-width: min(760px, 100%);
    margin: 0;
    text-align: center;
    color: rgba(245, 248, 250, 0.84);
    line-height: 1.7;
}

.image-lightbox-close {
    position: absolute;
    top: 24px;
    right: 24px;
    min-height: 42px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: none;
}

.image-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.18);
}

@media (max-width: 720px) {
    .image-lightbox {
        padding: 18px;
    }

    .image-lightbox-close {
        top: 16px;
        right: 16px;
    }

    .image-lightbox-media {
        max-height: calc(100vh - 120px);
    }
}


.ingredient-filter-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
}

.ingredient-card-missing {
    border-color: rgba(181, 73, 63, 0.14);
    background: linear-gradient(180deg, rgba(255, 248, 246, 0.92), rgba(255, 253, 249, 0.82));
}

.badge-ingredient-available {
    color: var(--success);
    background: rgba(47, 125, 88, 0.14);
}

.badge-ingredient-missing {
    color: var(--danger);
    background: rgba(181, 73, 63, 0.14);
}

@media (max-width: 1080px) {
    .ingredient-filter-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .ingredient-filter-form {
        grid-template-columns: 1fr;
    }
}


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

.meal-plan-card {
    display: grid;
    gap: 16px;
    padding: 22px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: var(--shadow);
    background: var(--surface);
    backdrop-filter: blur(16px);
    scroll-margin-top: 24px;
}

.meal-summary, .meal-recipe-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.meal-ingredient-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid rgba(15, 108, 120, 0.1);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.5);
}

.meal-ingredient-picker .tag-choice {
    width: 100%;
}

.meal-plan-form {
    gap: 14px;
}

@media (max-width: 1080px) {
    .meal-plan-grid {
        grid-template-columns: 1fr;
    }
}
.season-formset {
    display: grid;
    gap: 16px;
    padding: 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(15, 108, 120, 0.08);
}

.season-formset-head {
    align-items: center;
}

.season-formset-rows,
.watch-plan-rows {
    display: grid;
    gap: 12px;
}

.season-row,
.watch-plan-row {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(15, 108, 120, 0.12);
    background: rgba(255, 255, 255, 0.78);
}

.season-row-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    gap: 14px;
    align-items: end;
}

.season-row-actions,
.watch-plan-row-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
}

.season-row-remove,
.watch-plan-row-remove {
    min-height: 48px;
    white-space: nowrap;
}

.season-empty-state,
.watch-plan-empty-state {
    margin: 0;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px dashed rgba(15, 108, 120, 0.18);
    background: rgba(255, 255, 255, 0.45);
}

.watch-plan-builder {
    display: grid;
    gap: 14px;
}

.watch-plan-row-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(160px, 0.7fr) minmax(160px, 0.7fr) auto;
    gap: 14px;
    align-items: end;
}

.watch-plan-builder .form-actions {
    margin-top: 2px;
}

.watch-plan-builder .field-block,
.season-row .field-block {
    margin: 0;
}

@media (max-width: 1080px) {
    .season-row-grid,
    .watch-plan-row-grid {
        grid-template-columns: 1fr 1fr;
    }

    .season-row-actions,
    .watch-plan-row-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .season-formset,
    .season-row,
    .watch-plan-row {
        padding: 16px;
    }

    .season-row-grid,
    .watch-plan-row-grid {
        grid-template-columns: 1fr;
    }
}
.watch-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 18px;
}

.watch-plan-card {
    align-content: start;
    scroll-margin-top: 24px;
}

.watch-plan-current {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: 20px;
    border: 1px solid rgba(15, 108, 120, 0.1);
    background: rgba(255, 255, 255, 0.38);
}

.watch-plan-current-filled {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(249, 253, 252, 0.42));
}

.watch-plan-summary {
    margin-top: 6px;
}

.watch-plan-note-preview {
    margin-top: 6px;
}

.watch-plan-builder-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 2px 2px 0;
}

.watch-plan-builder-head .field-help {
    margin: 0;
}

.watch-plan-note-field textarea {
    min-height: 96px;
}

.watch-plan-complete-form {
    margin-top: -4px;
}

.watch-plan-row-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    gap: 14px;
}

.watch-plan-row-grid > .field-block:first-child {
    grid-column: 1 / -1;
}

.watch-plan-row-actions {
    justify-content: flex-start;
}

.watch-plan-row-summary {
    margin: 0;
    padding: 2px 4px 0;
    color: var(--muted);
    line-height: 1.65;
    font-size: 0.92rem;
}

@media (max-width: 1080px) {
    .watch-plan-grid {
        grid-template-columns: 1fr;
    }

    .watch-plan-row-grid {
        grid-template-columns: 1fr 1fr;
    }

    .watch-plan-row-grid > .field-block:first-child {
        grid-column: 1 / -1;
    }

    .watch-plan-row-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .watch-plan-builder-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .watch-plan-row-grid {
        grid-template-columns: 1fr;
    }

    .watch-plan-row-grid > .field-block:first-child,
    .watch-plan-row-actions {
        grid-column: auto;
    }
}




.exercise-quick-form {
    margin-top: 14px;
}

.exercise-weight-field {
    max-width: 240px;
}

.weight-chart-shell {
    display: grid;
    gap: 18px;
}

.weight-chart-frame {
    padding: 16px 18px 10px;
    border-radius: 22px;
    border: 1px solid rgba(15, 108, 120, 0.1);
    background: rgba(255, 255, 255, 0.56);
}

.weight-chart-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.weight-chart-line {
    fill: none;
    stroke: var(--brand);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.weight-chart-point {
    fill: var(--accent);
    stroke: rgba(255, 255, 255, 0.96);
    stroke-width: 2;
}

.weight-chart-point-value {
    fill: var(--brand-strong);
    font-size: 0.72rem;
    font-weight: 700;
}

.finance-upload-card {
    align-content: start;
}

.finance-year-strip {
    margin-bottom: 18px;
}

.finance-summary-list {
    margin-top: 18px;
}

.dual-bar-list {
    display: grid;
    gap: 16px;
}

.dual-bar-row {
    display: grid;
    gap: 10px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(15, 108, 120, 0.1);
    background: rgba(255, 255, 255, 0.56);
}

.dual-bar-head,
.dual-bar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.dual-bar-meta {
    color: var(--muted);
    font-size: 0.92rem;
}

.dual-track-shell {
    display: grid;
    gap: 10px;
}

.dual-track {
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 108, 120, 0.08);
}

.dual-fill {
    height: 100%;
    border-radius: 999px;
}

.dual-fill-income,
.finance-income-fill {
    background: linear-gradient(90deg, rgba(47, 125, 88, 0.94), rgba(15, 108, 120, 0.9));
}

.dual-fill-expense,
.finance-expense-fill,
.finance-quarter-fill {
    background: linear-gradient(90deg, rgba(196, 109, 45, 0.96), rgba(181, 73, 63, 0.9));
}

.finance-channel-fill {
    background: linear-gradient(90deg, rgba(15, 108, 120, 0.94), rgba(43, 138, 160, 0.88));
}

.finance-quarter-row {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(15, 108, 120, 0.08);
}

.finance-ledger-row {
    align-items: center;
}

.finance-ledger-amount {
    font-weight: 800;
    font-size: 1rem;
}

.finance-ledger-income {
    color: var(--success);
}

.finance-ledger-expense {
    color: var(--danger);
}

@media (max-width: 720px) {
    .dual-bar-head,
    .dual-bar-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}


.watch-item-card {
    border-color: rgba(15, 108, 120, 0.1);
}

.watch-item-card-ready {
    background: linear-gradient(180deg, rgba(255, 249, 242, 0.94), rgba(249, 253, 252, 0.88));
}

.watch-progress-panel {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(15, 108, 120, 0.1);
    background: rgba(255, 255, 255, 0.54);
}

.watch-progress-panel-ready {
    border-color: rgba(196, 109, 45, 0.16);
    background: linear-gradient(180deg, rgba(255, 250, 244, 0.94), rgba(255, 255, 255, 0.74));
}

.watch-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.watch-progress-track {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 108, 120, 0.08);
}

.watch-progress-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(15, 108, 120, 0.94), rgba(196, 109, 45, 0.9));
}

.watch-plan-progress-tip {
    padding-top: 2px;
}

@media (max-width: 860px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

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

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

/* study-sharing styles start */
.study-list-section {
    display: grid;
    gap: 16px;
}
.study-section-copy {
    max-width: 760px;
}
.study-insight-grid,
.study-access-grid,
.study-request-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}
.study-insight-card {
    display: grid;
    gap: 10px;
}
.study-status-list {
    display: grid;
    gap: 12px;
}
.study-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border: 1px solid rgba(23, 36, 45, 0.14);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
}
.permission-option-stack {
    align-items: flex-start;
}
.permission-option-stack input[type="checkbox"] {
    margin-top: 4px;
}
.permission-option-copy {
    display: grid;
    gap: 4px;
}
.permission-option-copy strong {
    font-size: 0.95rem;
}
.permission-option-copy small,
.inline-note,
.study-owner {
    color: var(--muted);
    font-weight: 500;
    line-height: 1.7;
}
.inline-form {
    margin: 0;
}
.study-request-card {
    display: grid;
    gap: 14px;
}
.study-owner {
    margin: 12px 0 0;
    font-size: 0.92rem;
}
@media (max-width: 720px) {
    .study-status-row {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* study-sharing styles end */