/* Graphite workspace. Space and typography carry the hierarchy. */
:root {
  --bg: #0c0e10;
  --surface: #111417;
  --surface2: #1a1e23;
  --border: #292f36;
  --text: #edf0f3;
  --muted: #969fa9;
  --accent: #e1e8ef;
  --green: #b2c8bc;
  --red: #cf9398;
  --input: #101317;
  --steel: #b4c6d8;
}
:root[data-theme="light"] {
  --bg: #f4f6f8;
  --surface: #fafbfc;
  --surface2: #e9edf1;
  --border: #d6dde4;
  --text: #202831;
  --muted: #64717f;
  --accent: #273340;
  --green: #3f6655;
  --red: #99565e;
  --input: #fafbfc;
  --steel: #506a85;
}
.sidebar {
  max-width: 1280px;
  padding: 22px 40px;
  min-height: 84px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--border);
}
.brand {
  font-size: 20px;
  letter-spacing: -0.6px;
  white-space: nowrap;
}
#navigation {
  min-height: 0;
  margin: 0;
  border: 0;
  width: auto;
  gap: 2px;
}
.nav-item,
.nav-more > summary {
  padding: 10px 11px;
  font-size: 11px;
}
.nav-item.active {
  background: var(--surface2);
  border-radius: 6px;
}
.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.header-actions .icon-button {
  font-size: 18px;
  width: 30px;
  height: 30px;
}
main {
  max-width: 1280px;
  padding: 0 40px;
}
.page-heading {
  padding: 38px 0 28px;
}
.page-heading h1 {
  font-size: 28px;
  font-weight: 550;
  letter-spacing: -0.9px;
}
.page-heading p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.global-filters {
  margin-bottom: 28px;
  gap: 10px;
}
.global-filters select {
  font-size: 11px;
  border-color: var(--border);
  background: transparent;
  padding-block: 9px;
}
.global-filters > span {
  font-size: 10px;
}
.panel {
  border: 0;
  border-radius: 0;
  margin-bottom: 30px;
  background: transparent;
}
.card-heading {
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.card-heading h2 {
  font-size: 14px;
  font-weight: 500;
}
.card-heading p {
  font-size: 11px;
  line-height: 1.6;
}
.primary {
  color: var(--bg);
  background: var(--accent);
  border-radius: 6px;
}
:root[data-theme="light"] .primary {
  color: #fff;
}
.secondary {
  background: transparent;
  border-radius: 6px;
}
button {
  font-weight: 500;
}
.performance-hero {
  padding: 32px 0 40px;
}
.performance-hero > strong {
  color: var(--text);
}
.performance-hero > strong.negative {
  color: var(--red);
}
.performance-strip {
  padding-block: 27px;
}
.chart path {
  stroke: var(--steel);
}
.overview-visuals .chart svg {
  height: auto;
  aspect-ratio: 900 / 420;
  min-height: 220px;
}
.overview-visuals {
  gap: 35px;
  margin-top: 12px;
}
.journal-day {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
}
.day-heading {
  padding-inline: 4px;
  border-bottom: 0;
}
.journal-row {
  padding-inline: 4px;
}
.symbol-token {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--steel);
}
.review-invitation {
  margin-block: 24px 35px;
  padding-block: 25px;
}
.review-invitation h3 {
  font-size: 17px;
}
.review-tabs {
  margin: 0 0 28px auto;
}
.review-home {
  gap: 42px;
  grid-template-columns: 1.4fr 1fr;
}
.review-welcome {
  padding: 20px 0 35px;
}
.review-welcome h2 {
  font-size: clamp(35px, 3.9vw, 51px);
  max-width: 560px;
}
.review-home > .panel:last-child {
  border-left: 1px solid var(--border);
  padding-left: 32px;
}
.weekly-focus {
  padding: 16px 0 28px;
}
.weekly-focus h3 {
  font-size: 22px;
}
.review-session {
  padding: 24px 0 35px;
  border-top: 1px solid var(--border);
}
.review-complete {
  border-top: 1px solid var(--border);
}
.practice-stats {
  padding: 15px 0 28px;
}
.review-week {
  padding: 8px 0;
}
.milestone-grid,
.lesson-grid {
  padding: 3px 0 20px;
  gap: 20px;
}
.milestone,
.lesson-card {
  border-radius: 7px;
  background: transparent;
}
.lesson-search {
  padding-inline: 0;
}
.settings-form,
.updates-settings,
.desktop-controls {
  padding-inline: 0;
}
.desktop-about {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding-block: 6px 25px;
}
.desktop-about strong {
  font-size: 18px;
  display: block;
  font-weight: 500;
}
.desktop-about span {
  color: var(--muted);
  font-size: 11px;
}
.desktop-about > div > span {
  display: block;
  margin-top: 7px;
}
.desktop-display {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-block: 7px 22px;
}
.desktop-display label {
  margin-right: 15px;
  font-size: 12px;
}
.desktop-display select {
  width: auto;
  min-width: 140px;
}
.desktop-shortcuts {
  color: var(--muted);
  font-size: 11px;
  padding-block: 10px 20px;
}
.desktop-shortcuts > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 22px 8px 0;
}
.desktop-shortcuts p {
  line-height: 1.7;
}
.desktop-shortcuts kbd {
  padding: 3px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 10px;
  color: var(--text);
}
.desktop-maintenance {
  display: flex;
  gap: 16px;
  align-items: center;
}
.updates-settings {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  padding-bottom: 15px;
}
.updates-settings h3 {
  font-size: 16px;
  font-weight: 500;
}
.updates-settings p {
  color: var(--muted);
  line-height: 1.7;
  max-width: 610px;
  font-size: 12px;
}
.updates-settings small {
  color: var(--muted);
  font-size: 10px;
}
.updates-settings > button {
  flex-shrink: 0;
}
.page-footer {
  border-top: 1px solid var(--border);
  margin-top: 42px;
  padding-block: 20px;
  color: var(--muted);
}
.page-footer > span:first-child {
  visibility: hidden;
}
.update-status[data-update-state="ready"],
.update-status[data-update-state="downloading"] {
  border-color: var(--steel);
  color: var(--steel);
}

/* The update center is a focused page inside the app, not an interruption. */
.update-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 30px 32px 24px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.update-page-heading,
.update-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.update-brand {
  justify-content: flex-start;
  gap: 11px;
}
.update-brand img {
  width: 28px;
  height: 28px;
}
.update-brand span {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 1.5px;
}
.update-brand h2,
.update-brand h1 {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  margin: 4px 0 0;
  letter-spacing: 0;
}
.update-hero {
  text-align: center;
  padding: 30px 0 25px;
}
.update-emblem {
  display: grid;
  place-items: center;
  margin: 0 auto 23px;
  width: 62px;
  height: 62px;
  color: var(--steel);
  border: 1px solid var(--border);
  border-radius: 50%;
}
.update-emblem svg {
  width: 28px;
  height: 28px;
}
.update-hero .eyebrow {
  color: var(--muted);
  font-size: 8px;
}
.update-hero h3 {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.8px;
  margin: 12px 0;
}
.update-hero p {
  color: var(--muted);
  line-height: 1.75;
  font-size: 12px;
  max-width: 430px;
  margin: 0 auto;
}
.update-versions {
  display: grid;
  grid-template-columns: 1fr 24px 1fr;
  align-items: center;
  padding: 18px 22px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  gap: 15px;
}
.update-versions > div {
  min-width: 0;
}
.update-versions span {
  color: var(--muted);
  font-size: 10px;
}
.update-versions strong {
  display: block;
  font-size: 16px;
  font-weight: 500;
  margin-top: 7px;
  overflow-wrap: anywhere;
}
.version-arrow {
  text-align: center;
}
.update-download {
  margin-top: 24px;
}
.update-download > div,
.notice-progress-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}
.update-download strong {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.update-dialog progress,
.update-notice progress {
  appearance: none;
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 3px;
  overflow: hidden;
  display: block;
  background: var(--border);
  accent-color: var(--steel);
  margin: 12px 0 9px;
}
.update-dialog progress::-webkit-progress-bar,
.update-notice progress::-webkit-progress-bar {
  background: var(--border);
  border-radius: 3px;
}
.update-dialog progress::-webkit-progress-value,
.update-notice progress::-webkit-progress-value {
  background: var(--steel);
  border-radius: 3px;
}
.update-dialog progress::-moz-progress-bar,
.update-notice progress::-moz-progress-bar {
  background: var(--steel);
}
.update-download > small {
  display: block;
  min-height: 14px;
  font-size: 9px;
  color: var(--muted);
}
.update-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0;
  margin: 25px 0;
  gap: 12px;
  list-style: none;
}
.update-steps li {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}
.update-steps b {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 400;
}
.update-steps small {
  grid-column: 2;
  font-size: 9px;
}
.update-steps .done,
.update-steps .active {
  color: var(--text);
}
.update-steps .active {
  border-color: var(--steel);
}
.update-steps .done b {
  color: var(--steel);
}
.update-release-notes {
  border-top: 1px solid var(--border);
  margin-top: 26px;
  padding-top: 20px;
}
.update-release-notes h4 {
  font-size: 12px;
  font-weight: 500;
  margin: 0 0 12px;
}
.update-release-notes p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  max-height: 200px;
  overflow-y: auto;
}
.update-footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  margin-top: 28px;
  line-height: 1.6;
}
.update-actions {
  margin-top: 20px;
  padding-top: 20px;
  align-items: center;
}
.update-actions > .text-button {
  margin-right: auto;
  font-size: 10px;
}
#update-feedback {
  margin-bottom: 0;
  font-size: 11px;
}
.update-notice {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 350px;
  max-width: calc(100vw - 32px);
  z-index: 60;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 17px 20px 20px;
  box-shadow: 0 12px 35px #0003;
}
.update-notice-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.update-notice-heading .eyebrow {
  font-size: 8px;
  color: var(--steel);
}
.update-notice-heading .icon-button {
  width: 23px;
  height: 23px;
  padding: 0;
  font-size: 19px;
  color: var(--muted);
}
.update-notice h3 {
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.3px;
  margin: 13px 0 8px;
}
.update-notice > p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  margin: 0 0 17px;
}
.notice-progress-label {
  color: var(--muted);
  font-size: 10px;
}
.notice-progress-label strong {
  font-weight: 400;
}
.update-notice-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
}
.update-notice-actions > button {
  font-size: 11px;
}
body:has(#update-notice:not([hidden])) #toast {
  top: 20px;
  bottom: auto;
}

/* Private access uses the same visual language in its secure native window. */
.update-access-page main.update-settings {
  margin: 0 auto;
  width: 100%;
  max-width: 620px;
  padding: 32px 28px;
}
.update-access-page .update-brand h1 {
  font-size: 20px;
  margin-top: 6px;
}
.update-settings .access-intro {
  margin: 22px 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
}
.access-status-card {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 9px;
  margin-bottom: 24px;
}
.access-status-card > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.access-status-card h2 {
  font-size: 17px;
  font-weight: 500;
  margin: 22px 0 10px;
}
.update-settings #connection-status {
  border: 0;
  padding: 0;
  background: transparent;
  margin: 0;
  line-height: 1.8;
  font-size: 11px;
  color: var(--muted);
}
.connection-badge {
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 9px;
  padding: 5px 7px;
  color: var(--muted);
}
.connection-badge[data-connected="true"] {
  color: var(--steel);
  border-color: var(--steel);
}
.access-guide,
.access-credentials {
  border: 0;
  padding: 0;
  border-radius: 0;
  margin: 22px 0;
}
.access-guide > summary,
.access-credentials > summary {
  font-size: 12px;
  padding: 6px 0;
  color: var(--text);
}
.access-guide > summary > span {
  font-size: 9px;
  color: var(--muted);
  margin-left: 10px;
}
.update-settings .access-guide ol {
  padding-left: 20px;
  margin: 20px 0;
  color: var(--text);
  line-height: 1.6;
}
.access-guide li {
  padding-left: 5px;
  font-size: 12px;
}
.access-guide li strong {
  font-weight: 500;
}
.access-guide li p {
  font-size: 11px;
  color: var(--muted);
  margin: 7px 0 17px;
  line-height: 1.8;
}
.update-settings #connect-form {
  margin-top: 19px;
  gap: 12px;
}
#connect-form label {
  font-size: 11px;
}
#connect-form .primary {
  width: fit-content;
  margin-top: 4px;
}
.access-footnote {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 28px;
}
.access-footnote > span {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 1.5px;
}
.access-footnote p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.9;
}
@media (prefers-reduced-motion: no-preference) {
  .update-notice {
    animation: update-arrive 180ms ease-out;
  }
  .update-dialog[data-update-state="checking"] .update-emblem svg,
  .update-dialog[data-update-state="installing"] .update-emblem svg {
    animation: update-spin 1.8s linear infinite;
  }
  @keyframes update-arrive {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  @keyframes update-spin {
    to {
      transform: rotate(360deg);
    }
  }
}
@media (max-width: 1000px) {
  .sidebar {
    gap: 12px;
    padding-inline: 25px;
  }
  .brand {
    font-size: 18px;
  }
  .nav-item,
  .nav-more > summary {
    font-size: 10px;
    padding-inline: 8px;
    gap: 5px;
  }
  main {
    padding-inline: 25px;
  }
}
@media (max-width: 760px) and (min-width: 641px) {
  .sidebar {
    grid-template-columns: 1fr auto;
    padding-bottom: 12px;
  }
  #navigation {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 8px;
  }
  .header-actions {
    grid-column: 2;
    grid-row: 1;
  }
}
@media (max-width: 640px) {
  .sidebar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 18px 18px;
    min-height: 72px;
    height: auto;
    border: 0;
  }
  .brand {
    font-size: 19px;
  }
  .brand-mark {
    width: 23px;
    height: 23px;
  }
  #navigation {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    padding: 5px 4px;
    border: 1px solid var(--border);
    width: calc(100% - 20px);
    min-height: 64px;
    background: var(--surface);
  }
  .nav-item,
  .nav-more > summary {
    font-size: 8px;
    padding: 8px 3px;
  }
  .nav-item.active,
  :root[data-theme="light"] .nav-item.active {
    background: var(--surface2);
    color: var(--text);
    border-radius: 12px;
  }
  :root[data-theme="light"] #navigation,
  :root[data-theme="light"] .more-menu {
    background: var(--surface);
    border-color: var(--border);
  }
  main {
    padding: 0 18px 98px;
  }
  .page-heading {
    padding: 25px 0;
  }
  .page-heading h1 {
    font-size: 26px;
  }
  .page-heading p {
    font-size: 11px;
    line-height: 1.6;
    max-width: 240px;
  }
  .page-heading .actions {
    gap: 6px;
  }
  .page-heading button {
    font-size: 10px;
  }
  .global-filters {
    margin-bottom: 25px;
  }
  .global-filters > span {
    font-size: 9px;
  }
  .panel {
    margin-bottom: 24px;
  }
  .card-heading {
    padding-block: 15px;
  }
  .card-heading h2 {
    font-size: 13px;
  }
  .performance-hero {
    padding: 24px 0 32px;
  }
  .review-home {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .review-welcome {
    padding: 14px 0 25px;
  }
  .review-welcome h2 {
    font-size: 38px;
  }
  .review-home > .panel:last-child {
    border-left: 0;
    border-top: 1px solid var(--border);
    padding-left: 0;
  }
  .review-tabs {
    margin-bottom: 20px;
  }
  .weekly-focus {
    padding-top: 6px;
  }
  .review-session {
    padding: 18px 0 25px;
  }
  .review-workspace {
    gap: 27px;
  }
  .practice-stats {
    gap: 13px;
  }
  .milestone-grid,
  .lesson-grid {
    padding-inline: 0;
    gap: 14px;
  }
  .desktop-about {
    align-items: flex-start;
    flex-direction: column;
  }
  .desktop-display label {
    width: 100%;
  }
  .updates-settings {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .update-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    padding: 22px 20px;
  }
  .update-hero {
    padding-top: 25px;
  }
  .update-hero h3 {
    font-size: 23px;
  }
  .update-versions {
    padding: 15px;
    gap: 9px;
  }
  .update-actions {
    flex-wrap: wrap;
    gap: 12px;
  }
  .update-actions > .text-button {
    flex-basis: 100%;
    text-align: left;
  }
  .update-notice {
    right: 14px;
    bottom: 88px;
    width: min(350px, calc(100vw - 28px));
    padding-inline: 18px;
  }
  .update-notice-actions > button {
    padding-inline: 10px;
  }
  .page-footer {
    margin-top: 28px;
  }
}
@media print {
  .update-notice,
  .desktop-controls,
  .update-dialog {
    display: none !important;
  }
  main {
    padding: 0;
    max-width: none;
  }
}
