:root {
  color-scheme: light;
  --paper: #f6f5f1;
  --surface: #fff;
  --ink: #17201c;
  --muted: #69716d;
  --line: #dfe2df;
  --soft: #ebece9;
  --accent: #1d2a24;
  --accent-soft: #dfe9e2;
  --highlight: #c9ff5c;
  --danger: #a53a2f;
  --radius: 14px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Quiet, text-led layout inspired by the original StudyTrack sketch. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}

button, input, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(560px, 1fr) 360px;
}

.sidebar, .focus-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  background: rgba(255,255,255,.66);
  backdrop-filter: blur(20px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 30px 20px 24px;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 8px 34px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.45rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  color: var(--paper);
  background: var(--accent);
  font-family: var(--sans);
  font-size: .9rem;
  font-weight: 700;
}

.nav-list { display: grid; gap: 7px; }
.nav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 13px;
  border-radius: 9px;
  color: #4e5652;
  text-decoration: none;
  font-size: .94rem;
}
.nav-item:hover { background: var(--soft); color: var(--ink); }
.nav-item.active { background: var(--accent); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 0 10px; }
.sidebar-foot p { color: var(--muted); font-size: .78rem; }
.text-button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: none;
  cursor: pointer;
  font-size: .78rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.main-content { padding: 34px 38px 70px; min-width: 0; }
.profile-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.profile-bar p { margin: 0; }
.profile-bar label { display: inline-block; margin: 0 8px 0 0; color: var(--muted); font-size: .78rem; }
.profile-bar select { width: auto; min-width: 170px; }
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 30px;
}
.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
h1, h2 { margin: 0; font-family: var(--serif); font-weight: 400; letter-spacing: -.025em; }
h1 { font-size: clamp(2.4rem, 4vw, 4.25rem); line-height: 1; }
h2 { font-size: 1.75rem; line-height: 1.15; }
.subtitle { margin: 10px 0 0; color: var(--muted); font-family: var(--serif); font-size: 1.05rem; }

.primary-action, .secondary-action, .submit-button, .timer-button {
  border: 1px solid var(--accent);
  border-radius: 9px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.primary-action:hover, .submit-button:hover, .timer-button:hover { transform: translateY(-1px); background: #314239; }
.primary-action { padding: 12px 16px; color: #fff; background: var(--accent); font-weight: 650; }
.secondary-action { padding: 9px 12px; background: transparent; font-size: .88rem; }
.secondary-action:hover { background: var(--accent); color: #fff; }

.metrics {
  display: grid;
  grid-template-columns: 1.35fr 1fr .85fr .95fr;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.metric-card { min-height: 154px; padding: 20px; border-left: 1px solid var(--line); }
.metric-card:first-child { border-left: 0; }
.metric-card.featured { background: var(--accent); color: #fff; }
.metric-top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .78rem; }
.featured .metric-top, .featured p { color: #c9d0cc; }
.metric-icon { font-size: 1rem; }
.metric-card strong { display: block; margin-top: 13px; font-family: var(--serif); font-size: 2.25rem; font-weight: 400; line-height: 1; }
.metric-card p { margin: 12px 0 0; color: var(--muted); font-size: .78rem; }
.progress-track { height: 4px; margin-top: 17px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; }
.progress-track.subtle { background: var(--soft); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--highlight); transition: width .5s ease; }
.progress-track.subtle span { background: var(--accent); }

.subject-section { margin-top: 38px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.table-header, .subject-main {
  display: grid;
  grid-template-columns: minmax(240px, 1.7fr) 82px 78px minmax(150px, 1fr) 30px;
  gap: 12px;
  align-items: center;
}
.table-header { padding: 0 16px 9px; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.subject-card { border-top: 1px solid var(--line); }
.subject-card:last-child { border-bottom: 1px solid var(--line); }
.subject-main { min-height: 62px; padding: 10px 10px 10px 4px; }
.subject-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.subject-name strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--serif); font-size: 1.05rem; font-weight: 400; }
.subject-type { flex: none; padding: 3px 6px; border-radius: 4px; background: var(--accent-soft); color: #46564d; font-size: .63rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.expand-button, .menu-button, .remove-button {
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  cursor: pointer;
}
.expand-button { width: 22px; height: 28px; transition: transform .2s ease; }
.subject-card.collapsed .expand-button { transform: rotate(-90deg); }
.subject-hours, .subject-goal, .progress-label { font-variant-numeric: tabular-nums; font-size: .84rem; }
.progress-cell { display: flex; align-items: center; gap: 10px; }
.mini-progress { flex: 1; height: 6px; overflow: hidden; border-radius: 20px; background: var(--soft); }
.mini-progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.menu-wrap { position: relative; }
.menu-button { width: 30px; height: 30px; border-radius: 6px; }
.menu-button:hover { background: var(--soft); }
.menu-popover {
  position: absolute;
  z-index: 4;
  right: 0;
  top: 32px;
  width: 165px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(22,31,27,.13);
}
.menu-popover button { width: 100%; padding: 8px 9px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; font-size: .78rem; }
.menu-popover button:hover { background: var(--soft); }
.menu-popover .danger { color: var(--danger); }
.topic-list { padding: 0 44px 12px 36px; }
.subject-card.collapsed .topic-list { display: none; }
.topic-row {
  display: grid;
  grid-template-columns: minmax(180px,1.7fr) 82px 78px minmax(150px,1fr);
  gap: 12px;
  align-items: center;
  min-height: 39px;
  padding: 5px 0 5px 17px;
  border-left: 1px solid #aeb5b1;
  color: #4c5550;
  font-size: .82rem;
}
.topic-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.add-topic { margin-left: 17px; padding: 8px 0; border: 0; color: var(--muted); background: none; cursor: pointer; font-size: .78rem; }
.add-topic:hover { color: var(--ink); }
.empty-state { padding: 48px 20px; border: 1px dashed #b9bfbb; border-radius: var(--radius); text-align: center; }

.focus-panel { padding: 34px 28px 50px; border-left: 1px solid var(--line); overflow-y: auto; }
.tool-section { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.tool-section + .tool-section { padding-top: 27px; }
.tool-heading { display: flex; justify-content: space-between; align-items: center; }
.tool-heading h2 { font-size: 1.6rem; }
.tool-heading.compact { margin-bottom: 20px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #c8ceca; }
.live-dot.running { background: #70a875; box-shadow: 0 0 0 5px rgba(112,168,117,.13); }
.timer-tabs { display: grid; grid-template-columns: repeat(3,1fr); margin-top: 24px; border-bottom: 1px solid var(--line); }
.timer-tab { padding: 9px 2px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); cursor: pointer; font-size: .75rem; }
.timer-tab.active { border-color: var(--ink); color: var(--ink); }
.timer-display { margin-top: 28px; font-family: var(--serif); font-size: 4.8rem; line-height: 1; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.timer-caption { min-height: 21px; margin: 12px 0 24px; color: var(--muted); text-align: center; font-size: .82rem; }
.timer-actions { display: grid; grid-template-columns: 1fr 46px; gap: 8px; }
.timer-button { height: 46px; color: #fff; background: var(--accent); font-weight: 650; }
.icon-button { border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; font-size: 1.2rem; }
.icon-button:hover { background: var(--soft); }

label, legend { display: block; margin-bottom: 7px; color: #3b443f; font-size: .78rem; font-weight: 650; }
label span { color: var(--muted); font-weight: 400; }
input, select {
  width: 100%;
  height: 43px;
  padding: 0 11px;
  border: 1px solid #cfd4d0;
  border-radius: 8px;
  outline: 0;
  background: #fff;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29,42,36,.08); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.entry-section label:not(:first-child) { margin-top: 15px; }
.submit-button { width: 100%; height: 46px; margin-top: 18px; color: #fff; background: var(--accent); font-weight: 650; }
.next-focus { border-bottom: 0; }
.focus-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding: 17px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.focus-card strong, .focus-card span { display: block; }
.focus-card strong { font-family: var(--serif); font-weight: 400; font-size: 1.02rem; }
.focus-card span { margin-top: 2px; color: var(--muted); font-size: .75rem; }

dialog { width: min(500px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 15px; color: var(--ink); box-shadow: 0 30px 100px rgba(18,27,23,.25); }
dialog::backdrop { background: rgba(20,28,24,.45); backdrop-filter: blur(4px); }
dialog form { padding: 28px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.dialog-close { width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--soft); cursor: pointer; font-size: 1.35rem; line-height: 1; }
.type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 18px; padding: 0; border: 0; }
.type-switch legend { grid-column: 1 / -1; }
.type-switch label { margin: 0; }
.type-switch input { position: absolute; opacity: 0; pointer-events: none; }
.type-switch span { display: grid; place-items: center; height: 42px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--muted); }
.type-switch input:checked + span { border-color: var(--accent); color: #fff; background: var(--accent); }
#module-fields, #script-fields { margin-top: 16px; }
.field-hint { margin: 10px 0 0; color: var(--muted); font-size: .77rem; }
.toast { position: fixed; z-index: 20; right: 28px; bottom: 28px; max-width: 340px; padding: 13px 16px; border-radius: 9px; color: #fff; background: var(--accent); box-shadow: 0 10px 35px rgba(18,27,23,.2); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 190px minmax(0,1fr); }
  .focus-panel { position: static; grid-column: 2; width: auto; height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 28px 38px 55px; border-top: 1px solid var(--line); border-left: 0; }
  .focus-panel .tool-section { border-bottom: 0; padding: 0; }
  .focus-panel .next-focus { display: none; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric-card:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .metric-card:nth-child(4) { border-top: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .app-shell { display: block; padding-bottom: 66px; }
  .sidebar { position: fixed; z-index: 10; top: auto; right: 0; bottom: 0; left: 0; width: auto; height: 66px; padding: 8px 12px; border-top: 1px solid var(--line); border-right: 0; }
  .brand, .sidebar-foot { display: none; }
  .nav-list { grid-template-columns: repeat(6,1fr); height: 100%; gap: 2px; }
  .nav-item { flex-direction: column-reverse; justify-content: center; gap: 2px; padding: 4px; font-size: .65rem; }
  .nav-item span:last-child { font-size: 1rem; }
  .main-content { padding: 24px 18px 42px; }
  .page-header { align-items: start; }
  .page-header .primary-action { width: 44px; height: 44px; padding: 0; overflow: hidden; font-size: 0; }
  .page-header .primary-action span { font-size: 1.25rem; }
  h1 { font-size: 2.7rem; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 132px; padding: 16px; }
  .metric-card strong { font-size: 1.75rem; }
  .section-heading { align-items: start; }
  .section-heading .secondary-action { width: 38px; height: 38px; padding: 0; overflow: hidden; font-size: 0; }
  .section-heading .secondary-action::first-letter { font-size: 1rem; }
  .profile-bar { align-items: stretch; flex-direction: column; gap: 12px; }
  .profile-bar select { width: 100%; }
  .calendar-card { padding: 14px; }
  .calendar-day { min-height: 54px; padding: 6px; }
  .calendar-weekdays { font-size: .6rem; }
  .table-header { display: none; }
  .subject-card { padding: 9px 0; }
  .subject-main { grid-template-columns: minmax(0,1fr) 34px; gap: 8px; }
  .subject-name { grid-column: 1; }
  .subject-hours, .subject-goal { display: none; }
  .progress-cell { grid-column: 1; padding-left: 32px; }
  .menu-wrap { grid-column: 2; grid-row: 1 / 3; }
  .topic-list { padding: 0 4px 5px 27px; }
  .topic-row { grid-template-columns: minmax(0,1fr) 58px; }
  .topic-row > :nth-child(3), .topic-row > :nth-child(4) { display: none; }
  .focus-panel { display: block; padding: 28px 18px 45px; }
  .focus-panel .tool-section + .tool-section { padding-top: 30px; }
  .focus-panel .tool-section { padding-bottom: 30px; border-bottom: 1px solid var(--line); }
  .timer-display { font-size: 4rem; }
}

@media (max-width: 420px) {
  .metrics { grid-template-columns: 1fr; }
  .metric-card, .metric-card:nth-child(2), .metric-card:nth-child(4) { border-left: 0; border-top: 1px solid var(--line); }
  .metric-card:first-child { border-top: 0; }
  .field-row { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Shared additions for accounts, direct time entries and tasks. */
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #6e905f; outline-offset: 3px; }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
button, input, select { min-height: 40px; }
input[type="checkbox"], input[type="radio"] { min-height: 0; }
.muted { color: var(--muted); font-size: .9rem; }
.eyebrow, .metric-top, .metric-card p, label, legend, .field-hint, .timer-tab { font-size: .875rem; }
.eyebrow { letter-spacing: .06em; font-size: .75rem; }
.sidebar-foot p, .text-button, .topic-row, .add-topic { font-size: .875rem; }
.nav-item { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; }
.nav-count { display: inline-block; margin-left: 4px; font-size: .75rem; }
.main-content, .focus-panel, .login-card { min-width: 0; }
.app-shell { grid-template-columns: 200px minmax(0, 1fr) 340px; }
.main-content { padding: 38px 32px 60px; }
.page-header .primary-action { flex-shrink: 0; }
.metric-card { padding: 18px 16px; }
.metrics { grid-template-columns: 1.2fr 1fr 1fr 1fr; }
.metric-card strong { font-size: 2rem; }
.subject-name strong { white-space: normal; overflow-wrap: anywhere; }
.subject-label { min-width: 0; }
.subject-owner { display: block; color: var(--muted); font-size: .75rem; margin-top: 3px; }
.table-header, .subject-main { grid-template-columns: minmax(160px, 1.5fr) 65px 65px minmax(95px, 1fr) 74px; gap: 10px; }
.table-header { padding-left: 4px; }
.row-actions { display: flex; justify-content: end; gap: 3px; }
.add-time-button { display: grid; place-items: center; border: 1px solid #c5cfc8; border-radius: 8px; color: var(--ink); background: #e7ede7; width: 36px; min-height: 36px; font-size: 1.4rem; cursor: pointer; flex-shrink: 0; }
.add-time-button:hover { background: var(--accent); color: white; }
.add-time-button.small { width: 30px; min-height: 30px; font-size: 1.1rem; }
.menu-button { min-width: 30px; min-height: 36px; font-size: 1.1rem; }
.topic-list { padding: 0 44px 12px 22px; }
.topic-row { grid-template-columns: minmax(120px, 1.5fr) 65px 65px minmax(95px, 1fr) 30px; gap: 10px; padding-left: 12px; }
.topic-name { white-space: normal; overflow-wrap: anywhere; }
.section-hint { margin: -8px 0 20px; }
.inline-plus { display: inline-grid; place-items: center; border: 1px solid var(--line); width: 22px; height: 22px; border-radius: 5px; }
.focus-panel label { margin-top: 16px; }
.timer-actions { margin-top: 18px; }
.timer-display { font-size: 4.2rem; }
.timer-caption { margin-bottom: 20px; }
.focus-panel .field-hint { font-size: .8rem; line-height: 1.6; }
.focus-card { text-decoration: none; color: var(--ink); }
.focus-card strong { overflow-wrap: anywhere; }
.focus-card span { font-size: .8rem; }
.text-link { display: inline-block; margin-top: 16px; color: var(--ink); font-size: .875rem; text-underline-offset: 4px; }
.history-section { margin-top: 38px; }
.history-row { display: flex; align-items: center; gap: 15px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.history-row > div { flex: 1; min-width: 0; }
.history-row strong { font-weight: 500; font-size: .9rem; }
.history-row span { display: block; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.history-row b { font-size: .875rem; white-space: nowrap; font-weight: 500; }
.import-section { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
.import-section input { max-width: 350px; font-size: .8rem; height: auto; padding: 8px; }
.import-section .field-hint { max-width: 520px; margin-bottom: 12px; }
.todo-create { display: grid; grid-template-columns: minmax(0, 1fr) 175px auto; align-items: end; gap: 14px; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.todo-create .primary-action { height: 43px; }
.todo-create .form-error { grid-column: 1 / -1; }
.todo-filters { display: flex; gap: 8px; margin: 28px 0 18px; }
.todo-filters button { border: 1px solid var(--line); border-radius: 20px; padding: 6px 16px; background: transparent; cursor: pointer; font-size: .9rem; }
.todo-filters .active { background: var(--accent); color: white; border-color: var(--accent); }
.todo-summary { padding: 8px 13px; background: var(--accent-soft); border-radius: 20px; white-space: nowrap; font-size: .875rem; }
.todo-row { display: flex; align-items: center; gap: 15px; padding: 19px 16px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.todo-row input { flex-shrink: 0; width: 21px; height: 21px; accent-color: var(--accent); cursor: pointer; }
.todo-content { flex: 1; min-width: 0; }
.todo-content strong { font-weight: 550; overflow-wrap: anywhere; }
.deadline { display: block; margin-top: 5px; font-size: .875rem; color: var(--muted); }
.overdue { border-color: #e6b6af; background: #fff4f1; border-left: 3px solid #b94130; }
.overdue .deadline, .focus-card.overdue span { color: #9e3326; }
.todo-row.done strong { color: var(--muted); text-decoration: line-through; }
.todo-row.done { background: #eff3ee; }
.form-error { color: #a22d24; font-size: .875rem; }
.form-error:empty { display: none; }
.notice { border-left: 3px solid var(--accent); padding: 12px; background: var(--accent-soft); font-size: .9rem; }
dialog { max-height: calc(100dvh - 30px); overflow-y: auto; }
dialog form > label, dialog form > .field-row { margin-top: 16px; }
dialog fieldset:not(.type-switch) { border: 0; padding: 0; }
dialog input, dialog select { font-size: 1rem; }
.confirm-actions { display: flex; justify-content: end; gap: 10px; margin-top: 24px; }
.account-logout { display: block; margin: 20px auto 0; }
.mobile-account { display: none; }
.login-screen { min-height: 100dvh; display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 8vw; padding: 70px 8vw; }
.login-intro .brand { margin: 0 0 90px; }
.login-intro h1 { font-size: clamp(2.8rem, 5.4vw, 5.8rem); line-height: 1.06; margin: 20px 0; }
.login-intro .subtitle { line-height: 1.6; }
.login-rule { height: 5px; max-width: 110px; background: var(--accent); margin: 45px 0 15px; }
.login-footnote { color: var(--muted); font-size: .875rem; }
.login-card { width: 100%; max-width: 430px; padding: 40px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.login-card h2 { font-size: 2.2rem; }
.login-card label { margin-top: 22px; }
.login-card input { font-size: 1rem; }
.login-card .submit-button { margin-top: 28px; }
.calendar-card { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.calendar-toolbar h2 { font-size: 1.6rem; }
.calendar-controls { display: flex; align-items: center; gap: 8px; }
.calendar-controls .secondary-action { min-height: 40px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar-weekdays { margin-top: 24px; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.calendar-day { min-height: 72px; padding: 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: left; cursor: pointer; display: flex; flex-direction: column; justify-content: space-between; }
.calendar-day:hover, .calendar-day.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(29,42,36,.1); }
.calendar-day.outside { color: #a4aaa6; background: var(--soft); }
.calendar-day.today span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; }
.calendar-day b { color: var(--accent); font-size: .72rem; font-weight: 600; }
.calendar-detail { margin-top: 38px; }
@media (max-width: 1280px) {
  .app-shell { grid-template-columns: 180px minmax(0, 1fr); }
  .focus-panel { position: static; grid-column: 2; width: auto; height: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; padding: 30px; border-top: 1px solid var(--line); border-left: 0; }
  .focus-panel .tool-section { padding: 0; border: 0; }
  .main-content { padding: 32px 28px; }
}
@media (max-width: 1040px) {
  .table-header, .subject-main { grid-template-columns: minmax(140px, 1fr) 60px 60px minmax(75px, .7fr) 70px; gap: 8px; }
  .topic-row { grid-template-columns: minmax(95px, 1fr) 60px 60px minmax(75px, .7fr) 30px; gap: 8px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric-card:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .metric-card:nth-child(4) { border-top: 1px solid var(--line); }
  .todo-create { grid-template-columns: 1fr 175px; }
  .todo-create .primary-action { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .main-content { padding: 26px 18px; }
  .table-header { display: none; }
  .subject-main { grid-template-columns: minmax(0, 1fr) 75px; }
  .row-actions { grid-column: 2; grid-row: 1 / 3; }
  .subject-name { grid-column: 1; }
  .subject-hours, .subject-goal { display: none; }
  .subject-main > .progress-cell { grid-column: 1; padding-left: 32px; }
  .topic-row { grid-template-columns: minmax(0, 1fr) 64px 30px; }
  .topic-row > :nth-child(3), .topic-row > :nth-child(4) { display: none; }
  .topic-list { padding-right: 8px; }
  .topic-row .add-time-button { grid-column: 3; }
  .focus-panel { display: block; padding: 25px 18px; }
  .focus-panel .tool-section + .tool-section { margin-top: 30px; }
  .mobile-account { display: block; margin: 28px 0; }
  .nav-item { font-size: .75rem; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 150px; }
  .metric-card:nth-child(2) { border-top: 0; border-left: 1px solid var(--line); }
  .metric-card:nth-child(4) { border-left: 1px solid var(--line); }
  .field-row { grid-template-columns: 1fr 1fr; }
  .section-heading .secondary-action { font-size: 1.1rem; width: auto; padding: 6px 10px; }
  .section-heading { flex-wrap: wrap; }
  .todo-create { grid-template-columns: 1fr; padding: 18px; }
  .todo-row { flex-wrap: wrap; gap: 10px; }
  .todo-row .text-button { font-size: .8rem; }
  .login-screen { grid-template-columns: 1fr; gap: 28px; padding: 28px 20px; }
  .login-intro .brand { display: flex; margin-bottom: 30px; }
  .login-intro h1 { font-size: 2.7rem; }
  .login-rule, .login-footnote { display: none; }
  .login-card { max-width: none; padding: 28px; }
  .login-intro .subtitle { font-size: 1rem; }
}

/* Text-led presentation */
:root { --paper:#fff; --accent:#272727; --ink:#222; --muted:#686868; --line:#e3e3e3; --soft:#f5f5f5; --accent-soft:#f2f2f2; --highlight:#777; --radius:0; --sans:Georgia,"Times New Roman",serif; }
body { font-size:16px; }
.app-shell { grid-template-columns:190px minmax(0,1fr) 310px; }
.sidebar,.focus-panel { background:#fafafa; backdrop-filter:none; }
.main-content { padding:30px 34px 60px; }
.brand { font-size:1.65rem; margin-left:10px; }
.brand-mark,.nav-item > span:last-child,.login-rule { display:none; }
h1 { font-size:2.4rem; }
h2 { font-size:1.6rem; }
.eyebrow { text-transform:none; letter-spacing:0; font-weight:400; }
.nav-item,.nav-item.active { color:var(--ink); border-radius:3px; background:transparent; }
.nav-item.active { background:#ededed; }
.profile-bar { background:none; border:0; border-bottom:1px solid var(--line); border-radius:0; padding:0 0 16px; margin-bottom:24px; }
.profile-bar .eyebrow { display:none; }
.metrics { border:0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); border-radius:0; background:none; padding:18px 0; }
.metric-card { min-height:115px; padding:5px 20px; background:none; }
.metric-card.featured { background:none; color:var(--ink); }
.featured .metric-top,.featured p { color:var(--muted); }
.metric-card strong { font-size:2rem; }
.progress-track { display:none; }
.primary-action,.submit-button,.timer-button { color:var(--ink); background:#f4f4f4; border:1px solid #ccc; border-radius:3px; font-weight:400; }
.primary-action:hover,.submit-button:hover,.timer-button:hover { background:#e9e9e9; transform:none; }
.secondary-action,.icon-button,.login-card,dialog,input,select { border-radius:3px; }
.page-header .primary-action,.section-heading .secondary-action { border:0; background:none; }
.table-header,.subject-main { grid-template-columns:minmax(150px,1.4fr) 55px 55px minmax(85px,.8fr) 130px 68px; gap:8px; }
.table-header { text-transform:none; letter-spacing:0; font-size:.85rem; }
.subject-type { background:none; font-size:.7rem; font-weight:400; }
.forecast { font-size:.8rem; color:var(--muted); }
.mini-progress { height:7px; border-radius:0; background:#eee; }
.mini-progress span { border-radius:0; background:#656565; }
.add-time-button,.add-time-button.small { border:0; background:none; border-radius:0; }
.add-time-button:hover { background:#eee; color:#222; }
.topic-list { border-left:1px solid #bbb; margin-left:20px; padding-left:14px; }
.topic-row { grid-template-columns:minmax(130px,1.4fr) 55px 55px minmax(85px,.8fr) 30px; }
.timer-display { font-size:3.3rem; }
.timer-tabs { border-radius:0; background:none; border-bottom:1px solid var(--line); }
.timer-tab.active { background:none; box-shadow:none; border-bottom:1px solid #222; border-radius:0; }
.live-dot { display:none; }
.todo-create,.todo-row,.focus-card,.calendar-card { border-radius:0; box-shadow:none; background:none; }
.todo-create { border:0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding:18px 0; }
.todo-row { border:0; border-bottom:1px solid var(--line); }
.todo-row.overdue { border-left:3px solid #a53a2f; background:#fff6f4; }
.calendar-day { border-radius:0; }
.calendar-day.selected { box-shadow:none; border-color:#555; }
.login-card { border-radius:0; }
@media (max-width:1400px) {
 .app-shell { grid-template-columns:170px minmax(0,1fr); }
 .focus-panel { grid-column:2; position:static; height:auto; display:grid; grid-template-columns:1fr 1fr; gap:30px; border-left:0; border-top:1px solid var(--line); padding:28px 34px; }
}
@media (max-width:760px) {
 .app-shell { display:block; }
 .main-content { padding:24px 18px; }
 .nav-item > span:last-child { display:none; }
 .nav-item { font-size:.8rem; }
 .profile-bar { gap:8px; }
 .profile-bar select { width:100%; }
 .table-header { display:none; }
 .subject-main { grid-template-columns:minmax(0,1fr) 68px; }
 .subject-main > .forecast { grid-column:1; padding-left:32px; }
 .row-actions { grid-column:2; grid-row:1 / 4; }
 .subject-hours,.subject-goal { display:none; }
 .topic-row { grid-template-columns:minmax(0,1fr) 60px 30px; }
 .focus-panel { display:block; padding:24px 18px; }
 .calendar-card { padding:12px 0; }
 .calendar-day { min-width:0; min-height:48px; padding:4px; }
 .calendar-day b { font-size:.65rem; }
 .calendar-toolbar h2 { font-size:1.25rem; }
 .metrics { grid-template-columns:1fr 1fr; }
 .metric-card { padding:12px; }
}
