/* =========================================================
   BloomOS — design tokens
   Light is the default theme; [data-theme="dark"] swaps tokens.
   Font sizes are in rem so the in-app "Text size" setting
   (and the browser's own font size) scale the whole UI.
   ========================================================= */

:root {
    /* surfaces */
    --bg: #f5f3fb;
    --ambient:
        radial-gradient(ellipse at 56% 6%, rgba(167, 139, 250, .26), transparent 45%),
        radial-gradient(ellipse at 92% 70%, rgba(94, 234, 212, .2), transparent 40%),
        radial-gradient(ellipse at 4% 96%, rgba(244, 114, 182, .14), transparent 38%),
        linear-gradient(160deg, #fbfaff, #f3f1fb 60%, #f1f4fc);
    --surface: rgba(255, 255, 255, .86);
    --surface-raised: #ffffff;
    --surface-sunken: #f4f2fb;
    --surface-overlay: rgba(255, 255, 255, .97);
    --surface-solid: #ffffff;
    --glass: rgba(255, 255, 255, .78);
    --dock: rgba(255, 255, 255, .96);
    --track: #e7e4f4;

    /* lines & ink */
    --line: rgba(76, 64, 140, .12);
    --line-strong: rgba(76, 64, 140, .24);
    --text: #1c1838;
    --muted: #55536f;
    --faint: #6b6988;
    --eyebrow: #0d7f86;

    /* status inks (text-safe on the surfaces above) */
    --green: #0b8a5c;
    --amber: #a85f00;
    --red: #c4264a;
    --cyan: #0077a8;

    /* shadows */
    --shadow: 0 1px 2px rgba(30, 20, 80, .05), 0 20px 50px rgba(60, 40, 140, .1);
    --shadow-card: 0 1px 2px rgba(30, 20, 80, .04), 0 8px 24px rgba(60, 40, 140, .06);
    --shadow-soft: 0 12px 32px rgba(60, 40, 140, .12);

    /* garden scene — dawn */
    --scene-bg: linear-gradient(180deg, #e8e4ff 0%, #fbe9f4 52%, #e2f2ff 100%);
    --scene-glow: radial-gradient(ellipse at 50% 50%, rgba(var(--accent-rgb), .16), transparent 45%);
    --sun-bg: radial-gradient(circle at 40% 40%, #fffbe6, #ffd98a 48%, rgba(255, 168, 110, .25) 72%);
    --sun-shadow: 0 0 80px rgba(255, 190, 110, .55);
    --mtn-1: rgba(124, 108, 220, .16);
    --mtn-2: rgba(110, 96, 210, .22);
    --mtn-3: rgba(150, 120, 230, .2);
    --water-bg: radial-gradient(ellipse at 50% 24%, rgba(170, 200, 255, .75), rgba(130, 165, 245, .55) 45%, rgba(110, 140, 230, .45) 78%);
    --water-edge: rgba(90, 130, 255, .5);
    --ring: rgba(80, 120, 240, .45);
    --island-bg: linear-gradient(180deg, #d8deff, #aab6f2);
    --island-edge: rgba(90, 120, 240, .5);
    --island-inner: linear-gradient(90deg, #c7b6ff, #a8e3f0, #e2b6f5);
    --node-bg: rgba(255, 255, 255, .88);
    --stars: 0;
    --soil: #e8e4f8;

    /* accent (violet default) */
    --accent: #7c4dff;
    --accent-2: #e04fd6;
    --accent-3: #12a8d8;
    --accent-rgb: 124, 77, 255;
    --accent-ink: color-mix(in srgb, var(--accent) 72%, #000);
    --on-accent: #ffffff;

    --radius: 22px;
    --sidebar-expanded: 260px;
    --sidebar-collapsed: 78px;
    --ease-out: cubic-bezier(.22, 1, .36, 1);

    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #050a18;
    --ambient:
        radial-gradient(ellipse at 56% 20%, rgba(54, 58, 145, .42), transparent 38%),
        radial-gradient(ellipse at 82% 68%, rgba(0, 105, 148, .2), transparent 38%),
        radial-gradient(ellipse at 10% 90%, rgba(var(--accent-rgb), .12), transparent 35%),
        linear-gradient(130deg, #050918, #071127 55%, #040817);
    --surface: rgba(13, 23, 52, .82);
    --surface-raised: rgba(17, 28, 62, .86);
    --surface-sunken: rgba(10, 18, 42, .75);
    --surface-overlay: rgba(9, 16, 38, .97);
    --surface-solid: #0f1a3a;
    --glass: rgba(7, 13, 31, .88);
    --dock: rgba(5, 10, 25, .96);
    --track: #1e2a54;

    --line: rgba(151, 174, 255, .16);
    --line-strong: rgba(151, 174, 255, .3);
    --text: #f4f6ff;
    --muted: #b0bcdf;
    --faint: #8a98c2;
    --eyebrow: #83e9e2;

    --green: #54f0b0;
    --amber: #ffc163;
    --red: #ff7b98;
    --cyan: #4bdcff;

    --shadow: 0 24px 70px rgba(0, 0, 0, .34), 0 0 0 1px rgba(255, 255, 255, .02);
    --shadow-card: 0 12px 30px rgba(0, 0, 0, .16);
    --shadow-soft: 0 12px 40px rgba(0, 0, 0, .28);

    --scene-bg: linear-gradient(180deg, rgba(15, 25, 60, .8), rgba(4, 12, 30, .92));
    --scene-glow: radial-gradient(ellipse at 50% 50%, rgba(var(--accent-rgb), .26), transparent 45%), radial-gradient(ellipse at 50% 88%, rgba(20, 183, 225, .24), transparent 55%);
    --sun-bg: radial-gradient(circle at 35% 35%, #fff4ff, #b7aaff 45%, rgba(112, 105, 255, .2) 70%);
    --sun-shadow: 0 0 75px rgba(158, 128, 255, .42);
    --mtn-1: rgba(31, 47, 99, .65);
    --mtn-2: rgba(28, 40, 84, .8);
    --mtn-3: rgba(40, 43, 102, .66);
    --water-bg: radial-gradient(ellipse at 50% 24%, rgba(61, 103, 218, .45), rgba(13, 44, 90, .75) 45%, rgba(3, 13, 33, .98) 78%);
    --water-edge: rgba(105, 205, 255, .52);
    --ring: rgba(99, 217, 255, .6);
    --island-bg: linear-gradient(180deg, #263c70, #07172d);
    --island-edge: rgba(103, 222, 255, .7);
    --island-inner: linear-gradient(90deg, #3b276d, #123d55, #6b3c90);
    --node-bg: rgba(8, 18, 43, .84);
    --stars: 1;
    --soil: #0b1a36;

    --accent: #9c63ff;
    --accent-2: #ed5ce8;
    --accent-3: #4bdcff;
    --accent-rgb: 156, 99, 255;
    --accent-ink: color-mix(in srgb, var(--accent) 50%, #fff);

    color-scheme: dark;
}

html[data-accent="ocean"]   { --accent: #2f6fe0; --accent-2: #12a8d8; --accent-3: #0fae84; --accent-rgb: 47, 111, 224; }
html[data-accent="rose"]    { --accent: #d93a6c; --accent-2: #f07a3a; --accent-3: #c94ad6; --accent-rgb: 217, 58, 108; }
html[data-accent="emerald"] { --accent: #0f9a6c; --accent-2: #12a8d8; --accent-3: #6bbf2a; --accent-rgb: 15, 154, 108; }
html[data-theme="dark"][data-accent="ocean"]   { --accent: #3b8cff; --accent-2: #4bdcff; --accent-3: #54f0b0; --accent-rgb: 59, 140, 255; }
html[data-theme="dark"][data-accent="rose"]    { --accent: #ff5c8a; --accent-2: #ffa05c; --accent-3: #ed5ce8; --accent-rgb: 255, 92, 138; }
html[data-theme="dark"][data-accent="emerald"] { --accent: #22c993; --accent-2: #4bdcff; --accent-3: #a3f06b; --accent-rgb: 34, 201, 147; }

html[data-text="large"]  { font-size: 112.5%; }
html[data-text="larger"] { font-size: 125%; }

/* =========================================================
   BASE
   ========================================================= */

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

html {
    scroll-behavior: smooth;
    scrollbar-color: rgba(var(--accent-rgb), .45) transparent;
    scrollbar-width: thin;
}

body {
    margin: 0;
    min-height: 100dvh;
    overflow-x: clip;
    background: var(--bg);
    color: var(--text);
    font: .9375rem/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    transition: background-color .4s, color .4s;
}

button, input, textarea, select { font: inherit; color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
img, svg, canvas { max-width: 100%; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

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

.skip-link {
    position: fixed; top: 10px; left: 10px; z-index: 100;
    padding: 10px 16px; border-radius: 12px;
    background: var(--accent); color: var(--on-accent); text-decoration: none; font-weight: 700;
    transform: translateY(-150%); transition: transform .2s;
}
.skip-link:focus { transform: none; }

/* =========================================================
   AMBIENT BACKGROUND
   ========================================================= */

.ambient { position: fixed; inset: 0; z-index: -3; pointer-events: none; background: var(--ambient); }
#water { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none; opacity: .72; }

/* =========================================================
   LAYOUT
   ========================================================= */

.layout {
    --sidebar-width: var(--sidebar-expanded);
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100dvh;
    align-items: start;
    transition: grid-template-columns .48s var(--ease-out);
}
.layout.sidebar-is-collapsed { --sidebar-width: var(--sidebar-collapsed); }

main {
    min-width: 0; width: 100%; max-width: 1500px;
    margin: 0 auto;
    padding: 22px clamp(16px, 3vw, 42px) 42px;
}

.page-enter > * { animation: rise .55s var(--ease-out) both; }
.page-enter > *:nth-child(2) { animation-delay: .04s; }
.page-enter > *:nth-child(3) { animation-delay: .08s; }
.page-enter > *:nth-child(4) { animation-delay: .12s; }
.page-enter > *:nth-child(5) { animation-delay: .16s; }
.page-enter > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    position: sticky; top: 0;
    width: 100%; height: 100dvh;
    display: flex; flex-direction: column;
    padding: 22px 14px 16px;
    overflow-x: hidden; overflow-y: auto;
    white-space: nowrap;
    border-right: 1px solid var(--line);
    background: radial-gradient(ellipse at 0% 0%, rgba(var(--accent-rgb), .1), transparent 48%), var(--glass);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
    backdrop-filter: blur(24px) saturate(145%);
    z-index: 10;
    scrollbar-width: thin;
    transition: padding .42s var(--ease-out);
}
.sidebar.collapsed { padding: 22px 10px 16px; }

.sidebar-toggle {
    position: absolute; top: 30px; right: 10px;
    width: 28px; height: 28px;
    display: grid; place-items: center; padding: 0;
    border: 0; border-radius: 10px;
    background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000));
    color: var(--on-accent); font-size: .6875rem; z-index: 12;
    box-shadow: 0 4px 14px rgba(var(--accent-rgb), .3);
    transition: transform .3s var(--ease-out), filter .3s;
}
.sidebar-toggle:hover { transform: scale(1.06); filter: brightness(1.1); }
.sidebar-toggle i { transition: transform .4s var(--ease-out); }
.sidebar.collapsed .sidebar-toggle { position: static; margin: 0 auto 14px; }
.sidebar.collapsed .sidebar-toggle i { transform: rotate(180deg); }

.brand {
    min-height: 44px;
    display: flex; align-items: center; gap: 11px;
    padding: 0 35px 26px 8px;
    text-decoration: none;
}
.brand-mark {
    width: 42px; height: 42px; flex: 0 0 42px;
    display: grid; place-items: center;
    border-radius: 15px;
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    color: var(--on-accent); font-size: 1.15rem;
    box-shadow: 0 6px 18px rgba(var(--accent-rgb), .3);
    transition: transform .35s var(--ease-out);
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.brand-copy strong { display: block; font-size: 1rem; letter-spacing: -.2px; }
.brand-copy small { display: block; color: var(--faint); font-size: .6875rem; }

.nav-label { padding: 8px 13px 10px; color: var(--faint); font-size: .625rem; font-weight: 800; letter-spacing: 1.7px; }

.nav { display: grid; gap: 4px; }
.nav a {
    position: relative;
    display: flex; align-items: center; gap: 13px;
    min-height: 44px; padding: 10px 13px;
    border: 1px solid transparent; border-radius: 14px;
    color: var(--muted); text-decoration: none; font-size: .875rem; font-weight: 500;
    transition: color .25s, background-color .25s, border-color .25s, transform .25s var(--ease-out);
}
.nav a:hover { color: var(--text); background: rgba(var(--accent-rgb), .07); transform: translateX(2px); }
.nav a.active {
    color: var(--text); font-weight: 600;
    background: linear-gradient(100deg, rgba(var(--accent-rgb), .16), rgba(var(--accent-rgb), .04));
    border-color: rgba(var(--accent-rgb), .22);
    box-shadow: inset 3px 0 var(--accent);
}
.nav .ico { width: 21px; flex: 0 0 21px; display: inline-grid; place-items: center; font-size: 1rem; transition: transform .3s var(--ease-out), color .25s; }
.nav a:hover .ico, .nav a.active .ico { color: var(--accent-ink); }
.nav a:hover .ico { transform: scale(1.12); }
.nav .count {
    margin-left: auto; min-width: 22px; padding: 1px 7px;
    border-radius: 99px; background: rgba(var(--accent-rgb), .14);
    color: var(--accent-ink); font-size: .6875rem; font-weight: 700; text-align: center;
}

.sidebar-bottom { margin-top: auto; padding-top: 20px; white-space: normal; display: grid; gap: 10px; }
.daily-note {
    padding: 16px 15px;
    border: 1px solid var(--line); border-radius: 17px;
    background: linear-gradient(145deg, rgba(var(--accent-rgb), .1), transparent);
}
.daily-note strong { display: flex; align-items: center; gap: 8px; font-size: .8125rem; }
.daily-note strong i { color: var(--amber); }
.daily-note p { margin: 6px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.side-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 13px; border-radius: 12px;
    color: var(--faint); font-size: .8125rem; text-decoration: none;
}
.side-link:hover, .side-link.active { color: var(--text); background: rgba(var(--accent-rgb), .07); }

.sidebar.collapsed .brand { justify-content: center; padding: 0 0 22px; }
.sidebar.collapsed .brand-copy,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav .count,
.sidebar.collapsed .sidebar-bottom { display: none; }
.sidebar.collapsed .nav a { justify-content: center; padding-inline: 0; }
.sidebar.collapsed .nav a:hover { transform: none; }
.sidebar.collapsed .nav .ico { font-size: 1.125rem; }

/* =========================================================
   TOPBAR
   ========================================================= */

.topbar { position: relative; z-index: 20; display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }

.search { position: relative; flex: 1; max-width: 540px; }
.search > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: .875rem; pointer-events: none; }
.search input {
    width: 100%;
    border: 1px solid var(--line); background: var(--surface-raised);
    border-radius: 16px; padding: 12px 54px 12px 43px;
    outline: none; box-shadow: var(--shadow-card);
    transition: border-color .25s, box-shadow .25s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { border-color: rgba(var(--accent-rgb), .6); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .12); }
.search kbd {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    padding: 2px 7px; border-radius: 7px;
    border: 1px solid var(--line-strong); color: var(--faint);
    font: 600 .6875rem/1.6 inherit; pointer-events: none;
}
.search input::-webkit-search-cancel-button { display: none; }

.search-results {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    max-height: 380px; overflow-y: auto;
    padding: 6px; margin: 0; list-style: none;
    border: 1px solid var(--line-strong); border-radius: 16px;
    background: var(--surface-overlay);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
}
.search-results li a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; text-decoration: none; }
.search-results li a .ri { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(var(--accent-rgb), .14); color: var(--accent-ink); font-size: .875rem; }
.search-results li a small { display: block; color: var(--faint); font-size: .75rem; }
.search-results li a[aria-selected="true"], .search-results li a:hover { background: rgba(var(--accent-rgb), .12); }
.search-results .empty { padding: 14px; color: var(--muted); font-size: .8125rem; }

.top-spacer { flex: 1; }

.icon-btn {
    position: relative; flex: none;
    width: 44px; height: 44px; display: grid; place-items: center;
    border-radius: 15px; border: 1px solid var(--line);
    background: var(--surface-raised); color: var(--text); font-size: 1rem;
    box-shadow: var(--shadow-card);
    transition: border-color .2s, background .2s, transform .2s;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { border-color: rgba(var(--accent-rgb), .55); background: rgba(var(--accent-rgb), .1); }
.icon-btn:active { transform: scale(.95); }
.theme-btn i { transition: transform .5s var(--ease-out); }
.theme-btn:hover i { transform: rotate(25deg); }
.dot { position: absolute; right: 9px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: #ff4f93; box-shadow: 0 0 0 2px var(--surface-raised); }

.profile {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid var(--line); background: var(--surface-raised);
    padding: 5px 12px 5px 5px; border-radius: 17px;
    box-shadow: var(--shadow-card);
    transition: border-color .2s;
}
.profile:hover, .profile[aria-expanded="true"] { border-color: rgba(var(--accent-rgb), .55); }
.avatar {
    width: 34px; height: 34px; flex: none; border-radius: 12px;
    background: linear-gradient(135deg, var(--c1, var(--accent)), var(--c2, var(--accent-3)));
    display: grid; place-items: center;
    font-weight: 800; color: #fff; font-size: .875rem;
}
.profile-copy { text-align: left; }
.profile-copy strong { display: block; font-size: .8125rem; line-height: 1.2; }
.profile-copy small { display: block; color: var(--muted); font-size: .6875rem; }
.profile > i { color: var(--faint); font-size: .6875rem; margin-left: 4px; }

.menu-wrap { position: relative; }
.popover {
    position: absolute; right: 0; top: calc(100% + 10px);
    width: min(340px, calc(100vw - 32px)); padding: 8px;
    border: 1px solid var(--line-strong); border-radius: 18px;
    background: var(--surface-overlay);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    animation: pop .2s var(--ease-out);
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.popover-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 10px; font-weight: 700; font-size: .875rem; }
.popover-head button { border: 0; background: none; color: var(--accent-ink); font-size: .75rem; font-weight: 600; }
.notif { display: flex; gap: 12px; padding: 10px; border-radius: 12px; font-size: .8125rem; }
.notif.unread { background: rgba(var(--accent-rgb), .08); }
.notif .ni { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface-sunken); color: var(--accent-ink); }
.notif p { margin: 0; color: var(--muted); line-height: 1.45; }
.notif time { display: block; color: var(--faint); font-size: .6875rem; margin-top: 3px; }
.menu-item {
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 10px 12px; border: 0; border-radius: 11px;
    background: none; text-align: left; text-decoration: none; font-size: .875rem;
}
.menu-item i { width: 18px; color: var(--faint); }
.menu-item:hover { background: rgba(var(--accent-rgb), .1); }
.menu-sep { height: 1px; margin: 6px 4px; background: var(--line); }

/* =========================================================
   TYPOGRAPHY & PAGE HEADS
   ========================================================= */

.page-head, .welcome { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 18px; margin-bottom: 24px; }
.eyebrow { color: var(--eyebrow); font-size: .6875rem; text-transform: uppercase; letter-spacing: 2px; font-weight: 800; }
h1 { font-size: clamp(1.75rem, 3.2vw, 2.5rem); letter-spacing: -1.4px; line-height: 1.12; margin: 7px 0 9px; }
h1 .name, .grad-text {
    background: linear-gradient(90deg, var(--accent), var(--accent-2) 60%, var(--accent-3));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[data-theme="dark"] h1 .name, html[data-theme="dark"] .grad-text {
    background-image: linear-gradient(90deg, #fff, color-mix(in srgb, var(--accent) 45%, #fff) 54%, var(--accent-3));
}
.subtitle { margin: 0; color: var(--muted); font-size: .9375rem; max-width: 62ch; }
h2 { font-size: 1.0625rem; margin: 0; letter-spacing: -.3px; }
h3 { font-size: 1rem; margin: 0; letter-spacing: -.2px; }

/* daily goal widget (home) */
.daily-goal {
    display: flex; align-items: center; gap: 14px;
    padding: 10px 16px 10px 10px;
    border: 1px solid var(--line); border-radius: 18px;
    background: var(--surface-raised); box-shadow: var(--shadow-card);
}
.daily-goal .ring { width: 48px; height: 48px; }
.daily-goal strong { display: block; font-size: .875rem; }
.daily-goal small { display: block; color: var(--muted); font-size: .75rem; }
.daily-goal.met { border-color: color-mix(in srgb, var(--green) 40%, transparent); }

.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); animation: pulse 1.8s infinite; display: inline-block; }
@keyframes pulse { 50% { opacity: .4; } }

/* =========================================================
   BUTTONS & FORMS
   ========================================================= */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 10px 18px;
    border: 1px solid var(--line-strong); border-radius: 13px;
    background: var(--surface-raised); color: var(--text);
    font-size: .875rem; font-weight: 600; text-decoration: none; white-space: nowrap;
    transition: transform .2s var(--ease-out), filter .2s, background .2s, border-color .2s;
}
.btn:hover { border-color: rgba(var(--accent-rgb), .55); background: rgba(var(--accent-rgb), .08); }
.btn:active { transform: scale(.97); }
.btn-primary {
    border: 0; color: var(--on-accent);
    background: linear-gradient(100deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--accent-2)) 60%, var(--accent-2));
    box-shadow: 0 8px 20px rgba(var(--accent-rgb), .28);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); background: linear-gradient(100deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--accent-2)) 60%, var(--accent-2)); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { border-color: color-mix(in srgb, var(--red) 45%, transparent); color: var(--red); background: color-mix(in srgb, var(--red) 6%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 14%, transparent); border-color: var(--red); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .8125rem; border-radius: 11px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; min-height: 36px; padding: 0; border-radius: 11px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
label.btn { cursor: pointer; }

.pill {
    display: inline-flex; align-items: center; gap: 7px;
    border: 1px solid var(--line-strong); background: var(--surface-raised);
    border-radius: 999px; padding: 7px 14px;
    color: var(--muted); font-size: .75rem; font-weight: 600;
}
button.pill:hover { border-color: rgba(var(--accent-rgb), .55); color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    padding: 7px 14px; border-radius: 99px;
    border: 1px solid var(--line); background: var(--surface-raised);
    color: var(--muted); font-size: .8125rem; font-weight: 500;
    transition: all .2s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { color: var(--accent-ink); background: rgba(var(--accent-rgb), .12); border-color: rgba(var(--accent-rgb), .5); font-weight: 600; }

.segmented { display: inline-flex; padding: 3px; border-radius: 13px; background: var(--surface-sunken); border: 1px solid var(--line); }
.segmented button { border: 0; background: none; padding: 7px 14px; border-radius: 10px; font-size: .8125rem; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.segmented button[aria-checked="true"] { background: var(--surface-raised); color: var(--text); box-shadow: var(--shadow-card); }

.field { display: grid; gap: 6px; }
.field label, .field-label { font-size: .75rem; font-weight: 600; color: var(--muted); }
.input {
    width: 100%; padding: 11px 14px;
    border: 1px solid var(--line-strong); border-radius: 12px;
    background: var(--surface-raised); outline: none;
    transition: border-color .2s, box-shadow .2s;
}
textarea.input { resize: vertical; min-height: 92px; line-height: 1.5; }
.input:focus { border-color: rgba(var(--accent-rgb), .6); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .12); }
.input::placeholder { color: var(--faint); }
select.input option { background: var(--surface-solid); }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--track); border: 1px solid var(--line-strong); transition: background .25s; }
.switch span::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
    transition: transform .25s var(--ease-out);
}
.switch input:checked + span { background: var(--accent); border-color: transparent; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

/* =========================================================
   CARDS & PANELS
   ========================================================= */

.panel {
    border: 1px solid var(--line); background: var(--surface);
    border-radius: var(--radius); padding: 22px;
    box-shadow: var(--shadow-card);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2 { display: flex; align-items: center; gap: 10px; font-size: 1rem; }
.panel-head h2 i { color: var(--accent-ink); font-size: .875rem; }
.panel-link { color: var(--muted); text-decoration: none; font-size: .8125rem; font-weight: 600; }
.panel-link:hover { color: var(--accent-ink); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
    position: relative; overflow: hidden;
    border: 1px solid var(--line); background: var(--surface-raised);
    border-radius: 18px; padding: 18px; box-shadow: var(--shadow-card);
    transition: transform .3s var(--ease-out), border-color .3s;
}
.stat:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.stat::after {
    content: ""; position: absolute; width: 90px; height: 90px; right: -40px; top: -42px;
    border-radius: 50%; background: var(--glow, rgba(var(--accent-rgb), .16)); filter: blur(14px);
}
.stat-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .8125rem; }
.stat-icon { font-size: 1rem; color: var(--glow-solid, var(--accent)); position: relative; z-index: 1; }
.stat strong { display: block; font-size: 1.875rem; letter-spacing: -1px; margin-top: 8px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat small { color: var(--faint); font-size: .75rem; }
.stat small em { font-style: normal; color: var(--green); font-weight: 700; }

.progress { height: 7px; border-radius: 20px; background: var(--track); overflow: hidden; }
.progress > span {
    display: block; height: 100%; width: var(--p, 0%); border-radius: 20px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .8s var(--ease-out);
}
.progress.done > span { background: linear-gradient(90deg, #0fae74, #3ddc97); }

.ring {
    --p: 0; --ring-c: var(--accent);
    width: 52px; height: 52px; border-radius: 50%; flex: none;
    display: grid; place-items: center; position: relative;
    background: conic-gradient(var(--ring-c) calc(var(--p) * 1%), var(--track) 0);
}
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface-solid); }
.ring span { position: relative; font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ring.met { --ring-c: var(--green); }

.donut {
    --p: 0;
    width: 104px; height: 104px; flex-shrink: 0; border-radius: 50%;
    display: grid; place-items: center; position: relative;
    background: conic-gradient(var(--accent) 0, var(--accent-2) calc(var(--p) * 1%), var(--track) 0);
}
.donut::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface-solid); }
.donut strong { position: relative; font-size: 1.375rem; font-variant-numeric: tabular-nums; }

.empty-state {
    display: grid; place-items: center; gap: 10px;
    padding: 46px 20px; text-align: center;
    border: 1px dashed var(--line-strong); border-radius: var(--radius);
    color: var(--muted);
}
.empty-state i { font-size: 1.875rem; color: var(--accent-ink); }
.empty-state p { margin: 0; max-width: 40ch; }

.status-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 99px;
    font-size: .6875rem; font-weight: 700; white-space: nowrap;
    border: 1px solid var(--line-strong); color: var(--muted); background: var(--surface-raised);
}
.status-tag.progress-tag { color: var(--accent-ink); border-color: rgba(var(--accent-rgb), .4); background: rgba(var(--accent-rgb), .1); }
.status-tag.done-tag { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); background: color-mix(in srgb, var(--green) 9%, transparent); }

.section-label { margin: 26px 0 12px; color: var(--faint); font-size: .75rem; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; }

/* =========================================================
   HOME — GARDEN SCENE
   ========================================================= */

.garden-card-large {
    position: relative; min-height: 600px; overflow: hidden;
    border-radius: 28px; border: 1px solid var(--line-strong);
    background: var(--scene-bg);
    box-shadow: var(--shadow); isolation: isolate;
    margin-bottom: 22px; cursor: crosshair;
}
.garden-card-large::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--scene-glow); }
.garden-top { position: relative; z-index: 4; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 24px 28px 0; }
.section-title { font-size: 1.125rem; font-weight: 750; letter-spacing: -.3px; }
.section-sub { color: var(--muted); font-size: .8125rem; margin: 4px 0 0; max-width: 52ch; }

.garden-scene-large { position: absolute; inset: 84px 0 0; overflow: hidden; }
.stars { position: absolute; inset: 0; pointer-events: none; opacity: var(--stars); transition: opacity .6s; }
.stars i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; animation: twinkle 3.5s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .1; } }

.moon {
    position: absolute; width: 110px; height: 110px; top: 6%; left: 50%;
    transform: translateX(-50%); border-radius: 50%;
    background: var(--sun-bg); box-shadow: var(--sun-shadow); opacity: .9;
}
.mountain { position: absolute; bottom: 35%; width: 0; height: 0; border-left: 240px solid transparent; border-right: 240px solid transparent; border-bottom: 220px solid var(--mtn-1); }
.mountain.one { left: -10%; }
.mountain.two { right: -10%; border-bottom-color: var(--mtn-2); }
.mountain.three { left: 24%; bottom: 38%; border-left-width: 170px; border-right-width: 170px; border-bottom-width: 170px; border-bottom-color: var(--mtn-3); }
.water-plane {
    position: absolute; left: -20%; right: -20%; bottom: -15%; height: 68%;
    border-radius: 50% 50% 0 0 / 18% 18% 0 0;
    background: var(--water-bg); border-top: 1px solid var(--water-edge);
    transform: perspective(600px) rotateX(7deg);
}
.ripple-ring {
    position: absolute; left: 50%; top: 58%;
    width: var(--size, 320px); height: var(--size, 320px);
    border: 1px solid var(--ring); border-radius: 50%;
    transform: translate(-50%, -50%) scaleY(.42);
    animation: ringBreath 5s ease-in-out infinite;
}
.ripple-ring.r2 { --size: 420px; animation-delay: -1.4s; border-color: rgba(var(--accent-rgb), .45); }
.ripple-ring.r3 { --size: 520px; animation-delay: -2.8s; }
.ripple-ring.r4 { --size: 640px; animation-delay: -.8s; }
@keyframes ringBreath {
    0%, 100% { transform: translate(-50%, -50%) scaleY(.42) scale(.96); opacity: .25; }
    50% { transform: translate(-50%, -50%) scaleY(.42) scale(1.04); opacity: .75; }
}

.splash {
    position: absolute; width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--ring);
    transform: translate(-50%, -50%) scaleY(.4);
    pointer-events: none; animation: splash 1.4s ease-out forwards;
}
@keyframes splash { to { width: 260px; height: 260px; opacity: 0; border-width: 1px; } }

.lotus {
    position: absolute; left: 50%; top: 50%; width: 160px; height: 175px;
    transform: translate(-50%, -50%) scale(var(--bloom, 1));
    filter: drop-shadow(0 0 30px rgba(var(--accent-rgb), .55));
    animation: lotusFloat 4.5s ease-in-out infinite;
    transition: transform 1s var(--ease-out);
}
@keyframes lotusFloat { 0%, 100% { translate: 0 2%; } 50% { translate: 0 -4%; } }
.petal {
    position: absolute; bottom: 25px; left: 50%; width: 50px; height: 104px;
    border-radius: 90% 10% 70% 30%; transform-origin: bottom center;
    background: linear-gradient(160deg, #f4f0ff 0%, color-mix(in srgb, var(--accent) 50%, #fff) 34%, var(--accent) 75%, var(--accent-3) 100%);
    border: 1px solid rgba(255, 255, 255, .8);
    box-shadow: inset 0 0 18px rgba(255, 255, 255, .45);
}
.petal.p1 { transform: translateX(-50%) rotate(0deg); height: 128px; width: 45px; z-index: 4; }
.petal.p2 { transform: translateX(-50%) rotate(-32deg); z-index: 3; }
.petal.p3 { transform: translateX(-50%) rotate(32deg) scaleX(-1); z-index: 3; }
.petal.p4 { transform: translateX(-50%) rotate(-62deg) scale(.82); z-index: 2; }
.petal.p5 { transform: translateX(-50%) rotate(62deg) scaleX(-1) scale(.82); z-index: 2; }
.lotus-core {
    position: absolute; z-index: 5; bottom: 15px; left: 50%; transform: translateX(-50%);
    width: 26px; height: 32px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff, #ffe5a4 40%, #ff70e9);
    box-shadow: 0 0 24px #ff8cf5;
}
.stem { position: absolute; left: 50%; top: 62%; height: 115px; width: 3px; background: linear-gradient(color-mix(in srgb, var(--accent) 50%, #fff), #28c9b4); transform: translateX(-50%); z-index: -1; }
.island {
    position: absolute; left: 50%; top: 65%; transform: translateX(-50%);
    width: 250px; height: 54px; border-radius: 50%;
    background: var(--island-bg); border: 1px solid var(--island-edge);
    box-shadow: 0 10px 30px rgba(20, 20, 80, .2), 0 0 38px rgba(72, 127, 255, .25);
}
.island::before { content: ""; position: absolute; inset: 5px 20px 14px; border-radius: 50%; background: var(--island-inner); filter: blur(6px); }

.skill-node {
    position: absolute; z-index: 3;
    display: flex; align-items: center; gap: 11px;
    padding: 11px 15px 11px 11px;
    border-radius: 16px; border: 1px solid var(--line-strong);
    background: var(--node-bg);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: var(--shadow-soft);
    min-width: 176px;
    color: var(--text); font: inherit; text-align: left; cursor: pointer;
    animation: nodeFloat 5s ease-in-out infinite;
    transition: border-color .25s, box-shadow .25s;
}
.skill-node:hover { border-color: var(--accent); box-shadow: var(--shadow-soft), 0 0 0 4px rgba(var(--accent-rgb), .12); }
.skill-node b { font-size: .8125rem; display: block; }
.skill-node small { font-size: .75rem; color: var(--muted); }
.skill-node .node-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 11px; background: linear-gradient(145deg, var(--c1), var(--c2)); color: #fff; font-size: .9375rem; }
.skill-node .mini { display: block; height: 4px; margin-top: 6px; border-radius: 4px; background: var(--track); overflow: hidden; }
.skill-node .mini span { display: block; height: 100%; width: var(--p); background: linear-gradient(90deg, var(--c1), var(--c2)); }
.skill-node.pos-0 { top: 22%; left: 18%; animation-delay: -1s; }
.skill-node.pos-1 { top: 22%; right: 18%; animation-delay: -2.2s; }
.skill-node.pos-2 { top: 60%; left: 8%; animation-delay: -.5s; }
.skill-node.pos-3 { top: 60%; right: 8%; animation-delay: -3.4s; }
@keyframes nodeFloat { 50% { translate: 0 -8px; } }

.garden-hint { position: absolute; z-index: 4; bottom: 20px; left: 26px; right: 26px; color: var(--muted); font-size: .75rem; display: flex; align-items: center; gap: 8px; pointer-events: none; }
.hint-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--accent-3); box-shadow: 0 0 10px var(--accent-3); }

/* =========================================================
   HOME — PANELS
   ========================================================= */

.home-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px; }
.current-course { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-sunken); }
.current-course strong { display: block; font-size: .9375rem; }
.current-course small { color: var(--muted); font-size: .8125rem; }
.course-logo {
    width: 48px; height: 48px; flex-shrink: 0; display: grid; place-items: center;
    border-radius: 14px; font-size: 1.375rem; color: #fff;
    background: linear-gradient(145deg, var(--c1, #266be0), var(--c2, #19cce1));
    box-shadow: 0 6px 16px color-mix(in srgb, var(--c1, #266be0) 30%, transparent);
}
.course-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .8125rem; margin: 16px 0 8px; }
.course-meta b { color: var(--text); font-weight: 700; }
.next-step { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.next-step strong { display: flex; align-items: center; gap: 8px; font-size: .8125rem; }
.next-step strong i { color: var(--amber); }
.next-step p { font-size: .875rem; color: var(--muted); line-height: 1.6; margin: 6px 0 0; }

.progress-panel { display: flex; align-items: center; gap: 22px; }
.progress-copy strong { font-size: .9375rem; display: block; margin-bottom: 6px; }
.progress-copy p { margin: 0 0 4px; color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.progress-copy .good { color: var(--green); font-weight: 600; }

.week-chart { margin-top: 22px; }
.week-chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.week-chart-head span { font-size: .8125rem; font-weight: 700; }
.week-chart-head small { color: var(--faint); font-size: .75rem; }
.bars { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 110px; padding-top: 18px; border-bottom: 1px solid var(--line-strong); }
.bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; border-radius: 6px; }
.bar > span:last-child { width: min(26px, 70%); height: var(--h); min-height: 3px; border-radius: 4px 4px 0 0; background: rgba(var(--accent-rgb), .4); transition: height .7s var(--ease-out), background .2s; }
.bar.today > span:last-child { background: var(--accent); }
.bar:hover > span:last-child, .bar:focus-visible > span:last-child { background: var(--accent-2); }
.bar .tip {
    position: absolute; bottom: calc(var(--h) + 6px);
    padding: 3px 8px; border-radius: 7px;
    background: var(--surface-overlay); border: 1px solid var(--line-strong); box-shadow: var(--shadow-card);
    font-size: .6875rem; font-weight: 600; white-space: nowrap; color: var(--text);
    opacity: 0; transform: translateY(4px); pointer-events: none;
    transition: opacity .15s, transform .15s;
}
.bar:hover .tip, .bar:focus-visible .tip { opacity: 1; transform: none; }
.bar-labels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 6px; }
.bar-labels span { text-align: center; font-size: .6875rem; color: var(--faint); }
.bar-labels span.today { color: var(--text); font-weight: 700; }

.bottom-note { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; color: var(--faint); font-size: .75rem; padding: 0 3px; }
.bottom-note a { color: var(--accent-ink); font-weight: 600; text-decoration: none; }

/* =========================================================
   COURSES
   ========================================================= */

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.result-count { color: var(--faint); font-size: .8125rem; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.course-card {
    position: relative; display: flex; flex-direction: column; gap: 14px;
    padding: 20px; border: 1px solid var(--line); border-radius: 20px;
    background: var(--surface-raised); box-shadow: var(--shadow-card);
    transition: transform .3s var(--ease-out), border-color .3s, box-shadow .3s;
}
.course-card:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow-soft); }
.course-card.flash { animation: flash 1.8s var(--ease-out); }
@keyframes flash { 0%, 50% { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .25), var(--shadow-soft); } }
.course-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.course-card h3 { font-size: 1.0625rem; margin-bottom: 3px; }
.course-card .level { font-size: .8125rem; color: var(--muted); margin: 0; }
.course-card .desc { font-size: .875rem; color: var(--muted); margin: 0; line-height: 1.55; flex: 1; }
.course-card .meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--faint); font-size: .75rem; }
.course-card .meta i { margin-right: 5px; }
.course-card .course-meta { margin: 0 0 7px; font-size: .75rem; }

/* =========================================================
   GARDEN PAGE
   ========================================================= */

.garden-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 22px; }
.plant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.plant-card {
    display: flex; flex-direction: column;
    border: 1px solid var(--line); border-radius: 22px;
    background: var(--surface-raised); box-shadow: var(--shadow-card);
    overflow: hidden; transition: transform .3s var(--ease-out), border-color .3s;
}
.plant-card:hover { transform: translateY(-4px); border-color: var(--line-strong); }
.plant-stage {
    position: relative; height: 210px;
    background:
        radial-gradient(ellipse at 50% 100%, color-mix(in srgb, var(--c2) 26%, transparent), transparent 60%),
        linear-gradient(180deg, rgba(var(--accent-rgb), .06), transparent);
    border-bottom: 1px solid var(--line); overflow: hidden;
}
.plant-stage svg { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 180px; height: 190px; overflow: visible; }
.plant-stage .sway { transform-origin: 90px 170px; animation: sway 6s ease-in-out infinite; }
@keyframes sway { 50% { transform: rotate(2.2deg); } }
.plant-card.watered .plant-stage svg { animation: grow .8s var(--ease-out); }
@keyframes grow { 40% { transform: translateX(-50%) scale(1.06); filter: brightness(1.25); } }
.drop { position: absolute; top: -10px; width: 6px; height: 10px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: var(--accent-3); animation: drop .9s ease-in forwards; }
@keyframes drop { to { transform: translateY(170px); opacity: 0; } }
.stage-label { position: absolute; top: 12px; left: 12px; }
.plant-body { padding: 18px; display: grid; gap: 12px; flex: 1; }
.plant-body h3 { display: flex; align-items: center; gap: 9px; }
.plant-body h3 i { color: var(--c1); }
.plant-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0; }
.plant-facts dt { font-size: .6875rem; color: var(--faint); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.plant-facts dd { margin: 0; font-size: .8125rem; font-weight: 500; }
.plant-actions { display: flex; gap: 8px; margin-top: auto; }
.plant-actions .btn { flex: 1; }

/* =========================================================
   GOALS
   ========================================================= */

.goals-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.goal-list { display: grid; gap: 12px; }
.goal-item {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
    padding: 16px 18px; background: var(--surface-raised);
    border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-card);
    transition: border-color .25s, opacity .25s;
}
.goal-item:hover { border-color: var(--line-strong); }
.goal-item.complete { opacity: .8; }
.goal-item.complete .goal-title { text-decoration: line-through; text-decoration-color: var(--faint); }
.goal-item.complete .ring { --ring-c: var(--green); }
.goal-title { font-weight: 650; font-size: .9375rem; }
.goal-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--faint); font-size: .8125rem; margin-top: 3px; }
.goal-sub .overdue { color: var(--red); font-weight: 600; }
.goal-sub .soon { color: var(--amber); font-weight: 600; }
.goal-actions { display: flex; align-items: center; gap: 6px; }
.goal-count { min-width: 64px; text-align: center; font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.confirm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .8125rem; color: var(--red); font-weight: 600; }
.goal-form { display: grid; gap: 14px; }
.goal-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* =========================================================
   ACHIEVEMENTS
   ========================================================= */

.ach-hero { display: flex; align-items: center; gap: 22px; margin-bottom: 22px; flex-wrap: wrap; }
.ach-hero .donut { width: 90px; height: 90px; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.badge {
    position: relative; overflow: hidden; isolation: isolate;
    display: grid; justify-items: center; gap: 8px; padding: 26px 20px 20px;
    background: var(--surface-raised); border: 1px solid var(--line); border-radius: 20px;
    box-shadow: var(--shadow-card); text-align: center;
    transition: transform .3s var(--ease-out), border-color .3s;
}
.badge:hover { transform: translateY(-4px); }
.badge .medal {
    width: 72px; height: 72px; display: grid; place-items: center;
    border-radius: 50%; font-size: 1.75rem; color: #fff;
    background: linear-gradient(145deg, var(--c1), var(--c2));
    box-shadow: 0 8px 26px color-mix(in srgb, var(--c2) 40%, transparent), inset 0 0 0 4px rgba(255, 255, 255, .22);
}
.badge.locked .medal { background: var(--surface-sunken); color: var(--faint); box-shadow: inset 0 0 0 2px var(--line-strong); }
.badge.locked h3 { color: var(--muted); }
.badge.unlocked { border-color: color-mix(in srgb, var(--c2) 40%, transparent); }
.badge.unlocked::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--c2) 16%, transparent), transparent 65%); }
.badge p { margin: 0; font-size: .8125rem; color: var(--muted); }
.badge .progress { width: 100%; margin-top: 6px; }
.badge .badge-foot { font-size: .75rem; color: var(--faint); font-weight: 600; }
.badge.unlocked .badge-foot { color: var(--green); }

/* =========================================================
   COMMUNITY
   ========================================================= */

.community-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.composer { display: grid; gap: 12px; margin-bottom: 18px; }
.composer-top { display: flex; gap: 12px; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.composer-foot .input { width: auto; padding: 8px 12px; }
.char-count { font-size: .75rem; color: var(--faint); margin-left: auto; }
.feed { display: grid; gap: 14px; }
.post { background: var(--surface-raised); border: 1px solid var(--line); padding: 18px 20px; border-radius: 20px; box-shadow: var(--shadow-card); animation: rise .4s var(--ease-out) both; }
.post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.post-head .avatar { width: 38px; height: 38px; }
.post-head strong { display: block; font-size: .875rem; }
.post-head small { color: var(--faint); font-size: .75rem; }
.post-head .status-tag { margin-left: auto; }
.post p { margin: 0 0 12px; font-size: .9375rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.post-actions { display: flex; gap: 6px; }
.like-btn[aria-pressed="true"] { color: #d6246e; border-color: rgba(214, 36, 110, .4); background: rgba(214, 36, 110, .08); }
html[data-theme="dark"] .like-btn[aria-pressed="true"] { color: #ff8db4; }
.like-btn[aria-pressed="true"] i { animation: heart .4s var(--ease-out); }
@keyframes heart { 50% { transform: scale(1.4); } }
.side-stack { display: grid; gap: 16px; }
.leader { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.leader li { display: flex; align-items: center; gap: 10px; font-size: .875rem; }
.leader .avatar { width: 30px; height: 30px; font-size: .75rem; border-radius: 10px; }
.leader .rank { width: 18px; color: var(--faint); font-size: .75rem; font-weight: 700; }
.leader .pts { margin-left: auto; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.leader li.me strong { color: var(--accent-ink); }

/* =========================================================
   SETTINGS
   ========================================================= */

.settings-grid { display: grid; gap: 18px; max-width: 780px; }
.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: 0; padding-bottom: 0; }
.panel-head + .setting-row { padding-top: 0; }
.setting-row strong { display: block; font-size: .875rem; }
.setting-row small { display: block; color: var(--faint); font-size: .8125rem; margin-top: 2px; }
.setting-row .input { max-width: 240px; }
.swatches { display: flex; gap: 10px; }
.swatch {
    width: 34px; height: 34px; border-radius: 50%; padding: 0;
    border: 3px solid var(--surface-raised);
    background: linear-gradient(135deg, var(--s1), var(--s2));
    box-shadow: 0 0 0 1px var(--line-strong);
    transition: transform .2s;
}
.swatch:hover { transform: scale(1.1); }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--text); }

/* =========================================================
   CASE STUDY (about.html)
   ========================================================= */

.cs-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: stretch; margin-bottom: 20px; }
.cs-hero .panel { display: grid; align-content: center; gap: 12px; }
.big-stat { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 800; letter-spacing: -2px; line-height: 1; }
.cs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.cs-card { padding: 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-raised); box-shadow: var(--shadow-card); }
.cs-card .cs-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: rgba(var(--accent-rgb), .12); color: var(--accent-ink); margin-bottom: 12px; }
.cs-card h3 { margin-bottom: 6px; }
.cs-card p { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.6; }
.persona { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; }
.persona .avatar { width: 64px; height: 64px; font-size: 1.5rem; border-radius: 20px; }
.persona ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: .875rem; line-height: 1.7; }
.flow { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.flow li {
    flex: 1 1 150px; position: relative; counter-increment: step;
    padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-raised);
    font-size: .8125rem; color: var(--muted);
}
.flow li strong { display: block; color: var(--text); font-size: .875rem; margin-bottom: 4px; }
.flow li::before { content: counter(step); display: grid; place-items: center; width: 24px; height: 24px; margin-bottom: 8px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: .75rem; }
.a11y-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.a11y-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .875rem; color: var(--muted); }
.a11y-list li i { color: var(--green); margin-top: 4px; }
.a11y-list li b { color: var(--text); }

/* =========================================================
   DIALOGS (lesson + onboarding)
   ========================================================= */

dialog.modal {
    width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 32px);
    padding: 0; border: 1px solid var(--line-strong); border-radius: 24px;
    background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow);
}
dialog.modal[open] { animation: pop .3s var(--ease-out); }
dialog.modal::backdrop { background: rgba(20, 14, 50, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
html[data-theme="dark"] dialog.modal::backdrop { background: rgba(2, 5, 14, .7); }
.modal-body { padding: 26px; display: grid; gap: 16px; }
.modal-head { display: flex; align-items: center; gap: 14px; }
.modal-head small { display: block; color: var(--faint); font-size: .75rem; }
.modal-close { margin-left: auto; align-self: flex-start; }
.lesson-box { padding: 16px; border-radius: 16px; background: rgba(var(--accent-rgb), .08); border: 1px solid rgba(var(--accent-rgb), .22); }
.lesson-box h3 { font-size: 1rem; margin-bottom: 6px; }
.lesson-box p { margin: 0; color: var(--muted); font-size: .875rem; }
.checklist { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; font-size: .875rem; transition: background .2s, border-color .2s; }
.checklist input { accent-color: var(--accent); width: 17px; height: 17px; }
.checklist label:has(input:checked) { background: color-mix(in srgb, var(--green) 8%, transparent); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; align-items: center; }

.focus-timer { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line-strong); font-size: .8125rem; color: var(--muted); }
.focus-timer time { font-size: 1.125rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; min-width: 54px; }
.focus-timer .btn { margin-left: auto; }

/* onboarding */
.onboard .modal-body { gap: 18px; }
.ob-steps { display: flex; gap: 6px; }
.ob-steps span { height: 4px; flex: 1; border-radius: 4px; background: var(--track); transition: background .3s; }
.ob-steps span.on { background: var(--accent); }
.ob-hero { display: grid; place-items: center; height: 120px; border-radius: 18px; background: var(--scene-bg); position: relative; overflow: hidden; }
.ob-hero svg { width: 96px; height: 96px; filter: drop-shadow(0 6px 18px rgba(var(--accent-rgb), .45)); }
.ob-title { font-size: 1.375rem; letter-spacing: -.5px; margin: 0; }
.ob-sub { margin: -8px 0 0; color: var(--muted); font-size: .875rem; }
.ob-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ob-skill {
    display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px;
    border: 1px solid var(--line-strong); background: var(--surface-raised);
    text-align: left; font-size: .8125rem; font-weight: 600;
    transition: border-color .2s, background .2s;
}
.ob-skill .course-logo { width: 32px; height: 32px; font-size: .875rem; border-radius: 10px; box-shadow: none; }
.ob-skill[aria-checked="true"] { border-color: var(--accent); background: rgba(var(--accent-rgb), .1); box-shadow: inset 0 0 0 1px var(--accent); }
.ob-options { display: grid; gap: 8px; }
.ob-option {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
    border: 1px solid var(--line-strong); background: var(--surface-raised); text-align: left;
}
.ob-option i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-sunken); color: var(--accent-ink); flex: none; }
.ob-option strong { display: block; font-size: .875rem; }
.ob-option small { color: var(--muted); font-size: .75rem; }
.ob-option[aria-checked="true"] { border-color: var(--accent); background: rgba(var(--accent-rgb), .08); box-shadow: inset 0 0 0 1px var(--accent); }
.ob-foot { display: flex; align-items: center; gap: 10px; }
.ob-foot .spacer { flex: 1; }

/* =========================================================
   TOAST & CELEBRATION
   ========================================================= */

.toast {
    position: fixed; right: 24px; bottom: 24px; z-index: 60;
    width: min(360px, calc(100vw - 32px));
    display: flex; gap: 12px; align-items: flex-start;
    padding: 15px 17px; border: 1px solid var(--line-strong); border-left: 4px solid var(--accent); border-radius: 17px;
    background: var(--surface-overlay); box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    opacity: 0; transform: translateY(20px); pointer-events: none;
    transition: opacity .35s, transform .35s var(--ease-out);
}
.toast.show { opacity: 1; transform: none; pointer-events: auto; }
.toast-icon { font-size: 1.375rem; line-height: 1.2; }
.toast strong { display: block; font-size: .875rem; }
.toast p { font-size: .8125rem; color: var(--muted); margin: 3px 0 0; }

.petal-rain { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.petal-rain i {
    position: absolute; top: -20px; width: 12px; height: 16px;
    border-radius: 90% 10% 70% 30%;
    background: linear-gradient(160deg, #fff, var(--pc));
    animation: fall var(--d) cubic-bezier(.3, .6, .5, 1) forwards;
}
@keyframes fall {
    to { transform: translate(var(--x), 105vh) rotate(var(--r)); opacity: .2; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1200px) {
    .goals-layout, .community-layout { grid-template-columns: 1fr; }
    .goals-layout > .panel { order: -1; }
    .community-layout .side-stack { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}

@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-grid, .cs-hero { grid-template-columns: 1fr; }
    .skill-node.pos-0 { left: 6%; }
    .skill-node.pos-1 { right: 6%; }
    .skill-node.pos-2 { left: 3%; }
    .skill-node.pos-3 { right: 3%; }
}

@media (max-width: 900px) {
    .layout, .layout.sidebar-is-collapsed { --sidebar-width: var(--sidebar-collapsed); }
    .sidebar, .sidebar.collapsed { padding: 22px 10px 16px; }
    .sidebar-toggle { display: none; }
    .brand { justify-content: center; padding: 0 0 22px; }
    .brand-copy, .nav-label, .nav-text, .nav .count, .sidebar-bottom { display: none; }
    .nav a { justify-content: center; padding-inline: 0; }
    .nav a:hover { transform: none; }
    .nav .ico { font-size: 1.125rem; }
    .profile-copy, .profile > i { display: none; }
    .profile { padding: 5px; }
    .garden-card-large { min-height: 560px; }
    .skill-node { min-width: 0; }
    .skill-node .mini, .skill-node small { display: none; }
}

@media (max-width: 620px) {
    .layout, .layout.sidebar-is-collapsed { display: block; }
    .sidebar, .sidebar.collapsed {
        position: fixed; top: auto; bottom: 0; left: 0; right: 0;
        width: 100%; height: auto;
        padding: 6px 6px max(6px, env(safe-area-inset-bottom));
        overflow: visible;
        border-right: 0; border-top: 1px solid var(--line);
        background: var(--dock);
        box-shadow: 0 -8px 30px rgba(30, 20, 80, .1);
        z-index: 40;
    }
    .brand { display: none; }
    .nav { display: flex; justify-content: space-around; gap: 2px; }
    .nav a, .sidebar.collapsed .nav a { flex: 1; min-height: 52px; padding: 5px 2px; flex-direction: column; justify-content: center; gap: 3px; border-radius: 12px; }
    .nav a.active { box-shadow: inset 0 2px var(--accent); }
    .nav .ico { font-size: 1rem; }
    .nav-text, .sidebar.collapsed .nav-text { display: block; font-size: .625rem; line-height: 1.15; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
    main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
    .topbar { gap: 8px; margin-bottom: 20px; }
    .search kbd { display: none; }
    .search input { padding-right: 14px; }
    .top-spacer { display: none; }
    .icon-btn { width: 42px; height: 42px; }
    .stats { gap: 10px; }
    .stat { padding: 14px; }
    .stat strong { font-size: 1.5rem; }
    .garden-card-large { min-height: 520px; border-radius: 22px; }
    .garden-top { flex-direction: column; padding: 18px 18px 0; }
    .garden-scene-large { inset: 150px 0 0; }
    .lotus { --bloom: .75; }
    .skill-node { padding: 8px; gap: 0; }
    .skill-node .node-text { display: none; }
    .skill-node.pos-0 { top: 10%; left: 6%; }
    .skill-node.pos-1 { top: 10%; right: 6%; }
    .skill-node.pos-2 { top: 64%; left: 6%; }
    .skill-node.pos-3 { top: 64%; right: 6%; }
    .progress-panel { flex-direction: column; align-items: flex-start; }
    .goal-item { grid-template-columns: auto minmax(0, 1fr); }
    .goal-actions { grid-column: 1 / -1; justify-content: flex-end; }
    .goal-form .row { grid-template-columns: 1fr; }
    .setting-row { flex-wrap: wrap; }
    .setting-row .input { max-width: none; }
    .persona { grid-template-columns: 1fr; }
    .toast { right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); }
    .modal-body { padding: 20px; }
}

/* =========================================================
   REDUCED MOTION (system or in-app setting)
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
html.reduce-motion { scroll-behavior: auto; }
html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important;
}
html.reduce-motion .petal-rain, html.reduce-motion .drop { display: none; }

@media (forced-colors: active) {
    .progress > span, .ring, .donut, .bar > span:last-child { forced-color-adjust: none; }
    .btn, .chip, .panel, .stat, .course-card { border: 1px solid CanvasText; }
}
