:root {
    --bg: #050505;
    --bg-soft: #0b0d10;
    --panel: rgba(17, 19, 24, 0.9);
    --panel-strong: rgba(12, 13, 16, 0.96);
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --text: #f4ede5;
    --muted: #afa49b;
    --muted-strong: #d0c4ba;
    --accent: #ff5b1f;
    --accent-soft: rgba(255, 91, 31, 0.18);
    --accent-strong: #ff8e63;
    --green: #89d36b;
    --red: #ff6b6b;
    --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.26);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

html.app-locked body {
    overflow: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Sora", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 91, 31, 0.14), transparent 32%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.05), transparent 28%),
        radial-gradient(circle at bottom right, rgba(255, 91, 31, 0.08), transparent 35%),
        linear-gradient(180deg, #040404 0%, #090a0d 46%, #050505 100%);
    color: var(--text);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(transparent 0%, rgba(255, 255, 255, 0.015) 100%),
        radial-gradient(circle at center, transparent 35%, rgba(0, 0, 0, 0.25) 100%);
    z-index: -2;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.07;
    z-index: 2;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.9) 0 0.5px, transparent 0.5px),
        radial-gradient(circle at 70% 35%, rgba(255, 255, 255, 0.7) 0 0.5px, transparent 0.5px),
        radial-gradient(circle at 45% 80%, rgba(255, 255, 255, 0.6) 0 0.5px, transparent 0.5px);
    background-size: 18px 18px, 24px 24px, 20px 20px;
    mix-blend-mode: soft-light;
}

.page-shell {
    position: relative;
    z-index: 3;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding-bottom: 72px;
    transition: opacity 220ms ease, filter 220ms ease, transform 220ms ease;
}

html.app-locked .page-shell {
    opacity: 0.12;
    filter: blur(18px);
    transform: scale(1.01);
    pointer-events: none;
    user-select: none;
}

.lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top left, rgba(255, 91, 31, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.06), transparent 32%),
        rgba(3, 3, 4, 0.78);
    backdrop-filter: blur(22px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}

html.app-locked .lock-overlay {
    opacity: 1;
    pointer-events: auto;
}

.lock-card {
    width: min(460px, 100%);
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 91, 31, 0.2);
    background: linear-gradient(180deg, rgba(19, 20, 24, 0.95), rgba(11, 12, 15, 0.96));
    box-shadow: var(--shadow-lg);
}

.lock-card h1 {
    margin: 0;
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(2.6rem, 8vw, 3.6rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.lock-copy {
    margin: 16px 0 0;
    color: var(--muted-strong);
    line-height: 1.8;
}

.lock-form {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.lock-feedback {
    min-height: 1.6em;
    margin: 16px 0 0;
    color: #ffd8ca;
    line-height: 1.6;
}

html.app-locked .toast,
html.app-locked .level-up-banner,
html.app-locked .modal-overlay {
    opacity: 0;
    pointer-events: none;
}

.section {
    margin-top: 32px;
}

.topbar {
    position: sticky;
    top: 14px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 18px 22px;
    border: 1px solid transparent;
    border-radius: 999px;
    transition: background-color 240ms ease, border-color 240ms ease, box-shadow 240ms ease, transform 240ms ease;
}

.topbar.is-scrolled {
    background: rgba(5, 5, 5, 0.82);
    border-color: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-md);
}

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

.brand-mark {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 0.9;
    letter-spacing: -0.04em;
}

.brand-copy {
    color: var(--muted);
    font-size: 0.78rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.level-chip,
.sync-chip,
.ghost-button,
.primary-button,
.secondary-button,
.submit-button,
.day-tab,
.day-toggle,
.delete-button {
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.level-chip {
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 91, 31, 0.28);
    background: rgba(255, 91, 31, 0.12);
    color: #ffd8ca;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(255, 91, 31, 0.05) inset;
    white-space: nowrap;
}

.sync-chip {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted-strong);
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.sync-chip.is-syncing {
    border-color: rgba(255, 210, 99, 0.24);
    background: rgba(255, 210, 99, 0.12);
    color: #ffe8ad;
}

.sync-chip.is-synced {
    border-color: rgba(137, 211, 107, 0.24);
    background: rgba(137, 211, 107, 0.12);
    color: #d9ffd5;
}

.sync-chip.is-error {
    border-color: rgba(255, 107, 107, 0.24);
    background: rgba(255, 107, 107, 0.12);
    color: #ffc4c4;
}

.sync-chip.is-setup {
    border-color: rgba(255, 210, 99, 0.24);
    background: rgba(255, 210, 99, 0.12);
    color: #ffe8ad;
}

.ghost-button,
.secondary-button,
.delete-button {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
}

.ghost-button,
.primary-button,
.secondary-button,
.submit-button,
.delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 999px;
    padding: 0 18px;
}

.ghost-button:hover,
.secondary-button:hover,
.delete-button:hover {
    transform: translateY(-1px);
    border-color: var(--line-strong);
    background: rgba(255, 255, 255, 0.05);
}

.primary-button,
.submit-button {
    border: 1px solid transparent;
    background:
        linear-gradient(135deg, rgba(255, 112, 65, 0.96), rgba(255, 91, 31, 0.96));
    color: #140905;
    font-weight: 700;
    box-shadow: 0 18px 34px rgba(255, 91, 31, 0.25);
}

.primary-button:hover,
.submit-button:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 20px 36px rgba(255, 91, 31, 0.32);
}

.hero {
    position: relative;
    min-height: 84vh;
    display: grid;
    align-items: center;
    padding: 70px 0 26px;
    overflow: hidden;
}

.hero-atmosphere {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(18px);
}

.glow-one {
    top: 7%;
    left: -5%;
    width: min(480px, 54vw);
    height: min(480px, 54vw);
    background: radial-gradient(circle, rgba(255, 91, 31, 0.3) 0%, rgba(255, 91, 31, 0.05) 48%, transparent 72%);
    animation: float-slow 14s ease-in-out infinite;
}

.glow-two {
    right: -8%;
    bottom: 2%;
    width: min(400px, 46vw);
    height: min(400px, 46vw);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.11) 0%, rgba(255, 255, 255, 0.02) 54%, transparent 76%);
    animation: float-slow-reverse 16s ease-in-out infinite;
}

.grid-fade {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 1), transparent 82%);
    opacity: 0.26;
}

.hero-copy-block {
    position: relative;
    width: min(760px, 100%);
    padding: 40px 0;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent-strong);
    text-transform: uppercase;
    letter-spacing: 0.24em;
    font-size: 0.72rem;
}

.hero h1,
.section-head h2,
.chart-head h3 {
    margin: 0;
    font-family: "Cormorant Garamond", serif;
    line-height: 0.92;
    letter-spacing: -0.04em;
}

.hero h1 {
    font-size: clamp(3.6rem, 11vw, 6.8rem);
    max-width: 11ch;
    text-wrap: balance;
}

.hero-copy {
    width: min(620px, 100%);
    margin: 18px 0 0;
    color: var(--muted-strong);
    font-size: clamp(1rem, 2.7vw, 1.14rem);
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.hero-meta,
.mini-stats,
.stats-grid {
    display: grid;
    gap: 14px;
}

.hero-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 34px;
}

.meta-card,
.mini-stat-card,
.stat-card,
.panel,
.xp-panel,
.task-card,
.empty-state,
.motivation-card,
.chart-shell,
.level-up-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.meta-card {
    min-height: 108px;
    padding: 18px;
    border-radius: var(--radius-md);
}

.meta-label,
.mini-stat-card span,
.stat-card span,
.task-meta,
.section-note,
.panel-footnote,
.chart-head p,
.chart-value,
.select-wrap span,
.field span,
.checkbox-note {
    color: var(--muted);
}

.meta-value {
    display: block;
    margin-top: 8px;
    font-size: 1.25rem;
    line-height: 1.4;
}

.xp-panel {
    margin-top: 22px;
    padding: 18px;
    border-radius: var(--radius-md);
}

.xp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.92rem;
}

.progress-track,
.mini-progress-track {
    position: relative;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.progress-track {
    height: 12px;
    margin-top: 14px;
}

.xp-rank-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 14px;
    color: var(--muted-strong);
    font-size: 0.86rem;
    line-height: 1.6;
}

.progress-fill,
.mini-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff8e63 0%, #ff5b1f 100%);
    box-shadow: 0 0 24px rgba(255, 91, 31, 0.32);
    width: 0;
    transition: width 320ms ease;
}

.panel {
    padding: 24px;
    border-radius: var(--radius-lg);
}

.app-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    gap: 18px;
    align-items: stretch;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.section-head h2 {
    font-size: clamp(2.2rem, 4vw, 3.2rem);
}

.task-form,
.field-grid {
    display: grid;
    gap: 16px;
}

.field-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 10px;
}

.field span,
.select-wrap span {
    font-size: 0.82rem;
}

.field input,
.field select,
.field textarea,
.select-wrap select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    padding: 14px 16px;
    outline: none;
    transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.select-wrap select:focus {
    border-color: rgba(255, 91, 31, 0.55);
    box-shadow: 0 0 0 4px rgba(255, 91, 31, 0.08);
    background: rgba(255, 255, 255, 0.045);
}

.field textarea {
    resize: vertical;
    min-height: 120px;
}

.field input::placeholder {
    color: rgba(208, 196, 186, 0.46);
}

.field.is-hidden {
    display: none;
}

.day-selector,
.day-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.day-toggle,
.day-tab {
    min-height: 44px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted-strong);
    padding: 0 16px;
}

.day-toggle.is-selected,
.day-tab.is-active,
.day-tab.is-today {
    border-color: rgba(255, 91, 31, 0.34);
    background: rgba(255, 91, 31, 0.14);
    color: #ffd9cc;
}

.day-toggle:hover,
.day-tab:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 91, 31, 0.3);
}

.panel-footnote {
    margin: 18px 0 0;
    line-height: 1.7;
    font-size: 0.88rem;
}

.insights-panel {
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.motivation-card {
    padding: 22px;
    border-radius: var(--radius-md);
}

.daily-line-card {
    margin-top: 18px;
    padding: 22px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(255, 91, 31, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 91, 31, 0.18);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.motivation-card p {
    margin: 14px 0 0;
    color: var(--text);
    line-height: 1.72;
}

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

.daily-line-date {
    color: var(--muted);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
}

.daily-line-text {
    margin: 16px 0 0;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.8;
}

.motivation-tag {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 91, 31, 0.1);
    border: 1px solid rgba(255, 91, 31, 0.2);
    color: #ffd8ca;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}

.mini-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 18px;
}

.mini-stat-card,
.stat-card {
    padding: 18px;
    border-radius: var(--radius-md);
}

.mini-stat-card strong,
.stat-card strong {
    display: block;
    margin-top: 8px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1;
}

.tasks-panel {
    margin-top: 18px;
}

.task-list {
    display: grid;
    gap: 22px;
    margin-top: 20px;
}

.task-category-group {
    display: grid;
    gap: 14px;
}

.task-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.task-category-head h3,
.table-head h3,
.logbook-card h3,
.modal-card h3 {
    margin: 0;
    font-family: "Cormorant Garamond", serif;
    line-height: 0.95;
    letter-spacing: -0.03em;
}

.task-category-head h3 {
    font-size: clamp(1.9rem, 3vw, 2.4rem);
}

.task-category-head p,
.table-head p,
.logbook-card-summary,
.modal-copy {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.task-category-stack {
    display: grid;
    gap: 14px;
}

.task-category-empty {
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--line-strong);
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
}

.task-card,
.empty-state {
    border-radius: var(--radius-md);
}

.task-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: flex-start;
    padding: 18px;
    position: relative;
    overflow: hidden;
}

.task-card.task-card-physique {
    box-shadow: inset 3px 0 0 rgba(137, 211, 107, 0.72), var(--shadow-lg);
}

.task-card.task-card-earnings {
    box-shadow: inset 3px 0 0 rgba(255, 200, 96, 0.78), var(--shadow-lg);
}

.task-card.task-card-intelligence {
    box-shadow: inset 3px 0 0 rgba(126, 200, 255, 0.74), var(--shadow-lg);
}

.task-card::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 91, 31, 0.34), transparent);
    opacity: 0;
    transition: opacity 180ms ease;
}

.task-card.is-complete {
    border-color: rgba(137, 211, 107, 0.24);
    background: linear-gradient(180deg, rgba(137, 211, 107, 0.07), rgba(255, 255, 255, 0.015));
}

.task-card.is-complete::after {
    opacity: 1;
}

.task-card.completion-flash {
    animation: completion-flash 720ms ease;
}

.task-main {
    display: flex;
    gap: 14px;
}

.task-copy {
    min-width: 0;
}

.task-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.task-title {
    margin: 0;
    font-size: 1.06rem;
    line-height: 1.45;
}

.task-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.task-tag {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid var(--line);
    color: var(--muted-strong);
    background: rgba(255, 255, 255, 0.03);
}

.task-tag.task-tag-accent {
    border-color: rgba(255, 91, 31, 0.24);
    background: rgba(255, 91, 31, 0.12);
    color: #ffd8ca;
}

.task-tag.task-tag-physique {
    border-color: rgba(137, 211, 107, 0.32);
    background: rgba(137, 211, 107, 0.12);
    color: #d9ffd5;
}

.task-tag.task-tag-earnings {
    border-color: rgba(255, 200, 96, 0.34);
    background: rgba(255, 200, 96, 0.14);
    color: #ffe8a8;
}

.task-tag.task-tag-intelligence {
    border-color: rgba(126, 200, 255, 0.32);
    background: rgba(126, 200, 255, 0.14);
    color: #d1ecff;
}

.task-meta {
    margin: 9px 0 0;
    line-height: 1.6;
    font-size: 0.92rem;
}

.task-progress {
    margin-top: 12px;
}

.task-progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.86rem;
}

.mini-progress-track {
    height: 8px;
}

.task-side {
    display: grid;
    justify-items: end;
    gap: 12px;
}

.task-status {
    text-align: right;
    font-size: 0.86rem;
    line-height: 1.5;
}

.task-status strong {
    display: block;
    color: var(--text);
}

.delete-button {
    min-width: 92px;
    color: #ffb0b0;
}

.delete-button:hover {
    border-color: rgba(255, 107, 107, 0.32);
    background: rgba(255, 107, 107, 0.08);
}

.checkbox-shell {
    position: relative;
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin-top: 4px;
}

.checkbox-shell input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    margin: 0;
}

.checkbox-mark {
    position: absolute;
    inset: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.checkbox-mark::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 8px;
    width: 6px;
    height: 11px;
    border-right: 2px solid transparent;
    border-bottom: 2px solid transparent;
    transform: rotate(45deg);
    transition: border-color 180ms ease;
}

.checkbox-shell input:focus-visible + .checkbox-mark {
    box-shadow: 0 0 0 4px rgba(255, 91, 31, 0.1);
}

.checkbox-shell input:checked + .checkbox-mark {
    background: rgba(137, 211, 107, 0.2);
    border-color: rgba(137, 211, 107, 0.4);
}

.checkbox-shell input:checked + .checkbox-mark::after {
    border-color: #ccffd5;
}

.checkbox-shell input:not(:disabled):hover + .checkbox-mark {
    transform: translateY(-1px);
    border-color: rgba(255, 91, 31, 0.36);
}

.checkbox-shell input:disabled + .checkbox-mark {
    opacity: 0.7;
    cursor: not-allowed;
}

.empty-state {
    padding: 28px;
    text-align: center;
}

.empty-state h3 {
    margin: 0;
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(2rem, 4vw, 2.7rem);
}

.empty-state p {
    width: min(520px, 100%);
    margin: 12px auto 0;
    color: var(--muted);
    line-height: 1.7;
}

.dashboard-panel {
    margin-top: 18px;
}

.stats-head {
    align-items: end;
}

.select-wrap {
    display: grid;
    gap: 10px;
    min-width: 170px;
}

.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 18px;
}

.category-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.category-summary-card {
    padding: 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018));
    box-shadow: var(--shadow-lg);
}

.category-summary-card span,
.category-summary-card p {
    color: var(--muted);
}

.category-summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1;
}

.category-summary-card p {
    margin: 10px 0 0;
    line-height: 1.6;
}

.chart-shell {
    margin-top: 22px;
    padding: 20px;
    border-radius: var(--radius-lg);
}

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

.chart-head h3 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.chart-head p {
    margin: 8px 0 0;
    line-height: 1.7;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--muted-strong);
    font-size: 0.86rem;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.legend-dot-tasks {
    background: linear-gradient(180deg, rgba(255, 177, 147, 0.95), rgba(255, 123, 78, 0.95));
}

.legend-dot-xp {
    background: linear-gradient(180deg, rgba(255, 91, 31, 0.95), rgba(181, 54, 8, 0.95));
}

.legend-dot-physique {
    background: linear-gradient(180deg, rgba(137, 211, 107, 0.98), rgba(80, 163, 52, 0.98));
}

.legend-dot-earnings {
    background: linear-gradient(180deg, rgba(255, 210, 99, 0.98), rgba(212, 147, 18, 0.98));
}

.legend-dot-intelligence {
    background: linear-gradient(180deg, rgba(126, 200, 255, 0.98), rgba(52, 125, 194, 0.98));
}

.chart-scroll {
    overflow-x: auto;
    padding-top: 16px;
}

.chart-bars {
    display: flex;
    align-items: end;
    gap: 14px;
    min-height: 280px;
    min-width: 100%;
    padding-bottom: 6px;
}

.chart-item {
    min-width: 64px;
    flex: 1 0 64px;
}

.chart-bar-pair {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 8px;
    height: 220px;
}

.chart-bar {
    width: 22px;
    min-height: 6px;
    border-radius: 999px 999px 6px 6px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.chart-bar.tasks {
    background: linear-gradient(180deg, rgba(255, 185, 161, 0.95), rgba(255, 118, 69, 0.95));
}

.chart-bar.xp {
    background: linear-gradient(180deg, rgba(255, 118, 69, 0.96), rgba(171, 50, 11, 0.96));
}

.chart-label {
    margin-top: 10px;
    text-align: center;
    color: var(--muted-strong);
    font-size: 0.82rem;
}

.chart-value {
    margin-top: 4px;
    text-align: center;
    font-size: 0.76rem;
}

.category-chart-shell {
    margin-top: 18px;
}

.category-line-chart {
    margin-top: 18px;
}

.line-chart-empty,
.logbook-empty {
    padding: 22px;
    border-radius: var(--radius-md);
    border: 1px dashed var(--line-strong);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.02);
}

.line-chart-wrap {
    display: grid;
    gap: 14px;
}

.line-chart-frame {
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)),
        linear-gradient(transparent 95%, rgba(255, 255, 255, 0.04) 100%);
}

.line-chart-svg {
    display: block;
    width: 100%;
    height: auto;
}

.line-chart-axis {
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 1;
}

.line-chart-grid {
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 1;
    stroke-dasharray: 4 6;
}

.line-chart-path {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.line-chart-point {
    stroke: rgba(5, 5, 5, 0.9);
    stroke-width: 2;
}

.line-chart-labels {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.line-chart-label {
    color: var(--muted-strong);
    font-size: 0.8rem;
    line-height: 1.5;
}

.table-shell {
    margin-top: 18px;
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012));
    box-shadow: var(--shadow-lg);
}

.table-wrap {
    overflow-x: auto;
    margin-top: 16px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.stats-table th,
.stats-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-table th {
    color: var(--muted-strong);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stats-table td {
    color: var(--text);
}

.stats-table td.table-focus {
    color: #ffd8ca;
}

.logbook-panel {
    margin-top: 18px;
}

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

.logbook-card {
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018));
    box-shadow: var(--shadow-lg);
}

.logbook-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.logbook-card-head strong {
    color: var(--text);
}

.logbook-task-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.logbook-task-item {
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
}

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

.logbook-task-head strong {
    color: var(--text);
}

.logbook-task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.logbook-task-copy {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.logbook-task-remark {
    margin-top: 10px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 91, 31, 0.08);
    border: 1px solid rgba(255, 91, 31, 0.12);
    color: var(--muted-strong);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 36;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 2, 3, 0.6);
    backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
}

.modal-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    width: min(520px, 100%);
    padding: 26px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 91, 31, 0.16);
    background: linear-gradient(180deg, rgba(17, 19, 24, 0.96), rgba(12, 13, 16, 0.98));
    box-shadow: var(--shadow-lg);
}

.modal-card h3 {
    font-size: clamp(2.1rem, 5vw, 2.9rem);
}

.modal-form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.modal-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(120%);
    min-width: min(460px, calc(100% - 32px));
    max-width: 92vw;
    padding: 16px 20px;
    border-radius: 18px;
    border: 1px solid rgba(255, 91, 31, 0.22);
    background: rgba(14, 15, 18, 0.92);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(16px);
    transition: transform 280ms ease, opacity 280ms ease;
    opacity: 0;
    z-index: 30;
}

.toast.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.level-up-banner {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 2, 3, 0.54);
    opacity: 0;
    pointer-events: none;
    transition: opacity 260ms ease;
    z-index: 35;
}

.level-up-banner.is-visible {
    opacity: 1;
}

.level-up-card {
    width: min(420px, 100%);
    padding: 28px;
    border-radius: var(--radius-lg);
    text-align: center;
    transform: translateY(16px) scale(0.96);
    transition: transform 260ms ease;
}

.level-up-banner.is-visible .level-up-card {
    transform: translateY(0) scale(1);
}

.level-up-card h3 {
    margin: 0;
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(2.2rem, 6vw, 3.2rem);
}

.reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes float-slow {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-16px) scale(1.02);
    }
}

@keyframes float-slow-reverse {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(18px) scale(1.03);
    }
}

@keyframes completion-flash {
    0% {
        transform: scale(1);
        box-shadow: var(--shadow-lg);
    }
    45% {
        transform: scale(1.01);
        box-shadow: 0 0 0 1px rgba(255, 91, 31, 0.08), 0 24px 60px rgba(255, 91, 31, 0.18);
    }
    100% {
        transform: scale(1);
        box-shadow: var(--shadow-lg);
    }
}

@media (max-width: 980px) {
    .topbar {
        position: static;
        margin-top: 14px;
        padding: 0;
        border-radius: 0;
    }

    .topbar.is-scrolled {
        background: transparent;
        border-color: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .app-grid,
    .stats-grid,
    .category-summary-grid,
    .hero-meta,
    .mini-stats {
        grid-template-columns: 1fr;
    }

    .field-grid {
        grid-template-columns: 1fr;
    }

    .task-card {
        grid-template-columns: 1fr;
    }

    .task-side {
        justify-items: start;
    }

    .task-status {
        text-align: left;
    }

    .section-head,
    .logbook-card-head,
    .chart-head {
        flex-direction: column;
    }
}

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

    .lock-card {
        padding: 22px;
    }

    .hero {
        min-height: auto;
        padding-top: 34px;
    }

    .hero h1 {
        max-width: 8ch;
    }

    .brand-copy {
        display: none;
    }

    .topbar-actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .panel {
        padding: 20px;
    }

    .stats-table {
        min-width: 560px;
    }

    .modal-card {
        padding: 22px;
    }

    .chart-bars {
        min-width: max-content;
    }

    .chart-item {
        min-width: 56px;
        flex-basis: 56px;
    }

    .chart-bar {
        width: 18px;
    }
}

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

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