/* Rytm Study 2.0 — shared visual QA refinements */
:root {
  color-scheme: dark;
  --bg: #111519;
  --paper: #191e23;
  --ink: #f4f4f1;
  --muted: #a0a6ad;
  --line: #2b3037;
  --blue: #89a9ff;
  --button-color: #89a9ff;
  --button-text: #101722;
  --rs-blue: #89a9ff;
  --rs-surface: #171c21;
  --rs-raised: #21272e;
  --radius: 18px;
  --control-radius: 12px;
  --rs-space-1: 4px;
  --rs-space-2: 8px;
  --rs-space-3: 12px;
  --rs-space-4: 16px;
  --rs-space-5: 22px;
  --rs-space-6: 30px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

html, body, .app { background: var(--bg); color: var(--ink); }
body { font-size: 14px; line-height: 1.5; font-weight: 400; letter-spacing: -.01em; }
.sidebar { background: var(--bg); border-color: var(--line); }
.topbar { background: var(--bg); border-color: var(--line); }
.content { width: min(1320px, 100%); padding: 27px clamp(20px, 3vw, 42px) 72px; }
.page-head { margin: 0 0 22px; }
.page-head h1, .rhythm-page-intro h1 {
  margin: 4px 0 7px; font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.12; letter-spacing: -.045em; font-weight: 600;
}
.page-head p, .rhythm-page-intro p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted); }
.eyebrow, .rhythm-kicker { font-size: 10px; line-height: 1.3; letter-spacing: .08em; font-weight: 600; color: var(--muted); }
h2, h3, .card h2 { letter-spacing: -.025em; font-weight: 600; }
.nav-item { min-height: 42px; border-radius: var(--control-radius); font-size: 13px; font-weight: 500; }
.nav-item.active { background: var(--paper); color: var(--ink); }
.nav-item.active svg { color: var(--blue); }
.card, .rhythm-panel, .tool-card, .subject-card, .note-side, .editor {
  min-width: 0; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: none;
}
.card.pad, .rhythm-panel { padding: 18px; }
.card-head { margin-bottom: 13px; }
.card-head h2, .rhythm-panel-heading h2 { font-size: 16px; line-height: 1.3; }
.card-head .sub { font-size: 12px; }
.btn, .soft, .quiet, .link {
  min-height: 42px; border-radius: var(--control-radius); font-size: 13px;
  font-weight: 600; transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.btn { background: var(--button-color); box-shadow: none; }
.btn:hover, .soft:hover, .quiet:hover, .icon-btn:hover { filter: brightness(1.08); }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px; box-shadow: none;
}
.sm { min-height: 36px; padding: 7px 11px; font-size: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--control-radius); background: var(--paper); border-color: var(--line); }
input, select, textarea, .search input, .note-search, .note-quick input { border-radius: var(--control-radius); font-size: 14px; color: var(--ink); }
.field input, .field select, .field textarea { min-height: 44px; background: var(--bg); border-color: var(--line); padding: 10px 12px; }
.field textarea { min-height: 110px; }
.search input, .note-search, .note-quick input { min-height: 44px; background: var(--bg); border-color: var(--line); }
.pill { border: 1px solid var(--line); background: var(--rs-raised); color: var(--muted); font-size: 11px; }
.mobile-fab { width: 44px; height: 44px; font-size: 22px; background: var(--button-color); box-shadow: 0 5px 16px #0005; }

/* Use the bundled atlas at its native pixel dimensions; avoid desktop upscaling. */
.rhythm-hero {
  isolation: isolate; max-width: 1160px; min-height: clamp(310px, 33vw, 390px);
  margin: 0 auto 18px; border: 1px solid var(--line); border-radius: 25px;
  background: var(--rs-surface); box-shadow: none;
}
.rhythm-hero:before {
  background-image: linear-gradient(120deg, #0b1119 0%, #0b1119a8 62%, #0b11191c 100%);
  background-size: cover; background-position: center; opacity: 1;
}
.rhythm-hero:after {
  content: ""; position: absolute; z-index: 0; inset: 0 0 0 auto; width: min(48%, 512px);
  background-image: linear-gradient(90deg, #0b111956, #0b11190c 42%), url("./images/rytm-photo-atlas.png");
  background-size: cover, 1536px 1024px; background-position: center, -512px 0;
  background-repeat: no-repeat; pointer-events: none;
}
.rhythm-hero-shade { background: linear-gradient(90deg, #0b1119e6 0%, #0b11197a 47%, #0b111918 100%); }
.rhythm-hero-copy { max-width: 56%; padding: 0; }
.rhythm-hero h1 { font-size: clamp(27px, 3vw, 40px); line-height: 1.12; letter-spacing: -.045em; font-weight: 600; }
.rhythm-hero h1 em { font-weight: 400; }
.rhythm-hero p { max-width: 42ch; font-size: 14px; line-height: 1.55; }
.rhythm-hero-actions { gap: 9px; margin-top: 18px; }
.rhythm-light-button, .rhythm-outline-button {
  min-height: 44px; padding: 10px 14px; border-radius: var(--control-radius); font-size: 13px; font-weight: 600;
}
.rhythm-light-button { background: #f1efe8; color: #172129; border-color: #f1efe8; }
.rhythm-outline-button { border-color: #ffffff55; background: #0b111960; color: #f4f4f1; }
.rhythm-hero-clock { right: 22px; top: 19px; }
.rhythm-hero-footer { font-size: 10px; letter-spacing: .07em; }
.rhythm-hero-sky { display: none; }
.rhythm-landscape { display: none; }
.course-cover {
  isolation: isolate; max-width: 1320px; min-height: 260px; margin: 0 auto 12px;
  border: 0; border-radius: 22px; background: var(--rs-surface);
}
.course-cover:before {
  content: ""; position: absolute; z-index: 0; inset: 0 0 0 auto; width: min(48%, 512px);
  background: url("./images/rytm-photo-atlas.png") no-repeat -1024px 0 / 1536px 1024px;
  pointer-events: none;
}
.course-cover:after { z-index: 1; background: linear-gradient(90deg, #0b1119e8 0%, #0b11199b 52%, #0b111918 100%); }
.course-cover > * { position: relative; z-index: 2; }
.course-cover h1 { font-size: clamp(25px, 2.5vw, 36px); font-weight: 600; letter-spacing: -.04em; }
.course-cover p { font-size: 13px; }
.course-tabs { position: sticky; top: 62px; z-index: 8; padding: 7px 0; background: var(--bg); }
.course-tabs button { min-height: 37px; border-radius: 999px; font-size: 12px; }
.subject-hub { margin-bottom: 14px; }
.subject-list { gap: 8px; }
.subject-card { min-height: 78px; padding: 8px 10px; border-radius: 15px; background: var(--rs-surface); }
.subject-mark { width: 62px; height: 62px; border-radius: 11px; font-size: 0; }
.subject-photo { background-size: 1536px 1024px; background-repeat: no-repeat; }
.subject-photo-1 { background-position: 0 0; }
.subject-photo-2 { background-position: -512px 0; }
.subject-photo-3 { background-position: -1024px 0; }
.subject-photo-4 { background-position: 0 -512px; }
.subject-photo-5 { background-position: -512px -512px; }
.subject-photo-6 { background-position: -1024px -512px; }
.subject-copy b { font-size: 14px; font-weight: 600; }
.subject-copy small { font-size: 11px; line-height: 1.35; }
.subject-copy i { height: 4px; background: var(--line); }
.subject-copy i em { background: var(--blue); }
.learning-tools { gap: 10px; margin: 14px 0; }
.tool-card { min-height: 148px; padding: 16px; }
.tool-card b { font-size: 14px; }
.tool-card small, .tool-card i { font-size: 11px; }
.tool-icon { width: 36px; height: 36px; border-radius: 11px; background: var(--rs-raised); color: var(--blue); }
.tool-icon svg { width: 18px; height: 18px; }
.course-overview { gap: 12px; }
.course-actions { gap: 8px; }
.course-actions button { min-height: 76px; border-color: var(--line); border-radius: var(--control-radius); background: var(--rs-surface); color: var(--blue); }

/* Planner mode switch and colored schedule rows use only saved events. */
.rhythm-planner-page { max-width: 1320px; margin: 0 auto; }
.rhythm-page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 2px 0 16px; }
.rhythm-page-actions { display: grid; gap: 8px; justify-items: end; }
.rs-segment { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.rs-segment button { min-height: 34px; min-width: 76px; padding: 6px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; }
.rs-segment button.is-active, .rs-segment button[aria-selected="true"] { background: var(--button-color); color: var(--button-text); }
.rhythm-calendar-nav { display: flex; align-items: center; gap: 8px; }
.rhythm-calendar-nav button { min-width: 36px; min-height: 34px; padding: 5px 10px; }
.rhythm-week-strip { padding: 11px 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.rhythm-week-strip .rhythm-days { gap: 6px; margin-top: 0; }
.rhythm-day { min-height: 58px; border: 1px solid transparent; border-radius: var(--control-radius); background: transparent; }
.rhythm-day span { font-size: 11px; color: var(--muted); }
.rhythm-day b { font-size: 16px; font-weight: 600; }
.rhythm-day.is-selected { background: var(--rs-raised); border-color: var(--blue); }
.rhythm-day.is-today:not(.is-selected) { background: var(--rs-raised); }
.rhythm-day-mark.has-items { background: var(--blue); }
.rhythm-planner-layout { grid-template-columns: minmax(0, 1.4fr) minmax(270px, .75fr); gap: 14px; margin-top: 14px; }
.rhythm-planner-main, .rhythm-planner-aside { gap: 12px; }
.rhythm-panel { padding: 18px; }
.rhythm-panel-heading { gap: 12px; margin-bottom: 11px; }
.rhythm-panel-heading h2 { font-size: 17px; }
.rhythm-panel-heading small { font-size: 12px; line-height: 1.45; }
.rhythm-heading-icon { width: 36px; height: 36px; border-radius: var(--control-radius); }
.rhythm-small-add { width: 36px; height: 36px; border-radius: var(--control-radius); font-size: 18px; background: var(--rs-raised); border-color: var(--line); color: var(--blue); }
.rhythm-small-add svg { width: 17px; height: 17px; }
.rhythm-task { min-height: 48px; padding: 9px 3px; border-bottom-color: var(--line); font-size: 13px; gap: 10px; }
.rhythm-task input { width: 17px; height: 17px; flex: none; margin: 0; accent-color: var(--blue); }
.rhythm-task-copy { display: block; min-width: 0; flex: 1; }
.rhythm-task-copy b { display: block; font-size: 13px; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.rhythm-task-time { flex: none; margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rhythm-agenda-list { display: grid; gap: 7px; }
.rhythm-agenda-row.lesson-block {
  display: grid; grid-template-columns: 54px 4px minmax(0, 1fr) auto; align-items: center; gap: 11px;
  min-height: 58px; padding: 8px 11px; border: 1px solid var(--line); border-left: 3px solid var(--lesson-accent);
  border-radius: 13px; background: var(--rs-surface);
}
.rhythm-agenda-time { font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.rhythm-agenda-line { width: 4px; height: 36px; border-radius: 5px; background: var(--lesson-accent); }
.rhythm-agenda-copy { min-width: 0; }
.rhythm-agenda-copy b { font-size: 13px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.rhythm-agenda-copy small { font-size: 11px; line-height: 1.35; margin-top: 3px; }
.rhythm-agenda-date { color: var(--muted) !important; }
.rhythm-agenda-tag { justify-self: end; padding: 5px 8px; border-radius: 999px; background: var(--rs-raised); color: var(--lesson-accent); font-size: 10px; white-space: nowrap; }
.tone-blue { --lesson-accent: #7da7ff; }
.tone-mint { --lesson-accent: #52d0a0; }
.tone-coral { --lesson-accent: #f29272; }
.tone-violet { --lesson-accent: #a68af5; }
.tone-rose { --lesson-accent: #e586af; }
.tone-amber { --lesson-accent: #e5bb69; }
.rhythm-agenda-empty { min-height: 66px; padding: 15px; border: 1px dashed var(--line); border-radius: 13px; background: transparent; font-size: 12px; }
.rhythm-empty-illustration { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--rs-raised); color: var(--blue); }
.rhythm-empty-illustration svg { width: 18px; height: 18px; }
.rhythm-planner-note { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; padding: 10px 2px; }
.rhythm-planner-note span svg { width: 16px; height: 16px; }
.rhythm-text-button { font-size: 12px; font-weight: 600; }
.rhythm-exam { border-radius: var(--radius); background: var(--rs-raised); border-color: var(--line); }
.rhythm-exam-number { color: var(--blue); }
.rhythm-mini-face { font-size: 26px; font-variant-numeric: tabular-nums; }
.rhythm-focus-progress { height: 4px; background: var(--line); }
.rhythm-focus-progress i { background: var(--blue); }

/* Notes, flashcards, Tutor and More use quieter, shared surfaces. */
.notes-layout { grid-template-columns: minmax(260px, .72fr) minmax(0, 1.5fr); gap: 12px; }
.note-side { padding: 13px; max-height: calc(100vh - 150px); overflow: auto; }
.note-list { gap: 2px; max-height: none; }
.note-item { padding: 12px 11px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.note-item.active { border-color: var(--line); background: var(--rs-raised); box-shadow: inset 3px 0 var(--blue); }
.note-item b { font-size: 13px; font-weight: 600; line-height: 1.35; }
.note-item span { margin-top: 4px; font-size: 11px; line-height: 1.45; }
.note-item small { margin-top: 6px; font-size: 10px; }
.note-quick button { width: 42px; min-height: 42px; border-radius: var(--control-radius); background: var(--button-color); color: var(--button-text); }
.editor { padding: 16px 18px; }
.editor-title { font-size: 22px; font-weight: 600; letter-spacing: -.03em; }
.editor-body { font-size: 15px; line-height: 1.75; }
.note-format-toolbar { gap: 3px; }
.note-format-toolbar button { min-width: 32px; min-height: 32px; border-radius: var(--control-radius); }
.flash-stage { min-height: 260px; }
.flash-card { min-height: 240px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--rs-surface); box-shadow: none; }
.flash-card h2 { max-width: 34ch; font-size: clamp(20px, 2vw, 27px); line-height: 1.35; font-weight: 500; }
.flash-actions { gap: 8px; }
.flash-actions button { min-height: 44px; }
.ai-orb, .ai-empty-mark { box-shadow: none; filter: none; }
.ai-orb { background: var(--rs-raised); color: var(--blue); }
.ai-chat-card, .ai-chat-feed, .ai-compose { background: var(--paper); border-color: var(--line); }
.ai-chat-feed { border-radius: var(--radius); }
.ai-compose textarea { min-height: 48px; }
.rs-more-profile { display: flex; align-items: center; gap: 13px; max-width: 880px; margin: 0 0 22px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.rs-profile-avatar { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: var(--control-radius); background: var(--rs-raised); color: var(--blue); font-size: 18px; font-weight: 600; }
.rs-profile-copy { min-width: 0; flex: 1; }
.rs-more-profile b, .rs-more-profile small { display: block; }
.rs-more-profile b { font-size: 15px; font-weight: 600; }
.rs-more-profile small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.rs-profile-edit { min-width: 36px; min-height: 36px; border: 0; border-radius: var(--control-radius); background: transparent; color: var(--muted); font-size: 23px; }
.rs-settings-group { max-width: 880px; }
.rs-settings-group h2 { margin: 0 0 9px; font-size: 15px; font-weight: 600; }
.more-list { gap: 0; max-width: 880px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.more-link { min-height: 62px; padding: 9px 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.more-link:last-child { border-bottom: 0; }
.more-link:hover { background: var(--rs-raised); }
.more-icon { width: 34px; height: 34px; border-radius: var(--control-radius); background: var(--rs-raised); color: var(--blue); }
.more-icon svg { width: 17px; height: 17px; }
.more-link b { font-size: 13px; font-weight: 550; }
.more-link small { font-size: 11px; }
.donut { box-shadow: none; border: 1px solid var(--line); }

@media (min-width: 1440px) {
  .content { width: min(1380px, 100%); padding-left: 44px; padding-right: 44px; }
  .rhythm-hero { max-width: 1160px; }
  .rhythm-planner-layout { gap: 18px; }
  .rhythm-panel { padding: 20px; }
}
@media (max-width: 980px) {
  .rhythm-planner-layout { grid-template-columns: minmax(0, 1fr) minmax(250px, .8fr); }
  .content { padding-left: 22px; padding-right: 22px; }
  .course-cover { min-height: 230px; }
}
@media (max-width: 760px) {
  .content { padding: calc(14px + env(safe-area-inset-top)) 15px calc(94px + env(safe-area-inset-bottom)); }
  .page-head { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 18px; }
  .page-head h1, .rhythm-page-intro h1 { font-size: 26px; }
  .page-head p, .rhythm-page-intro p { font-size: 13px; }
  .page-head .actions { width: 100%; gap: 7px; }
  .rhythm-hero { min-height: 340px; margin-bottom: 13px; padding: 23px 20px 50px; border-radius: 20px; }
  .rhythm-hero:after { width: 100%; background-image: linear-gradient(90deg, #0b1119e0 0%, #0b11199a 54%, #0b11194c 100%), url("./images/rytm-photo-atlas.png"); background-size: cover, 1536px 1024px; background-position: center, -512px 0; }
  .rhythm-hero-copy { max-width: 78%; }
  .rhythm-hero h1 { font-size: 30px; }
  .rhythm-hero p { max-width: 31ch; font-size: 13px; }
  .rhythm-hero-clock { display: none; }
  .rhythm-hero-footer { left: 20px; right: 20px; font-size: 8px; }
  .rhythm-hero-actions { margin-top: 15px; }
  .rhythm-light-button, .rhythm-outline-button { font-size: 12px; padding: 9px 10px; }
  .rhythm-page-intro { align-items: flex-start; flex-direction: column; gap: 13px; margin-bottom: 13px; }
  .rhythm-page-actions { width: 100%; justify-items: stretch; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .rhythm-calendar-nav { justify-content: flex-end; }
  .rs-segment { width: 100%; justify-content: space-around; }
  .rs-segment button { min-width: 0; flex: 1; padding: 6px 8px; }
  .rhythm-week-strip { padding: 9px 8px; }
  .rhythm-week-strip .rhythm-days { gap: 2px; }
  .rhythm-day { min-height: 49px; padding: 7px 2px; }
  .rhythm-day span { font-size: 10px; }
  .rhythm-day b { font-size: 15px; }
  .rhythm-planner-layout, .rhythm-planner-main, .rhythm-planner-aside { grid-template-columns: 1fr; gap: 10px; }
  .rhythm-planner-layout { margin-top: 11px; }
  .rhythm-panel { padding: 14px; }
  .rhythm-panel-heading { gap: 9px; }
  .rhythm-panel-heading h2 { font-size: 16px; }
  .rhythm-panel-heading small { font-size: 11px; }
  .rhythm-agenda-row.lesson-block { grid-template-columns: 46px 4px minmax(0, 1fr); gap: 9px; min-height: 58px; padding: 8px; }
  .rhythm-agenda-tag { grid-column: 3; justify-self: start; margin-top: -1px; }
  .rhythm-agenda-copy b { font-size: 12px; }
  .rhythm-agenda-time { font-size: 11px; }
  .rhythm-agenda-line { height: 100%; min-height: 34px; }
  .rhythm-planner-note { padding: 9px 2px; }
  .notes-layout { grid-template-columns: 1fr; gap: 10px; }
  .note-side { max-height: none; padding: 10px; }
  .note-list { max-height: 34vh; }
  .editor { min-height: 42vh; padding: 12px; }
  .editor-body { min-height: 36vh; }
  .learning-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tool-card { min-height: 124px; padding: 12px; }
  .learning-tools .tool-card:last-child { grid-column: 1 / -1; }
  .course-cover { min-height: 205px; padding: 16px; }
  .course-tabs { top: 0; overflow: auto; white-space: nowrap; padding: 6px 0; }
  .course-tabs button { flex: 0 0 auto; }
  .subject-card { min-height: 72px; gap: 9px; padding: 7px; }
  .subject-mark { width: 56px; height: 56px; }
  .subject-copy small { font-size: 10px; }
  .more-list { border-radius: 16px; }
  .rs-more-profile { margin-bottom: 18px; }
  .rs-settings-group { margin-bottom: 14px; }
  .more-link { min-height: 60px; padding: 8px 11px; }
  .mobile-nav { height: calc(64px + env(safe-area-inset-bottom)); padding: 5px 4px env(safe-area-inset-bottom); background: var(--bg); border-top: 1px solid var(--line); }
  .mobile-nav button { font-size: 10px; font-weight: 500; gap: 3px; }
  .mobile-nav button svg { width: 19px; height: 19px; }
  .mobile-nav button.active { color: var(--blue); }
  .mobile-fab { right: 15px; bottom: calc(76px + env(safe-area-inset-bottom)); width: 42px; height: 42px; font-size: 21px; }
  .course-actions button { min-height: 66px; }
}
@media (max-width: 390px) {
  .content { padding-left: 12px; padding-right: 12px; }
  .rhythm-hero { padding-left: 16px; padding-right: 16px; }
  .rhythm-hero-copy { max-width: 84%; }
  .rhythm-hero h1 { font-size: 27px; }
  .rhythm-hero-actions { gap: 6px; }
  .rhythm-light-button, .rhythm-outline-button { font-size: 11px; }
  .rhythm-page-actions { grid-template-columns: 1fr; }
  .rhythm-calendar-nav { justify-content: space-between; }
  .rs-segment button { font-size: 11px; }
  .rhythm-agenda-row.lesson-block { grid-template-columns: 41px 3px minmax(0, 1fr); gap: 7px; }
  .rhythm-agenda-tag { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Shared product typography and dependable control states. */
:root { --font-ui: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif; }
html, body, button, input, select, textarea, .app, .modal, .toast {
  font-family: var(--font-ui); font-synthesis: none; text-rendering: optimizeLegibility;
}
button, [role="button"], input[type="checkbox"], input[type="radio"] { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:not(:disabled):hover { filter: brightness(1.06); }
button:not(:disabled):active { transform: translateY(1px); }

/* Today: give the welcome image a real full-width hero frame and keep its crop intentional. */
.rhythm-workspace { gap: 15px; }
.rhythm-hero {
  width: 100%; max-width: none; min-height: clamp(300px, 28vw, 380px);
  margin: 0; padding: clamp(25px, 3.2vw, 42px); border-radius: 24px;
  background: #182027; isolation: isolate;
}
.rhythm-hero:before {
  z-index: 0; inset: 0;
  background: linear-gradient(90deg, #101519 0%, #101519e8 30%, #1015199c 57%, #10151935 100%);
}
.rhythm-hero:after {
  content: ""; position: absolute; z-index: 0; top: 0; right: 0; bottom: 0; left: auto;
  width: 60%; background-image: url("./images/rytm-photo-atlas.png");
  background-size: 300% auto; background-position: 50% 50%; background-repeat: no-repeat;
  pointer-events: none;
}
.rhythm-hero-shade {
  z-index: 1; background: linear-gradient(90deg, #101519 0%, #101519df 34%, #1015197a 57%, #10151912 100%);
}
.rhythm-hero-copy { z-index: 2; width: min(56%, 620px); max-width: 620px; }
.rhythm-hero h1 { max-width: 17ch; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.08; }
.rhythm-hero p { max-width: 39ch; margin-top: 13px; font-size: 15px; line-height: 1.55; }
.rhythm-hero-clock, .rhythm-hero-footer { z-index: 2; }
.rhythm-hero-footer { bottom: 15px; }

/* Put the selected day's calendar and agenda directly beneath the greeting. */
.rhythm-week-strip {
  margin: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 17px;
  background: var(--paper);
}
.rhythm-week-strip .rhythm-section-label { margin-bottom: 9px; }
.rhythm-week-strip .rhythm-section-label h2 { font-size: 15px; font-weight: 550; }
.rhythm-week-strip .rhythm-days { gap: 5px; }
.rhythm-day { min-height: 48px; background: var(--bg); border-color: transparent; }
.rhythm-day.is-selected { background: #263d65; border-color: #718fce; }
.rhythm-main-grid { grid-template-columns: minmax(0, 1.35fr) minmax(270px, .72fr); gap: 14px; }
.rhythm-main-grid > .rhythm-panel { align-self: start; }
.rhythm-panel-heading h2 { font-size: 17px; }
.rhythm-agenda { display: grid; gap: 2px; }
.rhythm-agenda-row.lesson-block {
  min-height: 66px; grid-template-columns: 58px 5px minmax(0, 1fr) auto; gap: 12px;
  padding: 9px 10px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  background: transparent;
}
.rhythm-agenda-row.lesson-block:last-child { border-bottom: 0; }
.rhythm-agenda-line { width: 5px; height: 38px; }
.rhythm-agenda-copy b { font-size: 14px; font-weight: 550; }
.rhythm-agenda-copy small { font-size: 12px; }
.rhythm-agenda-tag { padding: 5px 9px; font-size: 10px; }
.rhythm-task { min-height: 52px; }
.rhythm-task input { width: 18px; height: 18px; }

/* Make the weekly recap a compact, data-led card instead of a decorative placeholder. */
.rhythm-wrapped-card {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr); gap: 22px;
  align-items: center; padding: clamp(18px, 2.4vw, 28px); border: 1px solid var(--line);
  border-radius: 20px; background: var(--paper); color: var(--ink);
}
.rhythm-wrapped-copy { max-width: 58ch; }
.rhythm-wrapped-copy h2 { margin: 8px 0; font-size: clamp(22px, 2.2vw, 29px); line-height: 1.15; }
.rhythm-wrapped-copy p { max-width: 46ch; margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.rhythm-wrapped-button {
  min-height: 42px; padding: 9px 13px; border: 1px solid #536b97; border-radius: 12px;
  background: #263d65; color: #f3f6ff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.rhythm-wrapped-summary { min-width: 0; padding: 15px 16px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg); }
.rhythm-wrapped-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rhythm-wrapped-total strong { font-size: clamp(24px, 3vw, 36px); line-height: 1.1; letter-spacing: -.04em; font-weight: 550; font-variant-numeric: tabular-nums; }
.rhythm-wrapped-total span { color: var(--muted); font-size: 11px; }
.rhythm-wrapped-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 8px; height: 54px; margin: 13px 0 9px; }
.rhythm-wrapped-bar { display: flex; align-items: end; height: 100%; border-radius: 5px; background: #222a34; overflow: hidden; }
.rhythm-wrapped-bar i { display: block; width: 100%; height: var(--bar-height); border-radius: inherit; background: #8aa9f4; }
.rhythm-wrapped-stats { display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.rhythm-wrapped-stats b { color: var(--ink); font-weight: 600; }

/* Accessible color choices for events; selected colors are saved with the existing event record. */
.event-color-field { min-width: 0; padding: 0; border: 0; }
.event-color-field legend { margin-bottom: 8px; padding: 0; color: #a6b4c4; font-size: 11px; }
.event-color-options { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.event-color-options label { display: grid; justify-items: center; gap: 5px; min-width: 0; padding: 8px 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); cursor: pointer; }
.event-color-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.event-color-options input:focus-visible + .event-color-swatch { outline: 2px solid var(--ink); outline-offset: 3px; }
.event-color-swatch { width: 20px; height: 20px; border: 2px solid #ffffff33; border-radius: 50%; background: var(--lesson-accent); }
.event-color-options input:checked + .event-color-swatch { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--lesson-accent); }
.event-color-options small { color: var(--muted); font-size: 9px; }

@media (max-width: 980px) {
  .rhythm-main-grid { grid-template-columns: minmax(0, 1fr); }
  .rhythm-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .rhythm-hero { min-height: 330px; }
  .rhythm-hero:after { width: 58%; }
}
@media (max-width: 760px) {
  .rhythm-hero { min-height: 320px; padding: 23px 18px 48px; border-radius: 19px; }
  .rhythm-hero:after { width: 100%; background-size: 300% auto; background-position: 50% 48%; }
  .rhythm-hero:before { background: linear-gradient(90deg, #101519e8 0%, #101519ad 48%, #10151946 100%); }
  .rhythm-hero-shade { background: linear-gradient(90deg, #101519da 0%, #10151988 48%, #10151924 100%); }
  .rhythm-hero-copy { width: min(86%, 460px); max-width: 460px; }
  .rhythm-hero h1 { font-size: clamp(27px, 7vw, 34px); }
  .rhythm-hero p { max-width: 31ch; font-size: 13px; }
  .rhythm-hero-actions { gap: 7px; }
  .rhythm-light-button, .rhythm-outline-button { min-height: 42px; padding: 8px 10px; font-size: 11px; }
  .rhythm-hero-footer { left: 17px; right: 17px; font-size: 8px; }
  .rhythm-week-strip { padding: 11px 9px; }
  .rhythm-week-strip .rhythm-section-label { align-items: flex-start; }
  .rhythm-week-strip .rhythm-section-label h2 { font-size: 13px; }
  .rhythm-week-strip .rhythm-days { gap: 2px; }
  .rhythm-day { min-height: 47px; padding: 6px 1px; }
  .rhythm-day span { font-size: 9px; }
  .rhythm-day b { font-size: 14px; }
  .rhythm-rail { grid-template-columns: minmax(0, 1fr); }
  .rhythm-agenda-row.lesson-block { grid-template-columns: 48px 4px minmax(0, 1fr); gap: 9px; min-height: 62px; padding: 8px 2px; }
  .rhythm-agenda-tag { grid-column: 3; justify-self: start; margin-top: -2px; }
  .rhythm-agenda-line { height: 100%; min-height: 34px; }
  .rhythm-agenda-copy b { font-size: 13px; }
  .rhythm-agenda-copy small { font-size: 11px; }
  .rhythm-wrapped-card { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 16px; }
  .rhythm-wrapped-summary { padding: 13px; }
  .event-color-options { gap: 4px; }
  .event-color-options label { padding: 7px 2px; }
}
@media (max-width: 390px) {
  .rhythm-hero { min-height: 300px; padding-left: 15px; padding-right: 15px; }
  .rhythm-hero-copy { width: 90%; }
  .rhythm-hero-actions { flex-direction: column; align-items: flex-start; }
  .rhythm-hero-actions button { min-width: 178px; justify-content: center; }
  .rhythm-hero-footer { left: 14px; right: 14px; font-size: 7px; }
}

/* Login splash: use the bundled mountain tile as the full-screen first impression. */
.auth-screen {
  position: relative; isolation: isolate; display: grid; place-items: center;
  width: 100%; height: 100vh; height: 100svh; min-height: 560px; padding: 0;
  overflow: hidden; background: #09121d;
}
.auth-screen::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(180deg, #07111a14 0%, #07111a05 36%, #07111a30 56%, #06101ad9 100%), url("./images/rytm-photo-atlas.png");
  background-size: cover, max(300vw, 300vh) max(200vw, 200vh);
  background-position: center, 10% 0; background-repeat: no-repeat;
}
.auth-splash {
  width: min(100%, 540px); height: 100%; min-height: inherit; margin: auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(145px, 22svh, 210px) 24px max(24px, env(safe-area-inset-bottom));
}
.auth-splash-brand { display: grid; justify-items: center; color: #fffaf4; text-shadow: 0 2px 20px #09101d99; }
.auth-splash-brand span { font: 500 clamp(56px, 14vw, 76px)/.9 Georgia, "Times New Roman", serif; letter-spacing: -.055em; }
.auth-splash-brand small { margin-top: 12px; padding-left: .44em; font-size: 11px; line-height: 1; letter-spacing: .44em; font-weight: 500; }
.auth-splash-tagline {
  margin: clamp(112px, 19svh, 176px) 0 0; color: #f5ece7;
  font: italic 400 clamp(18px, 5vw, 22px)/1.42 Georgia, "Times New Roman", serif;
  text-shadow: 0 2px 14px #07101acc;
}
.auth-splash-actions { width: min(270px, 100%); display: grid; gap: 10px; margin-top: auto; padding-top: 28px; }
.auth-splash-primary, .auth-splash-secondary {
  min-height: 48px; border-radius: 15px; font-size: 14px; font-weight: 600;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.auth-splash-primary { border: 1px solid #f3eee5; background: #f3eee5; color: #17211f; }
.auth-splash-secondary { border: 1px solid #ffffff70; background: #09121d36; color: #fff; backdrop-filter: blur(8px); }
.auth-splash-primary:hover { background: #fff; }
.auth-splash-secondary:hover { background: #ffffff18; border-color: #ffffffa8; }
.auth-card {
  position: relative; z-index: 2; width: min(420px, calc(100% - 28px)); max-height: calc(100svh - 24px);
  overflow-y: auto; margin: auto; padding: 22px; border: 1px solid #ffffff28;
  border-radius: 24px; background: #0a1422e8; box-shadow: 0 22px 70px #0008;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.auth-back { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; margin: -7px 0 10px; padding: 4px 0; border: 0; background: transparent; color: #d7dfeb; font-size: 12px; }
.auth-back svg { width: 17px; height: 17px; }
.auth-back:hover { color: #fff; }
.auth-screen .auth-brand { margin-bottom: 16px; }
.auth-screen .auth-card h1 { margin: 0 0 7px; font-size: 22px; line-height: 1.2; }
.auth-screen .auth-card > p { margin: 0 0 16px; color: #b3c0cf; line-height: 1.5; }
@media (min-aspect-ratio: 1/1) {
  .auth-screen::before { background-position: center, 0 14%; }
  .auth-splash { padding-top: clamp(80px, 17svh, 160px); }
  .auth-splash-tagline { margin-top: clamp(90px, 15svh, 150px); }
}
@media (max-height: 620px) {
  .auth-screen { min-height: 100svh; }
  .auth-splash { padding-top: 13svh; }
  .auth-splash-tagline { margin-top: 8svh; }
}

/* Real local variable font: no missing webfont or synthetic weights. */
@font-face {
  font-family: "Rytm Inter";
  src: url("./fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
:root { --rytm-font: "Rytm Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-family: var(--rytm-font); }
body, .app, button, input, select, textarea { font-family: var(--rytm-font); font-synthesis: none; }
h1, h2, h3 { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
button { touch-action: manipulation; }
.rhythm-workspace, .rhythm-main-grid, .rhythm-rail, .rhythm-panel, .rhythm-panel-heading > div,
.rhythm-agenda-copy, .rhythm-note-preview span, .rhythm-metric > div { min-width: 0; }
.rhythm-panel-heading { align-items: center; }
.rhythm-panel-heading > div:not(.rhythm-heading-icon) { flex: 1; }
.rhythm-panel-heading h2, .rhythm-goal-heading h2 { margin: 3px 0; line-height: 1.3; }
.rhythm-panel-heading small, .rhythm-agenda-copy small, .rhythm-next-step b, .rhythm-note-preview b,
.rhythm-goal-list, .rhythm-hero-quote, .rhythm-metric b { overflow-wrap: anywhere; }
.rhythm-small-add { flex: none; width: 36px; height: 36px; font-size: 21px; line-height: 1; }
.rhythm-hero { display: flex; flex-direction: column; min-height: 350px; padding: 32px; }
.rhythm-hero { container-type: inline-size; }
.rhythm-hero:after { background-image: linear-gradient(90deg, #10151940, transparent 45%), url("./images/rytm-photo-atlas.png"); background-size: cover, max(180cqw, 1740px) max(120cqw, 1160px); background-position: center, 50% 0; }
.rhythm-hero-copy { width: 58%; max-width: 660px; }
.rhythm-hero-copy .rhythm-kicker { display: block; margin-bottom: 22px; font-size: 10px; }
.rhythm-greeting { display: block; font-size: clamp(21px, 2.1vw, 28px); line-height: 1.3; color: #f8f6f2; }
.rhythm-hero h1 { margin: 3px 0 10px; max-width: 100%; font-size: clamp(32px, 3.5vw, 46px); line-height: 1.1; font-weight: 600; letter-spacing: -.04em; }
.rhythm-hero .rhythm-hero-tagline { margin: 0 0 17px; font-size: 18px; line-height: 1.4; color: #f4f3ef; }
.rhythm-hero .rhythm-hero-quote { max-width: 34ch; margin: 0 0 18px; font-size: 13px; line-height: 1.6; color: #e6e5e1; }
.rhythm-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 0; }
.rhythm-hero-actions button { font-size: 12px; min-height: 40px; }
.rhythm-hero-clock { position: static; margin-top: 20px; z-index: 2; }
.rhythm-clock { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rhythm-clock time { font-size: 14px; line-height: 1.4; }
.rhythm-clock small { font-size: 10px; }
.rhythm-hero-footer { position: static; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 18px; font-size: 8px; line-height: 1.4; }
.rhythm-hero-shade { pointer-events: none; }
.rhythm-agenda-row.lesson-block { display: grid; grid-template-columns: 48px 4px minmax(0, 1fr) 64px; gap: 10px; align-items: center; padding: 12px 0; }
.rhythm-agenda-time { white-space: nowrap; line-height: 1.4; font-size: 12px; }
.rhythm-agenda-time small { display: block; font-size: 10px; color: var(--muted); margin-top: 4px; }
.rs-row-actions { display: flex; gap: 2px; align-items: center; justify-content: flex-end; }
.rs-row-actions button { display: grid; place-items: center; flex: none; width: 30px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
.rs-row-actions button svg { width: 15px; height: 15px; }
.rs-row-actions button:hover { color: var(--ink); background: var(--rs-raised); }
.rs-task-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px; align-items: center; gap: 7px; border-bottom: 1px solid var(--line); }
.rs-task-row:last-child { border-bottom: 0; }
.rs-task-row .rhythm-task { display: flex; gap: 10px; padding: 12px 0; margin: 0; border: 0; min-width: 0; cursor: pointer; }
.rs-task-row .rhythm-task input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; flex: none; border: 1.5px solid var(--muted); border-radius: 50%; background: transparent; }
.rs-task-row .rhythm-task input:checked { border-color: var(--blue); background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 12 4 4 8-9' fill='none' stroke='%23101929' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat; }
.rs-task-row .rhythm-task-copy { flex: 1; min-width: 0; }
.rs-task-row .rhythm-task-copy b { font-size: 13px; line-height: 1.5; }
.rs-task-row .rhythm-task-time { margin-left: 0; font-size: 11px; white-space: nowrap; }
.rs-plan-navigation { display: flex; gap: 4px; width: fit-content; max-width: 100%; margin: 0 0 18px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); }
.rs-plan-navigation button { border: 0; border-radius: 9px; padding: 10px 15px; min-height: 40px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; }
.rs-plan-navigation button.is-active { background: var(--blue); color: #101722; }
.rs-study-mode { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 0 0 20px; font-size: 12px; }
.rs-study-mode select { min-height: 40px; max-width: 100%; padding: 8px 32px 8px 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.rs-study-mode > span { margin-left: auto; color: var(--muted); font-size: 11px; }
.rs-meeting-card { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin: 0 0 20px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--paper); }
.rs-meeting-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 13px; background: #89a9ff1a; color: var(--blue); }
.rs-meeting-copy { flex: 1; min-width: 180px; }
.rs-meeting-copy h2 { margin: 5px 0; font-size: 16px; font-weight: 600; }
.rs-meeting-copy p { margin: 0; font-size: 12px; color: var(--muted); }
.rs-meeting-count { color: var(--blue); font-size: 23px; font-weight: 600; letter-spacing: -.03em; white-space: nowrap; }
.rs-timetable-tabs { display: none; }
.rs-timetable-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 9px; align-items: start; }
.rs-timetable-day { min-width: 0; }
.rs-timetable-day > header { display: grid; grid-template-columns: minmax(0, 1fr) 28px; align-items: center; padding: 10px 5px 14px; }
.rs-timetable-day > header h2 { margin: 0; font-size: 12px; line-height: 1.3; font-weight: 600; }
.rs-timetable-day > header span { grid-row: 2; color: var(--muted); font-size: 10px; }
.rs-timetable-day > header button { grid-column: 2; grid-row: 1/3; display: grid; place-items: center; width: 28px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: var(--paper); color: var(--blue); }
.rs-timetable-day > div { display: grid; gap: 9px; }
.rs-lesson { min-width: 0; padding: 12px 10px 7px; border: 1px solid color-mix(in srgb, var(--lesson-accent) 24%, transparent); border-left: 4px solid var(--lesson-accent); border-radius: 12px; background: color-mix(in srgb, var(--lesson-accent) 13%, var(--paper)); }
.rs-lesson-time { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 9px; font-size: 11px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.rs-lesson-time span { color: var(--muted); }
.rs-lesson-copy h3 { margin: 0 0 5px; font-size: 13px; font-weight: 600; line-height: 1.4; }
.rs-lesson-copy p, .rs-lesson-copy small { display: block; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.rs-lesson .rs-row-actions { margin-top: 8px; }
.rs-plan-empty { margin: 0; padding: 18px 8px; color: var(--muted); font-size: 12px; text-align: center; }
.rs-empty-add { min-height: 40px; border: 1px dashed var(--line); border-radius: 10px; background: transparent; color: var(--muted); font-size: 11px; }
.rs-plan-help { margin: 20px 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.rs-meetings-section { margin-top: 28px; }
.rs-section-head { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.rs-section-head h2 { margin: 0 0 5px; font-size: 18px; }
.rs-section-head p { margin: 0; color: var(--muted); font-size: 12px; }
.rs-meetings-list { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.rs-meeting-row { display: grid; grid-template-columns: 24px minmax(0, 1fr) 64px; align-items: center; gap: 12px; padding: 14px 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.rs-meeting-row:last-child { border: 0; }
.rs-meeting-row > span { color: var(--blue); }
.rs-meeting-row b { display: block; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.rs-meeting-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.rs-meeting-row.is-past > div:first-of-type { opacity: .6; }
.rs-form-hint { margin: 0 0 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.rs-form-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rs-form-two input { min-width: 0; }
.rs-form-error { color: #f6a39e; font-size: 12px; padding: 10px 12px; border: 1px solid #a94b4b70; border-radius: 9px; background: #a94b4b14; }
.modal-box { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.modal-head { align-items: center; }
.modal-head h2 { line-height: 1.3; }
.rhythm-exam-empty { display: flex; align-items: center; gap: 10px; }
.rhythm-exam-empty > div { flex: 1; min-width: 0; }
.rhythm-exam-empty b, .rhythm-exam-empty small { display: block; }
.rhythm-exam-empty b { font-size: 13px; line-height: 1.4; }
.rhythm-exam-empty small { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.rhythm-icon-action { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--rs-raised); color: var(--blue); }
.rhythm-planner-main, .rhythm-planner-aside { min-width: 0; }
.mobile-nav { display: none; }
@media (max-width: 1100px) {
  .rhythm-planner-layout { grid-template-columns: minmax(0, 1fr); }
  .rhythm-planner-aside { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .rhythm-page-intro { flex-wrap: wrap; }
  .rhythm-page-intro > div, .rhythm-page-actions { min-width: 0; }
  .rs-timetable-tabs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 0 0 18px; padding: 4px; background: var(--paper); border-radius: 13px; }
  .rs-timetable-tabs button { min-height: 42px; padding: 6px 2px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 11px; }
  .rs-timetable-tabs button.is-active { background: var(--blue); color: #101722; }
  .rs-timetable-grid { display: block; }
  .rs-timetable-day { display: none; }
  .rs-timetable-day.is-selected { display: block; }
  .rs-timetable-day > header h2 { font-size: 18px; }
  .rs-timetable-day > header span { font-size: 11px; }
  .rs-lesson { display: grid; grid-template-columns: 75px minmax(0, 1fr) 64px; gap: 14px; padding: 16px; }
  .rs-lesson-time { display: flex; flex-direction: column; gap: 4px; margin-bottom: 0; font-size: 12px; }
  .rs-lesson-copy h3 { font-size: 15px; }
  .rs-lesson-copy p, .rs-lesson-copy small { font-size: 12px; }
  .rs-lesson .rs-row-actions { margin: 0; }
}
@media (max-width: 980px) {
  .app { display: block; }
  .sidebar { position: fixed; top: 0; left: 0; width: 236px; height: 100dvh; transform: translateX(-100%); z-index: 60; transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu { display: grid; }
  .topbar { padding: 0 18px; }
  .topbar .search { display: none; }
  .top-actions { margin-left: auto; }
  .content { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .mobile-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: calc(66px + env(safe-area-inset-bottom)); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
  .mobile-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 0; border: 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 500; }
  .mobile-nav button svg { width: 21px; height: 21px; }
  .mobile-nav button.active { color: var(--blue); }
}
@media (max-width: 760px) {
  .topbar { display: none; }
  .rhythm-hero { min-height: 365px; padding: 25px 20px 18px; border-radius: 18px; }
  .rhythm-hero-copy { width: 100%; max-width: 100%; }
  .rhythm-hero:after { background-size: cover, max(300cqw, 1440px) max(200cqw, 960px); background-position: center, 50% 0; }
  .rhythm-hero-copy .rhythm-kicker { margin-bottom: 16px; }
  .rhythm-greeting { font-size: 23px; }
  .rhythm-hero h1 { font-size: 36px; }
  .rhythm-hero .rhythm-hero-tagline { font-size: 19px; }
  .rhythm-hero .rhythm-hero-quote { max-width: 29ch; font-size: 12px; }
  .rhythm-hero-actions { flex-direction: row; align-items: center; }
  .rhythm-hero-actions button { min-width: 0; font-size: 11px; min-height: 40px; }
  .rhythm-hero-clock { display: block; margin-top: 17px; }
  .rhythm-clock small, .rhythm-hero-footer > span:last-child { display: none; }
  .rhythm-hero-footer { margin-top: 12px; }
  .rhythm-agenda-row.lesson-block { grid-template-columns: 43px 4px minmax(0, 1fr) 30px; gap: 9px; }
  .rhythm-agenda-row .rs-row-actions { flex-direction: column; }
  .rs-meeting-card { gap: 12px; padding: 16px; }
  .rs-meeting-icon { width: 36px; height: 36px; }
  .rs-meeting-copy { min-width: 0; flex-basis: calc(100% - 48px); }
  .rs-meeting-count { margin-left: 48px; font-size: 21px; }
  .rs-meeting-card > button { margin-left: auto; }
  .rs-study-mode { align-items: flex-start; }
  .rs-study-mode > label { width: 100%; }
  .rs-study-mode > span { width: 100%; margin: 0; }
  .rs-plan-navigation { width: 100%; }
  .rs-plan-navigation button { flex: 1; padding: 8px 6px; }
  .rs-lesson { grid-template-columns: 61px minmax(0, 1fr) 30px; padding: 14px 12px; gap: 10px; }
  .rs-lesson .rs-row-actions { flex-direction: column; }
  .rs-task-row { grid-template-columns: minmax(0, 1fr) 30px; }
  .rs-task-row .rs-row-actions { flex-direction: column; }
  .rs-task-row .rhythm-task { flex-wrap: wrap; }
  .rs-task-row .rhythm-task-copy { flex-basis: calc(100% - 32px); }
  .rs-task-row .rhythm-task-time { margin-left: 30px; margin-top: -5px; }
  .rs-meeting-row { padding: 12px; gap: 9px; }
  .rs-timetable-page .rhythm-page-intro > .btn { width: 100%; }
  .rhythm-planner-aside { grid-template-columns: minmax(0, 1fr); }
  .modal-box { width: calc(100% - 24px); max-height: calc(100dvh - 24px); padding: 20px; }
}
