.app-body {
    background: #eef4fa;
}

.app-shell {
    width: min(1320px, calc(100% - 24px));
    margin: 28px auto 72px;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    gap: 18px;
}

.app-sidebar {
    position: sticky;
    top: 92px;
    align-self: start;
    min-height: calc(100vh - 120px);
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 18px;
    color: #fff;
    background: var(--primary-900);
    border-radius: 8px;
}

.app-sidebar .brand-link {
    color: #fff;
    margin-bottom: 28px;
}

.app-nav {
    display: grid;
    gap: 6px;
}

.app-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.74);
    text-decoration: none;
    border-radius: 8px;
}

.app-nav a:hover,
.app-nav a.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.app-nav svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.app-main {
    min-width: 0;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.app-topbar h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    line-height: 1;
}

.app-topbar p {
    margin: 6px 0 0;
    color: var(--text-secondary);
}

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

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

.app-panel {
    padding: 22px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.app-panel h2,
.app-panel h3 {
    margin: 0 0 12px;
}

.app-panel p {
    color: var(--text-secondary);
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-tile {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.stat-tile strong {
    display: block;
    font-family: var(--font-mono);
    font-size: 2rem;
    line-height: 1;
}

.stat-tile span {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.focus-command {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
    gap: 18px;
    margin-bottom: 18px;
    padding: 22px;
    color: #fff;
    background: linear-gradient(135deg, #102f3f 0%, #17606e 54%, #2a7d68 100%);
    border-radius: 8px;
}

.focus-command h2 {
    max-width: 760px;
    margin: 6px 0 10px;
    font-size: clamp(1.45rem, 3vw, 2.35rem);
    line-height: 1.08;
}

.focus-command p {
    max-width: 820px;
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
}

.focus-command .section-kicker {
    color: rgba(255, 255, 255, 0.72);
}

.onboarding-flow {
    align-items: start;
}

.onboarding-fields {
    display: grid;
    gap: 12px;
}

.onboarding-fields label {
    display: grid;
    gap: 7px;
    color: #fff;
    font-weight: 800;
}

.onboarding-fields .field,
.onboarding-fields .select-field {
    color: var(--text-primary);
    background: #fff;
}

.focus-steps {
    display: grid;
    gap: 10px;
    align-content: center;
}

.focus-steps a,
.focus-steps span {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
}

.focus-steps strong {
    display: grid;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    place-items: center;
    color: #0e2935;
    background: #fff;
    border-radius: 50%;
    font-family: var(--font-mono);
    font-size: 0.86rem;
}

.quick-energy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
}

.quick-energy label {
    display: grid;
    gap: 6px;
    color: #fff;
    font-weight: 800;
}

.quick-energy .field {
    min-height: 42px;
    color: var(--text-primary);
    background: #fff;
}

.quick-energy .btn {
    min-height: 42px;
    white-space: nowrap;
}

.tomorrow-report {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.tomorrow-report h2 {
    margin: 6px 0 10px;
    font-size: clamp(1.35rem, 2.5vw, 2rem);
}

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

.tomorrow-actions div {
    min-height: 112px;
    padding: 14px;
    background: #f7fbfc;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.tomorrow-actions strong,
.tomorrow-actions span {
    display: block;
}

.tomorrow-actions strong {
    margin-bottom: 8px;
    color: var(--primary-900);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tomorrow-actions span {
    color: var(--text-secondary);
}

.risk-meter {
    display: grid;
    gap: 10px;
    align-content: start;
    padding: 16px;
    background: #f7fbfc;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.risk-meter > span {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.risk-meter strong {
    font-family: var(--font-mono);
    font-size: 2.4rem;
    line-height: 1;
}

.risk-meter i {
    display: block;
    height: 10px;
    overflow: hidden;
    background: #dde8ee;
    border-radius: 999px;
}

.risk-meter i::before {
    content: "";
    display: block;
    width: var(--risk, 0%);
    height: 100%;
    background: linear-gradient(90deg, #00c896, #f4bf45 55%, #ff6b6b);
    border-radius: inherit;
}

.risk-meter p {
    margin: 0;
    color: var(--text-secondary);
}

.timer-card {
    display: grid;
    gap: 22px;
    justify-items: center;
    text-align: center;
}

.timer-ring {
    width: min(280px, 72vw);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at center, #fff 0 57%, transparent 58%),
        conic-gradient(var(--primary-600) var(--progress, 0deg), rgba(79, 163, 209, 0.18) 0);
    border: 12px solid rgba(79, 163, 209, 0.22);
}

.timer-display {
    font-family: var(--font-mono);
    font-size: clamp(2.7rem, 8vw, 4.6rem);
    line-height: 1;
    letter-spacing: 0;
}

.timer-label {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.timer-actions,
.segmented,
.sound-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.icon-button {
    width: 48px;
    height: 48px;
    display: inline-grid;
    place-items: center;
    color: #fff;
    background: var(--primary-600);
    border: 0;
    border-radius: 8px;
}

.icon-button.secondary {
    color: var(--primary-600);
    background: #fff;
    border: 1px solid rgba(44, 79, 163, 0.22);
}

.segmented button {
    min-height: 40px;
    padding: 8px 12px;
    color: var(--text-secondary);
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.segmented button.is-active {
    color: #fff;
    background: var(--primary-600);
    border-color: var(--primary-600);
}

.segmented button:disabled {
    cursor: not-allowed;
    color: var(--text-muted);
    background: #edf2f7;
    opacity: 0.72;
}

.coach-phase {
    margin-bottom: 14px;
}

.coach-phase p {
    margin: 0;
}

.coach-review {
    margin: 20px 0;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
}

.coach-output {
    margin-top: 14px;
    min-height: auto;
}

.template-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.template-strip a {
    display: grid;
    gap: 8px;
    min-height: 88px;
    padding: 14px;
    color: var(--text-primary);
    text-decoration: none;
    background: #f7fbfc;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.template-strip a:hover {
    border-color: rgba(44, 79, 163, 0.32);
    transform: translateY(-1px);
}

.template-strip span {
    color: var(--text-muted);
}

.template-card .check-list {
    margin: 14px 0;
}

.energy-heatmap {
    display: grid;
    grid-template-columns: repeat(12, minmax(22px, 1fr));
    gap: 6px;
    margin-top: 18px;
}

.energy-cell {
    aspect-ratio: 1;
    border-radius: 5px;
    background: rgba(79, 163, 209, calc(0.08 + var(--level) * 0.1));
    border: 1px solid rgba(79, 163, 209, 0.14);
}

.energy-cell.high {
    background: rgba(0, 200, 150, 0.7);
}

.energy-cell.low {
    background: rgba(255, 107, 107, 0.22);
}

.line-chart {
    position: relative;
    height: 180px;
    margin-top: 20px;
    background:
        linear-gradient(to top, transparent 24%, rgba(226, 232, 240, 0.8) 25%, transparent 26%),
        linear-gradient(to top, transparent 49%, rgba(226, 232, 240, 0.8) 50%, transparent 51%),
        linear-gradient(to top, transparent 74%, rgba(226, 232, 240, 0.8) 75%, transparent 76%);
    border-bottom: 1px solid var(--border-light);
}

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

.task-list {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
}

.task-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.task-row input {
    width: 18px;
    height: 18px;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    color: var(--primary-900);
    background: rgba(79, 163, 209, 0.14);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 850;
}

.pill.success {
    background: var(--success-100);
}

.pill.warn {
    background: var(--accent-100);
}

.blocker-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.blocker-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.range-row {
    display: grid;
    gap: 8px;
    margin: 18px 0;
}

.range-row input {
    accent-color: var(--primary-600);
}

.focus-message {
    width: 100%;
    min-height: 72px;
    padding: 16px;
    color: var(--primary-900);
    background: var(--success-100);
    border: 1px solid rgba(0, 200, 150, 0.28);
    border-radius: 8px;
    text-align: left;
}

.energy-guide {
    background: linear-gradient(135deg, #102f3f 0%, #1c5268 52%, #4f7f62 100%);
}

.energy-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.energy-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.energy-legend i {
    width: 16px;
    height: 16px;
    background: rgba(79, 163, 209, 0.38);
    border-radius: 4px;
}

.energy-legend i.low {
    background: rgba(127, 144, 163, 0.28);
}

.energy-legend i.high {
    background: rgba(0, 200, 150, 0.52);
}

.energy-checkin {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border-light);
}

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

.sound-protocols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.sound-protocols article {
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.sound-protocols span,
.sound-tag {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 8px;
    padding: 5px 9px;
    color: var(--primary-900);
    background: var(--success-100);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sound-protocols strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.sound-protocols p {
    margin: 0;
    color: var(--text-secondary);
}

.sound-card {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.sound-card h3 {
    margin: 0 0 8px;
}

.sound-card p {
    min-height: 48px;
}

.sound-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 0;
}

.sound-meta span {
    padding: 6px 9px;
    color: var(--text-muted);
    background: #f5f8fb;
    border: 1px solid var(--border-light);
    border-radius: 999px;
    font-size: 0.82rem;
}

.sound-wave {
    height: 44px;
    margin: 14px 0;
    background:
        linear-gradient(90deg, rgba(79, 163, 209, 0.2) 0 8%, transparent 8% 13%),
        linear-gradient(90deg, rgba(44, 79, 163, 0.44) 0 4%, transparent 4% 9%);
    background-size: 34px 100%, 21px 100%;
    border-radius: 8px;
}

.article-page {
    background: #fff;
}

.article-layout {
    width: min(860px, calc(100% - 32px));
    margin: 0 auto;
    padding: 72px 0;
}

.article-layout h1 {
    margin: 12px 0 18px;
    font-size: clamp(2.4rem, 6vw, 5rem);
    line-height: 1.02;
}

.article-layout h2 {
    margin: 42px 0 12px;
}

.article-layout p,
.article-layout li {
    color: var(--text-secondary);
    font-size: 1.08rem;
}

.article-callout {
    margin: 32px 0;
    padding: 24px;
    color: var(--primary-900);
    background: var(--warm-100);
    border-left: 4px solid var(--accent-500);
    border-radius: 8px;
}

.editorial-article {
    background: #fff;
}

.article-hero {
    color: #fff;
    background:
        radial-gradient(circle at 22% 22%, rgba(79, 163, 209, 0.24), transparent 34%),
        linear-gradient(135deg, #12283a 0%, #1a3650 54%, #244583 100%);
}

.article-hero-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 72px 0;
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 42px;
    align-items: center;
}

.article-hero .section-kicker {
    color: rgba(255, 255, 255, 0.86);
}

.article-hero-copy h1 {
    margin: 16px 0 18px;
    font-size: clamp(2.9rem, 6vw, 5.8rem);
    line-height: 0.96;
}

.article-hero-copy p {
    width: min(560px, 100%);
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.16rem;
}

.article-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 26px;
}

.article-meta-row span {
    padding: 7px 10px;
    color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}

.article-hero-media {
    margin: 0;
}

.article-hero-media img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.26);
}

.article-body {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 72px 0 104px;
    display: grid;
    grid-template-columns: 250px minmax(0, 780px);
    gap: 64px;
    align-items: start;
}

.article-toc {
    position: sticky;
    top: 104px;
    display: grid;
    gap: 10px;
    padding: 18px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.article-toc strong {
    margin-bottom: 6px;
}

.article-toc a:not(.btn) {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 750;
}

.article-toc a:not(.btn):hover {
    color: var(--primary-600);
}

.article-toc .btn {
    margin-top: 10px;
}

.article-prose {
    min-width: 0;
}

.article-lead {
    margin: 0 0 30px;
    color: var(--text-primary);
    font-size: clamp(1.26rem, 2vw, 1.62rem);
    line-height: 1.46;
    font-weight: 680;
}

.article-prose h2 {
    margin: 54px 0 14px;
    font-size: clamp(1.9rem, 3vw, 3rem);
    line-height: 1.08;
}

.article-prose p,
.article-prose li {
    color: var(--text-secondary);
    font-size: 1.08rem;
}

.article-table-wrap {
    margin: 30px 0;
    overflow-x: auto;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    background: #fff;
}

.article-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

.article-table-wide {
    min-width: 1120px;
}

.article-table th,
.article-table td {
    padding: 15px 16px;
    border-bottom: 1px solid var(--border-light);
    text-align: left;
    vertical-align: top;
}

.article-table th {
    color: var(--primary-900);
    background: var(--bg-light);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.article-table td {
    color: var(--text-secondary);
    font-size: 0.98rem;
}

.article-table tbody tr:last-child td {
    border-bottom: 0;
}

.article-summary,
.article-method,
.article-warning-grid,
.article-insight-grid {
    display: grid;
    gap: 14px;
    margin: 34px 0;
}

.article-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.article-summary div,
.article-method div,
.article-warning-grid article,
.article-insight-card {
    padding: 20px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 8px;
}

.article-summary strong,
.article-method strong,
.article-warning-grid strong {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-900);
}

.article-summary p,
.article-method p,
.article-warning-grid p,
.article-insight-card p {
    margin: 0;
}

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

.article-insight-card span {
    display: block;
    margin-bottom: 10px;
    color: var(--primary-600);
    font-family: var(--font-mono);
    font-size: 1.7rem;
    font-weight: 850;
}

.article-warning-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.article-checklist {
    list-style: none;
    margin: 28px 0;
    padding: 0;
}

.article-checklist li {
    position: relative;
    padding: 14px 0 14px 34px;
    border-bottom: 1px solid var(--border-light);
}

.article-checklist li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 23px;
    width: 12px;
    height: 12px;
    background: var(--success-500);
    border-radius: 50%;
}

.article-quote {
    margin: 42px 0;
    padding: 28px;
    color: var(--primary-900);
    background: var(--warm-100);
    border-left: 4px solid var(--accent-500);
    border-radius: 8px;
}

.article-quote p {
    margin: 0;
    color: var(--primary-900);
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    line-height: 1.28;
    font-weight: 800;
}

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

.article-cta {
    margin-top: 64px;
    padding: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: #fff;
    background:
        linear-gradient(120deg, rgba(26, 54, 80, 0.98), rgba(44, 79, 163, 0.92)),
        url("../images/hero-features.png") center / cover no-repeat;
    border-radius: 8px;
}

.article-cta h2 {
    margin: 0 0 10px;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.article-cta p {
    max-width: 560px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 1040px) {
    .app-shell,
    .app-grid,
    .app-grid.three,
    .focus-command,
    .tomorrow-report,
    .sound-protocols,
    .template-strip {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: static;
        min-height: auto;
    }

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

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

    .article-hero-shell,
    .article-body {
        grid-template-columns: 1fr;
    }

    .article-body {
        gap: 34px;
    }

    .article-toc {
        position: static;
    }
}

@media (max-width: 680px) {
    .app-shell {
        width: min(100% - 20px, 1320px);
        margin-top: 16px;
    }

    .stat-row,
    .sound-grid,
    .tomorrow-actions {
        grid-template-columns: 1fr;
    }

    .focus-command {
        padding: 18px;
    }

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

    .app-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .energy-heatmap {
        grid-template-columns: repeat(6, minmax(22px, 1fr));
    }

    .article-hero-shell {
        width: min(100% - 24px, 1180px);
        padding: 48px 0;
    }

    .article-body {
        width: min(100% - 24px, 1180px);
        padding: 48px 0 74px;
    }

    .article-summary,
    .article-method,
    .article-warning-grid,
    .article-insight-grid {
        grid-template-columns: 1fr;
    }

    .article-cta {
        align-items: flex-start;
        flex-direction: column;
        padding: 26px;
    }
}

@media (max-width: 440px) {
    .app-nav {
        grid-template-columns: 1fr;
    }
}
