:root {
  color-scheme: light;
  --paper: #f2efe7;
  --paper-deep: #e7e2d6;
  --surface: #fffdf8;
  --surface-soft: #f8f5ed;
  --ink: #17231d;
  --ink-soft: #425148;
  --muted: #6f776f;
  --line: #d8d3c6;
  --line-strong: #b8b2a4;
  --forest: #315c49;
  --forest-dark: #214536;
  --forest-soft: #dfe9e1;
  --sage: #789682;
  --brick: #a64f3f;
  --brick-dark: #843c31;
  --brick-soft: #f1dfda;
  --ochre: #9b6d2d;
  --ochre-soft: #f2e7d2;
  --blue: #45657a;
  --blue-soft: #dce7ed;
  --shadow: 0 18px 48px rgba(40, 47, 42, 0.09);
  --shadow-soft: 0 8px 24px rgba(40, 47, 42, 0.07);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --header-height: 72px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 2%, rgba(49, 92, 73, 0.08), transparent 28rem),
    radial-gradient(circle at 94% 20%, rgba(166, 79, 63, 0.06), transparent 24rem),
    linear-gradient(rgba(23, 35, 29, 0.018) 1px, transparent 1px),
    var(--paper);
  background-size: auto, auto, 100% 30px, auto;
  color: var(--ink);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, transparent 0, rgba(255, 255, 255, 0.28) 50%, transparent 100%);
  content: "";
  pointer-events: none;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

button,
input,
select,
textarea,
summary {
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #ca7f47;
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Songti SC", "STZhongsong", "Microsoft YaHei", serif;
  letter-spacing: -0.02em;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: 1.32rem;
  line-height: 1.25;
}

p {
  color: var(--muted);
  line-height: 1.75;
}

small {
  line-height: 1.5;
}

kbd {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 6px;
  padding: 0 6px;
  background: rgba(255, 255, 255, 0.35);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  opacity: 0.74;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--forest-dark);
  color: #fff;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(184, 178, 164, 0.72);
  background: rgba(242, 239, 231, 0.9);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  width: min(1240px, calc(100% - 40px));
  min-height: var(--header-height);
  margin: 0 auto;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
}

.brand-cat {
  position: relative;
  display: block;
  width: 43px;
  height: 34px;
  border-radius: 48% 48% 40% 40%;
  background: var(--ink);
}

.brand-cat::before,
.brand-cat::after {
  position: absolute;
  top: -7px;
  width: 17px;
  height: 18px;
  background: var(--ink);
  content: "";
}

.brand-cat::before {
  left: 3px;
  border-radius: 80% 20% 50% 35%;
  transform: rotate(-18deg);
}

.brand-cat::after {
  right: 3px;
  border-radius: 20% 80% 35% 50%;
  transform: rotate(18deg);
}

.brand-cat span::before,
.brand-cat span::after {
  position: absolute;
  top: 15px;
  z-index: 2;
  width: 5px;
  height: 8px;
  border-radius: 50%;
  background: #f9f3df;
  content: "";
}

.brand-cat span::before {
  left: 12px;
}

.brand-cat span::after {
  right: 12px;
}

.brand-copy {
  display: grid;
  line-height: 1.05;
}

.brand-copy strong {
  font-family: Georgia, serif;
  font-size: 1.24rem;
  letter-spacing: 0.01em;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.date-block {
  display: grid;
  gap: 3px;
  justify-self: start;
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.date-block strong {
  font-size: 0.94rem;
}

.date-block span {
  color: var(--muted);
  font-size: 0.78rem;
}

.top-nav {
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  background: rgba(255, 253, 248, 0.72);
}

.nav-tab {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.nav-tab.is-active {
  background: var(--ink);
  color: #fff;
}

.storage-notice {
  width: min(1240px, calc(100% - 40px));
  margin: 12px auto -4px;
  border: 1px solid #c9a962;
  border-radius: 12px;
  padding: 10px 14px;
  background: #fff2c9;
  color: #654a16;
  font-size: 0.88rem;
}

.app-main {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 70px;
}

.view {
  animation: view-in 280ms ease both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-kicker {
  margin-bottom: 8px;
  color: var(--forest);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.dashboard-intro {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  min-height: 170px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  overflow: hidden;
}

.dashboard-intro > div {
  position: relative;
  z-index: 2;
}

.dashboard-intro p:last-child {
  max-width: 620px;
  margin-bottom: 24px;
}

.desk-cat {
  width: 230px;
  opacity: 0.93;
  transform: translateY(24px);
}

.today-strip,
.history-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 253, 248, 0.64);
  box-shadow: var(--shadow-soft);
}

.today-strip > div,
.history-overview > div {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 18px 20px;
}

.today-strip > div + div,
.history-overview > div + div {
  border-left: 1px solid var(--line);
}

.today-strip dt,
.history-overview dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.today-strip dd,
.history-overview dd {
  margin: 0;
  font-family: "Songti SC", "STZhongsong", serif;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 800;
}

.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid #c7a763;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  padding: 16px 18px;
  background: #fff8df;
  box-shadow: var(--shadow-soft);
}

.resume-banner > div:first-child {
  display: flex;
  align-items: center;
  gap: 13px;
}

.resume-banner strong {
  display: block;
  margin-bottom: 4px;
}

.resume-banner p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.inline-actions,
.data-actions,
.summary-actions,
.session-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.launch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.72fr);
  align-items: start;
  gap: 20px;
}

.paper-card,
.timer-workbench {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 248, 0.92);
  box-shadow: var(--shadow);
}

.launch-card {
  padding: clamp(22px, 3vw, 34px);
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.card-heading.compact {
  margin-bottom: 16px;
}

.mode-badge,
.count-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 11px;
  background: var(--forest-soft);
  color: var(--forest-dark);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}

.template-card {
  display: grid;
  min-width: 0;
  min-height: 132px;
  justify-items: start;
  align-content: start;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px;
  background: var(--surface-soft);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.template-card:hover {
  border-color: var(--sage);
  transform: translateY(-2px);
}

.template-card.is-selected {
  border-color: var(--forest);
  background: var(--forest-soft);
  box-shadow: inset 0 0 0 1px var(--forest);
}

.template-card strong {
  font-size: 0.94rem;
}

.template-card small {
  color: var(--muted);
  font-size: 0.73rem;
}

.template-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--surface);
  color: var(--forest-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(49, 92, 73, 0.14);
}

.session-form {
  display: grid;
  gap: 18px;
}

.form-row {
  display: grid;
  gap: 14px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-columns {
  grid-template-columns: 1.3fr 0.72fr 0.72fr;
}

.compact-columns {
  grid-template-columns: minmax(180px, 0.55fr) minmax(0, 1fr);
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field > span:first-child,
.markdown-details > label {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
}

input,
select {
  min-height: 48px;
  padding: 0 13px;
}

textarea {
  padding: 13px;
  resize: vertical;
  line-height: 1.7;
}

input::placeholder,
textarea::placeholder {
  color: #999b94;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(49, 92, 73, 0.12);
}

.mode-fields {
  display: grid;
  gap: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  padding: 16px;
  background: rgba(248, 245, 237, 0.7);
}

.field-note {
  align-content: center;
  border-left: 1px solid var(--line);
  padding-left: 18px;
}

.field-note p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.55;
}

.input-with-unit {
  position: relative;
  display: block;
}

.input-with-unit input {
  padding-right: 60px;
}

.input-with-unit em {
  position: absolute;
  top: 50%;
  right: 13px;
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
  transform: translateY(-50%);
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.check-field input {
  width: 18px;
  min-height: 18px;
  margin-top: 1px;
  accent-color: var(--forest);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 0 16px;
  font-weight: 800;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button.primary {
  border-color: var(--forest);
  background: var(--forest);
  color: #fff;
  box-shadow: 0 9px 20px rgba(49, 92, 73, 0.2);
}

.button.primary:hover:not(:disabled) {
  background: var(--forest-dark);
}

.button.secondary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.button.quiet {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.button.quiet:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--paper-deep);
}

.button.marker {
  border-color: #c8aa71;
  background: var(--ochre-soft);
  color: #68491e;
}

.button.danger-quiet {
  border-color: #d4a098;
  background: var(--brick-soft);
  color: var(--brick-dark);
}

.button.text-only {
  background: transparent;
  color: var(--muted);
}

.start-button {
  display: flex;
  min-height: 64px;
  flex-direction: column;
  gap: 1px;
  margin-top: 4px;
}

.start-button small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.72rem;
  font-weight: 500;
}

.dashboard-side {
  display: grid;
  gap: 20px;
}

.compass-card,
.review-preview,
.session-stats,
.live-log,
.review-queue,
.history-list-card,
.summary-details,
.reflection-card {
  padding: 22px;
}

.compass-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 253, 248, 0.96), rgba(223, 233, 225, 0.78));
}

.compass-card::after {
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(49, 92, 73, 0.16);
  border-radius: 50%;
  content: "";
}

.compass-card > p:not(.section-kicker) {
  margin: 14px 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.compass-rule {
  width: 56px;
  height: 2px;
  margin: 18px 0;
  background: var(--forest);
}

.plain-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.plain-list li::before {
  position: absolute;
  top: 0.45em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  content: "";
}

.text-button {
  min-height: 36px;
  border: 0;
  padding: 0 4px;
  background: transparent;
  color: var(--forest);
  font-size: 0.8rem;
  font-weight: 800;
}

.small-empty,
.empty-panel {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.65;
}

.empty-panel {
  display: grid;
  gap: 5px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  padding: 24px;
  background: var(--surface-soft);
  text-align: center;
}

.empty-panel strong {
  color: var(--ink);
}

.review-mini-list,
.review-queue-list,
.live-log-list,
.history-list,
.summary-details-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-mini-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

.review-mini-list strong {
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-mini-list span {
  color: var(--muted);
  font-size: 0.74rem;
}

.review-mini-list em {
  grid-row: span 2;
  align-self: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--brick-soft);
  color: var(--brick-dark);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
}

.session-view {
  min-height: calc(100vh - var(--header-height) - 112px);
}

.session-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.session-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.session-identity p {
  margin-bottom: 2px;
  font-size: 0.8rem;
}

.session-identity h1 {
  max-width: 700px;
  margin: 0;
  overflow: hidden;
  font-size: clamp(1.4rem, 3vw, 2rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  align-items: start;
  gap: 20px;
}

.timer-workbench {
  position: relative;
  display: grid;
  min-height: 660px;
  align-content: start;
  justify-items: center;
  overflow: hidden;
  padding: clamp(24px, 4vw, 46px);
  text-align: center;
}

.timer-workbench::before {
  position: absolute;
  top: -150px;
  right: -120px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(49, 92, 73, 0.1), transparent 68%);
  content: "";
  pointer-events: none;
}

.timer-state-row {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.timer-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-weight: 800;
}

.status-orb {
  display: inline-block;
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
}

.status-orb.running {
  background: #4d8b68;
  box-shadow: 0 0 0 6px rgba(77, 139, 104, 0.13);
}

.status-orb.paused {
  background: #a87731;
  box-shadow: 0 0 0 6px rgba(168, 119, 49, 0.12);
}

.focus-companion {
  display: none;
}

.current-focus {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 7px;
  margin-top: clamp(54px, 8vh, 84px);
}

.current-focus p {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.current-focus > strong {
  max-width: min(650px, 80vw);
  overflow: hidden;
  font-family: "Songti SC", "STZhongsong", serif;
  font-size: clamp(1.55rem, 4vw, 2.55rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-focus > span:last-child {
  color: var(--muted);
  font-size: 0.8rem;
}

.current-item-editor {
  width: min(480px, 78vw);
}

.current-item-editor input {
  min-height: 54px;
  border-color: transparent;
  background: transparent;
  font-family: "Songti SC", "STZhongsong", serif;
  font-size: clamp(1.55rem, 4vw, 2.55rem);
  font-weight: 800;
  text-align: center;
}

.current-item-editor input:hover,
.current-item-editor input:focus {
  border-color: var(--line);
  background: var(--surface-soft);
}

.timer-display {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.2vw, 14px);
  width: 100%;
  margin: clamp(20px, 4vh, 36px) 0 28px;
  color: var(--ink);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: clamp(3.5rem, 9vw, 7.7rem);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  letter-spacing: -0.08em;
  line-height: 0.95;
}

.timer-display span {
  display: inline-grid;
  min-width: 1.72em;
  min-height: 1.08em;
  place-items: center;
  border: 1px solid #24332b;
  border-radius: 12px;
  padding: 0.08em 0.08em 0.12em;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 48%, rgba(0, 0, 0, 0.16) 49%, rgba(0, 0, 0, 0.28)),
    #1b2922;
  color: #f7f2e7;
  text-shadow: 0 2px #000;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 13px 28px rgba(24, 34, 28, 0.18);
}

.timer-display i {
  margin-left: -0.04em;
  font-family: Georgia, serif;
  font-size: 0.72em;
  font-style: normal;
  letter-spacing: 0;
}

.progress-block {
  position: relative;
  z-index: 2;
  width: min(620px, 100%);
  margin-bottom: 24px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.progress-copy strong {
  color: var(--forest-dark);
}

.goal-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-deep);
}

.goal-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--forest));
  transition: width 260ms ease;
}

.primary-actions,
.focus-actions {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(620px, 100%);
  gap: 11px;
}

.main-action {
  min-height: 62px;
  font-size: 1rem;
}

.main-action kbd,
.marker-actions .primary kbd {
  color: #fff;
}

.support-actions,
.marker-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.marker-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.marker-note-field input {
  text-align: left;
}

.session-control-bar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.mobile-only {
  display: none;
}

.shortcut-help {
  position: relative;
  z-index: 2;
  width: min(620px, 100%);
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: left;
}

.shortcut-help summary {
  min-height: 36px;
  padding: 8px 4px;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.shortcut-grid div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 10px;
  background: var(--surface-soft);
}

.session-sidebar {
  display: grid;
  gap: 20px;
}

.live-stats {
  display: grid;
  margin: 0;
}

.live-stats div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}

.live-stats div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.live-stats dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.live-stats dd {
  margin: 0;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 1rem;
  font-weight: 800;
}

.live-log-list {
  max-height: 330px;
  overflow: auto;
}

.live-log-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding: 11px 0;
}

.log-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--forest-soft);
  color: var(--forest-dark);
  font-size: 0.7rem;
  font-weight: 800;
}

.log-main {
  min-width: 0;
}

.log-main strong,
.log-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-main strong {
  font-size: 0.82rem;
}

.log-main span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
}

.log-tag,
.record-tag,
.subject-chip {
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.log-tag.stuck,
.record-tag.stuck,
.record-tag.wrong {
  background: var(--brick-soft);
  color: var(--brick-dark);
}

.log-tag.skipped,
.record-tag.uncertain,
.record-tag.unfinished {
  background: var(--ochre-soft);
  color: #68491e;
}

.log-tag.marker,
.record-tag.correct {
  background: var(--forest-soft);
  color: var(--forest-dark);
}

.focus-exit-hint {
  position: fixed;
  top: max(68px, calc(env(safe-area-inset-top) + 58px));
  left: 50%;
  z-index: 120;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.75rem;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.view-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.view-heading p:last-child {
  margin-bottom: 0;
}

.history-overview {
  margin-bottom: 20px;
}

.history-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(0, 1.35fr);
  align-items: start;
  gap: 20px;
}

.review-queue-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  background: var(--surface-soft);
}

.review-item-copy {
  min-width: 0;
}

.review-item-copy strong,
.review-item-copy span {
  display: block;
}

.review-item-copy strong {
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-item-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.review-resolve-btn {
  align-self: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--forest-dark);
  font-size: 0.72rem;
  font-weight: 800;
}

.filter-field select {
  min-height: 40px;
  font-size: 0.8rem;
}

.history-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 18px;
  border-top: 1px solid var(--line);
  padding: 16px 0;
}

.history-list li:first-child {
  border-top: 0;
  padding-top: 2px;
}

.history-entry-main {
  min-width: 0;
}

.history-entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}

.history-entry-main h3 {
  margin: 0 0 7px;
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-entry-main p {
  margin: 0;
  overflow: hidden;
  font-size: 0.76rem;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-entry-stats {
  display: grid;
  justify-items: end;
  align-content: center;
  gap: 5px;
  white-space: nowrap;
}

.history-entry-stats strong {
  font-family: "Cascadia Mono", Consolas, monospace;
}

.history-entry-stats button {
  min-height: 34px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--forest);
  font-size: 0.76rem;
  font-weight: 800;
}

.summary-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 170px;
  align-items: center;
  min-height: 170px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 22px;
}

.summary-hero p:last-child {
  margin-bottom: 0;
}

.summary-hero img {
  width: 180px;
  transform: translateY(18px);
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.summary-card {
  display: grid;
  gap: 8px;
  min-height: 110px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 17px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.summary-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.summary-card strong {
  font-family: "Songti SC", "STZhongsong", serif;
  font-size: 1.38rem;
}

.summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.65fr);
  align-items: start;
  gap: 20px;
}

.summary-details-list li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 13px 0;
}

.summary-details-list li:first-child {
  border-top: 0;
}

.record-number {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

.record-main {
  min-width: 0;
}

.record-main strong,
.record-main span {
  display: block;
}

.record-main strong {
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.74rem;
}

.record-review {
  display: flex;
  align-items: center;
  gap: 7px;
}

.result-select {
  width: auto;
  min-width: 100px;
  min-height: 38px;
  padding: 0 8px;
  font-size: 0.76rem;
}

.reflection-field {
  margin-top: 18px;
}

.reflection-field textarea {
  min-height: 158px;
}

.save-hint {
  margin: 9px 0 0;
  font-size: 0.74rem;
}

.summary-actions {
  margin-top: 20px;
}

.markdown-details {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  background: rgba(255, 253, 248, 0.72);
}

.markdown-details summary {
  min-height: 38px;
  padding: 7px 0;
  font-weight: 800;
  cursor: pointer;
}

.markdown-details > label {
  display: block;
  margin: 12px 0 8px;
}

.markdown-details textarea {
  min-height: 280px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.78rem;
}

.end-dialog {
  width: min(460px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(20, 28, 23, 0.3);
}

.end-dialog::backdrop {
  background: rgba(14, 21, 17, 0.56);
  backdrop-filter: blur(4px);
}

.end-dialog form {
  display: grid;
  justify-items: center;
  padding: 30px;
  text-align: center;
}

.dialog-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  margin-bottom: 16px;
  background: var(--brick-soft);
  color: var(--brick-dark);
  font-size: 0.8rem;
}

.end-dialog h2 {
  margin-bottom: 10px;
  font-size: 1.55rem;
}

.end-dialog p {
  margin-bottom: 20px;
  font-size: 0.88rem;
}

.dialog-actions {
  display: grid;
  width: 100%;
  gap: 9px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 160;
  max-width: min(360px, calc(100% - 32px));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 18px 46px rgba(17, 29, 22, 0.3);
  font-size: 0.84rem;
}

body.focus-mode {
  overflow: hidden;
  background: #0d1511;
  color: #f5f1e6;
}

body.focus-mode::before,
body.focus-mode .app-header,
body.focus-mode .storage-notice,
body.focus-mode .session-topline,
body.focus-mode .session-sidebar,
body.focus-mode .shortcut-help {
  display: none;
}

body.focus-mode .app-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.focus-mode #sessionView {
  display: block !important;
  min-height: 100dvh;
}

body.focus-mode .session-layout {
  display: block;
}

body.focus-mode .timer-workbench {
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  align-content: center;
  border: 0;
  border-radius: 0;
  padding: max(58px, env(safe-area-inset-top)) clamp(18px, 5vw, 72px) max(116px, calc(env(safe-area-inset-bottom) + 98px));
  background:
    radial-gradient(circle at 50% 36%, rgba(75, 115, 91, 0.16), transparent 32rem),
    #0d1511;
  box-shadow: none;
}

body.focus-mode .timer-workbench::before {
  display: none;
}

body.focus-mode .timer-state-row {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  width: auto;
  max-width: calc(100vw - 32px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 9px 15px;
  background: rgba(255, 255, 255, 0.055);
  color: rgba(245, 241, 230, 0.62);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

body.focus-mode .timer-state {
  color: #f5f1e6;
}

body.focus-mode .focus-companion {
  display: block;
  width: clamp(150px, 23vw, 310px);
  max-height: 210px;
  margin-bottom: clamp(2px, 1vh, 12px);
}

body.focus-mode .focus-companion img {
  display: block;
  width: 100%;
  max-height: 210px;
  object-fit: contain;
  filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.58));
}

body.focus-mode .current-focus {
  margin-top: 0;
}

body.focus-mode .current-focus p,
body.focus-mode .current-focus > span:last-child,
body.focus-mode .progress-copy {
  color: rgba(245, 241, 230, 0.58);
}

body.focus-mode .current-focus > strong,
body.focus-mode .current-item-editor input {
  color: #f5f1e6;
}

body.focus-mode .current-item-editor input:hover,
body.focus-mode .current-item-editor input:focus {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

body.focus-mode .timer-display {
  color: #f5f1e6;
  font-size: clamp(4rem, 12vw, 10.6rem);
}

body.focus-mode .timer-display span {
  border-color: #030706;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 48%, rgba(0, 0, 0, 0.28) 49%, rgba(0, 0, 0, 0.4)),
    #131d18;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

body.focus-mode .progress-block,
body.focus-mode .primary-actions,
body.focus-mode .focus-actions {
  width: min(720px, 92vw);
}

body.focus-mode .progress-copy strong {
  color: #bdd6c5;
}

body.focus-mode .goal-progress {
  background: rgba(255, 255, 255, 0.1);
}

body.focus-mode .marker-note-field input {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: #f5f1e6;
}

body.focus-mode .session-control-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 130;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px clamp(12px, 4vw, 44px) max(12px, env(safe-area-inset-bottom));
  background: rgba(8, 14, 11, 0.9);
  backdrop-filter: blur(18px);
}

body.focus-mode .session-control-bar .button {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: #f5f1e6;
}

body.focus-mode .session-control-bar .secondary {
  background: #f2ede2;
  color: #122018;
}

body.focus-mode .session-control-bar .danger-quiet {
  background: rgba(166, 79, 63, 0.23);
  color: #f1c5bc;
}

body.focus-mode .mobile-only {
  display: inline-flex;
}

body.focus-mode .focus-exit-hint {
  display: block !important;
}

@media (max-width: 1100px) {
  .header-inner,
  .app-main,
  .storage-notice {
    width: min(100% - 30px, 920px);
  }

  .date-block {
    display: none;
  }

  .header-inner {
    grid-template-columns: 1fr auto;
  }

  .launch-grid,
  .session-layout,
  .history-layout,
  .summary-layout {
    grid-template-columns: 1fr;
  }

  .dashboard-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .session-sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timer-workbench {
    min-height: 620px;
  }

  .summary-layout {
    align-items: stretch;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 64px;
    --radius-lg: 18px;
  }

  .header-inner,
  .app-main,
  .storage-notice {
    width: min(100% - 20px, 660px);
  }

  .header-inner {
    gap: 10px;
  }

  .brand-copy small {
    display: none;
  }

  .brand-cat {
    width: 38px;
    height: 30px;
  }

  .top-nav {
    border: 0;
    padding: 0;
    background: transparent;
  }

  .nav-tab {
    min-height: 40px;
    padding: 0 11px;
    font-size: 0.78rem;
  }

  .nav-tab:not(.is-active) {
    display: none;
  }

  .app-main {
    padding: 24px 0 92px;
  }

  .dashboard-intro {
    grid-template-columns: 1fr 90px;
    min-height: 130px;
  }

  .dashboard-intro h1 {
    font-size: 2rem;
  }

  .dashboard-intro p:last-child {
    display: none;
  }

  .desk-cat {
    width: 120px;
    transform: translate(-8px, 30px);
  }

  .today-strip,
  .history-overview {
    grid-template-columns: repeat(2, 1fr);
  }

  .today-strip > div,
  .history-overview > div {
    padding: 14px;
  }

  .today-strip > div + div,
  .history-overview > div + div {
    border-left: 0;
  }

  .today-strip > div:nth-child(even),
  .history-overview > div:nth-child(even) {
    border-left: 1px solid var(--line);
  }

  .today-strip > div:nth-child(n + 3),
  .history-overview > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .resume-banner,
  .view-heading,
  .session-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-actions .button,
  .data-actions .button,
  .summary-actions .button {
    flex: 1 1 160px;
  }

  .launch-card,
  .compass-card,
  .review-preview,
  .session-stats,
  .live-log,
  .review-queue,
  .history-list-card,
  .summary-details,
  .reflection-card {
    padding: 18px;
  }

  .template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .template-card {
    min-height: 116px;
  }

  .two-columns,
  .three-columns,
  .compact-columns,
  .dashboard-side,
  .session-sidebar {
    grid-template-columns: 1fr;
  }

  .field-note {
    border-top: 1px solid var(--line);
    border-left: 0;
    padding-top: 14px;
    padding-left: 0;
  }

  .session-top-actions {
    display: none;
  }

  .session-view {
    min-height: calc(100dvh - var(--header-height) - 34px);
  }

  .session-layout {
    display: block;
  }

  .timer-workbench {
    min-height: calc(100dvh - var(--header-height) - 122px);
    border-radius: 18px;
    padding: 18px 14px 108px;
  }

  .timer-state-row {
    font-size: 0.74rem;
  }

  .current-focus {
    margin-top: 34px;
  }

  .current-focus > strong,
  .current-item-editor input {
    font-size: 1.7rem;
  }

  .timer-display {
    gap: 4px;
    margin: 18px 0 20px;
    font-size: clamp(2.5rem, 15vw, 4.25rem);
  }

  .timer-display span {
    border-radius: 9px;
  }

  .main-action {
    min-height: 58px;
  }

  .marker-actions {
    grid-template-columns: 1fr 1fr;
  }

  .marker-actions .primary {
    grid-column: 1 / -1;
    min-height: 54px;
  }

  .session-control-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
    margin: 0;
    border-top: 1px solid var(--line);
    padding: 10px 10px max(10px, env(safe-area-inset-bottom));
    background: rgba(242, 239, 231, 0.94);
    backdrop-filter: blur(15px);
  }

  .session-control-bar .button {
    min-width: 0;
    min-height: 48px;
    padding: 0 7px;
    font-size: 0.76rem;
  }

  .session-control-bar kbd {
    display: none;
  }

  .mobile-only {
    display: inline-flex;
  }

  .shortcut-help {
    display: none;
  }

  .session-sidebar {
    display: grid;
    margin-top: 16px;
    padding-bottom: 44px;
  }

  .view-heading {
    align-items: stretch;
  }

  .data-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-hero {
    grid-template-columns: 1fr 95px;
    min-height: 130px;
  }

  .summary-hero img {
    width: 110px;
  }

  .summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-card {
    min-height: 94px;
  }

  .summary-details-list li {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .record-review {
    grid-column: 2;
    justify-self: start;
  }

  .toast {
    right: 50%;
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 70px));
    transform: translateX(50%);
  }

  body.focus-mode .timer-workbench {
    padding-right: 12px;
    padding-left: 12px;
  }

  body.focus-mode .focus-companion {
    width: min(180px, 48vw);
  }

  body.focus-mode .timer-display {
    font-size: clamp(2.8rem, 16vw, 5rem);
  }

  body.focus-mode .timer-state-row {
    width: calc(100% - 24px);
    justify-content: center;
  }

  body.focus-mode .timer-state-row > span:last-child {
    display: none;
  }
}

@media (max-width: 430px) {
  .brand-copy strong {
    font-size: 1.05rem;
  }

  .top-nav {
    max-width: 116px;
  }

  .nav-tab {
    max-width: 116px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .template-card {
    min-height: 112px;
    padding: 12px;
  }

  .template-card small {
    font-size: 0.68rem;
  }

  .timer-workbench {
    min-height: calc(100dvh - var(--header-height) - 100px);
  }

  .timer-display {
    font-size: clamp(2.18rem, 14.2vw, 3.7rem);
  }

  .timer-display span {
    min-width: 1.62em;
  }

  .support-actions {
    grid-template-columns: 1fr 1fr;
  }

  .session-control-bar .button {
    font-size: 0.7rem;
  }

  .history-list li {
    grid-template-columns: 1fr;
  }

  .history-entry-stats {
    grid-template-columns: 1fr auto;
    justify-items: start;
  }

  .data-actions {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .button:hover:not(:disabled),
  .template-card:hover {
    transform: none;
  }
}

@media (forced-colors: active) {
  .status-orb,
  .goal-progress span,
  .brand-cat,
  .brand-cat::before,
  .brand-cat::after {
    forced-color-adjust: none;
  }
}
