:root { color-scheme: light; --ink:#17211e; --muted:#62706b; --surface:#faf9f5; --paper:#fff; --line:#e8e9e2; --orange:#e86d42; --navy:#172923; }
* { box-sizing:border-box; }
body { margin:0; background:var(--surface); color:var(--ink); font-family:'Segoe UI',Inter,Arial,sans-serif; font-size:15px; line-height:1.5; }
h1,h2,h3,p { margin-top:0; }
h1,h2,h3,strong,.brand { letter-spacing:-.035em; }
a { color:inherit; text-decoration:none; }
a:hover { color:var(--orange); }
button,select { font:inherit; }
button:disabled { cursor:not-allowed; opacity:.6; }
a:focus-visible,button:focus-visible,select:focus-visible { outline:3px solid var(--orange); outline-offset:3px; }
.app-shell { display:flex; min-height:100vh; }
.sidebar { width:250px; flex:0 0 250px; background:var(--navy); color:#e7ece6; padding:34px 22px 26px; display:flex; flex-direction:column; position:sticky; top:0; height:100vh; }
.brand { display:flex; gap:12px; align-items:center; color:white; font-size:23px; font-weight:900; line-height:1; letter-spacing:-.06em; }
.brand:hover { color:white; }
.brand-mark { width:43px; height:43px; border:2px solid #f38e64; display:grid; place-items:center; color:#fff; font-size:27px; font-style:italic; }
.brand-dot,.accent { color:var(--orange); }
.nav-group { margin-top:74px; }
.nav-label,.eyebrow { font-size:11px; font-weight:800; letter-spacing:.16em; }
.nav-label { color:#94a49a; margin-left:14px; }
.side-links { display:grid; gap:7px; margin-top:19px; }
.side-links a { display:flex; align-items:center; gap:14px; border-radius:10px; padding:12px 14px; color:#b7c5ba; font-weight:600; }
.side-links a span { font-size:21px; width:22px; text-align:center; line-height:1; }
.side-links a.active,.side-links a:hover { background:#35483e; color:white; }
.sidebar-bottom { margin-top:auto; display:grid; gap:12px; font-size:13px; }
.sidebar-bottom a { color:#b9c9b9; padding:4px; }
.preview-note { background:#2b3d33; border-radius:12px; padding:17px; }
.preview-note strong { color:#f39469; font-size:10px; letter-spacing:.15em; }
.preview-note p { color:#c4d2c7; margin:8px 0 0; }
.workspace { width:calc(100% - 250px); min-width:0; }
.topbar { height:78px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; padding:0 clamp(24px,5vw,78px); gap:20px; }
.topbar .eyebrow { color:var(--muted); }
.topbar .eyebrow span { padding:0 7px; color:var(--orange); }
.topbar-right { display:inline-flex; gap:12px; align-items:center; color:var(--muted); font-size:13px; white-space:nowrap; }
.content { max-width:1350px; margin:auto; padding:45px clamp(24px,5vw,78px) 90px; }
.page-heading { display:flex; justify-content:space-between; align-items:center; gap:24px; margin:5px 0 36px; }
.page-heading h1 { font-size:clamp(30px,3vw,40px); line-height:1.15; font-weight:750; margin:0 0 8px; letter-spacing:-.04em; }
.page-heading p { color:var(--muted); font-size:15px; margin-bottom:0; }
.button { display:inline-flex; justify-content:center; align-items:center; gap:18px; border-radius:8px; border:1px solid transparent; min-height:44px; padding:11px 20px; font-weight:750; cursor:pointer; white-space:nowrap; }
.button.primary { background:var(--orange); color:white; }
.button.primary:hover { background:#ce5631; color:white; }
.button.outline { background:transparent; border-color:#d3d9d2; color:var(--ink); }
.button.outline:hover { border-color:var(--orange); color:var(--orange); }
.button.danger { background:#fff0ed; color:#a1382d; border-color:#ecb4aa; }
.button.wide { width:100%; justify-content:space-between; }
.section-title { display:flex; justify-content:space-between; align-items:end; gap:12px; margin:32px 0 18px; }
.section-title h2,.panel-header h2 { font-size:24px; line-height:1.2; margin:6px 0 0; }
.section-title a { font-size:13px; font-weight:750; color:var(--orange); }
.stats-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; }
.stat-card,.state-card { background:var(--paper); border:1px solid var(--line); border-radius:13px; padding:24px; }
.stat-card > span { font-size:10px; font-weight:800; letter-spacing:.12em; color:var(--muted); }
.stat-card strong { display:block; font-size:32px; margin:12px 0 0; line-height:1.1; }
.stat-card em { font-size:17px; color:var(--muted); font-style:normal; }
.muted { color:var(--muted); font-size:13px; }
.session-list,.panel { background:var(--paper); border:1px solid var(--line); border-radius:13px; overflow:hidden; }
.session-row,.history-row,.exercise-row { border-bottom:1px solid var(--line); display:flex; align-items:center; gap:16px; padding:17px 22px; }
.session-row:last-child,.history-row:last-child,.exercise-row:last-child { border-bottom:0; }
.session-row:hover,.history-detail:hover,.exercise-row:hover { background:#faf9f5; color:var(--ink); }
.session-icon { width:43px; height:43px; flex:0 0 43px; background:#e8eee7; border-radius:10px; color:#415847; display:grid; place-items:center; font-weight:800; }
.session-info { display:grid; gap:2px; flex:1; min-width:0; }
.session-info strong { font-size:15px; }
.session-info small { color:var(--muted); font-size:13px; }
.session-row time { font-size:13px; color:var(--muted); }
.history-row { padding:0 18px 0 0; }
.history-detail { display:flex; flex:1; align-items:center; min-width:0; padding:17px 0 17px 22px; gap:16px; }
.clone-link { font-size:13px; color:var(--orange); font-weight:800; border:1px solid #f0c4b4; padding:8px 12px; border-radius:7px; white-space:nowrap; }
.history-arrow { color:var(--muted); }
.footnote { color:var(--muted); font-size:12px; margin:16px 0; }
.entry-screen { max-width:540px; margin:45px auto; }
.intro-card { background:var(--paper); border:1px solid var(--line); padding:clamp(26px,4vw,50px); border-radius:16px; }
.intro-card h1 { font-size:clamp(32px,4vw,42px); margin-bottom:18px; }
.intro-card p { color:var(--muted); }
.notice { background:#f3f5ef; border-left:3px solid #9cad95; padding:13px 15px; font-size:13px; color:#47574c; border-radius:3px; margin:24px 0; }
.back-link { display:inline-block; font-size:13px; color:var(--muted); margin:0 0 16px; }
.intro-card .back-link { margin:20px 0 0; }
.pill { background:#eaf0e9; color:#43604c; border-radius:50px; padding:7px 12px; font-size:11px; font-weight:800; white-space:nowrap; }
.outline-pill { background:transparent; border:1px solid #e6ddd0; color:#8d744d; }
.panel-header { padding:24px; display:flex; justify-content:space-between; align-items:center; gap:15px; border-bottom:1px solid var(--line); }
.panel-footer { padding:22px; border-top:1px solid var(--line); display:flex; flex-wrap:wrap; gap:12px; }
.exercise-summary { padding:18px 24px; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; gap:15px; align-items:center; }
.exercise-summary:last-child { border-bottom:0; }
.exercise-summary div { display:grid; }
.exercise-summary small,.exercise-summary > span { color:var(--muted); font-size:13px; }
.empty-preview { text-align:center; padding:45px 22px; }
.empty-preview p { color:var(--muted); }
.set-header,.set-row { display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; align-items:center; padding:12px 24px; }
.set-header { color:var(--muted); font-size:11px; letter-spacing:.15em; font-weight:800; }
.set-row { border-top:1px solid var(--line); }
.set-index { font-weight:800; color:var(--muted); }
.sample-value { background:var(--surface); border:1px solid var(--line); border-radius:7px; padding:9px 14px; }
.chart-panel { padding-bottom:12px; }
.filter-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; padding:24px; }
.filter-grid label { font-size:10px; font-weight:800; color:var(--muted); letter-spacing:.12em; }
select { display:block; width:100%; margin-top:8px; background:var(--paper); color:var(--ink); border:1px solid #d5dad3; border-radius:7px; padding:10px 12px; font-size:14px; font-weight:600; letter-spacing:0; min-height:43px; }
.chart-summary { padding:12px 25px 22px; display:grid; gap:4px; }
.chart-summary strong { font-size:38px; }
.chart-summary small { font-size:16px; color:var(--muted); }
.line-chart-container { padding:0 24px; overflow-x:auto; }
.line-chart { display:block; width:100%; min-width:480px; height:auto; }
.chart-grid { stroke:var(--line); stroke-width:1; }
.chart-axis { stroke:var(--muted); stroke-width:1.5; }
.chart-line { fill:none; stroke:var(--orange); stroke-width:3; stroke-linejoin:round; stroke-linecap:round; }
.chart-point { fill:var(--paper); stroke:var(--orange); stroke-width:3; }
.chart-tick,.chart-label { fill:var(--muted); font-size:12px; font-family:inherit; }
.chart-label { font-weight:700; }
.chart-panel .footnote { padding:0 25px; }
.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; align-items:start; }
.setting-row { padding:20px 24px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; gap:16px; }
.setting-row > div { flex:1; }
.setting-row strong,.setting-row small { display:block; }
.setting-row small { color:var(--muted); font-size:13px; margin-top:4px; }
.setting-row select { width:140px; flex:0 0 140px; }
.setting-row .button { font-size:12px; white-space:normal; text-align:center; }
.settings-panel .footnote { padding:0 24px 10px; }
.confirmation { position:fixed; inset:0; z-index:20; background:#0c1712ac; display:grid; place-items:center; padding:20px; }
.confirmation-card { background:var(--paper); border-radius:14px; padding:34px; max-width:480px; width:100%; box-shadow:0 20px 70px #0004; }
.confirmation-card h2 { font-size:29px; margin-top:14px; }
.confirmation-card p { color:var(--muted); }
.confirmation-actions { display:flex; justify-content:flex-end; gap:12px; flex-wrap:wrap; }
.state-card h2 { font-size:23px; margin:16px 0 8px; }
.state-card p { color:var(--muted); }
.state-card a { color:var(--orange); font-weight:700; }
.state-strip { margin-top:20px; padding:24px; }
.error-notice { background:#fff0ed; border-left:3px solid #bc463d; padding:13px 15px; color:#8b3731; font-size:13px; }
.mobile-nav { display:none; }
@media (max-width:1050px) {
    .sidebar { width:205px; flex-basis:205px; }
    .workspace { width:calc(100% - 205px); }
    .settings-grid { grid-template-columns:1fr; }
}
@media (max-width:750px) {
    .sidebar { display:none; }
    .workspace { width:100%; }
    .topbar { height:58px; padding:0 20px; }
    .topbar .eyebrow { font-size:9px; }
    .topbar-right { font-size:0; }
    .content { padding:30px 20px 102px; }
    .page-heading { align-items:start; flex-direction:column; gap:16px; }
    .page-heading h1 { font-size:32px; }
    .stats-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .stats-grid > :last-child { grid-column:1 / -1; }
    .entry-screen { margin:12px auto; }
    .mobile-nav { position:fixed; bottom:0; left:0; right:0; display:flex; justify-content:space-around; background:var(--paper); border-top:1px solid var(--line); z-index:10; padding:9px 4px max(9px,env(safe-area-inset-bottom)); }
    .mobile-nav a { font-size:12px; font-weight:700; color:var(--muted); padding:9px 5px; }
    .mobile-nav a.active { color:var(--orange); }
}
@media (max-width:520px) {
    .stats-grid,.filter-grid { grid-template-columns:1fr; }
    .stats-grid > :last-child { grid-column:auto; }
    .section-title h2 { font-size:21px; }
    .session-row time,.history-arrow,.exercise-row .pill { display:none; }
    .setting-row { align-items:stretch; flex-direction:column; }
    .setting-row select { width:100%; flex:auto; }
    .clone-link span { display:none; }
}
@media (prefers-color-scheme:dark) {
    :root { color-scheme:dark; --surface:#121b17; --paper:#1c2922; --ink:#e8eee7; --muted:#aab9ad; --line:#35433a; }
    .session-row:hover,.history-detail:hover,.exercise-row:hover { background:#25372a; }
    .notice,.pill,.session-icon,.sample-value { background:#2c4030; color:#d1e4d1; }
    .button.outline,select { border-color:#526256; }
    .button.danger,.error-notice { background:#4a2d2c; color:#ffd5c8; }
    .intro-card { box-shadow:none; }
}
