/* Rytm Study 3.0 — visual layer. Loaded last; overrides earlier stylesheets. */

body {
  --r3-bg: #060a13;
  --r3-side: #080d19;
  --r3-surface: #0c1322;
  --r3-raised: #111a2e;
  --r3-hover: #16213a;
  --r3-line: #1a2540;
  --r3-line-strong: #253252;
  --r3-ink: #eef2fb;
  --r3-ink-2: #c3cbdc;
  --r3-muted: #8590a8;
  --r3-faint: #5b6680;
  --r3-blue: #3d7cff;
  --r3-blue-hi: #6B9BFF;
  --r3-violet: #8b6cff;
  --r3-mint: #2fd1a3;
  --r3-amber: #f5a83b;
  --r3-coral: #f2675a;
  --r3-rose: #ec5f9c;
  --r3-r-lg: 18px;
  --r3-r-md: 13px;
  --r3-r-sm: 9px;
  --r3-shadow: 0 1px 0 #ffffff08 inset, 0 18px 40px -24px #000c;
  /* Map legacy tokens so older views follow the new palette. */
  --bg: var(--r3-bg);
  --paper: var(--r3-surface);
  --ink: var(--r3-ink);
  --muted: var(--r3-muted);
  --line: var(--r3-line);
  --blue: var(--r3-blue);
  --green: var(--r3-blue);
  --green2: #16264a;
  --button-color: var(--r3-blue);
  --button-text: #fff;
  --rs-blue: var(--r3-blue);
  --rs-surface: var(--r3-surface);
  --rs-raised: var(--r3-raised);
  --radius: var(--r3-r-lg);
  --control-radius: 10px;
  --violet: var(--r3-violet);
  --mint: var(--r3-mint);
  --amber: var(--r3-amber);
  --coral: var(--r3-coral);
  background: var(--r3-bg);
  color: var(--r3-ink);
  font-family: "Rytm Inter", Inter, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
body .r3-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
body :focus-visible { outline: 2px solid var(--r3-blue-hi); outline-offset: 2px; }
.tone-blue { --tone: var(--r3-blue); } .tone-violet { --tone: var(--r3-violet); } .tone-mint { --tone: var(--r3-mint); }
.tone-amber { --tone: var(--r3-amber); } .tone-coral { --tone: var(--r3-coral); } .tone-rose { --tone: var(--r3-rose); }

/* ---------- Shell ---------- */
body .app { grid-template-columns: 248px minmax(0, 1fr); background: var(--r3-bg); min-height: 100vh; }
body .sidebar.r3-sidebar {
  background: var(--r3-side); border-right: 1px solid var(--r3-line); padding: 18px 14px 14px; gap: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: none;
}
.r3-sidebar::-webkit-scrollbar { display: none; }
.r3-brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 18px; }
.r3-logo svg { width: 28px; height: 28px; display: block; }
.r3-brand b { font-size: 17px; font-weight: 700; letter-spacing: -.02em; color: var(--r3-ink); flex: 1; }
.r3-brand b span { color: var(--r3-ink-2); font-weight: 500; }
.r3-brand-search { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--r3-muted); cursor: pointer; }
.r3-brand-search:hover { background: var(--r3-hover); color: var(--r3-ink); }
.r3-brand-search svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
body .r3-nav { display: flex; flex-direction: column; gap: 2px; }
body .r3-nav .nav-label { margin: 12px 10px 4px; font-size: 11.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--r3-faint); }
body .r3-nav .nav-item {
  display: flex; align-items: center; gap: 12px; height: 36px; flex: none; padding: 0 12px; border-radius: 10px; border: 0;
  background: transparent; color: var(--r3-ink-2); font-size: 14px; font-weight: 500; text-align: left; cursor: pointer; position: relative;
}
body .r3-nav .nav-item svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
body .r3-nav .nav-item:hover { background: var(--r3-hover); color: var(--r3-ink); }
body .r3-nav .nav-item.active { background: linear-gradient(90deg, color-mix(in srgb, var(--r3-blue) 42%, var(--r3-side)), color-mix(in srgb, var(--r3-blue) 22%, var(--r3-side))); color: var(--r3-nav-active-ink, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--r3-blue) 25%, transparent); }
body .r3-nav .nav-item.active svg { opacity: 1; color: var(--r3-blue-hi); }
body .r3-nav .nav-count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; display: grid; place-items: center; border-radius: 6px; background: #ffffff0d; color: var(--r3-muted); font-size: 11.5px; font-weight: 600; }
body .r3-nav .nav-count:empty { display: none; }
body .r3-nav .nav-item.active .nav-count { background: var(--r3-blue); color: #fff; }
.r3-side-bottom { position: relative; margin: 10px -14px -14px; padding: 34px 14px 12px; background: linear-gradient(180deg, var(--r3-side) 0%, #080d19cc 30%, #080d19e8 100%), url("./images/mountains.jpg") center 30% / cover; }
body .r3-side-week { display: none; width: 100%; text-align: left; margin: 0 0 10px; padding: 12px 13px; border: 1px solid color-mix(in srgb, var(--r3-blue) 22%, transparent); border-radius: 13px; background: #0d1a36d9; backdrop-filter: blur(10px); cursor: pointer; color: var(--r3-ink); }
body .r3-side-week small { display: block; font-size: 11.5px; color: #9db8ff; font-weight: 600; letter-spacing: 0; }
body .r3-side-week b { display: block; margin: 4px 0 9px; font-size: 12.5px; font-weight: 500; line-height: 1.35; color: var(--r3-ink-2); }
body .r3-side-week .progress { height: 5px; border-radius: 9px; background: #ffffff14; overflow: hidden; }
body .r3-side-week .progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--r3-blue), var(--r3-blue-hi)); }
body .r3-sidebar .side-user { display: flex; align-items: center; gap: 10px; padding: 8px 4px 0; border: 0; background: none; }
body .r3-sidebar .avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(140deg, var(--r3-blue), #8b6cff); color: #fff; font-weight: 700; display: grid; place-items: center; flex: none; }
body .r3-sidebar .side-user > div:nth-child(2) { flex: 1; min-width: 0; }
body .r3-sidebar .side-user b { display: block; font-size: 13.5px; color: var(--r3-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body .r3-sidebar .side-user small { display: block; font-size: 11.5px; color: var(--r3-muted); }
body .r3-sidebar .signout-link { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--r3-muted); cursor: pointer; }
body .r3-sidebar .signout-link:hover { background: var(--r3-hover); color: var(--r3-ink); }
body .r3-sidebar .signout-link svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

body .main-shell { background: var(--r3-bg); min-width: 0; }
body .topbar { height: 64px; padding: 0 32px; gap: 14px; background: #060a13e6; backdrop-filter: blur(14px); border-bottom: 1px solid var(--r3-line); position: sticky; top: 0; z-index: 10; }
body .topbar .crumb { font-size: 13px; color: var(--r3-muted); flex: 1; }
body .topbar .crumb b { color: var(--r3-ink); font-weight: 600; font-size: 15px; }
body .topbar .search { width: min(340px, 34vw); height: 40px; border-radius: 11px; border: 1px solid var(--r3-line); background: var(--r3-surface); padding: 0 12px; gap: 9px; }
body .topbar .search:focus-within { border-color: color-mix(in srgb, var(--r3-blue) 50%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--r3-blue) 15%, transparent); }
body .topbar .search input { color: var(--r3-ink); font-size: 13.5px; border: 0; background: transparent; box-shadow: none; outline: none; min-height: 0; height: 100%; padding: 0; flex: 1; }
body .topbar .search input::placeholder { color: var(--r3-faint); }
body .topbar .search svg { color: var(--r3-muted); }
body .icon-btn { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--r3-line); background: var(--r3-surface); color: var(--r3-ink-2); }
body .icon-btn:hover { background: var(--r3-hover); color: var(--r3-ink); }
body .content { padding: 28px 32px 48px; max-width: 1480px; }

/* ---------- Controls ---------- */
body .btn, .r3-btn-primary {
  background: var(--r3-blue); color: #fff; border: 0; border-radius: 11px; font-weight: 600;
  box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--r3-blue) 69%, transparent), inset 0 1px 0 #ffffff2b;
}
body .btn:hover, .r3-btn-primary:hover { background: color-mix(in srgb, var(--r3-blue) 88%, #fff); }
body .quiet, body .soft { background: var(--r3-raised); color: var(--r3-ink); border: 1px solid var(--r3-line-strong); border-radius: 11px; font-weight: 500; }
body .quiet:hover, body .soft:hover { background: var(--r3-hover); }
body .link, .r3-link { color: var(--r3-blue-hi); background: none; border: 0; font-weight: 500; font-size: 13px; cursor: pointer; padding: 4px 0; }
body .link:hover, .r3-link:hover { color: #9dbcff; }
.r3-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.r3-btn .r3-ic { width: 17px; height: 17px; }
.r3-ic.is-solid { fill: currentColor; stroke: none; }
.r3-btn-ghost { background: #ffffff10; color: var(--r3-ink); border: 1px solid #ffffff1f; border-radius: 11px; font-weight: 500; backdrop-filter: blur(8px); }
.r3-btn-ghost:hover { background: #ffffff1c; }
.r3-btn-ghost .r3-ic { fill: none; }
.r3-icon-btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; border: 0; background: var(--r3-blue); color: #fff; cursor: pointer; }
.r3-icon-btn .r3-ic { width: 17px; height: 17px; stroke-width: 2.2; }
body .field { color: var(--r3-ink-2); font-size: 13px; font-weight: 500; }
body .field input, body .field select, body .field textarea, body .modal input, body .modal select, body .modal textarea {
  background: var(--r3-bg); border: 1px solid var(--r3-line-strong); border-radius: 10px; color: var(--r3-ink); min-height: 42px;
}
body .field input:focus, body .field select:focus, body .field textarea:focus, body .modal input:focus, body .modal select:focus, body .modal textarea:focus { border-color: var(--r3-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--r3-blue) 18%, transparent); outline: none; }
body .pill { background: var(--r3-raised); border: 1px solid var(--r3-line); color: var(--r3-ink-2); border-radius: 999px; }
body .eyebrow, body .rhythm-kicker { letter-spacing: .02em; text-transform: none; font-size: 12px; font-weight: 500; color: var(--r3-muted); }
body .card, body .rhythm-panel, body .r3-panel {
  background: var(--r3-surface); border: 1px solid var(--r3-line); border-radius: var(--r3-r-lg); box-shadow: var(--r3-shadow);
}
body .empty, body .rhythm-agenda-empty { color: var(--r3-muted); background: transparent; border: 1px dashed var(--r3-line-strong); border-radius: var(--r3-r-md); }
body .modal { background: #02050bc4; backdrop-filter: blur(6px); }
body .modal-box { background: var(--r3-surface); border: 1px solid var(--r3-line-strong); border-radius: 20px; box-shadow: 0 40px 90px -30px #000; }
body .modal-head h2 { font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
body .modal-head button { background: var(--r3-raised); border: 1px solid var(--r3-line); color: var(--r3-ink-2); border-radius: 9px; }
body .toast { background: var(--r3-raised); border: 1px solid var(--r3-line-strong); color: var(--r3-ink); border-radius: 12px; box-shadow: 0 20px 50px -20px #000; }

/* ---------- Shared r3 pieces ---------- */
.r3-page { display: grid; gap: 20px; min-width: 0; }
.r3-panel { padding: 20px; min-width: 0; }
.r3-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; min-height: 32px; }
.r3-panel-head h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -.01em; color: var(--r3-ink); }
.r3-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.r3-page-head h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.025em; }
.r3-page-head p { margin: 6px 0 0; color: var(--r3-muted); font-size: 14px; }
.r3-muted-line { color: var(--r3-muted); font-size: 13px; line-height: 1.55; margin: 12px 0 0; }
.r3-empty { padding: 18px; border: 1px dashed var(--r3-line-strong); border-radius: var(--r3-r-md); color: var(--r3-muted); font-size: 13px; }
.r3-empty p { margin: 0 0 6px; }
.r3-chev { width: 16px !important; height: 16px !important; color: var(--r3-faint); margin-left: auto; }
.r3-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--tone); background: color-mix(in srgb, var(--tone) 18%, transparent); }
.r3-meter { position: relative; display: block; flex: 1; height: 6px; border-radius: 99px; background: #ffffff12; overflow: hidden; }
.r3-meter i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, var(--tone, var(--r3-blue)), color-mix(in srgb, var(--tone, var(--r3-blue)) 60%, #fff)); }
.r3-meter.is-thick { height: 10px; }
.r3-ring { position: relative; width: var(--size); height: var(--size); display: inline-grid; place-items: center; flex: none; }
.r3-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.r3-ring circle { fill: none; stroke-width: 9; }
.r3-ring-track { stroke: #ffffff1a; }
.r3-ring-bar { stroke: var(--r3-blue-hi); stroke-linecap: round; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--r3-blue) 60%, transparent)); }
.r3-ring b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.r3-next-ic, .r3-tile-ic, .r3-quick-ic { display: grid; place-items: center; flex: none; color: var(--tone); background: color-mix(in srgb, var(--tone) 17%, transparent); }
.r3-next-ic { width: 36px; height: 36px; border-radius: 10px; }
.r3-check { display: flex; align-items: center; gap: 11px; padding: 9px 2px; font-size: 13.5px; color: var(--r3-ink-2); cursor: pointer; }
.r3-check input { position: absolute; opacity: 0; pointer-events: none; }
.r3-check-box { width: 20px; height: 20px; border-radius: 6px; border: 1.6px solid var(--r3-line-strong); display: grid; place-items: center; flex: none; transition: background .15s, border-color .15s; }
.r3-check-box .r3-ic { width: 14px; height: 14px; stroke-width: 2.6; opacity: 0; }
.r3-check-box .r3-ic rect { display: none; }
.r3-check.is-done .r3-check-box, .r3-check input:checked + .r3-check-box { background: var(--r3-blue); border-color: var(--r3-blue); }
.r3-check.is-done .r3-check-box .r3-ic, .r3-check input:checked + .r3-check-box .r3-ic { opacity: 1; color: #fff; }
.r3-check.is-done > span:last-child { color: var(--r3-muted); text-decoration: line-through; text-decoration-color: #ffffff40; }
.r3-check input:focus-visible + .r3-check-box { outline: 2px solid var(--r3-blue-hi); outline-offset: 2px; }
.r3-check.is-large { padding: 13px 14px; border-radius: 12px; background: var(--r3-raised); margin-bottom: 8px; font-size: 14px; }
.r3-seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--r3-surface); border: 1px solid var(--r3-line); }
.r3-seg button { height: 34px; padding: 0 16px; white-space: nowrap; border: 0; border-radius: 9px; background: transparent; color: var(--r3-muted); font-weight: 500; font-size: 13px; cursor: pointer; }
.r3-seg button small { opacity: .7; font-size: 11.5px; margin-left: 3px; }
.r3-seg button:hover { color: var(--r3-ink); }
.r3-seg button.is-active { background: var(--r3-blue); color: #fff; box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--r3-blue) 75%, transparent); }
.r3-stat { padding: 16px 18px; border-radius: var(--r3-r-md); background: var(--r3-surface); border: 1px solid var(--r3-line); display: grid; gap: 4px; min-width: 0; }
.r3-stat small { color: var(--r3-muted); font-size: 12.5px; }
.r3-stat b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.r3-stat span { font-size: 12.5px; color: var(--r3-muted); }
.r3-stat span.is-up { color: var(--r3-mint); } .r3-stat span.is-down { color: var(--r3-coral); }

/* ---------- Dashboard ---------- */
.r3-hero { position: relative; min-height: 300px; border-radius: 22px; overflow: hidden; border: 1px solid var(--r3-line); isolation: isolate; }
.r3-hero-photo { position: absolute; inset: 0; z-index: -2; background: url("./images/desk.jpg") 60% 72% / cover; transform: scale(1.02); }
.r3-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #060a13f2 0%, #060a13c4 34%, #060a1340 70%, #060a1326 100%), linear-gradient(0deg, #060a13d9 0%, transparent 46%); }
.r3-hero-body { display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-height: 300px; padding: 30px 30px 22px; }
.r3-hero-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.r3-hero h1 { margin: 0; font-size: clamp(28px, 3.1vw, 40px); line-height: 1.12; font-weight: 500; letter-spacing: -.03em; color: #f4f6fc; }
.r3-hero h1 strong { font-weight: 750; }
.r3-quote { margin: 14px 0 0; max-width: 38ch; color: #c5cee0; font-size: 14.5px; line-height: 1.5; }
.r3-hero-date { display: grid; justify-items: end; gap: 2px; padding: 10px 14px; border-radius: 13px; background: #060a1380; border: 1px solid #ffffff1a; backdrop-filter: blur(10px); text-align: right; }
.r3-hero-date span { font-size: 12.5px; color: #c5cee0; }
.r3-hero-date time { font-size: 24px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: #fff; }
.r3-hero-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 860px; }
.r3-glass-tile { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 13px 14px; border-radius: 14px; border: 1px solid #ffffff1c; background: #0b1222a8; backdrop-filter: blur(14px) saturate(1.2); color: #fff; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.r3-glass-tile:hover { background: #121c33c4; border-color: #ffffff30; }
.r3-tile-ic { width: 36px; height: 36px; border-radius: 10px; }
.r3-glass-tile small { display: block; font-size: 12px; color: #aeb8cc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r3-glass-tile b { display: block; font-size: 19px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.r3-glass-tile > span:last-child { min-width: 0; }

.r3-home-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.r3-col-main, .r3-col-side { display: grid; gap: 20px; min-width: 0; }
.r3-now-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; }
.r3-current { position: relative; min-height: 210px; border-radius: 15px; overflow: hidden; isolation: isolate; border: 1px solid var(--r3-line-strong); }
.r3-current-photo { position: absolute; inset: 0; z-index: -2; background: url("./images/lecture.jpg") center 35% / cover; }
.r3-current::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, #0a1120b0 0%, #0a1120e8 62%, #0a1120fa 100%); }
.r3-current.is-empty .r3-current-photo { background-image: url("./images/walkway.jpg"); }
.r3-current-body { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 210px; padding: 18px; }
.r3-current-head { display: flex; justify-content: space-between; gap: 14px; }
.r3-current-head h3 { margin: 10px 0 4px; font-size: 21px; font-weight: 700; letter-spacing: -.02em; overflow-wrap: anywhere; }
.r3-current-head p { margin: 0; color: #c0c9db; font-size: 13.5px; }
.r3-current-ring { display: grid; justify-items: center; gap: 4px; }
.r3-current-ring small { font-size: 11.5px; color: #aeb8cc; }
.r3-current-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.r3-current-timer { margin-left: auto; color: #aeb8cc; font-size: 13px; font-variant-numeric: tabular-nums; }
.r3-current-timer b { color: #fff; font-size: 16px; font-weight: 650; }
.r3-done-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: #c0c9db; cursor: pointer; }
.r3-done-check input { accent-color: var(--r3-blue); width: 16px; height: 16px; }
.r3-next-list { display: grid; gap: 8px; }
.r3-next-row, .r3-note-row, .r3-exam-row, .r3-progress-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--r3-line); background: var(--r3-raised); color: var(--r3-ink); text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.r3-next-row:hover, .r3-note-row:hover, .r3-exam-row:hover, .r3-progress-row:hover { background: var(--r3-hover); border-color: var(--r3-line-strong); }
.r3-next-copy { min-width: 0; flex: 1; }
.r3-next-copy b, .r3-exam-copy b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r3-next-copy small, .r3-exam-copy small { display: block; margin-top: 3px; font-size: 12.5px; color: var(--r3-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r3-quick-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.r3-quick-btn { display: grid; justify-items: center; align-content: center; gap: 10px; min-height: 96px; padding: 12px 8px; border-radius: 14px; border: 1px solid var(--r3-line); background: var(--r3-raised); color: var(--r3-ink-2); font-size: 12.5px; font-weight: 500; text-align: center; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.r3-quick-btn:hover { background: var(--r3-hover); border-color: var(--r3-line-strong); color: var(--r3-ink); }
.r3-quick-btn:active { transform: scale(.97); }
.r3-quick-ic { width: 40px; height: 40px; border-radius: 12px; }
.r3-quick-ic .r3-ic { width: 20px; height: 20px; }
.r3-exam-list { display: grid; gap: 8px; }
.r3-exam-days { width: 54px; height: 54px; border-radius: 12px; display: grid; place-content: center; text-align: center; background: linear-gradient(160deg, color-mix(in srgb, var(--r3-blue) 45%, var(--r3-surface)), color-mix(in srgb, var(--r3-blue) 25%, var(--r3-surface))); border: 1px solid color-mix(in srgb, var(--r3-blue) 25%, transparent); flex: none; }
.r3-exam-days b { font-size: 21px; line-height: 1; font-weight: 750; font-variant-numeric: tabular-nums; }
.r3-exam-days small { font-size: 11px; color: #a9c0f5; margin-top: 2px; }
.r3-exam-copy { flex: 1; min-width: 0; }
.r3-goal-meter { display: flex; align-items: center; gap: 12px; margin: -2px 0 6px; }
.r3-goal-meter b { font-size: 13px; color: var(--r3-ink-2); font-variant-numeric: tabular-nums; }
.r3-home-lower { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.r3-wrapped { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-radius: var(--r3-r-lg); border: 1px solid #8b6cff40; background: linear-gradient(110deg, #1b1640, #111a33 60%); }
.r3-wrapped b { display: block; font-size: 15px; }
.r3-wrapped span { display: block; margin-top: 3px; color: var(--r3-muted); font-size: 13px; }
.r3-week-total { display: flex; align-items: baseline; gap: 8px; margin: -4px 0 14px; }
.r3-week-total b { font-size: 26px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.r3-week-total span { color: var(--r3-muted); font-size: 13px; }
.r3-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; height: 170px; padding-top: 28px; align-items: end; }
.r3-bars.is-tall { height: 260px; }
.r3-bars.is-dense { gap: 4px; }
.r3-bar { display: grid; grid-template-rows: 1fr auto; gap: 7px; height: 100%; text-align: center; }
.r3-bar i { position: relative; align-self: end; height: var(--h); min-height: 4px; border-radius: 7px 7px 4px 4px; background: linear-gradient(180deg, color-mix(in srgb, var(--r3-blue) 88%, #fff), #2a5fd9); opacity: .78; }
.r3-bar.is-today i { opacity: 1; background: linear-gradient(180deg, #6fd9ff, var(--r3-blue)); box-shadow: 0 0 18px -4px #4fb2ff; }
.r3-bar em { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); font-style: normal; font-size: 11.5px; font-weight: 600; color: var(--r3-ink); white-space: nowrap; background: var(--r3-hover); padding: 3px 7px; border-radius: 7px; }
.r3-bar small { font-size: 11.5px; color: var(--r3-muted); min-height: 14px; }
.r3-setup { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-color: color-mix(in srgb, var(--r3-blue) 25%, transparent); background: linear-gradient(110deg, #0f1d3d, var(--r3-surface)); }
.r3-setup h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.r3-setup p { margin: 5px 0 0; color: var(--r3-muted); font-size: 13.5px; }
.r3-setup-steps { display: flex; gap: 10px; flex-wrap: wrap; }
.r3-setup-steps button { display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 16px 0 8px; border-radius: 11px; border: 1px solid var(--r3-line-strong); background: var(--r3-raised); color: var(--r3-ink); font-weight: 500; cursor: pointer; }
.r3-setup-steps button span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--r3-blue); color: #fff; font-size: 12.5px; font-weight: 700; }
.r3-inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.r3-inline-form input { height: 42px; min-width: 200px; padding: 0 13px; border-radius: 11px; border: 1px solid var(--r3-line-strong); background: var(--r3-bg); color: var(--r3-ink); }

/* ---------- Focus ---------- */
.r3-focus-stage { position: relative; border-radius: 24px; overflow: hidden; isolation: isolate; border: 1px solid var(--r3-line); min-height: 560px; display: grid; place-items: center; }
.r3-focus-photo { position: absolute; inset: 0; z-index: -2; background: url("./images/desk.jpg") center 40% / cover; filter: saturate(1.1); }
.r3-focus-stage::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 50% 48%, #060a1399 0%, #060a13e6 55%, #060a13f7 100%); }
.r3-focus-inner { display: grid; justify-items: center; gap: 26px; padding: 34px 20px; width: 100%; }
.r3-focus-dial { --timer-pct: 0%; width: min(330px, 74vw); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--r3-blue-hi) var(--timer-pct), #ffffff14 0); box-shadow: 0 0 60px -10px color-mix(in srgb, var(--r3-blue) 44%, transparent); padding: 9px; }
.r3-focus-dial-core { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #111b33, #070c18 72%); display: grid; place-content: center; text-align: center; gap: 6px; padding: 30px; }
.r3-focus-dial-core small { color: var(--r3-muted); font-size: 14px; }
.r3-focus-dial-core b { font-size: clamp(54px, 7vw, 76px); font-weight: 650; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.r3-focus-dial-core span { color: var(--r3-ink-2); font-size: 13.5px; max-width: 22ch; margin: 4px auto 0; line-height: 1.4; }
.r3-focus-controls { display: flex; align-items: center; gap: 18px; }
.r3-round-btn { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; border: 1px solid #ffffff24; background: #ffffff10; color: var(--r3-ink); cursor: pointer; backdrop-filter: blur(10px); }
.r3-round-btn:hover { background: #ffffff1f; }
.r3-round-btn.is-main { width: 70px; height: 70px; border: 0; background: var(--r3-blue); box-shadow: 0 12px 34px -8px color-mix(in srgb, var(--r3-blue) 82%, transparent); }
.r3-round-btn.is-main .r3-ic { width: 26px; height: 26px; }
.r3-round-btn.is-main:hover { background: color-mix(in srgb, var(--r3-blue) 88%, #fff); }
.r3-focus-progress { width: min(330px, 74vw); height: 4px; border-radius: 9px; background: #ffffff14; overflow: hidden; }
.r3-focus-progress i { display: block; height: 100%; background: var(--r3-blue-hi); }
.r3-focus-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.r3-focus-tips p { margin: 0; color: var(--r3-ink-2); line-height: 1.6; max-width: 75ch; }

/* ---------- Goals ---------- */
.r3-goals-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.r3-goal-hero { grid-column: 1 / -1; position: relative; overflow: hidden; isolation: isolate; min-height: 190px; display: flex; align-items: flex-end; padding: 0; }
.r3-goal-photo { position: absolute; inset: 0; z-index: -2; background: url("./images/mountains.jpg") center 45% / cover; }
.r3-goal-hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, #060a13f0 0%, #060a1366 60%, transparent); }
.r3-goal-hero-body { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 16px; width: 100%; padding: 22px 24px; }
.r3-goal-hero-body small { grid-column: 1 / -1; color: #c5cee0; font-size: 13px; }
.r3-goal-hero-body h2 { grid-column: 1 / -1; margin: 0 0 8px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.r3-goal-hero-body > span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.r3-progress-list { display: grid; gap: 8px; }
.r3-progress-copy { flex: 1; display: grid; gap: 8px; min-width: 0; }
.r3-progress-copy > span:first-child { display: flex; justify-content: space-between; gap: 10px; }
.r3-progress-copy b { font-size: 14px; font-weight: 600; }
.r3-progress-copy em { font-style: normal; font-size: 13px; color: var(--r3-ink-2); font-variant-numeric: tabular-nums; }
.r3-archive { display: grid; gap: 10px; }
.r3-archive-row { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 12px; font-size: 13px; color: var(--r3-ink-2); }

/* ---------- Stats ---------- */
.r3-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.r3-stats-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 20px; align-items: start; }
.r3-donut-wrap { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.r3-donut { width: 170px; height: 170px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.r3-donut span { width: 62%; height: 62%; border-radius: 50%; background: var(--r3-surface); }
.r3-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; flex: 1; min-width: 160px; }
.r3-legend li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--r3-ink-2); }
.r3-legend li i { width: 10px; height: 10px; border-radius: 50%; background: var(--tone); flex: none; }
.r3-legend li b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .r3-quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .r3-home-grid { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); }
}
@media (max-width: 1100px) {
  .r3-home-grid, .r3-home-lower, .r3-stats-layout { grid-template-columns: 1fr; }
  .r3-col-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  body .app { grid-template-columns: 220px minmax(0, 1fr); }
  body .content { padding: 22px 20px 40px; }
  .r3-hero-tiles, .r3-kpis, .r3-focus-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r3-now-grid, .r3-goals-layout { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  body .app { display: block; }
  body .sidebar.r3-sidebar { position: fixed; left: -280px; top: 0; width: 264px; height: 100%; z-index: 30; transition: left .22s; }
  body .sidebar.r3-sidebar.open { left: 0; }
  body .content { padding: calc(14px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom)); }
  .r3-page { gap: 14px; }
  .r3-hero, .r3-hero-body { min-height: 0; border-radius: 18px; }
  .r3-hero-body { padding: 20px 16px 16px; gap: 20px; }
  .r3-hero-top { flex-direction: column-reverse; gap: 12px; }
  .r3-hero-date { justify-items: start; text-align: left; padding: 0; background: none; border: 0; backdrop-filter: none; grid-auto-flow: column; align-items: baseline; gap: 10px; }
  .r3-hero-date time { font-size: 15px; order: -1; }
  .r3-hero h1 { font-size: 27px; }
  .r3-quote { font-size: 13.5px; margin-top: 8px; }
  .r3-hero-tiles { gap: 8px; }
  .r3-glass-tile { padding: 10px; gap: 9px; }
  .r3-tile-ic { width: 30px; height: 30px; }
  .r3-glass-tile b { font-size: 16px; }
  .r3-glass-tile small { font-size: 11px; }
  .r3-panel { padding: 16px; }
  .r3-col-side { grid-template-columns: 1fr; }
  .r3-quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .r3-quick-btn { min-height: 84px; font-size: 12px; }
  .r3-current-timer { margin-left: 0; }
  .r3-wrapped { flex-direction: column; align-items: flex-start; }
  .r3-focus-stage { min-height: 0; border-radius: 20px; }
  .r3-page-head h1 { font-size: 24px; }
  .r3-archive-row { grid-template-columns: 1fr 1fr 34px; }
  body .mobile-nav { background: #080d19f2; backdrop-filter: blur(16px); border-top: 1px solid var(--r3-line); }
  body .mobile-nav button { color: var(--r3-muted); }
  body .mobile-nav button.active { color: var(--r3-blue-hi); }
}
@media (prefers-reduced-motion: reduce) {
  .r3-glass-tile, .r3-quick-btn, .r3-next-row, .r3-check-box { transition: none; }
}

/* ---------- Calendar ---------- */
.r3-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.r3-cal-panel { padding: 0; overflow: hidden; }
.r3-cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--r3-line); }
.r3-cal-nav { display: flex; align-items: center; gap: 8px; }
.r3-cal-nav h2 { margin: 0 6px; font-size: 17px; font-weight: 650; letter-spacing: -.01em; min-width: 150px; text-align: center; }
.r3-nav-arrow { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--r3-line-strong); background: var(--r3-raised); color: var(--r3-ink-2); cursor: pointer; }
.r3-nav-arrow:hover { background: var(--r3-hover); color: var(--r3-ink); }
.r3-ic.is-left { transform: rotate(180deg); }
.r3-btn.is-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.r3-cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--r3-muted); }
.r3-cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.r3-cal-legend i { width: 9px; height: 9px; border-radius: 3px; background: var(--tone); }
.r3-cal-scroll { overflow: auto; max-height: calc(100vh - 250px); min-height: 420px; }
.r3-cal-grid { display: grid; grid-template-columns: 58px repeat(var(--cols), minmax(110px, 1fr)); min-width: calc(58px + var(--cols) * 110px); }
.r3-cal-grid > .r3-cal-corner, .r3-cal-dayhead { position: sticky; top: 0; z-index: 3; background: var(--r3-surface); border-bottom: 1px solid var(--r3-line); }
.r3-cal-dayhead { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border: 0; border-bottom: 1px solid var(--r3-line); color: var(--r3-muted); cursor: pointer; }
.r3-cal-dayhead small { font-size: 12px; }
.r3-cal-dayhead b { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; font-size: 16px; color: var(--r3-ink); font-variant-numeric: tabular-nums; }
.r3-cal-dayhead:hover b { background: var(--r3-hover); }
.r3-cal-dayhead.is-today b { background: var(--r3-blue); color: #fff; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--r3-blue) 75%, transparent); }
.r3-cal-dayhead.is-today small { color: var(--r3-blue-hi); }
.r3-cal-hours { grid-column: 1; display: grid; grid-auto-rows: var(--row); }
.r3-cal-hours span { font-size: 11.5px; color: var(--r3-faint); text-align: right; padding: 0 10px 0 0; transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.r3-cal-hours span:first-child { transform: none; }
.r3-cal-body { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); background-image: linear-gradient(var(--r3-line) 1px, transparent 1px); background-size: 100% var(--row); }
.r3-cal-col { position: relative; border-left: 1px solid var(--r3-line); min-width: 0; }
.r3-cal-col.is-today { background: color-mix(in srgb, var(--r3-blue) 4%, transparent); }
.r3-cal-block { position: absolute; left: 4px; right: 4px; display: block; overflow: hidden; padding: 6px 8px; border-radius: 9px; border: 0; border-left: 3px solid var(--tone); background: color-mix(in srgb, var(--tone) 26%, #0c1322); color: var(--r3-ink); text-align: left; cursor: pointer; transition: filter .15s; }
.r3-cal-block:hover { filter: brightness(1.18); z-index: 2; }
.r3-cal-block b { display: block; font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r3-cal-block small { display: block; margin-top: 2px; font-size: 11.5px; color: #c9d2e6cc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r3-cal-block.is-task { background: color-mix(in srgb, var(--tone) 14%, #0c1322); border-left-style: dashed; }
.r3-cal-block.is-done b { text-decoration: line-through; opacity: .6; }
.r3-cal-allday { position: absolute; inset: 2px 4px auto; z-index: 2; display: grid; gap: 3px; }
.r3-cal-pill { height: 22px; padding: 0 7px; border-radius: 6px; border: 0; background: color-mix(in srgb, var(--tone) 32%, #0c1322); color: var(--r3-ink); font-size: 11.5px; font-weight: 600; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.r3-cal-now { position: absolute; left: -1px; right: 0; height: 2px; background: var(--r3-coral); z-index: 3; pointer-events: none; }
.r3-cal-now::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--r3-coral); }
.r3-calendar .rhythm-page-intro { display: none; }
@media (min-width: 681px) { body .rs-plan-navigation { display: none; } }

/* ---------- Tasks ---------- */
.r3-task-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.r3-quick-add { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--r3-line); background: var(--r3-surface); color: var(--r3-muted); }
.r3-quick-add:focus-within { border-color: color-mix(in srgb, var(--r3-blue) 50%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--r3-blue) 15%, transparent); }
.r3-quick-add input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--r3-ink); font: inherit; outline: none; }
.r3-task-group { padding: 16px 18px 10px; }
.r3-task-group .r3-panel-head { margin-bottom: 6px; }
.r3-task-group h2 { display: flex; align-items: center; gap: 9px; font-size: 14.5px; }
.r3-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone); }
.r3-count { font-size: 12px; font-weight: 600; color: var(--r3-muted); background: #ffffff0d; padding: 2px 7px; border-radius: 6px; }
.r3-task-row { display: flex; align-items: center; gap: 12px; padding: 3px 6px; border-radius: 10px; border-top: 1px solid var(--r3-line); }
.r3-task-row:first-of-type { border-top: 0; }
.r3-task-row:hover { background: var(--r3-raised); }
.r3-task-row .r3-check { flex: 1; min-width: 0; padding: 9px 0; }
.r3-task-text { min-width: 0; overflow-wrap: anywhere; color: var(--r3-ink); }
.r3-task-row.is-done .r3-task-text { color: var(--r3-muted); text-decoration: line-through; }
.r3-due { flex: none; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 7px; color: var(--r3-muted); background: #ffffff0a; font-variant-numeric: tabular-nums; }
.r3-due[class*="tone-"] { color: var(--tone); background: color-mix(in srgb, var(--tone) 15%, transparent); }
.r3-row-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.r3-task-row:hover .r3-row-actions, .r3-task-row:focus-within .r3-row-actions { opacity: 1; }
.r3-row-actions button { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--r3-muted); cursor: pointer; }
.r3-row-actions button:hover { background: var(--r3-hover); color: var(--r3-ink); }
.r3-row-actions svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: none) { .r3-row-actions { opacity: 1; } }
@media (max-width: 680px) {
  .r3-cal-toolbar { padding: 12px; }
  .r3-cal-legend { display: none; }
  .r3-cal-scroll { max-height: none; }
  .r3-cal-grid { min-width: 0; grid-template-columns: 48px minmax(0, 1fr); }
  .r3-head-actions { width: 100%; }
  .r3-head-actions .r3-seg { flex: 1; }
  .r3-head-actions .r3-seg button { flex: 1; }
  .r3-due { font-size: 11px; }
}
/* ---------- Legacy views: page heads and small labels ---------- */
body .page-head, body .rhythm-page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; }
body .page-head > div:first-child > .eyebrow, body .rhythm-page-intro .rhythm-kicker, body .rs-page-head .rhythm-kicker { display: none; }
body .page-head h1, body .rhythm-page-intro h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.025em; color: var(--r3-ink); }
body .page-head p, body .rhythm-page-intro p { margin: 6px 0 0; color: var(--r3-muted); font-size: 14px; }
body .eyebrow, body .rhythm-kicker { display: block; text-transform: lowercase; letter-spacing: 0; font-size: 12.5px; font-weight: 500; color: var(--r3-muted); }
body .eyebrow::first-letter, body .rhythm-kicker::first-letter { text-transform: uppercase; }
body .card-head h2, body .rhythm-panel h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; color: var(--r3-ink); }
body .sub, body .tiny { color: var(--r3-muted); }
body .nav-label { text-transform: none; }
/* ---------- Priorities, timer presets, sounds, habits ---------- */
.r3-prio { flex: none; font-size: 11.5px; font-weight: 650; padding: 4px 9px; border-radius: 7px; color: var(--tone); background: color-mix(in srgb, var(--tone) 16%, transparent); }
.r3-focus-seg { flex-wrap: wrap; justify-content: center; background: #060a13b3; backdrop-filter: blur(10px); }
.r3-custom-len { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px; background: #060a13cc; border: 1px solid var(--r3-line-strong); backdrop-filter: blur(10px); }
.r3-custom-len label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--r3-ink-2); }
.r3-custom-len input { width: 72px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--r3-line-strong); background: var(--r3-bg); color: var(--r3-ink); font: inherit; font-variant-numeric: tabular-nums; }
.r3-focus-lower { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.r3-sounds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.r3-sound { display: grid; justify-items: center; gap: 9px; padding: 16px 8px; border-radius: 14px; border: 1px solid var(--r3-line); background: var(--r3-raised); color: var(--r3-ink-2); font-size: 13px; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.r3-sound .r3-ic { width: 24px; height: 24px; }
.r3-sound:hover { background: var(--r3-hover); color: var(--r3-ink); }
.r3-sound.is-on { background: color-mix(in srgb, var(--r3-blue) 24%, var(--r3-surface)); border-color: color-mix(in srgb, var(--r3-blue) 50%, transparent); color: #fff; box-shadow: 0 0 0 1px color-mix(in srgb, var(--r3-blue) 25%, transparent), 0 10px 26px -14px var(--r3-blue); }
.r3-sound.is-on .r3-ic { color: var(--r3-blue-hi); }
.r3-volume { display: flex; align-items: center; gap: 14px; margin-top: 16px; font-size: 13px; color: var(--r3-muted); }
.r3-volume input { flex: 1; accent-color: var(--r3-blue); }
.r3-habits { grid-column: 1 / -1; }
.r3-habit-table { display: grid; gap: 6px; overflow-x: auto; }
.r3-habit-days, .r3-habit { display: grid; grid-template-columns: minmax(170px, 1.4fr) repeat(7, 38px) 52px 32px; align-items: center; gap: 8px; min-width: 560px; }
.r3-habit-days small { text-align: center; font-size: 12px; color: var(--r3-muted); }
.r3-habit-days small.is-today { color: var(--r3-blue-hi); font-weight: 650; }
.r3-habit { padding: 10px 12px; border-radius: 12px; background: var(--r3-raised); border: 1px solid var(--r3-line); }
.r3-habit-name { min-width: 0; display: flex; align-items: center; gap: 10px; }
.r3-habit-name::before { content: ""; width: 4px; align-self: stretch; border-radius: 4px; background: var(--tone); flex: none; }
.r3-habit-name b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r3-habit-name small { display: block; font-size: 12px; color: var(--r3-muted); margin-top: 2px; }
.r3-habit-name > b, .r3-habit-name > small { grid-column: 2; }
.r3-habit-name { display: grid; grid-template-columns: 4px 1fr; column-gap: 10px; }
.r3-habit-name::before { grid-row: 1 / 3; }
.r3-habit-day { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1.5px solid var(--r3-line-strong); background: transparent; color: #fff; cursor: pointer; transition: background .15s, border-color .15s; }
.r3-habit-day:hover:not(:disabled) { border-color: var(--tone); }
.r3-habit-day.is-today { border-color: color-mix(in srgb, var(--tone) 60%, var(--r3-line-strong)); }
.r3-habit-day.is-on { background: var(--tone); border-color: var(--tone); }
.r3-habit-day:disabled { opacity: .35; cursor: default; }
.r3-habit-day .r3-ic { width: 17px; height: 17px; stroke-width: 2.6; }
.r3-habit-day .r3-ic rect, .r3-habit-chip .r3-ic rect { display: none; }
.r3-habit-pct { text-align: right; font-weight: 650; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.r3-habit-del { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--r3-faint); cursor: pointer; }
.r3-habit-del:hover { background: var(--r3-hover); color: var(--r3-coral); }
.r3-habit-del svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.r3-habit-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; padding: 12px; border-radius: 12px; background: var(--r3-raised); border: 1px solid var(--r3-line-strong); }
.r3-habit-form input[name="name"] { flex: 1; min-width: 200px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--r3-line-strong); background: var(--r3-bg); color: var(--r3-ink); font: inherit; }
.r3-habit-form select { height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--r3-line-strong); background: var(--r3-bg); color: var(--r3-ink); font: inherit; }
.r3-color-pick { display: flex; gap: 6px; }
.r3-color-pick label { position: relative; cursor: pointer; }
.r3-color-pick input { position: absolute; opacity: 0; }
.r3-color-pick span { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--tone); box-shadow: 0 0 0 2px var(--r3-raised); }
.r3-color-pick input:checked + span { box-shadow: 0 0 0 2px var(--r3-raised), 0 0 0 4px var(--tone); }
.r3-color-pick input:focus-visible + span { outline: 2px solid var(--r3-blue-hi); outline-offset: 4px; }
.r3-habits-today { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--r3-line); }
.r3-habits-today small { width: 100%; font-size: 12.5px; color: var(--r3-muted); margin-bottom: 2px; }
.r3-habit-chip { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent); background: transparent; color: var(--r3-ink-2); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.r3-habit-chip.is-on { background: color-mix(in srgb, var(--tone) 22%, transparent); color: #fff; }
.r3-habit-chip .r3-ic { width: 14px; height: 14px; stroke-width: 2.6; color: var(--tone); }
@media (max-width: 920px) { .r3-focus-lower { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .r3-sounds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r3-focus-seg { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .r3-focus-seg button { padding: 0 8px; }
  .r3-habit-days, .r3-habit { grid-template-columns: repeat(7, minmax(0, 1fr)) 40px; min-width: 0; gap: 5px; }
  .r3-habit-days > span:first-child, .r3-habit-days > span:last-child, .r3-habit-del { display: none; }
  .r3-habit-name { grid-column: 1 / -1; margin-bottom: 4px; }
  .r3-habit-pct { font-size: 12px; }
  .r3-habit-day { width: 100%; height: 34px; border-radius: 9px; }
  .r3-habit { padding: 10px; }
  .r3-task-bar .r3-seg { width: 100%; }
  .r3-task-bar .r3-seg button { flex: 1; padding: 0 8px; }
}
/* ---------- Notes ---------- */
.r3-note-search { flex: 0 1 300px; min-width: 200px; }
.r3-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.r3-chip-btn { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--r3-line); background: var(--r3-surface); color: var(--r3-ink-2); font-size: 13px; font-weight: 500; cursor: pointer; }
.r3-chip-btn:hover { background: var(--r3-hover); color: var(--r3-ink); }
.r3-chip-btn.is-active { background: var(--r3-blue); border-color: var(--r3-blue); color: #fff; }
.r3-note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.r3-note-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 14px; border-radius: 16px; border: 1px solid var(--r3-line); background: var(--r3-surface); color: var(--r3-ink); text-align: left; cursor: pointer; transition: border-color .15s, transform .15s, background .15s; }
.r3-note-card:hover { border-color: color-mix(in srgb, var(--tone) 55%, var(--r3-line)); background: var(--r3-raised); }
.r3-note-card[hidden] { display: none; }
.r3-note-head { display: flex; align-items: flex-start; gap: 8px; }
.r3-note-head b { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.r3-note-pin .r3-ic { width: 15px; height: 15px; color: var(--r3-amber); }
.r3-note-card > small { font-size: 12px; color: var(--r3-muted); }
.r3-note-paper { position: relative; display: grid; align-content: start; gap: 4px; height: 128px; margin-top: 10px; padding: 12px 12px 12px 14px; overflow: hidden; border-radius: 11px; background: linear-gradient(180deg, #f3efe6, #e9e3d6); color: #2b2f38; font-size: 11.5px; line-height: 1.45; box-shadow: inset 4px 0 0 var(--tone); }
.r3-note-paper::after { content: ""; position: absolute; inset: auto 0 0; height: 36px; background: linear-gradient(transparent, #e9e3d6); }
.r3-note-paper strong { font-size: 12.5px; color: #12151c; }
.r3-note-paper span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r3-note-paper em { color: #7d8290; }
.r3-back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px; height: 34px; padding: 0 12px 0 8px; border-radius: 10px; border: 1px solid var(--r3-line); background: var(--r3-surface); color: var(--r3-ink-2); font-size: 13px; font-weight: 500; cursor: pointer; }
.r3-back:hover { background: var(--r3-hover); color: var(--r3-ink); }
.r3-back .r3-ic { width: 16px; height: 16px; }
@media (max-width: 680px) { .r3-note-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .r3-note-paper { height: 96px; } .r3-note-search { flex: 1 1 100%; } }
/* ---------- Exams ---------- */
.r3-exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.r3-exam-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; border: 1px solid var(--r3-line); background: var(--r3-surface); color: var(--r3-ink); text-align: left; cursor: pointer; }
.r3-exam-card:hover { background: var(--r3-raised); border-color: var(--r3-line-strong); }
.r3-exam-days.is-big { width: 66px; height: 66px; border-radius: 14px; }
.r3-exam-days.is-big b { font-size: 28px; }
.r3-exam-card .r3-exam-copy { display: grid; gap: 4px; }
.r3-exam-card .r3-meter { margin-top: 6px; }
.r3-exam-card em { font-style: normal; font-size: 11.5px; color: var(--r3-muted); }
.r3-prep { display: grid; gap: 12px; }
.r3-prep-row { display: grid; grid-template-columns: 36px minmax(110px, 200px) 1fr 44px; align-items: center; gap: 12px; }
.r3-prep-row b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r3-prep-row em { font-style: normal; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 13px; }
.r3-legacy-grades { margin-top: 20px; }
.r3-legacy-grades .page-head > div:first-child { display: none; }
.r3-legacy-grades .page-head { justify-content: flex-end; margin-bottom: 12px; }
.r3-note-editor-wrap .page-head > div:first-child { display: none; }
.r3-note-editor-wrap .page-head { justify-content: flex-end; margin: -48px 0 12px; }
.r3-note-search { flex: none; width: 280px; }
@media (max-width: 680px) { .r3-prep-row { grid-template-columns: 32px 1fr 40px; } .r3-prep-row .r3-meter { grid-column: 2 / 4; grid-row: 2; } .r3-note-editor-wrap .page-head { margin-top: 0; } .r3-note-search { width: 100%; } }
/* ---------- Light mode ---------- */
body.r3-light {
  color-scheme: light;
  --r3-bg: #f3f5fa;
  --r3-side: #ffffff;
  --r3-surface: #ffffff;
  --r3-raised: #f4f6fb;
  --r3-hover: #e9eef7;
  --r3-line: #e2e7f0;
  --r3-line-strong: #d2d9e6;
  --r3-ink: #0f1728;
  --r3-ink-2: #3a455b;
  --r3-muted: #657088;
  --r3-faint: #97a1b5;
  --r3-shadow: 0 1px 2px #0f172808, 0 12px 30px -22px #0f172840;
  --r3-nav-active-ink: var(--r3-ink);
  --green2: color-mix(in srgb, var(--r3-blue) 12%, #fff);
}
/* Photo areas keep light text in both modes. */
body .r3-hero, body .r3-current, body .r3-focus-stage, body .r3-goal-hero {
  --r3-ink: #eef2fb; --r3-ink-2: #c3cbdc; --r3-muted: #a9b3c7; --r3-faint: #7c879e;
  --r3-raised: #ffffff14; --r3-hover: #ffffff22; --r3-line: #ffffff1c; --r3-line-strong: #ffffff2e; --r3-surface: #0c1322;
  color: var(--r3-ink);
}
body.r3-light .r3-sidebar .side-user b { color: var(--r3-ink); }
body.r3-light .r3-side-bottom { background: linear-gradient(180deg, var(--r3-side) 0%, #ffffffcc 35%, #ffffffee 100%), url("./images/mountains.jpg") center 30% / cover; }
body.r3-light .topbar { background: #f3f5fae6; }
body.r3-light .r3-nav .nav-item.active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--r3-blue) 30%, transparent); }
body.r3-light .r3-nav .nav-item.active svg { color: var(--r3-blue); }
body.r3-light .r3-exam-days { color: var(--r3-ink); }
body.r3-light .r3-exam-days small { color: var(--r3-blue); }
body.r3-light .r3-exam-days { background: color-mix(in srgb, var(--r3-blue) 12%, #fff); border-color: color-mix(in srgb, var(--r3-blue) 30%, transparent); }
body.r3-light .r3-wrapped { background: linear-gradient(110deg, #efeaff, #eef3ff 60%); border-color: #d9d0ff; }
body.r3-light .r3-setup { background: linear-gradient(110deg, color-mix(in srgb, var(--r3-blue) 10%, #fff), #fff); }
body.r3-light .r3-sound.is-on { color: var(--r3-ink); }
body.r3-light .r3-sound.is-on .r3-ic { color: var(--r3-blue); }
body.r3-light .r3-habit-chip.is-on { color: var(--r3-ink); }
body.r3-light .r3-bar em { color: var(--r3-ink); }
body.r3-light .r3-cal-block { background: color-mix(in srgb, var(--tone) 16%, #fff); }
body.r3-light .r3-cal-block small { color: var(--r3-muted); }
body.r3-light .r3-cal-pill { background: color-mix(in srgb, var(--tone) 20%, #fff); }
body.r3-light .r3-cal-col.is-today { background: color-mix(in srgb, var(--r3-blue) 4%, transparent); }
body.r3-light .r3-meter, body.r3-light .r3-focus-progress, body.r3-light .r3-side-week .progress { background: #0f172812; }
body.r3-light .r3-ring-track { stroke: #0f172814; }
body.r3-light .r3-count, body.r3-light .r3-due { background: #0f17280a; }
body.r3-light .r3-btn-ghost:not(.r3-current .r3-btn-ghost) { background: var(--r3-raised); border-color: var(--r3-line-strong); color: var(--r3-ink); }
body.r3-light .r3-donut span { background: var(--r3-surface); }
body.r3-light .modal { background: #0f172859; }
body.r3-light .mobile-nav { background: #fffffff2; }
body.r3-light .note-format-toolbar button { color: var(--r3-ink-2); }
body.r3-light .note-format-toolbar button:hover { background: var(--r3-hover); color: var(--r3-ink); }

/* ---------- Appearance settings ---------- */
.r3-appearance .r3-seg { width: 100%; }
.r3-appearance .r3-seg button { flex: 1; }
.r3-accents { display: flex; gap: 10px; margin: 14px 0 4px; flex-wrap: wrap; }
.r3-accent { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--sw); cursor: pointer; box-shadow: 0 0 0 2px var(--r3-surface); }
.r3-accent.is-active { box-shadow: 0 0 0 2px var(--r3-surface), 0 0 0 4px var(--sw); }
.r3-field-label { display: block; margin: 16px 0 8px; font-size: 13px; font-weight: 500; color: var(--r3-ink-2); }
/* ---------- Legacy components aligned to the new look (both modes) ---------- */
body .study-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--r3-surface); border: 1px solid var(--r3-line); }
body .study-tabs button { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--r3-muted); font-weight: 500; font-size: 13px; }
body .study-tabs button svg { width: 16px; height: 16px; }
body .study-tabs button:hover { color: var(--r3-ink); }
body .study-tabs button.selected { background: var(--r3-blue); color: #fff; }
body .ai-suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
body .ai-suggestions button { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--r3-line-strong); background: var(--r3-raised); color: var(--r3-ink-2); font-size: 13px; font-weight: 500; }
body .ai-suggestions button:hover { background: var(--r3-hover); color: var(--r3-ink); border-color: color-mix(in srgb, var(--r3-blue) 45%, var(--r3-line-strong)); }
body #aiPrompt { background: var(--r3-bg); color: var(--r3-ink); border: 1px solid var(--r3-line-strong); border-radius: 12px; }
body #aiPrompt:focus { border-color: var(--r3-blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--r3-blue) 18%, transparent); outline: none; }
body .stat-icon { background: color-mix(in srgb, var(--r3-blue) 16%, transparent); color: var(--r3-blue-hi); }
body .progress { background: color-mix(in srgb, var(--r3-ink) 10%, transparent); }
body .progress i { background: linear-gradient(90deg, var(--r3-blue), var(--r3-blue-hi)); }
body .course-grade, body .grade-chip { background: var(--r3-raised); color: var(--r3-ink); border: 1px solid var(--r3-line); }
body .event-card { background: var(--r3-raised); border: 1px solid var(--r3-line); color: var(--r3-ink); }
body .subject-add { background: var(--r3-raised); color: var(--r3-ink-2); border: 1px dashed var(--r3-line-strong); }
body .subject-add:hover { background: var(--r3-hover); color: var(--r3-ink); }
body.r3-light .note-item.active, body.r3-light .note-item:hover { background: var(--r3-hover); }
body.r3-light .note-item { color: var(--r3-ink); }
/* ---------- Sign-in ---------- */
body .auth-screen { background: #060a13; place-items: center start; padding: 32px clamp(20px, 8vw, 120px); }
body .auth-screen::before { background-image: linear-gradient(90deg, #060a13f2 0%, #060a13b8 42%, #060a1326 100%), linear-gradient(0deg, #060a13d9, transparent 55%), url("./images/mountains.jpg"); background-size: cover, cover, cover; background-position: center, center, 62% 40%; }
body .auth-splash { width: min(100%, 460px); height: auto; min-height: 0; margin: 0; padding: 0; text-align: left; display: grid; gap: 26px; justify-items: start; align-items: start; }
body .auth-splash[hidden] { display: none; }
body .auth-splash-brand { justify-items: start; text-shadow: none; }
body .auth-splash-tagline { text-shadow: 0 2px 18px #060a13; }
body .auth-splash-actions { margin-top: 6px; padding-top: 0; }
body .auth-card { margin: 0; }
.r3-auth-brand { display: inline-flex; align-items: center; gap: 12px; }
.r3-auth-brand svg { width: 40px; height: 40px; }
.r3-auth-brand b { font-family: "Rytm Inter", Inter, sans-serif; font-size: 28px; font-weight: 750; letter-spacing: -.03em; color: #fff; font-style: normal; }
body .r3-auth-brand b span { font: inherit; font-weight: 500; letter-spacing: inherit; color: #c3cbdc; }
body .auth-splash-tagline { margin: 0; font-family: "Rytm Inter", Inter, sans-serif; font-style: normal; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.3; font-weight: 500; letter-spacing: -.02em; color: #eef2fb; text-align: left; max-width: 22ch; }
body .auth-splash-actions { display: grid; gap: 10px; width: min(340px, 100%); }
body .auth-splash-primary { height: 50px; border: 0; border-radius: 13px; background: var(--r3-blue); color: #fff; font-weight: 650; font-size: 15px; box-shadow: 0 14px 34px -14px var(--r3-blue); }
body .auth-splash-primary:hover { background: color-mix(in srgb, var(--r3-blue) 88%, #fff); }
body .auth-splash-secondary { height: 50px; border-radius: 13px; border: 1px solid #ffffff33; background: #ffffff12; color: #fff; font-weight: 600; font-size: 15px; backdrop-filter: blur(10px); }
body .auth-splash-secondary:hover { background: #ffffff20; }
body .auth-card { width: min(420px, 100%); padding: 28px; border-radius: 22px; background: #0b1222e6; border: 1px solid #ffffff1f; backdrop-filter: blur(20px); box-shadow: 0 40px 90px -40px #000; color: #eef2fb; }
body .auth-card .r3-auth-brand { display: flex; margin-bottom: 18px; }
body .auth-card .auth-back { display: flex; }
body .auth-card .r3-auth-brand svg { width: 32px; height: 32px; }
body .auth-card .r3-auth-brand b { font-size: 21px; }
body .auth-card h1 { font-family: "Rytm Inter", Inter, sans-serif; font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; color: #fff; }
body .auth-card p { color: #a9b3c7; }
body .auth-card .field { color: #c3cbdc; }
body .auth-card .field input { background: #060a13; border-color: #253252; color: #eef2fb; }
body .auth-card .auth-submit { width: 100%; height: 48px; margin-top: 6px; }
body .auth-back { color: #c3cbdc; }
@media (max-width: 680px) { body .auth-screen { place-items: end center; padding: 24px 20px calc(28px + env(safe-area-inset-bottom)); } body .auth-screen::before { background-image: linear-gradient(0deg, #060a13f5 0%, #060a13b0 50%, #060a1320 100%), url("./images/mountains.jpg"); background-size: cover, cover; background-position: center, 60% 30%; } body .auth-card { margin: auto; } body .auth-splash { justify-items: stretch; } body .auth-splash-actions { width: 100%; } }
/* ---------- Plan tabs (mobile) ---------- */
@media (max-width: 680px) {
  body .rs-plan-navigation { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; margin: 0; border-radius: 12px; background: var(--r3-surface); border: 1px solid var(--r3-line); }
  body .rs-plan-navigation button { height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--r3-muted); font-size: 13px; font-weight: 600; }
  body .rs-plan-navigation button.is-active { background: var(--r3-blue); color: #fff; }
  .r3-calendar .r3-page-head p, .r3-tasks .r3-page-head p { display: none; }
}

/* ---------- AI tutor ---------- */
.r3-ai .page-head > div:first-child { display: none; }
.r3-ai .page-head { justify-content: flex-end; margin: 0 0 -6px; }
.r3-ai .ai-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; margin-top: 16px; }
.r3-ai .ai-chat-card { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: calc(100vh - 210px); padding: 0; background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--r3-blue) 14%, transparent), transparent 60%), var(--r3-surface); }
.r3-ai .ai-chat-heading { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--r3-line); }
.r3-ai .ai-chat-heading h2 { margin: 0; font-size: 16px; }
.r3-ai .ai-chat-heading .sub { margin: 2px 0 0; font-size: 12.5px; }
.r3-ai-avatar { position: relative; width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--r3-blue) 16%, transparent); }
.r3-ai-avatar .r3-robot { width: 32px; height: 32px; }
.r3-ai-avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--r3-mint); box-shadow: 0 0 0 2.5px var(--r3-surface); }
.r3-ai-avatar.is-sm { width: 26px; height: 26px; border-radius: 9px; }
.r3-ai-avatar.is-sm .r3-robot { width: 20px; height: 20px; }
.r3-ai-avatar.is-sm::after { display: none; }
.r3-ai .ai-chat-feed { flex: 1; padding: 20px; overflow-y: auto; max-height: none; display: flex; flex-direction: column; gap: 16px; }
.r3-ai-empty { margin: auto; max-width: 620px; text-align: center; display: grid; justify-items: center; gap: 10px; padding: 20px 0; }
.r3-ai-hero { position: relative; width: 110px; height: 110px; display: grid; place-items: center; margin-bottom: 6px; }
.r3-ai-hero::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; background: conic-gradient(from 0deg, #3d7cff, #8b6cff, #5fe0ff, #3d7cff); filter: blur(26px); opacity: .45; animation: r3-spin 9s linear infinite; }
.r3-ai-hero .r3-robot { position: relative; width: 96px; height: 96px; filter: drop-shadow(0 12px 22px #3d7cff66); animation: r3-float 4s ease-in-out infinite; }
.r3-robot-eye { transform-box: fill-box; transform-origin: center; animation: r3-blink 5s infinite; }
.r3-robot-led { animation: r3-led 2.4s ease-in-out infinite; }
@keyframes r3-spin { to { transform: rotate(360deg); } }
@keyframes r3-float { 50% { transform: translateY(-6px); } }
@keyframes r3-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
@keyframes r3-led { 50% { opacity: .35; } }
.r3-ai-empty h2 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; letter-spacing: -.02em; background: linear-gradient(90deg, var(--r3-ink), color-mix(in srgb, var(--r3-blue-hi) 70%, var(--r3-ink))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.r3-ai-empty p { margin: 0 0 10px; color: var(--r3-muted); font-size: 14px; max-width: 46ch; line-height: 1.5; }
.r3-ai-suggest { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.r3-ai-suggest button { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--r3-line); background: var(--r3-raised); color: var(--r3-ink-2); font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.r3-ai-suggest button:hover { background: var(--r3-hover); border-color: color-mix(in srgb, var(--r3-blue) 45%, var(--r3-line)); color: var(--r3-ink); }
.r3-ai-suggest .r3-quick-ic { width: 34px; height: 34px; border-radius: 10px; }
.r3-ai .ai-message { max-width: 82%; padding: 0; border: 0; background: none; }
.r3-ai .ai-message.user { align-self: flex-end; }
.r3-ai .ai-message.assistant { align-self: flex-start; }
.r3-ai .ai-message-label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--r3-muted); }
.r3-ai .ai-message.user .ai-message-label { justify-content: flex-end; }
.r3-ai .ai-message-body { padding: 12px 15px; border-radius: 16px; line-height: 1.6; font-size: 14px; }
.r3-ai .ai-message.user .ai-message-body { background: var(--r3-blue); color: #fff; border-bottom-right-radius: 5px; }
.r3-ai .ai-message.assistant .ai-message-body { background: var(--r3-raised); border: 1px solid var(--r3-line); color: var(--r3-ink); border-top-left-radius: 5px; }
.r3-ai .ai-thinking { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 14px; background: var(--r3-raised); color: var(--r3-muted); font-size: 13px; }
.r3-ai .ai-thinking span { width: 7px; height: 7px; border-radius: 50%; background: var(--r3-blue-hi); animation: r3-led 1s ease-in-out infinite; }
.r3-ai .ai-thinking span:nth-child(2) { animation-delay: .15s; } .r3-ai .ai-thinking span:nth-child(3) { animation-delay: .3s; }
.r3-ai .ai-compose { margin: 0 16px 16px; padding: 8px; border-radius: 18px; border: 1px solid var(--r3-line-strong); background: var(--r3-bg); box-shadow: 0 10px 30px -18px #000; }
.r3-ai .ai-compose:focus-within { border-color: color-mix(in srgb, var(--r3-blue) 60%, var(--r3-line-strong)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--r3-blue) 16%, transparent); }
.r3-ai #aiPrompt { width: 100%; min-height: 52px; max-height: 200px; padding: 8px 10px; border: 0; background: transparent; box-shadow: none; resize: vertical; font: inherit; font-size: 14.5px; }
.r3-ai #aiPrompt:focus { box-shadow: none; border: 0; }
.r3-ai .ai-compose-row { display: flex; align-items: center; gap: 10px; padding: 4px 2px 0; }
.r3-ai .ai-compose-row .tiny { margin-right: auto; font-size: 12px; }
.r3-ai .ai-compose-row .quiet { height: 36px; border-radius: 999px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; }
.r3-ai .ai-compose-row .btn { height: 38px; border-radius: 999px; padding: 0 18px; display: inline-flex; align-items: center; gap: 7px; }
.r3-ai .ai-compose-row svg { width: 16px; height: 16px; }
.r3-ai .ai-side { display: grid; gap: 16px; }
.r3-ai .ai-side .eyebrow { display: none; }
.r3-ai .ai-side h2 { font-size: 15px; margin: 0 0 12px; }
.r3-ai .ai-web-toggle { display: flex; gap: 10px; align-items: flex-start; padding: 12px; margin-top: 12px; border-radius: 12px; background: var(--r3-raised); border: 1px solid var(--r3-line); cursor: pointer; }
.r3-ai .ai-web-toggle input { accent-color: var(--r3-blue); margin-top: 3px; }
.r3-ai .ai-web-toggle b { display: block; font-size: 13.5px; }
.r3-ai .ai-web-toggle small { display: block; color: var(--r3-muted); font-size: 12px; margin-top: 2px; }
.r3-ai .ai-meta { color: var(--r3-muted); font-size: 12.5px; line-height: 1.55; }
@media (max-width: 1100px) { .r3-ai .ai-layout { grid-template-columns: 1fr; } .r3-ai .ai-chat-card { min-height: 560px; } }
@media (max-width: 680px) { .r3-ai-suggest { grid-template-columns: 1fr 1fr; } .r3-ai .ai-message { max-width: 92%; } .r3-ai .ai-chat-feed { padding: 14px; } .r3-ai .ai-compose { margin: 0 10px 10px; } .r3-ai-hero { width: 90px; height: 90px; } .r3-ai-hero .r3-robot { width: 78px; height: 78px; } }
@media (prefers-reduced-motion: reduce) { .r3-ai-hero::before, .r3-ai-hero .r3-robot, .r3-robot-eye, .r3-robot-led, .r3-ai .ai-thinking span { animation: none; } }

/* ---------- Grades ---------- */
.r3-section-head { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.r3-section-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.r3-grade-summary { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.r3-grade-big { display: grid; gap: 2px; padding-right: 28px; border-right: 1px solid var(--r3-line); }
.r3-grade-big small { color: var(--r3-muted); font-size: 12.5px; }
.r3-grade-big b { font-size: 44px; line-height: 1; font-weight: 750; letter-spacing: -.03em; color: var(--tone); font-variant-numeric: tabular-nums; }
.r3-grade-facts { display: flex; gap: 32px; flex-wrap: wrap; }
.r3-grade-facts small { display: block; color: var(--r3-muted); font-size: 12.5px; }
.r3-grade-facts b { display: block; margin-top: 4px; font-size: 18px; font-weight: 650; }
.r3-grade-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.r3-grade-card { display: grid; gap: 14px; padding: 18px; border-radius: var(--r3-r-lg); border: 1px solid var(--r3-line); background: var(--r3-surface); box-shadow: inset 3px 0 0 var(--tone), var(--r3-shadow); }
.r3-grade-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.r3-grade-card h3 { margin: 0; font-size: 16px; font-weight: 650; }
.r3-grade-card header small { color: var(--r3-muted); font-size: 12.5px; }
.r3-grade-avg { display: grid; justify-items: center; min-width: 64px; padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--tone) 15%, transparent); }
.r3-grade-avg b { font-size: 20px; line-height: 1.1; font-weight: 750; color: var(--tone); font-variant-numeric: tabular-nums; }
.r3-grade-avg small { font-size: 11px; color: var(--r3-muted); }
.r3-grade-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 32px; align-items: center; }
.r3-grade-chip { display: inline-flex; align-items: baseline; gap: 2px; height: 32px; min-width: 38px; justify-content: center; align-items: center; padding: 0 10px; border-radius: 9px; background: color-mix(in srgb, var(--tone) 16%, transparent); color: var(--tone); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.r3-grade-chip small { font-size: 10.5px; font-weight: 600; opacity: .8; }
.r3-grade-progress { display: flex; align-items: center; gap: 10px; }
.r3-grade-progress em { font-style: normal; font-size: 12px; color: var(--r3-muted); white-space: nowrap; }
.r3-grade-card footer { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 680px) { .r3-grade-big { border-right: 0; padding-right: 0; } .r3-grade-summary { gap: 16px; } .r3-grade-grid { grid-template-columns: 1fr; } }
/* =========================================================================
   Refinement pass: calmer surfaces, real typographic hierarchy, fewer boxes.
   ========================================================================= */
body { --r3-r-lg: 14px; --r3-r-md: 11px; --r3-shadow: none; font-optical-sizing: auto; letter-spacing: -.003em; }
body .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.r3-num, .r3-hero-stat b, .r3-week-total b, .r3-stat b, .r3-grade-big b, .r3-focus-dial-core b, .r3-exam-days b { font-variation-settings: "opsz" 32; }

/* Type scale: page titles carry the hierarchy, panel titles stay quiet. */
.r3-page-head h1, body .page-head h1, body .rhythm-page-intro h1 { font-size: 30px; font-weight: 650; letter-spacing: -.032em; font-variation-settings: "opsz" 32; }
.r3-page-head p, body .page-head p { font-size: 14px; color: var(--r3-muted); }
.r3-panel-head h2, body .card-head h2 { font-size: 14px; font-weight: 600; letter-spacing: -.005em; color: var(--r3-ink); }
.r3-panel-head { min-height: 28px; margin-bottom: 10px; }

/* Surfaces: one border, no glow, no gradient washes. */
body .card, body .rhythm-panel, body .r3-panel { box-shadow: none; border-color: var(--r3-line); }
body .btn, .r3-btn-primary { box-shadow: inset 0 1px 0 #ffffff26; }
.r3-seg button.is-active { box-shadow: none; }
.r3-round-btn.is-main { box-shadow: 0 0 0 6px color-mix(in srgb, var(--r3-blue) 18%, transparent); }
body .topbar .btn { height: 38px; padding: 0 14px; }

/* Sidebar: quiet active state with an accent rail instead of a glowing pill. */
body .r3-nav .nav-item { height: 34px; border-radius: 8px; font-size: 13.5px; color: var(--r3-muted); }
body .r3-nav .nav-item svg { width: 18px; height: 18px; opacity: .9; }
body .r3-nav .nav-item:hover { background: color-mix(in srgb, var(--r3-ink) 5%, transparent); color: var(--r3-ink); }
body .r3-nav .nav-item.active { background: color-mix(in srgb, var(--r3-ink) 7%, transparent); box-shadow: none; color: var(--r3-ink); font-weight: 600; }
body .r3-nav .nav-item.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--r3-blue); }
body .r3-nav .nav-item.active svg { color: var(--r3-blue-hi); }
body .r3-nav .nav-item.active .nav-count { background: var(--r3-blue); }
body .r3-nav .nav-label { margin: 14px 12px 4px; font-size: 11.5px; }
.r3-brand { padding-bottom: 14px; }
body.r3-light .r3-nav .nav-item.active svg { color: var(--r3-blue); }

/* Topbar: only the page title and the tools. */
body .topbar { height: 58px; }
body .topbar .crumb #crumbDate, body .topbar .crumb { font-size: 0; }
body .topbar .crumb b { font-size: 15px; font-weight: 600; }
body .topbar .icon-btn { width: 38px; height: 38px; border-color: transparent; background: transparent; }
body .topbar .icon-btn:hover { background: color-mix(in srgb, var(--r3-ink) 6%, transparent); }
body .topbar .search { height: 38px; background: color-mix(in srgb, var(--r3-ink) 4%, transparent); }

/* Hero: shorter, editorial, stats as a ruled strip rather than glass tiles. */
.r3-hero { min-height: 0; border-radius: 16px; }
.r3-hero::before { background: linear-gradient(90deg, #060a13f0 0%, #060a13b0 38%, #060a1330 75%, #060a1310 100%), linear-gradient(0deg, #060a13e6 0%, #060a1300 55%); }
.r3-hero-body { min-height: 0; gap: 34px; padding: 28px 30px 0; }
.r3-hero-kicker { margin: 0 0 10px; font-size: 13px; color: #b9c3d6; font-variant-numeric: tabular-nums; }
.r3-hero-kicker time { color: #fff; font-weight: 600; }
.r3-hero h1 { font-size: clamp(30px, 3.2vw, 42px); font-weight: 600; letter-spacing: -.035em; font-variation-settings: "opsz" 32; }
.r3-quote { margin-top: 8px; font-size: 14px; color: #aeb9cd; }
.r3-hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid #ffffff1f; margin: 0 -30px; }
.r3-hero-stat { display: grid; gap: 4px; padding: 16px 30px 18px; border: 0; border-left: 1px solid #ffffff14; background: transparent; color: #fff; text-align: left; cursor: pointer; transition: background .15s; }
.r3-hero-stat:first-child { border-left: 0; }
.r3-hero-stat:hover { background: #ffffff0d; }
.r3-hero-stat span { font-size: 12.5px; color: #aeb9cd; }
.r3-hero-stat b { font-size: 30px; font-weight: 400; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; }
.r3-hero-stat b small { font-size: 14px; font-weight: 500; color: #aeb9cd; margin-left: 3px; letter-spacing: 0; }
.r3-hero-stat b i { font-style: normal; color: #7f8aa3; }

/* Lists: rows divided by hairlines instead of boxes inside boxes. */
.r3-next-list, .r3-exam-list, .r3-progress-list { gap: 0; }
.r3-next-row, .r3-note-row, .r3-exam-row, .r3-progress-row { border: 0; border-top: 1px solid var(--r3-line); border-radius: 0; background: transparent; padding: 12px 6px; margin: 0 -6px; width: calc(100% + 12px); }
.r3-next-list > :first-child, .r3-exam-list > :first-child, .r3-progress-list > :first-child { border-top: 0; }
.r3-next-row:hover, .r3-note-row:hover, .r3-exam-row:hover, .r3-progress-row:hover { background: color-mix(in srgb, var(--r3-ink) 4%, transparent); border-color: var(--r3-line); border-radius: 10px; }
.r3-next-row:hover + *, .r3-exam-row:hover + *, .r3-note-row:hover + * { border-top-color: transparent; }
.r3-next-ic { width: 32px; height: 32px; border-radius: 9px; background: transparent; border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent); }
.r3-next-ic .r3-ic { width: 16px; height: 16px; }
.r3-exam-days { width: 48px; height: 48px; border-radius: 10px; background: transparent; border: 1px solid var(--r3-line-strong); }
.r3-exam-days b { font-size: 20px; font-weight: 500; }
.r3-exam-days small { color: var(--r3-muted); }
body.r3-light .r3-exam-days { background: transparent; }

/* Current task: the photo stays, the box-in-box goes. */
.r3-now { padding: 0; overflow: hidden; }
.r3-now-grid { gap: 0; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.r3-now-grid > div:first-child { padding: 18px 20px 20px; border-right: 1px solid var(--r3-line); }
.r3-next { padding: 18px 20px 14px; }
.r3-current { border-radius: 12px; border: 0; min-height: 190px; }
.r3-current-body { min-height: 190px; }
.r3-current-head h3 { font-size: 20px; font-weight: 600; }

/* Quick actions: a compact command row. */
.r3-quick { padding: 14px 16px; }
.r3-quick .r3-panel-head { display: none; }
.r3-quick-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.r3-quick-btn { display: inline-flex; align-items: center; gap: 9px; min-height: 0; height: 40px; padding: 0 14px 0 10px; border-radius: 10px; border: 1px solid var(--r3-line); background: transparent; font-size: 13.5px; color: var(--r3-ink-2); }
.r3-quick-btn:hover { background: color-mix(in srgb, var(--r3-ink) 5%, transparent); border-color: var(--r3-line-strong); }
.r3-quick-ic { width: auto; height: auto; background: none; border-radius: 0; }
.r3-quick-ic .r3-ic { width: 17px; height: 17px; }

/* Charts and banners. */
.r3-week-total b { font-size: 34px; font-weight: 400; letter-spacing: -.03em; }
.r3-bars { gap: 14px; border-bottom: 1px solid var(--r3-line); }
.r3-bar { gap: 8px; }
.r3-bar i { border-radius: 5px 5px 0 0; background: color-mix(in srgb, var(--r3-blue) 55%, var(--r3-surface)); opacity: 1; max-width: 44px; justify-self: center; width: 100%; }
.r3-bar.is-today i { background: var(--r3-blue); box-shadow: none; }
.r3-bar em { background: none; padding: 0; color: var(--r3-ink-2); font-weight: 500; }
.r3-bar small { order: 2; }
.r3-wrapped, body.r3-light .r3-wrapped { background: transparent; border: 1px dashed var(--r3-line-strong); }
.r3-stat { gap: 6px; padding: 16px 18px 18px; }
.r3-stat b { font-size: 30px; font-weight: 400; letter-spacing: -.03em; }
.r3-goal-meter b, .r3-habit-pct { font-weight: 500; }

/* Chips, badges and checkboxes a notch smaller and calmer. */
.r3-chip { height: 22px; font-size: 11.5px; padding: 0 9px; border-radius: 6px; }
.r3-due, .r3-prio { border-radius: 6px; font-weight: 600; }
.r3-check-box { border-radius: 5px; }
.r3-task-group { padding: 14px 18px 8px; }

/* Focus, goals, notes, AI, grades. */
.r3-focus-stage { border-radius: 16px; min-height: 520px; }
.r3-focus-dial { box-shadow: none; padding: 6px; background: conic-gradient(var(--r3-blue-hi) var(--timer-pct), #ffffff12 0); }
.r3-focus-dial-core b { font-weight: 300; letter-spacing: -.05em; }
.r3-sound { border-radius: 12px; background: transparent; }
.r3-sound.is-on { box-shadow: none; }
.r3-note-card { border-radius: 14px; padding: 12px; }
.r3-note-paper { border-radius: 8px; box-shadow: inset 3px 0 0 var(--tone); }
.r3-grade-card { box-shadow: none; border-top: 3px solid var(--tone); border-radius: 12px; }
.r3-grade-big b, .r3-grade-avg b { font-weight: 500; }
.r3-ai { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 16px; }
.r3-ai > .page-head { grid-column: 2; grid-row: 1; margin: 0; }
.r3-ai > .study-tabs { grid-column: 1; grid-row: 1; justify-self: start; }
.r3-ai > .ai-layout { grid-column: 1 / -1; }
.r3-ai .ai-chat-card { min-height: 0; height: calc(100vh - 170px); max-height: 860px; }
.r3-ai-empty { padding: 10px 0; }
.r3-ai-empty h2 { background: none; color: var(--r3-ink); -webkit-text-fill-color: currentColor; font-weight: 600; letter-spacing: -.03em; }
.r3-ai-hero::before { opacity: .28; }
.r3-ai-suggest button { background: transparent; border-radius: 12px; min-height: 52px; }
.r3-ai-suggest .r3-quick-ic { width: auto; height: auto; background: none; }
.r3-ai .ai-compose { box-shadow: none; }
.r3-ai .ai-compose-row .btn { box-shadow: none; }

@media (max-width: 1100px) { .r3-now-grid > div:first-child { border-right: 0; border-bottom: 1px solid var(--r3-line); } .r3-now-grid { grid-template-columns: 1fr; } .r3-ai .ai-chat-card { height: auto; min-height: 560px; } }
@media (max-width: 920px) { .r3-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .r3-hero-stat:nth-child(3) { border-left: 0; } .r3-hero-stat:nth-child(n+3) { border-top: 1px solid #ffffff14; } }
@media (max-width: 680px) {
  .r3-hero-body { padding: 20px 16px 0; gap: 22px; }
  .r3-hero h1 { font-size: 28px; }
  .r3-hero-top { flex-direction: column; }
  .r3-hero-stats { margin: 0 -16px; }
  .r3-hero-stat { padding: 12px 16px 14px; }
  .r3-hero-stat b { font-size: 24px; }
  .r3-quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .r3-quick-btn { height: 44px; }
  .r3-page-head h1, body .page-head h1 { font-size: 26px; }
  .r3-ai { display: block; }
  .r3-ai > .page-head { display: none; }
  body .mobile-nav button { position: relative; font-size: 11px; font-weight: 500; }
  body .mobile-nav button.active::before { content: ""; position: absolute; top: 4px; left: 50%; width: 44px; height: 30px; margin-left: -22px; border-radius: 10px; background: color-mix(in srgb, var(--r3-blue) 18%, transparent); z-index: -1; }
  body .mobile-nav button svg { position: relative; }
}
@media (min-width: 681px) and (max-height: 860px) {
  body .r3-nav .nav-item { height: 31px; }
  body .r3-nav .nav-label { margin: 8px 12px 2px; }
  .r3-brand { padding-bottom: 8px; }
  .r3-side-bottom { padding-top: 10px; background: var(--r3-side); border-top: 1px solid var(--r3-line); margin-top: 8px; }
  body.r3-light .r3-side-bottom { background: var(--r3-side); }
}
body .r3-nav .nav-item { min-height: 0; margin: 0; padding-top: 0; padding-bottom: 0; }
.r3-ai .ai-chat-feed { justify-content: flex-start; }
.r3-ai-empty { margin: 0 auto; padding-top: 6px; }
@media (max-height: 860px) and (min-width: 681px) { .r3-ai-hero { width: 84px; height: 84px; } .r3-ai-hero .r3-robot { width: 72px; height: 72px; } .r3-ai-empty p { margin-bottom: 4px; } }.r3-grade-title { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; } .r3-grade-title:hover { color: var(--r3-blue-hi); }
@media (min-width: 681px) { body .topbar .crumb { visibility: hidden; } }
body .topbar .btn { background: color-mix(in srgb, var(--r3-ink) 7%, transparent); color: var(--r3-ink); box-shadow: none; border: 1px solid var(--r3-line-strong); }
body .topbar .btn:hover { background: color-mix(in srgb, var(--r3-ink) 11%, transparent); }
@media (max-width: 680px) {
  .r3-calendar > .rs-plan-navigation, .r3-tasks > .rs-plan-navigation { order: -1; }
  .r3-calendar, .r3-tasks { display: flex; flex-direction: column; }
  .r3-calendar .r3-page-head > div:first-child, .r3-tasks .r3-page-head > div:first-child { display: none; }
  .r3-calendar .r3-head-actions { flex-wrap: nowrap; }
  .r3-calendar [data-r3-cal="week"] { display: none; }
  .r3-calendar .r3-head-actions .r3-btn { flex: none; padding: 0 14px; }
  .r3-tasks .r3-page-head .r3-btn { width: 100%; }
  .r3-cal-nav h2 { font-size: 15px; min-width: 0; flex: 1; }
  .r3-cal-nav { width: 100%; }
}

/* ---------- AI plan card and plan modal ---------- */
.ai-plan-card { display: grid; gap: 12px; }
.ai-plan-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.ai-plan-card-head span { font-size: 14px; font-weight: 600; }
.ai-plan-card-head b { font-size: 12.5px; font-weight: 600; color: var(--r3-blue-hi); padding: 3px 9px; border-radius: 6px; background: color-mix(in srgb, var(--r3-blue) 14%, transparent); }
.ai-plan-points { display: flex; align-items: baseline; gap: 8px; }
.ai-plan-points strong { font-size: 34px; font-weight: 400; letter-spacing: -.03em; font-variation-settings: "opsz" 32; font-variant-numeric: tabular-nums; }
.ai-plan-points span { color: var(--r3-muted); font-size: 13px; }
.ai-plan-meter { height: 6px; border-radius: 9px; background: color-mix(in srgb, var(--r3-ink) 10%, transparent); overflow: hidden; }
.ai-plan-meter i { display: block; height: 100%; border-radius: inherit; background: var(--r3-blue); }
.ai-plan-card .ai-meta { margin: 0; }
.ai-plan-cta { width: 100%; height: 40px; }
body .modal.open { display: grid; }
.ai-plan-modal-box { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; }
.ai-plan-lead { margin: 4px 0 16px; font-size: 14.5px; line-height: 1.55; color: var(--r3-ink-2); }
.ai-plan-lead b { color: var(--r3-ink); }
.ai-plan-options { display: grid; gap: 8px; margin-bottom: 14px; }
.ai-plan-option { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--r3-line-strong); color: var(--r3-ink); text-decoration: none; transition: border-color .15s, background .15s; }
.ai-plan-option:hover { border-color: var(--r3-blue); background: color-mix(in srgb, var(--r3-blue) 7%, transparent); }
.ai-plan-option.featured { border-color: color-mix(in srgb, var(--r3-blue) 60%, var(--r3-line-strong)); background: color-mix(in srgb, var(--r3-blue) 9%, transparent); }
.ai-plan-option span b { display: block; font-size: 15px; font-weight: 650; }
.ai-plan-option span small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--r3-muted); }
.ai-plan-option strong { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-plan-option strong small { font-size: 12px; font-weight: 500; color: var(--r3-muted); }
.ai-plan-option i { font-style: normal; font-size: 13px; font-weight: 600; color: var(--r3-blue-hi); white-space: nowrap; }
.ai-plan-footnote { font-size: 12.5px; color: var(--r3-muted); line-height: 1.55; }
.ai-plan-safety { padding: 12px 14px; margin: 0 0 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--r3-amber) 40%, transparent); background: color-mix(in srgb, var(--r3-amber) 8%, transparent); }
.ai-plan-safety b { display: block; font-size: 13.5px; }
.ai-plan-safety p { margin: 4px 0 0; font-size: 13px; color: var(--r3-ink-2); line-height: 1.5; }
.ai-plan-modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.ai-plan-modal-actions a, .ai-plan-modal-actions button { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border-radius: 10px; text-decoration: none; font-weight: 600; font-size: 13.5px; }
.ai-plan-loading { display: flex; gap: 12px; align-items: center; padding: 16px 0; }
.ai-plan-loading small { display: block; color: var(--r3-muted); font-size: 12.5px; margin-top: 2px; }
.ai-plan-spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid color-mix(in srgb, var(--r3-blue) 25%, transparent); border-top-color: var(--r3-blue); animation: r3-spin .8s linear infinite; }
@media (max-width: 680px) { .ai-plan-option { grid-template-columns: 1fr auto; } .ai-plan-option i { display: none; } }
