:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --panel: #ffffff;
  --panel-2: #f7faf8;
  --paper: #fffdf8;
  --ink: #1f2937;
  --ink-strong: #111827;
  --muted: #667085;
  --muted-2: #98a2b3;
  --line: #d7dfdc;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #f59e0b;
  --gold: #b7791f;
  --paper-line: rgba(15, 118, 110, .075);
  --soft-green: #e9f8ef;
  --soft-blue: #eaf2ff;
  --soft-orange: #fff4df;
  --soft-red: #fff0f0;
  --shadow: 0 14px 34px rgba(31, 41, 55, .08);
  --shadow-soft: 0 6px 18px rgba(31, 41, 55, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, #e9f3ef 0, rgba(233, 243, 239, 0) 330px),
    linear-gradient(90deg, var(--paper-line) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, var(--paper-line) 0 1px, transparent 1px 100%),
    var(--bg);
  background-size: auto, 34px 34px, 34px 34px, auto;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 247, 245, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.wrap, main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 20px;
}

main { padding-bottom: 46px; }

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(620px, 1.5fr);
  gap: 16px;
  align-items: center;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0;
}

.sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(116px, 1fr));
  gap: 8px;
}

.stat, .panel, .calendar-card, .daily-card, .all-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: box-shadow .18s ease, border-color .18s ease;
}

.stat {
  position: relative;
  overflow: hidden;
  min-height: 68px;
  padding: 11px 12px 10px;
  background: rgba(255, 255, 255, .86);
  transition: transform .18s ease, box-shadow .18s ease;
}

.stat::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  width: calc(100% - 24px);
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: var(--accent);
  opacity: .86;
}

.stat:nth-child(3)::before { background: var(--red); }
.stat:nth-child(4)::before { background: var(--blue); }
.stat:nth-child(5)::before { background: var(--orange); }

.stat:hover,
.phase-tab:hover,
.task:hover,
.hour-box:hover,
.pie-card:hover {
  box-shadow: 0 18px 42px rgba(31, 41, 55, .1);
  transform: translateY(-1px);
}

.stat b {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  color: var(--ink-strong);
}

.stat span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 26px 0 11px;
}

.section-title h2 {
  position: relative;
  margin: 0;
  font-size: 18px;
  letter-spacing: 0;
  padding-left: 12px;
}

.section-title h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
}

.hint {
  color: var(--muted);
  font-size: 13px;
}

.phase-zone {
  margin-bottom: 16px;
}

.phase-zone-head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 24px;
  margin-bottom: 8px;
}

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

.phase-tab {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 13px 14px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.phase-tab::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: transparent;
}

.phase-tab.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, #fff 0%, #eefbf7 100%);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .12), var(--shadow);
}

.phase-tab.active::after {
  background: var(--accent);
}

.phase-tab strong {
  display: block;
  font-size: 15px;
  margin-bottom: 4px;
}

.phase-tab span {
  color: var(--muted);
  font-size: 12px;
}

.phase-panel {
  margin-top: 12px;
  overflow: hidden;
}

.phase-panel[hidden] {
  display: none;
}

.phase-panel details {
  overflow: hidden;
}

.phase-panel summary {
  list-style: none;
  cursor: pointer;
}

.phase-panel summary::-webkit-details-marker {
  display: none;
}

.phase-progress-details > summary {
  border-bottom: 0;
  background: transparent;
}

.phase-progress-details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.phase-collapsed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 18px;
}

.summary-ring-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 178px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.summary-ring-card .ring {
  width: 112px;
  height: 112px;
}

.summary-ring-card .ring span {
  width: 76px;
  font-size: 13px;
}

.summary-ring-card .percent {
  margin-top: 0;
  font-size: 20px;
}

.expand-hint {
  color: var(--muted);
  font-size: 12px;
}

.phase-progress-details[open] .expand-hint {
  display: none;
}

.syllabus-root {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.syllabus-root > summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.syllabus-root > summary::-webkit-details-marker {
  display: none;
}

.syllabus-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.syllabus-category,
.syllabus-subject {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.syllabus-category summary,
.syllabus-subject summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  list-style: none;
  cursor: pointer;
}

.syllabus-category summary::-webkit-details-marker,
.syllabus-subject summary::-webkit-details-marker {
  display: none;
}

.syllabus-category summary strong,
.syllabus-subject summary strong {
  display: block;
  font-size: 16px;
}

.syllabus-category summary p,
.syllabus-subject summary p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.syllabus-category summary::after,
.syllabus-subject summary::after {
  content: "+";
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  border: 1px solid var(--line);
}

.syllabus-category[open] summary::after,
.syllabus-subject[open] summary::after {
  content: "-";
}

.syllabus-category-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.syllabus-body {
  padding: 0 18px 16px;
}

.syllabus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.syllabus-item {
  border: 1px solid #eef2f7;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 11px;
  background: #fbfdff;
}

.syllabus-item strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.syllabus-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.syllabus-item.core { border-left-color: var(--red); }
.syllabus-item.important { border-left-color: var(--orange); }
.syllabus-item.base { border-left-color: var(--accent); }

.collapsible-panel {
  margin-top: 14px;
  overflow: hidden;
}

.collapsible-panel > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  list-style: none;
  cursor: pointer;
}

.collapsible-panel > summary::-webkit-details-marker {
  display: none;
}

.collapsible-panel > summary::after {
  content: "+";
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--accent);
  font-weight: 800;
}

.collapsible-panel[open] > summary::after {
  content: "-";
}

.collapsible-panel > summary strong {
  display: block;
  color: var(--ink-strong);
  font-size: 17px;
}

.collapsible-panel > summary p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.phase-summary, .daily-head, .calendar-head, .panel-head, summary {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.phase-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.phase-summary strong, .daily-head strong, .panel-head strong {
  font-size: 18px;
}

.phase-summary p, .daily-head p, .panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.progress-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 18px;
}

.progress-card {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 18px;
}

.progress-card.detailed {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.progress-card.english-card {
  grid-column: 1 / -1;
  min-height: 150px;
}

.progress-ring-col {
  display: grid;
  justify-items: center;
  align-content: center;
}

.ring {
  --value: 0;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, #fff 0 58%, transparent 59%),
    conic-gradient(var(--accent) calc(var(--value) * 1%), #e5eaf3 0);
}

.ring span {
  width: 86px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.percent {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
}

.sub-progress-list {
  display: grid;
  gap: 10px;
}

.sub-progress-item {
  border: 1px solid #eef2f7;
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
}

.sub-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.sub-progress-top strong {
  font-size: 14px;
}

.sub-progress-top span {
  color: var(--muted);
  white-space: nowrap;
}

.sub-progress-bar {
  height: 9px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.sub-progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.progress-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.placeholder {
  padding: 24px;
  color: var(--muted);
  line-height: 1.8;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2f7;
}

.segmented button {
  height: 32px;
  min-width: 74px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.segmented button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(31, 41, 55, .08);
  font-weight: 700;
}

.hour-stats {
  padding: 16px;
}

.hour-tools {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.hour-insight-actions {
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.record-library-toggle,
.record-date-toggle,
.study-distribution-toggle {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 14px;
  font-weight: 800;
  color: var(--accent-strong);
  background: rgba(15, 118, 110, .08);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .18);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

.record-date-toggle,
.study-distribution-toggle {
  color: var(--ink);
  background: rgba(255, 253, 248, .94);
}

.record-library-toggle:hover,
.record-library-toggle.active,
.record-date-toggle:hover,
.record-date-toggle.active,
.study-distribution-toggle:hover,
.study-distribution-toggle.active {
  color: var(--accent-strong);
  background: rgba(15, 118, 110, .1);
  transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .34), 0 12px 26px rgba(15, 118, 110, .1);
}

.record-library-actions {
  position: relative;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.record-calendar-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 12;
  width: 318px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, .98);
  box-shadow: 0 20px 46px rgba(8, 19, 22, .18);
  padding: 12px;
  animation: stats-panel-enter .22s ease both;
}

.record-calendar-head {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.record-calendar-head strong {
  text-align: center;
  font-size: 15px;
}

.record-calendar-head button,
.record-calendar-day {
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

.record-calendar-head button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 900;
}

.record-calendar-week,
.record-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
}

.record-calendar-week {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.record-calendar-day {
  position: relative;
  min-height: 34px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
}

.record-calendar-day.muted {
  color: var(--muted-2);
}

.record-calendar-day.has-record {
  color: var(--accent-strong);
  background: rgba(15, 118, 110, .09);
}

.record-calendar-day.has-record::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  transform: translateX(-50%);
}

.record-calendar-day.active {
  border-color: rgba(15, 118, 110, .55);
  background: var(--accent);
  color: #fff;
}

.study-distribution-panel {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .08), rgba(255, 253, 248, .92) 38%, rgba(245, 158, 11, .07));
  padding: 14px;
  overflow: hidden;
  animation: stats-panel-enter .24s ease both;
}

.distribution-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.distribution-head strong {
  display: block;
  color: var(--ink-strong);
  font-size: 15px;
  margin-bottom: 4px;
}

.distribution-subjects {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.distribution-subject-toggle,
.distribution-all-toggle {
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, .8);
  color: var(--muted);
  padding: 0 10px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, color .18s ease;
}

.distribution-subject-toggle.active {
  border-color: color-mix(in srgb, var(--subject-color) 42%, var(--line));
  background: color-mix(in srgb, var(--subject-color) 12%, #fff);
  color: var(--ink-strong);
}

.distribution-subject-toggle::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--subject-color);
  vertical-align: 1px;
  opacity: .45;
}

.distribution-subject-toggle.active::before {
  opacity: 1;
}

.distribution-subject-toggle:hover,
.distribution-all-toggle:hover {
  transform: translateY(-1px);
  color: var(--accent-strong);
  border-color: rgba(15, 118, 110, .32);
}

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

.distribution-kpi {
  border: 1px solid rgba(8, 19, 22, .09);
  border-radius: 8px;
  background: rgba(255, 253, 248, .74);
  padding: 10px;
  min-width: 0;
}

.distribution-kpi span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
}

.distribution-kpi b {
  display: block;
  color: var(--ink-strong);
  font-size: 18px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.distribution-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1.2fr) minmax(260px, .8fr);
  gap: 10px;
}

.distribution-card {
  border: 1px solid rgba(8, 19, 22, .09);
  border-radius: 8px;
  background: rgba(255, 253, 248, .76);
  padding: 12px;
  min-width: 0;
}

.distribution-card.wide {
  grid-column: 1 / -1;
}

.distribution-card strong {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--ink-strong);
  font-size: 13px;
}

.distribution-card strong span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.rhythm-bars {
  display: grid;
  grid-template-columns: repeat(24, minmax(12px, 1fr));
  gap: 4px;
  align-items: end;
  min-height: 148px;
  padding-top: 8px;
}

.rhythm-bar {
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.rhythm-bar span {
  display: block;
  min-height: 4px;
  height: var(--bar-height);
  border-radius: 999px 999px 4px 4px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, .86), rgba(15, 118, 110, .22));
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .12);
  transition: transform .18s ease, box-shadow .18s ease;
}

.rhythm-bar em {
  min-height: 12px;
  font-style: normal;
}

.rhythm-bar:hover span {
  transform: translateY(-3px) scaleX(1.16);
  box-shadow: 0 10px 18px rgba(15, 118, 110, .18);
}

.heatmap-scroll {
  overflow-x: auto;
  padding-bottom: 2px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: 34px repeat(24, minmax(20px, 1fr));
  gap: 4px;
  min-width: 680px;
  align-items: center;
}

.heat-label,
.heat-hour {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
}

.heat-label {
  text-align: left;
}

.heat-cell {
  height: 20px;
  border-radius: 5px;
  background: rgba(15, 118, 110, var(--heat-alpha));
  box-shadow: inset 0 0 0 1px rgba(8, 19, 22, .045);
  transition: transform .18s ease, box-shadow .18s ease;
}

.heat-cell:hover {
  transform: scale(1.16);
  box-shadow: 0 8px 16px rgba(15, 118, 110, .16);
}

.period-list,
.label-rank {
  display: grid;
  gap: 9px;
}

.period-row,
.label-rank-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.period-track,
.label-rank-track {
  height: 9px;
  border-radius: 999px;
  background: rgba(8, 19, 22, .07);
  overflow: hidden;
}

.period-track span,
.label-rank-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(15, 118, 110, .72), rgba(245, 158, 11, .64));
}

.study-distribution-empty {
  border: 1px dashed rgba(8, 19, 22, .16);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  background: rgba(255, 253, 248, .58);
  font-weight: 800;
}

.study-record-library {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, .82);
  padding: 12px;
  animation: stats-panel-enter .24s ease both;
}

@keyframes stats-panel-enter {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.study-distribution-panel.closing,
.study-record-library.closing,
.record-calendar-popover.closing {
  pointer-events: none;
  animation: stats-panel-exit .2s ease both;
}

@keyframes stats-panel-exit {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-8px) scale(.992);
  }
}

.study-record-focus-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(15, 118, 110, .28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, .14), rgba(245, 158, 11, .1), rgba(255, 253, 248, .72));
  color: var(--accent-strong);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 900;
  animation: record-focus-glow .9s ease both;
}

.study-record-focus-banner button {
  min-height: 28px;
  border-radius: 999px;
  background: rgba(255, 253, 248, .86);
  color: var(--accent-strong);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  padding: 0 10px;
}

.study-record-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.study-record-head strong {
  color: var(--ink-strong);
  font-size: 15px;
}

.study-record-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.study-record-row {
  display: grid;
  grid-template-columns: 88px 108px minmax(170px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(8, 19, 22, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
  padding: 8px;
}

.study-record-row.focused {
  border-color: rgba(15, 118, 110, .58);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, .13), rgba(255, 253, 248, .94));
  box-shadow: 0 12px 28px rgba(15, 118, 110, .14), inset 0 0 0 1px rgba(15, 118, 110, .13);
  animation: record-row-pop .8s ease both;
}

@keyframes record-focus-glow {
  0% {
    transform: translateY(-4px);
    opacity: 0;
    box-shadow: 0 0 0 rgba(15, 118, 110, 0);
  }
  55% {
    transform: translateY(0);
    opacity: 1;
    box-shadow: 0 16px 34px rgba(15, 118, 110, .18);
  }
  100% {
    transform: none;
    opacity: 1;
    box-shadow: 0 8px 20px rgba(15, 118, 110, .08);
  }
}

@keyframes record-row-pop {
  0% { transform: scale(.985); }
  55% { transform: scale(1.012); }
  100% { transform: scale(1); }
}

.study-record-row select,
.study-record-row input {
  width: 100%;
  height: 34px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.study-record-time {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.study-record-duration {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.study-record-save,
.study-record-delete {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
}

.study-record-save {
  color: var(--accent-strong);
  background: rgba(15, 118, 110, .1);
}

.study-record-delete {
  color: var(--red);
  background: rgba(220, 38, 38, .08);
}

.hour-panel {
  display: grid;
  grid-template-columns: minmax(280px, .95fr) minmax(280px, 1.05fr);
  gap: 14px;
  align-items: stretch;
}

.hour-box,
.pie-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.hour-box strong,
.pie-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 15px;
}

.hour-line {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid #eef2f7;
  font-size: 13px;
}

.hour-line:first-of-type { border-top: 0; }

.hour-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.hour-bar {
  height: 8px;
  border-radius: 999px;
  background: #eef2f7;
  overflow: hidden;
}

.hour-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.pie-layout {
  display: grid;
  grid-template-columns: 194px 170px minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

.pie {
  width: 184px;
  height: 184px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 0;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, .96) 0 40%, rgba(255, 255, 255, .72) 41% 48%, transparent 49%),
    radial-gradient(circle at 42% 32%, rgba(15, 118, 110, .1), transparent 58%);
  box-shadow: inset 0 0 0 1px rgba(31, 41, 55, .08), 0 16px 36px rgba(15, 118, 110, .08);
  cursor: pointer;
  padding: 0;
  position: relative;
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
}

.pie:hover {
  transform: translateY(-2px) scale(1.055);
  box-shadow: inset 0 0 0 1px rgba(31, 41, 55, .1), 0 22px 42px rgba(15, 118, 110, .18);
}

.pie-wrap {
  position: relative;
  width: 184px;
  height: 184px;
  min-width: 0;
}

.pie-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: auto;
}

.pie-track,
.pie-segment {
  fill: none;
}

.pie-track {
  stroke: #e8edf5;
  stroke-width: 18;
}

.pie-segment {
  stroke-width: 18;
  stroke-linecap: butt;
  filter: drop-shadow(0 4px 8px rgba(8, 19, 22, .08));
  transition: stroke-width .18s ease, filter .18s ease, opacity .18s ease;
  pointer-events: stroke;
}

.pie-segment:hover {
  stroke-width: 21;
  filter: drop-shadow(0 12px 18px rgba(8, 19, 22, .2));
  opacity: 1;
}

.pie-segment.active {
  stroke-width: 21;
  filter: drop-shadow(0 12px 20px rgba(15, 118, 110, .2));
}

.pie-empty {
  stroke: #e5eaf3;
  stroke-width: 18;
  fill: none;
}

.pie-total {
  position: relative;
  z-index: 2;
  width: 94px;
  height: 94px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.pie-total b {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.1;
}

.pie-legend {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.pie-subjects {
  display: grid;
  gap: 8px;
  align-content: center;
  min-width: 0;
}

.pie-subject-button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, .88);
  color: var(--muted);
  padding: 6px 9px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-align: left;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.pie-subject-button span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  font-weight: 800;
}

.pie-subject-button b {
  color: var(--ink-strong);
  font-size: 12px;
  white-space: nowrap;
}

.pie-subject-main {
  flex: 1 1 auto;
  gap: 0;
}

.pie-subject-meta {
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.pie-subject-button:hover,
.pie-subject-button.active {
  border-color: color-mix(in srgb, var(--subject-color) 46%, var(--line));
  background: color-mix(in srgb, var(--subject-color) 11%, #fff);
  color: var(--accent-strong);
  transform: translateY(-1px);
}

.hour-breakdown-panel {
  min-height: 118px;
  height: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, .72);
  padding: 10px;
  overflow: visible;
  align-self: stretch;
}

.breakdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.breakdown-head strong {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.breakdown-total {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.breakdown-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.breakdown-item {
  display: inline-grid;
  grid-template-columns: minmax(46px, 86px) 48px 22px 22px;
  gap: 4px;
  align-items: center;
  max-width: 192px;
  border: 1px solid rgba(8, 19, 22, .11);
  border-radius: 999px;
  background: rgba(255, 253, 248, .92);
  padding: 3px 4px 3px 9px;
}

.breakdown-item input {
  min-width: 0;
  height: 22px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  outline: 0;
}

.breakdown-item input[type="number"] {
  width: 48px;
  border-left: 1px solid var(--line);
  border-radius: 0;
  text-align: right;
}

.breakdown-delete,
.breakdown-confirm,
.breakdown-add {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, .84);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
}

.breakdown-delete,
.breakdown-confirm {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  font-weight: 900;
  padding: 0;
}

.breakdown-confirm {
  background: rgba(15, 118, 110, .1);
  color: var(--accent-strong);
}

.breakdown-add {
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-weight: 800;
  font-size: 12px;
}

.breakdown-chip,
.breakdown-other {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(15, 118, 110, .08);
  color: var(--accent-strong);
  padding: 0 10px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.1;
  font-weight: 800;
}

.breakdown-chip {
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.breakdown-chip:hover {
  border-color: rgba(15, 118, 110, .25);
  background: rgba(15, 118, 110, .12);
  transform: translateY(-1px);
}

.breakdown-chip.locked {
  cursor: pointer;
  color: var(--accent-strong);
  background: rgba(15, 118, 110, .08);
  border-color: transparent;
}

.breakdown-chip.locked:hover {
  border-color: rgba(15, 118, 110, .25);
  background: rgba(15, 118, 110, .12);
  transform: translateY(-1px);
}

.breakdown-chip small {
  margin-left: 4px;
  color: currentColor;
  font-size: 12px;
  font-weight: 800;
  opacity: .72;
}

.pie-popup-card {
  position: absolute;
  left: 154px;
  top: 18px;
  z-index: 5;
  width: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, .96);
  box-shadow: 0 18px 44px rgba(8, 19, 22, .14);
  padding: 10px;
  text-align: left;
}

.pie-popup-card strong {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 13px;
}

.pie-popup-card strong span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.pie-popup-list {
  display: grid;
  gap: 6px;
}

.pie-popup-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.pie-popup-row b {
  color: var(--ink-strong);
  font-weight: 800;
}

html[data-theme="dark"] .pie-subject-button,
html[data-theme="dark"] .hour-breakdown-panel,
html[data-theme="dark"] .breakdown-item,
html[data-theme="dark"] .breakdown-chip,
html[data-theme="dark"] .breakdown-add,
html[data-theme="dark"] .breakdown-delete,
html[data-theme="dark"] .breakdown-confirm,
html[data-theme="dark"] .pie-popup-card,
html[data-theme="dark"] .record-library-toggle,
html[data-theme="dark"] .record-date-toggle,
html[data-theme="dark"] .study-distribution-toggle,
html[data-theme="dark"] .study-distribution-panel,
html[data-theme="dark"] .distribution-card,
html[data-theme="dark"] .distribution-kpi,
html[data-theme="dark"] .distribution-subject-toggle,
html[data-theme="dark"] .distribution-all-toggle,
html[data-theme="dark"] .study-distribution-empty {
  border-color: rgba(255, 250, 240, .13);
  background: rgba(27, 40, 37, .96);
  color: var(--ink);
}

html[data-theme="dark"] .pie-subject-button:hover,
html[data-theme="dark"] .pie-subject-button.active {
  border-color: rgba(102, 208, 191, .46);
  background: rgba(102, 208, 191, .14);
  color: var(--accent-strong);
}

html[data-theme="dark"] .distribution-subject-toggle.active,
html[data-theme="dark"] .record-library-toggle:hover,
html[data-theme="dark"] .record-library-toggle.active,
html[data-theme="dark"] .record-date-toggle:hover,
html[data-theme="dark"] .record-date-toggle.active,
html[data-theme="dark"] .study-distribution-toggle:hover,
html[data-theme="dark"] .study-distribution-toggle.active {
  border-color: rgba(102, 208, 191, .45);
  background: rgba(102, 208, 191, .14);
  color: var(--ink-strong);
}

html[data-theme="dark"] .pie-track,
html[data-theme="dark"] .pie-empty {
  stroke: rgba(255, 250, 240, .18);
}

html[data-theme="dark"] .heat-cell {
  background: rgba(102, 208, 191, var(--heat-alpha));
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, .04);
}

html[data-theme="dark"] .period-track,
html[data-theme="dark"] .label-rank-track {
  background: rgba(255, 250, 240, .12);
}

html[data-theme="dark"] .breakdown-item input {
  color: var(--ink-strong);
}

html[data-theme="dark"] .breakdown-other {
  background: rgba(241, 207, 126, .13);
  color: #f1cf7e;
}

html[data-theme="dark"] .pie-popup-card {
  box-shadow: 0 18px 44px rgba(0, 0, 0, .35);
}

@media (max-width: 980px) {
  .hour-tools {
    grid-template-columns: 1fr auto;
  }

  .hour-insight-actions {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .pie-layout {
    grid-template-columns: 184px minmax(142px, .48fr) minmax(0, 1fr);
  }

  .distribution-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .hour-tools {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .hour-insight-actions,
  .record-library-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .record-library-actions {
    flex-wrap: wrap;
  }

  .distribution-head {
    display: grid;
  }

  .distribution-subjects {
    justify-content: flex-start;
  }

  .distribution-summary {
    grid-template-columns: 1fr;
  }

  .rhythm-bars {
    grid-template-columns: repeat(24, minmax(7px, 1fr));
    gap: 2px;
  }

  .rhythm-bar {
    font-size: 9px;
  }

  .pie-layout {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .pie {
    justify-self: center;
  }

  .pie-wrap {
    justify-self: center;
  }

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

  .hour-breakdown-panel {
    height: auto;
    align-self: stretch;
  }

  .pie-popup-card {
    left: 50%;
    top: 124px;
    transform: translateX(-50%);
    width: min(230px, calc(100vw - 64px));
  }

  .study-record-row {
    grid-template-columns: 1fr;
  }

  .study-record-time {
    grid-template-columns: 1fr;
  }

  .record-library-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .record-calendar-popover {
    width: min(318px, calc(100vw - 48px));
  }
}

.calendar-head {
  display: grid;
  grid-template-columns: 36px 1fr 36px auto;
  align-items: center;
  gap: 10px;
}

.calendar-card {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, .94) 0%, rgba(255, 255, 255, .94) 100%),
    var(--panel);
}

.calendar-head strong {
  text-align: center;
  font-size: 17px;
}

.calendar-overview {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(4, minmax(96px, .44fr));
  gap: 10px;
  padding: 14px 16px 0;
}

.calendar-brief,
.calendar-metric {
  border: 1px solid #e4ebe8;
  border-radius: 8px;
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--shadow-soft);
}

.calendar-brief {
  padding: 12px 14px;
}

.calendar-brief strong,
.calendar-metric b {
  display: block;
  color: var(--ink-strong);
  font-size: 16px;
  line-height: 1.25;
}

.calendar-brief p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.calendar-metric {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 66px;
  padding: 10px 12px;
}

.calendar-metric span {
  color: var(--muted);
  font-size: 12px;
}

.calendar-metric.done b { color: #166534; }
.calendar-metric.late b { color: #92400e; }
.calendar-metric.missed b { color: #991b1b; }
.calendar-metric.open b { color: var(--accent-strong); }

.icon-btn, .text-btn, select {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.icon-btn:hover,
.text-btn:hover,
select:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.icon-btn {
  width: 36px;
  font-size: 18px;
  line-height: 1;
}

.text-btn, select {
  padding: 0 12px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 7px;
  padding: 14px 16px;
}

.weekday, .day {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.weekday {
  min-height: 28px;
  font-weight: 700;
}

.day {
  position: relative;
  min-height: 58px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  align-content: center;
  gap: 5px;
  padding: 7px 4px;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.day:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}
.day.out { opacity: .32; cursor: default; }

.day.selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, #f1fbf8 0%, #fff 100%);
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .16), 0 10px 22px rgba(15, 118, 110, .12);
}

.day.today { box-shadow: inset 0 0 0 2px var(--gold); }
.day.today.selected { box-shadow: inset 0 0 0 2px var(--gold), 0 10px 22px rgba(15, 118, 110, .12); }

.badge {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.day.done .badge {
  border: 2px solid var(--green);
  background: var(--soft-green);
  color: var(--green);
  font-weight: 700;
}

.day.late .badge {
  border: 2px solid var(--orange);
  background: var(--soft-orange);
  color: #9a5a00;
  font-weight: 700;
}

.day.missed .badge {
  border: 2px solid var(--red);
  color: var(--red);
  font-weight: 700;
}

.subject-marks {
  display: flex;
  justify-content: center;
  gap: 3px;
  min-height: 6px;
}

.subject-mark {
  width: 15px;
  height: 4px;
  border-radius: 999px;
  background: #dbe3e0;
  opacity: .95;
}

.subject-mark.done { background: var(--mark-color); }

.issue-mark {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff;
}

.issue-mark.open { background: var(--red); }
.issue-mark.mastered { background: var(--green); }

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 14px;
  color: var(--muted);
  font-size: 13px;
}

.legend-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 5px;
  border-radius: 50%;
  vertical-align: -1px;
  background: currentColor;
}

.green { color: var(--green); }
.red { color: var(--red); }
.orange { color: var(--orange); }
.blue { color: var(--blue); }

.daily-card {
  margin-top: 8px;
  overflow: hidden;
  border-color: #cbd8d3;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, .08), rgba(255, 255, 255, 0) 38%),
    var(--panel);
  box-shadow: 0 20px 48px rgba(17, 24, 39, .1);
}

.daily-card.is-done { border-color: rgba(22, 163, 74, .42); }
.daily-card.is-late { border-color: rgba(245, 158, 11, .52); }
.daily-card.is-missed { border-color: rgba(220, 38, 38, .42); }

.daily-head {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr);
  gap: 18px;
  align-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(15, 118, 110, .12), transparent 38%),
    linear-gradient(180deg, #fffdf8 0%, #f7faf8 100%);
}

.daily-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.daily-date {
  display: block;
  margin: 0;
  color: var(--ink-strong);
  font-size: 28px;
  line-height: 1.2;
}

.daily-summary {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.status-pill,
.phase-pill,
.next-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.status-pill {
  border: 1px solid rgba(15, 118, 110, .24);
  background: #ecfdf5;
  color: var(--accent-strong);
}

.status-pill.done {
  border-color: rgba(22, 163, 74, .32);
  background: var(--soft-green);
  color: #166534;
}

.status-pill.late {
  border-color: rgba(245, 158, 11, .38);
  background: var(--soft-orange);
  color: #92400e;
}

.status-pill.missed {
  border-color: rgba(220, 38, 38, .32);
  background: var(--soft-red);
  color: #991b1b;
}

.phase-pill {
  border: 1px solid #d9e2e0;
  background: #fff;
  color: var(--ink);
}

.next-pill {
  margin-top: 12px;
  border: 1px solid rgba(37, 99, 235, .18);
  background: var(--soft-blue);
  color: #1d4ed8;
}

.daily-meter {
  border: 1px solid rgba(15, 118, 110, .16);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.daily-meter-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.daily-meter-top strong {
  color: var(--ink-strong);
  font-size: 30px;
  line-height: 1;
}

.daily-meter-top span {
  color: var(--muted);
  font-size: 12px;
}

.daily-progress-track {
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eeeb;
}

.daily-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transition: width .22s ease;
}

.daily-hours {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.daily-hours span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.daily-hours b {
  color: var(--ink-strong);
  font-size: 18px;
}

.daily-card .daily-head strong,
.daily-card .daily-head p {
  margin: 0;
}

.reminder {
  margin: 16px 20px 0;
  border: 1px solid #ecd49d;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fffaf0;
  color: #7a4b00;
  font-size: 14px;
  line-height: 1.6;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px 20px;
}

.task {
  position: relative;
  overflow: hidden;
  min-height: 188px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, .92);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.task::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
}

.task.subject-cs::before { background: var(--accent); }
.task.subject-math::before { background: var(--blue); }
.task.subject-english::before { background: var(--orange); }
.task.subject-politics::before { background: var(--red); }

.task.subject-cs:hover { border-color: rgba(15, 118, 110, .35); }
.task.subject-math:hover { border-color: rgba(37, 99, 235, .35); }
.task.subject-english:hover { border-color: rgba(245, 158, 11, .42); }
.task.subject-politics:hover { border-color: rgba(220, 38, 38, .35); }

.task.is-done {
  border-color: rgba(22, 163, 74, .34);
  background: linear-gradient(180deg, #f3fbf6 0%, #fff 92%);
}

.task.is-done::after {
  content: "已完成";
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: rgba(22, 101, 52, .14);
  font-size: 24px;
  font-weight: 800;
  pointer-events: none;
}

.task.completion-flash {
  animation: task-completion-flash .86s ease both;
}

.daily-card.date-focus-highlight {
  animation: daily-date-focus .9s ease both;
}

@keyframes task-completion-flash {
  0% {
    box-shadow: var(--shadow-soft);
    transform: translateY(0);
  }
  34% {
    border-color: rgba(241, 207, 126, .86);
    box-shadow: 0 0 0 4px rgba(241, 207, 126, .16), 0 16px 36px rgba(15, 118, 110, .12);
    transform: translateY(-2px);
  }
  100% {
    box-shadow: var(--shadow-soft);
    transform: translateY(0);
  }
}

@keyframes daily-date-focus {
  0% {
    box-shadow: var(--shadow);
  }
  35% {
    border-color: rgba(15, 118, 110, .54);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, .12), var(--shadow);
  }
  100% {
    box-shadow: var(--shadow);
  }
}

.task-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.task label.check-label {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.6;
}

.task input[type="checkbox"] {
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.task-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}

.task-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.task-state {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #f1f5f9;
  padding: 3px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task.is-done .task-state {
  background: var(--soft-green);
  color: #166534;
}

.hours-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eef2f7;
  color: var(--muted);
  font-size: 13px;
}

.hours-entry {
  display: grid;
  grid-template-columns: minmax(74px, 96px) minmax(86px, 120px) 34px;
  gap: 6px;
  align-items: center;
  justify-content: end;
}

.hours-entry select {
  height: 34px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.hours-confirm {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  color: var(--accent-strong);
  background: rgba(15, 118, 110, .1);
}

input[type="number"] {
  width: 86px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
  font: inherit;
  text-align: right;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.review {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 20px 20px;
}

.review-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}

.review-block label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.issue-entry-block {
  grid-column: 1 / -1;
}

.fix-block {
  grid-column: 1 / -1;
}

.subject-issue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.subject-issue {
  border: 1px solid #eef2f7;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.subject-issue.subject-cs { border-left-color: var(--accent); }
.subject-issue.subject-math { border-left-color: var(--blue); }
.subject-issue.subject-english { border-left-color: var(--orange); }
.subject-issue.subject-politics { border-left-color: var(--red); }

.subject-issue:focus-within {
  border-color: rgba(15, 118, 110, .35);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .08);
}

.subject-issue label {
  margin-bottom: 7px;
  color: var(--ink);
}

.subject-issue textarea {
  min-height: 104px;
}

textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  line-height: 1.5;
  transition: border-color .18s ease, box-shadow .18s ease;
}

textarea:focus,
input[type="number"]:focus {
  outline: 0;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}

.issues-list {
  padding: 12px 16px 16px;
}

.issue-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 0;
}

.issue-tabs.compact {
  padding: 0;
  margin-bottom: 10px;
}

.issue-tabs.sub {
  padding-top: 8px;
}

.subject-tab {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 14px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  transition: border-color .18s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}

.subject-tab:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-soft);
}

.subject-tab.active {
  border-color: var(--accent);
  background: #eefbf7;
  color: var(--accent);
  font-weight: 700;
}

.issue-tabs.sub .subject-tab {
  height: 30px;
  font-size: 13px;
  background: rgba(248, 250, 247, .78);
}

.issue-picker .subject-issue {
  margin-top: 4px;
}

.issue-list-head,
.issue-item {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.issue-list-head {
  padding: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}

.issue-item {
  padding: 12px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.6;
  border-radius: 8px;
}

.issue-item:first-child { border-top: 0; }

.issue-item:hover {
  background: #fbfdff;
}

.issue-date {
  width: 156px;
  height: auto;
  min-height: 36px;
  padding: 6px 8px;
  white-space: nowrap;
  line-height: 1.35;
  font-weight: 700;
  color: var(--blue);
}

.issue-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.confirm-grid label {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 6px;
  align-items: start;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  padding: 6px;
  border: 1px solid #eef2f7;
  border-radius: 7px;
  background: #fff;
}

.confirm-grid input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.empty {
  padding: 18px;
  color: var(--muted);
  background: #fbfdff;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

details.all-card {
  margin-top: 14px;
  overflow: hidden;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

.all-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.phase-table-title {
  flex: 1 1 280px;
  font-weight: 700;
}

.table-shell { overflow: auto; }

table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1.45;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef2f7;
  color: #344054;
}

tbody tr:hover {
  background: #fbfdff;
}

.mini-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 12px;
}

.status-circle {
  width: 19px;
  height: 19px;
  display: inline-block;
  border-radius: 50%;
  border: 2px solid #111827;
  vertical-align: middle;
  box-shadow: inset 0 0 0 2px #fff;
}

.status-circle.done { background: #111827; }
.status-circle.off { border-color: #cbd5e1; background: #f8fafc; }

.floating-today {
  position: fixed;
  right: 18px;
  top: 50%;
  z-index: 30;
  display: grid;
  gap: 8px;
}

.floating-today .text-btn {
  box-shadow: var(--shadow);
  background: #fff;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.version-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 22px auto 0;
  padding: 14px 0 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.version-footer button {
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, .2);
  background: rgba(255, 253, 248, .88);
  color: var(--accent-strong);
  padding: 0 12px;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.version-footer button:hover {
  transform: translateY(-1px);
  background: rgba(15, 118, 110, .09);
  box-shadow: 0 10px 22px rgba(15, 118, 110, .1);
}

.version-modal[hidden] {
  display: none;
}

.version-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 19, 22, .42);
  backdrop-filter: blur(10px);
  animation: version-backdrop-in .18s ease both;
}

.version-modal-card {
  width: min(920px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 248, .98);
  box-shadow: 0 28px 80px rgba(8, 19, 22, .26);
  overflow: hidden;
  animation: version-card-in .22s ease both;
}

.version-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  background: rgba(247, 250, 248, .9);
}

.version-modal-head strong {
  display: block;
  color: var(--ink-strong);
  font-size: 16px;
  margin-bottom: 3px;
}

.version-modal-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.version-modal-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.version-modal-actions a,
.version-modal-actions button {
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, .9);
  color: var(--accent-strong);
  padding: 0 12px;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.version-log-view {
  margin: 0;
  padding: 16px 18px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--ink);
  font: 13px/1.72 "Microsoft YaHei", "PingFang SC", ui-sans-serif, system-ui, sans-serif;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, .035), transparent 120px),
    rgba(255, 253, 248, .98);
}

@keyframes version-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes version-card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  .topbar,
  .daily-head,
  .progress-grid,
  .progress-card.detailed,
  .task-grid,
  .review,
  .hour-panel,
  .subject-issue-grid {
    grid-template-columns: 1fr;
  }

  .stats { grid-template-columns: repeat(2, 1fr); }
  .phase-tabs { grid-template-columns: 1fr; }
  .phase-collapsed { grid-template-columns: 1fr; }
  .phase-summary { display: block; }
  .calendar-head { grid-template-columns: 36px 1fr 36px; }
  .calendar-head .text-btn { grid-column: 1 / -1; }
  .calendar-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-brief { grid-column: 1 / -1; }
  .issue-list-head,
  .issue-item { grid-template-columns: 1fr; }
  .floating-today { right: 10px; bottom: 12px; top: auto; }
}

@media (max-width: 640px) {
  .wrap, main {
    padding-left: 12px;
    padding-right: 12px;
  }

  h1 { font-size: 22px; }
  .sub { font-size: 13px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { min-height: 62px; }
  .stat b { font-size: 21px; }

  .daily-head,
  .task-grid,
  .review {
    padding-left: 14px;
    padding-right: 14px;
  }

  .daily-date { font-size: 24px; }
  .daily-hours { grid-template-columns: 1fr; }
  .reminder { margin-left: 14px; margin-right: 14px; }
  .calendar-grid {
    gap: 4px;
    padding: 10px;
  }

  .version-modal {
    padding: 12px;
  }

  .version-modal-card {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .version-modal-head {
    display: grid;
    gap: 10px;
  }

  .version-modal-actions {
    justify-content: space-between;
  }
  .weekday, .day {
    font-size: 12px;
  }
  .day {
    min-height: 52px;
    padding: 6px 2px;
  }
  .badge {
    width: 28px;
    height: 28px;
  }
  .subject-mark {
    width: 10px;
    height: 4px;
  }
  .calendar-overview {
    padding: 12px 12px 0;
    gap: 8px;
  }
  .calendar-metric {
    min-height: 58px;
    padding: 9px 10px;
  }
  .hours-row { grid-template-columns: 1fr; }
  input[type="number"] { width: 100%; text-align: left; }
  .floating-today .text-btn { height: 34px; padding: 0 10px; }
}

/* Visual upgrade: quieter, sharper, and less instructional. */
:root {
  --bg: #eef2ee;
  --panel: #fffdf7;
  --panel-2: #f7f5ee;
  --paper: #fffdf7;
  --ink: #172126;
  --ink-strong: #071114;
  --muted: #66737a;
  --muted-2: #9aa3a7;
  --line: #d9dfda;
  --accent: #0d6b61;
  --accent-strong: #074c45;
  --blue: #2f5fba;
  --green: #16945c;
  --red: #c24135;
  --orange: #b97921;
  --gold: #b8892d;
  --shadow: 0 24px 60px rgba(14, 28, 32, .12);
  --shadow-soft: 0 12px 28px rgba(14, 28, 32, .08);
}

body {
  background:
    linear-gradient(180deg, rgba(7, 17, 20, .08) 0, rgba(7, 17, 20, 0) 280px),
    linear-gradient(90deg, rgba(7, 17, 20, .055) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(7, 17, 20, .045) 0 1px, transparent 1px 100%),
    #eef2ee;
  background-size: auto, 42px 42px, 42px 42px, auto;
}

header {
  position: sticky;
  top: 0;
  background:
    linear-gradient(135deg, rgba(7, 17, 20, .98), rgba(17, 39, 42, .95));
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  box-shadow: 0 18px 46px rgba(7, 17, 20, .22);
}

header h1 {
  color: #fffdf7;
  font-size: 24px;
  font-weight: 800;
}

header .sub {
  color: rgba(255, 253, 247, .62);
}

.wrap, main {
  max-width: 1360px;
}

main {
  padding-top: 22px;
}

.stat {
  min-height: 70px;
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .08);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.stat::before {
  height: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(255, 255, 255, .32));
}

.stat b {
  color: #fffdf7;
}

.stat span {
  color: rgba(255, 253, 247, .6);
}

.phase-zone,
.daily-card,
.calendar-card,
.collapsible-panel,
.syllabus-root,
.all-card,
.panel {
  border: 1px solid rgba(7, 17, 20, .11);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, .98), rgba(248, 249, 243, .96));
  box-shadow: var(--shadow);
}

.phase-zone {
  border-radius: 10px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, .78), rgba(255, 253, 247, .48));
  backdrop-filter: blur(10px);
}

.phase-zone-head {
  display: none;
}

.phase-tabs {
  margin-bottom: 0;
  gap: 12px;
}

.phase-tab {
  min-height: 104px;
  border-color: rgba(7, 17, 20, .11);
  background:
    linear-gradient(180deg, #fffdf7 0%, #f7f7f0 100%);
  box-shadow: 0 12px 30px rgba(7, 17, 20, .07);
}

.phase-tab strong {
  color: var(--ink-strong);
  font-size: 17px;
}

.phase-tab span {
  color: #65727a;
  font-size: 13px;
}

.phase-tab.active {
  border-color: rgba(13, 107, 97, .72);
  background:
    linear-gradient(135deg, rgba(13, 107, 97, .1), rgba(255, 253, 247, .98) 46%),
    #fffdf7;
  box-shadow: inset 0 -5px 0 var(--accent), 0 18px 42px rgba(13, 107, 97, .14);
}

.phase-panel {
  border-radius: 10px;
}

.section-title {
  margin: 24px 0 10px;
}

.section-title .hint {
  display: none;
}

.section-title h2 {
  color: var(--ink-strong);
  font-size: 16px;
  letter-spacing: 0;
}

.section-title h2::before {
  background: var(--gold);
}

.daily-card {
  border-radius: 12px;
  margin-top: 18px;
  background:
    linear-gradient(135deg, rgba(7, 17, 20, .96), rgba(18, 49, 49, .92) 46%, rgba(184, 137, 45, .16)),
    #0b1719;
  color: #fffdf7;
  overflow: hidden;
}

.daily-head {
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  background: transparent;
  padding: 24px;
}

.daily-date {
  color: #fffdf7;
  font-size: 31px;
  letter-spacing: 0;
}

.daily-summary {
  max-width: 760px;
  color: rgba(255, 253, 247, .66);
}

.phase-pill,
.status-pill,
.next-pill {
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .1);
  color: #fffdf7;
}

.next-pill {
  color: #f3d99a;
}

.daily-meter {
  border-color: rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .08);
  box-shadow: none;
}

.daily-meter-top strong,
.daily-hours b {
  color: #fffdf7;
}

.daily-meter-top span,
.daily-hours span {
  color: rgba(255, 253, 247, .62);
}

.daily-progress-track {
  background: rgba(255, 255, 255, .13);
}

.daily-progress-fill {
  background: linear-gradient(90deg, #f0c96d, #51b49e);
}

.reminder {
  margin: 18px 24px 0;
  border-color: rgba(240, 201, 109, .28);
  background: rgba(240, 201, 109, .11);
  color: #f8dfaa;
}

.task-grid {
  padding: 18px 24px;
  gap: 14px;
}

.task {
  min-height: 182px;
  border-color: rgba(255, 255, 255, .1);
  background: rgba(255, 253, 247, .95);
  color: var(--ink);
  box-shadow: 0 16px 42px rgba(7, 17, 20, .16);
}

.task.is-done {
  background:
    linear-gradient(180deg, rgba(22, 148, 92, .12), rgba(255, 253, 247, .98));
}

.task-title,
.task-state,
.calendar-brief strong,
.calendar-metric b {
  color: var(--ink-strong);
}

.review {
  padding: 0 24px 24px;
}

.review-block {
  border-color: rgba(255, 255, 255, .1);
  background: rgba(255, 253, 247, .96);
}

.calendar-card {
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, .98), rgba(247, 247, 240, .96));
  overflow: hidden;
}

.calendar-head,
.panel-head,
.phase-summary,
summary {
  background: rgba(247, 245, 238, .82);
}

.calendar-head {
  border-bottom: 1px solid rgba(7, 17, 20, .09);
  padding: 16px 18px;
}

.calendar-head strong {
  color: var(--ink-strong);
  font-size: 19px;
}

.calendar-overview {
  grid-template-columns: minmax(260px, 1fr) repeat(4, minmax(110px, .34fr));
  padding: 16px 18px 0;
}

.calendar-brief,
.calendar-metric {
  border-color: rgba(7, 17, 20, .09);
  background: rgba(255, 253, 247, .82);
  box-shadow: none;
}

.calendar-brief p {
  display: none;
}

.calendar-grid {
  gap: 8px;
  padding: 16px 18px;
}

.weekday {
  color: #7a8589;
  font-size: 12px;
}

.day {
  min-height: 64px;
  border-color: rgba(7, 17, 20, .07);
  background: rgba(255, 253, 247, .88);
  box-shadow: 0 8px 20px rgba(7, 17, 20, .045);
}

.day:hover {
  border-color: rgba(13, 107, 97, .42);
  box-shadow: 0 14px 30px rgba(13, 107, 97, .12);
}

.day.selected {
  background:
    linear-gradient(180deg, rgba(13, 107, 97, .13), rgba(255, 253, 247, .95));
  box-shadow: inset 0 0 0 1px rgba(13, 107, 97, .25), 0 18px 34px rgba(13, 107, 97, .16);
}

.day.today {
  box-shadow: inset 0 0 0 2px var(--gold), 0 8px 20px rgba(184, 137, 45, .14);
}

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

.subject-mark {
  height: 5px;
}

.legend {
  padding: 0 18px 18px;
}

.collapsible-panel {
  border-radius: 12px;
}

.collapsible-panel > summary {
  min-height: 62px;
  background: linear-gradient(180deg, rgba(255, 253, 247, .98), rgba(247, 245, 238, .9));
}

.collapsible-panel > summary strong {
  font-size: 16px;
}

.collapsible-panel > summary p {
  display: none;
}

.icon-btn,
.text-btn,
select {
  border-radius: 8px;
  border-color: rgba(7, 17, 20, .12);
  background: #fffdf7;
}

.floating-today .text-btn {
  background: rgba(7, 17, 20, .9);
  color: #fffdf7;
  border-color: rgba(255, 255, 255, .1);
}

.floating-today {
  top: auto;
  right: 22px;
  bottom: 22px;
  z-index: 40;
}

.floating-today .text-btn {
  height: 38px;
  border-radius: 999px;
  padding: 0 15px;
  box-shadow: 0 14px 34px rgba(7, 17, 20, .22);
}

input[type="number"],
textarea {
  border-color: rgba(7, 17, 20, .12);
  background: #fffdf7;
}

.hour-box,
.pie-card,
.progress-card,
.summary-ring-card,
.sub-progress-item,
.subject-issue {
  border-color: rgba(7, 17, 20, .09);
  background: #fffdf7;
  box-shadow: none;
}

@media (max-width: 980px) {
  .calendar-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .calendar-brief {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  main {
    padding-top: 14px;
  }
  header h1 {
    font-size: 21px;
  }
  .phase-zone {
    padding: 10px;
  }
  .phase-tab {
    min-height: 82px;
  }
  .daily-head {
    padding: 18px;
  }
  .daily-date {
    font-size: 25px;
  }
  .task-grid,
  .review {
    padding-left: 18px;
    padding-right: 18px;
  }
  .reminder {
    margin-left: 18px;
    margin-right: 18px;
  }
  .calendar-grid {
    gap: 5px;
    padding: 12px;
  }
  .day {
    min-height: 54px;
  }
  .calendar-overview {
    padding: 12px 12px 0;
  }
  .legend {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* Unified light revision: no split black/white surfaces. */
:root {
  --bg: #edf2ef;
  --panel: #fffdf8;
  --panel-2: #f8f6ef;
  --paper: #fffdf8;
  --ink: #192327;
  --ink-strong: #081316;
  --muted: #65737a;
  --muted-2: #9ca7ab;
  --line: #d8e0dc;
  --accent: #0d766d;
  --accent-strong: #07524c;
  --blue: #315fb7;
  --green: #158f59;
  --red: #bf3e34;
  --orange: #b7781f;
  --gold: #bd8f2e;
  --shadow: 0 22px 55px rgba(22, 35, 38, .10);
  --shadow-soft: 0 10px 28px rgba(22, 35, 38, .07);
}

body {
  background:
    radial-gradient(circle at 18% 0%, rgba(13, 118, 109, .13), transparent 28%),
    linear-gradient(180deg, rgba(255, 253, 248, .8) 0, rgba(237, 242, 239, 0) 360px),
    linear-gradient(90deg, rgba(8, 19, 22, .055) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(8, 19, 22, .045) 0 1px, transparent 1px 100%),
    var(--bg);
  background-size: auto, auto, 42px 42px, 42px 42px, auto;
}

header {
  background: rgba(255, 253, 248, .82);
  border-bottom: 1px solid rgba(8, 19, 22, .09);
  box-shadow: 0 18px 44px rgba(22, 35, 38, .08);
}

header h1 {
  color: var(--ink-strong);
}

header .sub {
  color: var(--muted);
}

.stat {
  border-color: rgba(8, 19, 22, .1);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, .98), rgba(247, 246, 239, .92));
  box-shadow: var(--shadow-soft);
}

.stat::before {
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.stat b {
  color: var(--ink-strong);
}

.stat span {
  color: var(--muted);
}

.phase-zone,
.daily-card,
.calendar-card,
.collapsible-panel,
.syllabus-root,
.all-card,
.panel {
  border-color: rgba(8, 19, 22, .1);
  background:
    linear-gradient(180deg, rgba(255, 253, 248, .97), rgba(248, 247, 241, .94));
  box-shadow: var(--shadow);
}

.phase-zone {
  background:
    linear-gradient(135deg, rgba(255, 253, 248, .9), rgba(239, 248, 245, .72));
}

.daily-card {
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(13, 118, 109, .09), rgba(255, 253, 248, .98) 42%, rgba(189, 143, 46, .1)),
    var(--paper);
  border-color: rgba(13, 118, 109, .22);
  box-shadow: 0 24px 58px rgba(22, 35, 38, .12);
}

.daily-head {
  background: transparent;
  border-bottom: 1px solid rgba(8, 19, 22, .08);
}

.daily-date,
.daily-meter-top strong,
.daily-hours b {
  color: var(--ink-strong);
}

.daily-summary,
.daily-meter-top span,
.daily-hours span {
  color: var(--muted);
}

.status-pill,
.phase-pill {
  border-color: rgba(8, 19, 22, .1);
  background: rgba(255, 253, 248, .82);
  color: var(--ink-strong);
}

.next-pill {
  border-color: rgba(189, 143, 46, .22);
  background: rgba(189, 143, 46, .11);
  color: #7a5513;
}

.daily-meter {
  border-color: rgba(8, 19, 22, .09);
  background: rgba(255, 253, 248, .72);
  box-shadow: var(--shadow-soft);
}

.daily-progress-track {
  background: #e4ebe7;
}

.daily-progress-fill {
  background: linear-gradient(90deg, var(--gold), var(--accent));
}

.reminder {
  border-color: rgba(189, 143, 46, .26);
  background: rgba(189, 143, 46, .09);
  color: #76530e;
}

.task {
  border-color: rgba(8, 19, 22, .1);
  background: rgba(255, 253, 248, .92);
  color: var(--ink);
  box-shadow: 0 14px 32px rgba(22, 35, 38, .08);
}

.task.is-done {
  background:
    linear-gradient(180deg, rgba(21, 143, 89, .11), rgba(255, 253, 248, .96));
}

.review-block {
  border-color: rgba(8, 19, 22, .1);
  background: rgba(255, 253, 248, .86);
}

.calendar-head,
.panel-head,
.phase-summary,
summary {
  background: rgba(248, 246, 239, .72);
}

.floating-today .text-btn {
  background: rgba(255, 253, 248, .94);
  color: var(--ink-strong);
  border-color: rgba(8, 19, 22, .14);
  box-shadow: 0 14px 34px rgba(22, 35, 38, .14);
}

.theme-toggle {
  margin-top: 12px;
  min-height: 34px;
  border: 1px solid rgba(8, 19, 22, .12);
  border-radius: 999px;
  background: rgba(255, 253, 248, .74);
  color: var(--ink-strong);
  padding: 0 14px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.theme-toggle:hover {
  border-color: rgba(13, 118, 109, .38);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101816;
  --panel: #18221f;
  --panel-2: #202b27;
  --paper: #18221f;
  --ink: #d8e1db;
  --ink-strong: #f5f2e8;
  --muted: #9ca9a3;
  --muted-2: #72807a;
  --line: #33413c;
  --accent: #4db7a6;
  --accent-strong: #8bd9c9;
  --blue: #7ea7ff;
  --green: #64cf95;
  --red: #f07d71;
  --orange: #e0a850;
  --gold: #e4c072;
  --shadow: 0 24px 58px rgba(0, 0, 0, .32);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, .22);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 18% 0%, rgba(77, 183, 166, .16), transparent 30%),
    linear-gradient(180deg, rgba(228, 192, 114, .07) 0, rgba(16, 24, 22, 0) 360px),
    linear-gradient(90deg, rgba(245, 242, 232, .045) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(245, 242, 232, .035) 0 1px, transparent 1px 100%),
    var(--bg);
  color: var(--ink);
}

html[data-theme="dark"] header {
  background: rgba(18, 28, 25, .86);
  border-bottom-color: rgba(245, 242, 232, .08);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .28);
}

html[data-theme="dark"] .stat,
html[data-theme="dark"] .phase-zone,
html[data-theme="dark"] .daily-card,
html[data-theme="dark"] .calendar-card,
html[data-theme="dark"] .collapsible-panel,
html[data-theme="dark"] .syllabus-root,
html[data-theme="dark"] .all-card,
html[data-theme="dark"] .panel {
  border-color: rgba(245, 242, 232, .09);
  background:
    linear-gradient(180deg, rgba(28, 39, 35, .96), rgba(22, 32, 29, .94));
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .phase-zone {
  background:
    linear-gradient(135deg, rgba(31, 48, 43, .92), rgba(18, 30, 27, .82));
}

html[data-theme="dark"] .phase-tab,
html[data-theme="dark"] .task,
html[data-theme="dark"] .review-block,
html[data-theme="dark"] .calendar-brief,
html[data-theme="dark"] .calendar-metric,
html[data-theme="dark"] .hour-box,
html[data-theme="dark"] .pie-card,
html[data-theme="dark"] .study-record-library,
html[data-theme="dark"] .study-record-row,
html[data-theme="dark"] .record-calendar-popover,
html[data-theme="dark"] .progress-card,
html[data-theme="dark"] .summary-ring-card,
html[data-theme="dark"] .sub-progress-item,
html[data-theme="dark"] .subject-issue,
html[data-theme="dark"] .issue-item,
html[data-theme="dark"] .empty {
  border-color: rgba(245, 242, 232, .09);
  background: rgba(24, 34, 31, .92);
  color: var(--ink);
  box-shadow: none;
}

html[data-theme="dark"] .phase-tab.active,
html[data-theme="dark"] .task.is-done,
html[data-theme="dark"] .calendar-focus-task.done {
  background:
    linear-gradient(180deg, rgba(77, 183, 166, .14), rgba(24, 34, 31, .94));
}

html[data-theme="dark"] .daily-card {
  background:
    linear-gradient(135deg, rgba(77, 183, 166, .13), rgba(24, 34, 31, .96) 42%, rgba(228, 192, 114, .08)),
    var(--paper);
}

html[data-theme="dark"] .daily-head,
html[data-theme="dark"] .calendar-head,
html[data-theme="dark"] .panel-head,
html[data-theme="dark"] .phase-summary,
html[data-theme="dark"] summary {
  background: rgba(32, 43, 39, .72);
  border-color: rgba(245, 242, 232, .08);
}

html[data-theme="dark"] .syllabus-category,
html[data-theme="dark"] .syllabus-subject {
  border-color: rgba(255, 250, 240, .13);
  background: rgba(27, 40, 37, .94);
  box-shadow: none;
}

html[data-theme="dark"] .syllabus-category summary::after,
html[data-theme="dark"] .syllabus-subject summary::after {
  border-color: rgba(102, 208, 191, .34);
  background: rgba(19, 31, 28, .96);
  color: var(--accent-strong);
}

html[data-theme="dark"] .syllabus-item {
  border-color: rgba(255, 250, 240, .12);
  border-left-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(34, 49, 45, .96), rgba(20, 32, 29, .98));
  color: var(--ink);
}

html[data-theme="dark"] .syllabus-item.core { border-left-color: var(--red); }
html[data-theme="dark"] .syllabus-item.important { border-left-color: var(--orange); }
html[data-theme="dark"] .syllabus-item.base { border-left-color: var(--accent); }

html[data-theme="dark"] .syllabus-item strong {
  color: var(--ink-strong);
}

html[data-theme="dark"] .syllabus-item p {
  color: var(--muted);
}

html[data-theme="dark"] .daily-meter,
html[data-theme="dark"] .reminder {
  border-color: rgba(245, 242, 232, .1);
  background: rgba(245, 242, 232, .055);
  color: var(--ink);
}

html[data-theme="dark"] .next-pill {
  border-color: rgba(228, 192, 114, .28);
  background: rgba(228, 192, 114, .12);
  color: #f0d18a;
}

html[data-theme="dark"] .status-pill,
html[data-theme="dark"] .phase-pill,
html[data-theme="dark"] .mini-status,
html[data-theme="dark"] .task-state {
  border-color: rgba(245, 242, 232, .1);
  background: rgba(245, 242, 232, .07);
  color: var(--ink-strong);
}

html[data-theme="dark"] .daily-progress-track,
html[data-theme="dark"] .sub-progress-bar,
html[data-theme="dark"] .hour-bar {
  background: rgba(245, 242, 232, .12);
}

html[data-theme="dark"] .day,
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .text-btn,
html[data-theme="dark"] select,
html[data-theme="dark"] .theme-toggle {
  border-color: rgba(245, 242, 232, .12);
  background: rgba(24, 34, 31, .94);
  color: var(--ink-strong);
}

html[data-theme="dark"] .day.selected {
  background:
    linear-gradient(180deg, rgba(77, 183, 166, .18), rgba(24, 34, 31, .95));
  box-shadow: inset 0 0 0 1px rgba(77, 183, 166, .4), 0 18px 34px rgba(0, 0, 0, .24);
}

html[data-theme="dark"] .day.done .badge,
html[data-theme="dark"] .day.late .badge {
  background: rgba(245, 242, 232, .08);
}

html[data-theme="dark"] .floating-today .text-btn {
  background: rgba(24, 34, 31, .94);
  color: var(--ink-strong);
  border-color: rgba(245, 242, 232, .14);
}

html[data-theme="dark"] th {
  background: #202b27;
  color: var(--ink-strong);
}

html[data-theme="dark"] tbody tr:hover {
  background: rgba(245, 242, 232, .045);
}

html[data-theme="dark"] .ring,
html[data-theme="dark"] .summary-ring-card .ring {
  background:
    radial-gradient(circle at center, #18221f 0 58%, transparent 59%),
    conic-gradient(var(--accent) calc(var(--value) * 1%), rgba(245, 242, 232, .12) 0);
}

/* Dark readability pass: raise contrast without returning to split black panels. */
html[data-theme="dark"] {
  --bg: #121a1a;
  --panel: #1d2927;
  --panel-2: #263330;
  --paper: #1d2927;
  --ink: #e4ece7;
  --ink-strong: #fffaf0;
  --muted: #b7c4bf;
  --muted-2: #8f9d98;
  --line: #40514c;
  --accent: #66d0bf;
  --accent-strong: #a6eadf;
  --blue: #94b9ff;
  --green: #79dfa6;
  --red: #ff9085;
  --orange: #f0bd63;
  --gold: #f1cf7e;
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 18% 0%, rgba(102, 208, 191, .14), transparent 30%),
    linear-gradient(180deg, rgba(241, 207, 126, .08) 0, rgba(18, 26, 26, 0) 360px),
    linear-gradient(90deg, rgba(255, 250, 240, .055) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, rgba(255, 250, 240, .04) 0 1px, transparent 1px 100%),
    var(--bg);
}

html[data-theme="dark"] header {
  background: rgba(20, 30, 29, .93);
  border-bottom-color: rgba(255, 250, 240, .12);
}

html[data-theme="dark"] header .sub,
html[data-theme="dark"] .sub,
html[data-theme="dark"] .hint,
html[data-theme="dark"] .phase-tab span,
html[data-theme="dark"] .daily-summary,
html[data-theme="dark"] .calendar-brief p,
html[data-theme="dark"] .calendar-metric span,
html[data-theme="dark"] .hours-row,
html[data-theme="dark"] .review-block label,
html[data-theme="dark"] .subject-issue textarea::placeholder,
html[data-theme="dark"] textarea::placeholder,
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] .issue-text,
html[data-theme="dark"] .pie-legend,
html[data-theme="dark"] .progress-note {
  color: var(--muted);
}

html[data-theme="dark"] .task-copy,
html[data-theme="dark"] .issue-text,
html[data-theme="dark"] .subject-issue label,
html[data-theme="dark"] td {
  color: var(--ink);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] strong,
html[data-theme="dark"] .daily-date,
html[data-theme="dark"] .task-title,
html[data-theme="dark"] .phase-tab strong,
html[data-theme="dark"] .calendar-head strong,
html[data-theme="dark"] .calendar-brief strong,
html[data-theme="dark"] .calendar-metric b,
html[data-theme="dark"] .daily-meter-top strong,
html[data-theme="dark"] .daily-hours b,
html[data-theme="dark"] .percent,
html[data-theme="dark"] .sub-progress-top strong {
  color: var(--ink-strong);
}

html[data-theme="dark"] .stat,
html[data-theme="dark"] .phase-zone,
html[data-theme="dark"] .daily-card,
html[data-theme="dark"] .calendar-card,
html[data-theme="dark"] .collapsible-panel,
html[data-theme="dark"] .syllabus-root,
html[data-theme="dark"] .all-card,
html[data-theme="dark"] .panel {
  border-color: rgba(255, 250, 240, .13);
  background:
    linear-gradient(180deg, rgba(32, 45, 42, .98), rgba(26, 38, 35, .96));
  box-shadow: 0 24px 58px rgba(0, 0, 0, .34);
}

html[data-theme="dark"] .phase-zone {
  background:
    linear-gradient(135deg, rgba(40, 63, 57, .95), rgba(23, 37, 34, .94));
}

html[data-theme="dark"] .daily-card {
  background:
    linear-gradient(135deg, rgba(102, 208, 191, .13), rgba(29, 41, 39, .98) 42%, rgba(241, 207, 126, .1)),
    var(--paper);
}

html[data-theme="dark"] .phase-tab,
html[data-theme="dark"] .task,
html[data-theme="dark"] .review-block,
html[data-theme="dark"] .calendar-brief,
html[data-theme="dark"] .calendar-metric,
html[data-theme="dark"] .hour-box,
html[data-theme="dark"] .pie-card,
html[data-theme="dark"] .study-record-library,
html[data-theme="dark"] .study-record-row,
html[data-theme="dark"] .record-calendar-popover,
html[data-theme="dark"] .progress-card,
html[data-theme="dark"] .summary-ring-card,
html[data-theme="dark"] .sub-progress-item,
html[data-theme="dark"] .subject-issue,
html[data-theme="dark"] .issue-item,
html[data-theme="dark"] .empty {
  border-color: rgba(255, 250, 240, .13);
  background: rgba(27, 40, 37, .96);
  color: var(--ink);
}

html[data-theme="dark"] .phase-tab.active,
html[data-theme="dark"] .task.is-done {
  background:
    linear-gradient(180deg, rgba(102, 208, 191, .18), rgba(27, 40, 37, .98));
  border-color: rgba(102, 208, 191, .55);
}

html[data-theme="dark"] .study-record-focus-banner,
html[data-theme="dark"] .study-record-row.focused {
  border-color: rgba(102, 208, 191, .55);
  background:
    linear-gradient(90deg, rgba(102, 208, 191, .18), rgba(241, 207, 126, .1), rgba(27, 40, 37, .96));
  color: var(--ink-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .24), inset 0 0 0 1px rgba(102, 208, 191, .12);
}

html[data-theme="dark"] .daily-head,
html[data-theme="dark"] .calendar-head,
html[data-theme="dark"] .panel-head,
html[data-theme="dark"] .phase-summary,
html[data-theme="dark"] summary {
  background: rgba(38, 51, 48, .86);
  border-color: rgba(255, 250, 240, .12);
}

html[data-theme="dark"] .daily-meter,
html[data-theme="dark"] .reminder {
  border-color: rgba(255, 250, 240, .15);
  background: rgba(255, 250, 240, .075);
  color: var(--ink);
}

html[data-theme="dark"] .reminder,
html[data-theme="dark"] .next-pill {
  color: #ffe0a0;
}

html[data-theme="dark"] .status-pill,
html[data-theme="dark"] .phase-pill,
html[data-theme="dark"] .mini-status,
html[data-theme="dark"] .task-state {
  border-color: rgba(255, 250, 240, .2);
  background: rgba(255, 250, 240, .13);
  color: var(--ink-strong);
}

html[data-theme="dark"] .task-state,
html[data-theme="dark"] .task.is-done .task-state {
  color: #fffaf0;
}

html[data-theme="dark"] .task.is-done .task-state {
  border-color: rgba(121, 223, 166, .34);
  background: rgba(121, 223, 166, .18);
  color: #dffcef;
}

html[data-theme="dark"] .daily-progress-track,
html[data-theme="dark"] .sub-progress-bar,
html[data-theme="dark"] .hour-bar {
  background: rgba(255, 250, 240, .18);
}

html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] .hours-entry select,
html[data-theme="dark"] .study-record-row select,
html[data-theme="dark"] .study-record-row input,
html[data-theme="dark"] textarea {
  border-color: rgba(255, 250, 240, .24);
  background: #172622;
  color: var(--ink-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, .025);
}

html[data-theme="dark"] .record-date-toggle,
html[data-theme="dark"] .record-calendar-head button,
html[data-theme="dark"] .record-calendar-day {
  color: var(--ink-strong);
}

html[data-theme="dark"] .record-library-toggle,
html[data-theme="dark"] .record-date-toggle,
html[data-theme="dark"] .study-distribution-toggle {
  border-color: rgba(255, 250, 240, .16);
  background: rgba(27, 40, 37, .96);
  color: var(--ink-strong);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, .04);
}

html[data-theme="dark"] .record-library-toggle:hover,
html[data-theme="dark"] .record-library-toggle.active,
html[data-theme="dark"] .record-date-toggle:hover,
html[data-theme="dark"] .record-date-toggle.active,
html[data-theme="dark"] .study-distribution-toggle:hover,
html[data-theme="dark"] .study-distribution-toggle.active {
  border-color: rgba(102, 208, 191, .55);
  background: rgba(102, 208, 191, .16);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(102, 208, 191, .18), 0 12px 26px rgba(0, 0, 0, .18);
}

html[data-theme="dark"] .record-calendar-day.has-record {
  color: var(--accent-strong);
  background: rgba(102, 208, 191, .14);
}

html[data-theme="dark"] .record-calendar-day.active {
  color: #071714;
  background: var(--accent-strong);
}

html[data-theme="dark"] .version-footer {
  color: var(--muted);
}

html[data-theme="dark"] .version-footer button,
html[data-theme="dark"] .version-modal-actions a,
html[data-theme="dark"] .version-modal-actions button {
  border-color: rgba(255, 250, 240, .16);
  background: rgba(27, 40, 37, .96);
  color: var(--accent-strong);
}

html[data-theme="dark"] .version-footer button:hover,
html[data-theme="dark"] .version-modal-actions a:hover,
html[data-theme="dark"] .version-modal-actions button:hover {
  border-color: rgba(102, 208, 191, .45);
  background: rgba(102, 208, 191, .14);
  color: var(--ink-strong);
}

html[data-theme="dark"] .version-modal {
  background: rgba(0, 0, 0, .52);
}

html[data-theme="dark"] .version-modal-card {
  border-color: rgba(255, 250, 240, .13);
  background: rgba(27, 40, 37, .98);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .42);
}

html[data-theme="dark"] .version-modal-head {
  border-color: rgba(255, 250, 240, .12);
  background: rgba(38, 51, 48, .9);
}

html[data-theme="dark"] .version-log-view {
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(102, 208, 191, .07), transparent 120px),
    rgba(27, 40, 37, .98);
}

html[data-theme="dark"] input[type="number"]:focus,
html[data-theme="dark"] textarea:focus {
  border-color: rgba(102, 208, 191, .72);
  box-shadow: 0 0 0 3px rgba(102, 208, 191, .18);
}

html[data-theme="dark"] .day,
html[data-theme="dark"] .icon-btn,
html[data-theme="dark"] .text-btn,
html[data-theme="dark"] select,
html[data-theme="dark"] .theme-toggle {
  border-color: rgba(255, 250, 240, .16);
  background: rgba(27, 40, 37, .96);
  color: var(--ink-strong);
}

html[data-theme="dark"] .day .badge {
  color: var(--ink-strong);
}

html[data-theme="dark"] .day.out {
  opacity: .46;
}

html[data-theme="dark"] .day.selected {
  background:
    linear-gradient(180deg, rgba(102, 208, 191, .22), rgba(27, 40, 37, .98));
  border-color: rgba(102, 208, 191, .68);
}

html[data-theme="dark"] .subject-mark {
  background: rgba(241, 207, 126, .28);
}

html[data-theme="dark"] .subject-mark.done {
  background: #f1cf7e;
  box-shadow: 0 0 12px rgba(241, 207, 126, .28);
}

html[data-theme="dark"] .issue-mark {
  box-shadow: 0 0 0 2px #1b2825;
}

html[data-theme="dark"] .floating-today .text-btn {
  background: rgba(27, 40, 37, .98);
  color: var(--ink-strong);
  border-color: rgba(255, 250, 240, .18);
}

html[data-theme="dark"] .ring,
html[data-theme="dark"] .summary-ring-card .ring {
  background:
    radial-gradient(circle at center, #1b2825 0 58%, transparent 59%),
    conic-gradient(var(--accent) calc(var(--value) * 1%), rgba(255, 250, 240, .18) 0);
}

html[data-theme="dark"] .segmented {
  border-color: rgba(255, 250, 240, .16);
  background: rgba(14, 24, 22, .82);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, .03);
}

html[data-theme="dark"] .segmented button {
  color: var(--muted);
  background: transparent;
}

html[data-theme="dark"] .segmented button.active {
  background: rgba(255, 250, 240, .12);
  color: var(--ink-strong);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

html[data-theme="dark"] .subject-tab {
  border-color: rgba(255, 250, 240, .16);
  background: rgba(27, 40, 37, .94);
  color: var(--muted);
}

html[data-theme="dark"] .subject-tab.active {
  border-color: rgba(102, 208, 191, .58);
  background: rgba(102, 208, 191, .16);
  color: var(--accent-strong);
}

html[data-theme="dark"] .issue-tabs.sub .subject-tab {
  border-color: rgba(255, 250, 240, .14);
  background: rgba(19, 31, 28, .96);
  color: rgba(214, 229, 224, .72);
}

html[data-theme="dark"] .issue-tabs.sub .subject-tab:hover {
  border-color: rgba(102, 208, 191, .45);
  background: rgba(35, 58, 52, .92);
  color: var(--ink-strong);
}

html[data-theme="dark"] .issue-tabs.sub .subject-tab.active {
  border-color: rgba(102, 208, 191, .72);
  background: rgba(102, 208, 191, .18);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(102, 208, 191, .18);
}

html[data-theme="dark"] .all-tools {
  border-color: rgba(255, 250, 240, .12);
  background: rgba(27, 40, 37, .96);
  color: var(--ink);
}

html[data-theme="dark"] .phase-table-title {
  color: var(--ink-strong);
}

html[data-theme="dark"] .all-tools label {
  color: var(--muted);
}

html[data-theme="dark"] select,
html[data-theme="dark"] option {
  background: #172622;
  color: var(--ink-strong);
}

html[data-theme="dark"] .table-shell {
  background: rgba(18, 28, 25, .92);
}

html[data-theme="dark"] table {
  background: transparent;
  color: var(--ink);
}

html[data-theme="dark"] th {
  border-color: rgba(255, 250, 240, .12);
  background: #22322e;
  color: var(--ink-strong);
}

html[data-theme="dark"] td {
  border-color: rgba(255, 250, 240, .11);
  color: var(--ink);
}

html[data-theme="dark"] .status-circle {
  border-color: rgba(255, 250, 240, .82);
  background: transparent;
  box-shadow: inset 0 0 0 2px rgba(18, 28, 25, .98);
}

html[data-theme="dark"] .status-circle.done {
  border-color: var(--accent);
  background: var(--accent);
}

html[data-theme="dark"] .status-circle.off {
  border-color: rgba(255, 250, 240, .42);
  background: rgba(255, 250, 240, .08);
}

html[data-theme="dark"] .confirm-grid label {
  border-color: rgba(255, 250, 240, .12);
  background: rgba(27, 40, 37, .94);
  color: var(--muted);
}

html[data-theme="dark"] .issue-list-head {
  border-color: rgba(255, 250, 240, .12);
  color: var(--muted);
}

html[data-theme="dark"] .issue-date {
  color: var(--accent-strong);
}

html[data-theme="dark"] .pie-total {
  background: #1b2825;
  color: var(--muted);
}

html[data-theme="dark"] .pie-total b {
  color: var(--ink-strong);
}
.cloud-sync {
  margin-bottom: 16px;
  overflow: hidden;
}

.cloud-sync > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 0 18px;
  cursor: pointer;
  list-style: none;
}

.cloud-sync > summary::-webkit-details-marker {
  display: none;
}

.cloud-title {
  color: var(--ink-strong);
  font-weight: 900;
  font-size: 18px;
}

.cloud-summary {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-chevron {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(9, 24, 27, .12);
  background: rgba(255, 255, 255, .52);
  color: var(--accent);
  transition: transform .18s ease, background .18s ease;
}

.cloud-sync[open] .cloud-chevron {
  transform: rotate(180deg);
}

.cloud-body {
  border-top: 1px solid var(--line);
  padding: 16px 18px 18px;
}

.cloud-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(9, 24, 27, .1);
  background: rgba(255, 253, 248, .58);
}

.cloud-status strong {
  color: var(--ink-strong);
}

.cloud-status span {
  color: var(--muted);
  font-size: 13px;
}

.cloud-status.ok {
  border-color: rgba(15, 118, 110, .26);
  background: rgba(15, 118, 110, .08);
}

.cloud-status.warn {
  border-color: rgba(189, 143, 46, .32);
  background: rgba(189, 143, 46, .12);
}

.cloud-status.error {
  border-color: rgba(220, 38, 38, .28);
  background: rgba(220, 38, 38, .08);
}

.cloud-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.cloud-auth {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.cloud-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.cloud-input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(9, 24, 27, .12);
  border-radius: 8px;
  background: rgba(255, 253, 248, .86);
  color: var(--ink);
  padding: 0 12px;
  font: inherit;
  outline: none;
}

.cloud-input:focus {
  border-color: rgba(15, 118, 110, .52);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}

.cloud-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.cloud-button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.cloud-primary,
.cloud-ghost {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.cloud-primary {
  border: 1px solid rgba(15, 118, 110, .38);
  background: var(--accent);
  color: #fffdf7;
}

.cloud-ghost {
  border: 1px solid rgba(9, 24, 27, .12);
  background: rgba(255, 253, 248, .72);
  color: var(--ink-strong);
}

.cloud-primary:disabled,
.cloud-ghost:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.cloud-auto {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.cloud-auto input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

html[data-theme="dark"] .cloud-chevron {
  border-color: rgba(255, 250, 240, .14);
  background: rgba(255, 250, 240, .08);
  color: var(--accent-2);
}

html[data-theme="dark"] .cloud-status {
  border-color: rgba(255, 250, 240, .11);
  background: rgba(14, 24, 22, .72);
}

html[data-theme="dark"] .cloud-status.ok {
  border-color: rgba(102, 208, 191, .32);
  background: rgba(102, 208, 191, .1);
}

html[data-theme="dark"] .cloud-status.warn {
  border-color: rgba(241, 207, 126, .34);
  background: rgba(241, 207, 126, .11);
}

html[data-theme="dark"] .cloud-status.error {
  border-color: rgba(255, 122, 112, .32);
  background: rgba(255, 122, 112, .1);
}

html[data-theme="dark"] .cloud-input,
html[data-theme="dark"] .cloud-ghost {
  border-color: rgba(255, 250, 240, .12);
  background: rgb(23, 38, 34);
  color: var(--ink);
}

html[data-theme="dark"] .cloud-primary {
  background: #3bb9a7;
  color: #061312;
  border-color: rgba(102, 208, 191, .5);
}

.readonly-note {
  margin: 0 18px 16px;
  padding: 11px 13px;
  border-radius: 8px;
  border: 1px solid rgba(189, 143, 46, .28);
  background: rgba(189, 143, 46, .1);
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 900;
}

.daily-card.is-readonly input,
.daily-card.is-readonly textarea,
.issues-list input:disabled {
  cursor: not-allowed;
}

.daily-card.is-readonly .task,
.daily-card.is-readonly .review-block {
  opacity: .82;
}

html[data-theme="dark"] .readonly-note {
  border-color: rgba(241, 207, 126, .35);
  background: rgba(241, 207, 126, .11);
  color: var(--ink-strong);
}

@media (max-width: 980px) {
  .cloud-grid,
  .cloud-auth {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .cloud-sync > summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .cloud-summary {
    grid-column: 1 / -1;
    white-space: normal;
  }
  .cloud-body {
    padding: 14px;
  }
  .cloud-actions {
    align-items: stretch;
  }
  .cloud-button-row,
  .cloud-primary,
  .cloud-ghost {
    width: 100%;
  }
}

.mobile-mini-bar {
  display: none;
}

@media (max-width: 640px) {
  header {
    position: static;
    top: auto;
  }

  header .wrap {
    padding: 22px 16px 16px;
  }

  .topbar {
    gap: 16px;
  }

  .stats {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 2px 6px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .stats::-webkit-scrollbar {
    display: none;
  }

  .stat {
    flex: 0 0 138px;
    min-height: 68px;
    scroll-snap-align: start;
  }

  .mobile-mini-bar {
    position: fixed;
    left: 10px;
    right: 10px;
    top: calc(8px + env(safe-area-inset-top));
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    padding: 8px 12px;
    border: 1px solid rgba(8, 19, 22, .13);
    border-radius: 999px;
    background: rgba(255, 253, 248, .9);
    box-shadow: 0 14px 34px rgba(22, 35, 38, .14);
    backdrop-filter: blur(16px);
    transform: translateY(calc(-120% - env(safe-area-inset-top)));
    opacity: 0;
    pointer-events: none;
    transition: transform .2s ease, opacity .2s ease;
  }

  body.mobile-mini-visible .mobile-mini-bar {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-mini-main {
    display: grid;
    gap: 1px;
    min-width: 0;
  }

  .mobile-mini-main strong {
    color: var(--ink-strong);
    font-size: 14px;
    line-height: 1.15;
  }

  .mobile-mini-main span,
  .mobile-mini-days {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .mobile-mini-days {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(15, 118, 110, .09);
    color: var(--accent-strong);
    font-weight: 800;
  }

  .phase-zone,
  .daily-card,
  .calendar-card,
  .collapsible-panel,
  .syllabus-root,
  .all-card {
    scroll-margin-top: calc(62px + env(safe-area-inset-top));
  }

  .floating-today {
    right: 12px;
    bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .floating-today .text-btn {
    min-height: 40px;
    padding: 0 14px;
  }
}

@media (max-width: 640px) {
  html[data-theme="dark"] .mobile-mini-bar {
    border-color: rgba(255, 250, 240, .13);
    background: rgba(18, 30, 27, .88);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .38);
  }

  html[data-theme="dark"] .mobile-mini-days {
    background: rgba(241, 207, 126, .14);
    color: #f1cf7e;
  }
}

.cloud-sync > summary,
.collapsible-panel > summary,
.syllabus-root > summary,
.all-card > summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 72px;
  padding: 18px 72px 18px 20px;
  list-style: none;
}

.cloud-sync > summary::-webkit-details-marker,
.collapsible-panel > summary::-webkit-details-marker,
.syllabus-root > summary::-webkit-details-marker,
.all-card > summary::-webkit-details-marker {
  display: none;
}

.cloud-sync > summary::marker,
.collapsible-panel > summary::marker,
.syllabus-root > summary::marker,
.all-card > summary::marker {
  content: "";
}

.cloud-sync > summary::after,
.collapsible-panel > summary::after,
.syllabus-root > summary::after,
.all-card > summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(8, 19, 22, .14);
  border-radius: 999px;
  background: rgba(255, 253, 248, .92);
  color: var(--accent);
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
  box-shadow: 0 8px 20px rgba(22, 35, 38, .08);
  transition: transform .22s ease, background .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.cloud-sync[open] > summary::after,
.collapsible-panel[open] > summary::after,
.syllabus-root[open] > summary::after,
.all-card[open] > summary::after {
  content: "-";
  transform: translateY(-50%) rotate(180deg);
}

.cloud-sync > summary:hover::after,
.collapsible-panel > summary:hover::after,
.syllabus-root > summary:hover::after,
.all-card > summary:hover::after {
  border-color: rgba(15, 118, 110, .32);
  box-shadow: 0 10px 24px rgba(15, 118, 110, .12);
}

.cloud-summary,
.cloud-chevron {
  display: none;
}

.cloud-title,
.collapsible-panel > summary strong,
.syllabus-root > summary,
.all-card > summary {
  color: var(--ink-strong);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

html[data-theme="dark"] .cloud-sync > summary::after,
html[data-theme="dark"] .collapsible-panel > summary::after,
html[data-theme="dark"] .syllabus-root > summary::after,
html[data-theme="dark"] .all-card > summary::after {
  border-color: rgba(102, 208, 191, .34);
  background: rgba(19, 31, 28, .96) !important;
  color: var(--accent-strong) !important;
  box-shadow: none !important;
}

@media (max-width: 640px) {
  .cloud-sync > summary,
  .collapsible-panel > summary,
  .syllabus-root > summary,
  .all-card > summary {
    min-height: 72px;
    padding: 18px 62px 18px 22px;
  }

  .cloud-sync > summary::after,
  .collapsible-panel > summary::after,
  .syllabus-root > summary::after,
  .all-card > summary::after {
    right: 20px;
    width: 34px;
    height: 34px;
    font-size: 20px;
  }
}

.motion-details {
  transition: height .46s cubic-bezier(.22, 1, .36, 1), box-shadow .24s ease, border-color .24s ease;
  will-change: height;
}

.motion-details[open] > :not(summary) {
  animation: panel-reveal .34s ease both;
}

@keyframes panel-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .motion-details,
  .motion-details[open] > :not(summary),
  .cloud-sync > summary::after,
  .collapsible-panel > summary::after,
  .syllabus-root > summary::after,
  .all-card > summary::after,
  .task.completion-flash,
  .daily-card.date-focus-highlight {
    animation: none !important;
    transition: none !important;
  }
}

.task-grid {
  align-items: start;
}

.task {
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
}

.task label.check-label {
  flex: 1 1 auto;
  align-items: start;
}

.task-copy {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.65;
}

.hours-row {
  margin-top: 12px;
  min-height: 40px;
  align-items: center;
}

.hours-row input[type="number"] {
  align-self: center;
}

@media (min-width: 981px) {
  .task-grid {
    align-items: start;
  }

  .task {
    min-height: 158px;
  }
}

@media (max-width: 640px) {
  .task-copy {
    -webkit-line-clamp: 4;
  }
}

.syllabus-category > summary,
.syllabus-subject > summary {
  display: grid;
  align-items: center;
  column-gap: 18px;
}

.syllabus-category > summary {
  grid-template-columns: minmax(0, 1fr) 124px 38px;
  padding-left: 22px;
  padding-right: 18px;
}

.syllabus-subject > summary {
  grid-template-columns: minmax(0, 1fr) 124px 38px;
  padding-left: 34px;
  padding-right: 18px;
}

.syllabus-category > summary > div,
.syllabus-subject > summary > div {
  min-width: 0;
}

.syllabus-category > summary p,
.syllabus-subject > summary p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  margin: 4px 0 0;
}

.syllabus-category > summary .mini-status,
.syllabus-subject > summary .mini-status {
  justify-self: center;
  min-width: 76px;
  text-align: center;
}

.syllabus-category > summary::after,
.syllabus-subject > summary::after {
  position: static;
  justify-self: end;
  transform: none;
  grid-column: 3;
  grid-row: 1 / span 2;
}

.syllabus-category[open] > summary::after,
.syllabus-subject[open] > summary::after {
  transform: none;
}

.syllabus-category-body {
  padding-left: 20px;
  padding-right: 20px;
}

@media (max-width: 640px) {
  .syllabus-category > summary {
    grid-template-columns: minmax(0, 1fr) 84px 34px;
    column-gap: 10px;
    padding-left: 18px;
    padding-right: 14px;
  }

  .syllabus-subject > summary {
    grid-template-columns: minmax(0, 1fr) 84px 34px;
    column-gap: 10px;
    padding-left: 26px;
    padding-right: 14px;
  }

  .syllabus-category > summary p,
  .syllabus-subject > summary p {
    font-size: 12px;
  }

  .syllabus-category > summary .mini-status,
  .syllabus-subject > summary .mini-status {
    min-width: 64px;
    padding-left: 7px;
    padding-right: 7px;
  }
}

.study-timer-panel {
  position: fixed;
  right: 0;
  top: 50%;
  z-index: 70;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 44px);
  border: 1px solid rgba(8, 19, 22, .12);
  border-right: 0;
  border-radius: 14px 0 0 14px;
  background: rgba(255, 253, 248, .96);
  box-shadow: 0 24px 60px rgba(22, 35, 38, .18);
  transform: translate(100%, -50%);
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  transition: transform .24s ease, opacity .2s ease;
  backdrop-filter: blur(16px);
}

.study-timer-panel.open {
  transform: translate(0, -50%);
  opacity: 1;
  pointer-events: auto;
}

.study-timer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(8, 19, 22, .09);
  background: rgba(248, 246, 239, .78);
}

.study-timer-head strong {
  color: var(--ink-strong);
  font-size: 18px;
}

.study-timer-hide {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(8, 19, 22, .12);
  border-radius: 999px;
  background: rgba(255, 253, 248, .88);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

.study-timer-body {
  display: grid;
  gap: 16px;
  padding: 18px;
  overflow: auto;
  max-height: calc(100vh - 118px);
}

.study-timer-time {
  display: grid;
  place-items: center;
  min-height: 118px;
  border: 1px solid rgba(13, 118, 109, .16);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(13, 118, 109, .08), rgba(189, 143, 46, .08)),
    rgba(255, 253, 248, .9);
  color: var(--ink-strong);
  font-size: 48px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.study-timer-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.study-timer-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.study-timer-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(8, 19, 22, .12);
  border-radius: 8px;
  background: rgba(255, 253, 248, .9);
  color: var(--ink-strong);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.study-timer-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.study-timer-actions button,
.study-history-delete {
  min-height: 38px;
  border: 1px solid rgba(8, 19, 22, .12);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink-strong);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.study-timer-actions .primary {
  border-color: rgba(13, 118, 109, .38);
  background: var(--accent);
  color: #fffdf7;
}

.study-timer-actions button:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.study-history {
  display: grid;
  gap: 8px;
}

.study-history-title {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.study-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  border: 1px solid rgba(8, 19, 22, .1);
  border-radius: 10px;
  background: rgba(255, 253, 248, .74);
  padding: 9px 10px 9px 12px;
}

.study-history-row b {
  display: block;
  color: var(--ink-strong);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.study-history-row span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.study-history-delete {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  color: var(--red);
  line-height: 1;
}

.study-history-empty {
  border: 1px dashed rgba(8, 19, 22, .15);
  border-radius: 10px;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

html[data-theme="dark"] .study-timer-panel {
  border-color: rgba(255, 250, 240, .14);
  background: rgba(27, 40, 37, .98);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .42);
}

html[data-theme="dark"] .study-timer-head {
  border-color: rgba(255, 250, 240, .12);
  background: rgba(38, 51, 48, .88);
}

html[data-theme="dark"] .study-timer-hide,
html[data-theme="dark"] .study-timer-actions button,
html[data-theme="dark"] .study-history-delete,
html[data-theme="dark"] .study-history-row,
html[data-theme="dark"] .study-timer-field select {
  border-color: rgba(255, 250, 240, .15);
  background: rgba(24, 34, 31, .96);
  color: var(--ink-strong);
}

html[data-theme="dark"] .study-timer-actions .primary {
  background: #3bb9a7;
  color: #061312;
}

html[data-theme="dark"] .study-timer-time {
  border-color: rgba(102, 208, 191, .24);
  background:
    linear-gradient(135deg, rgba(102, 208, 191, .12), rgba(241, 207, 126, .09)),
    rgba(24, 34, 31, .96);
  color: var(--ink-strong);
}

html[data-theme="dark"] .study-history-delete {
  color: var(--red);
}

html[data-theme="dark"] .study-history-empty {
  border-color: rgba(255, 250, 240, .16);
  color: var(--muted);
}

@media (max-width: 640px) {
  .study-timer-panel {
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: calc(100vh - 18px);
    border-right: 1px solid rgba(8, 19, 22, .12);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
  }

  .study-timer-panel.open {
    transform: translateY(0);
  }

  .study-timer-body {
    max-height: calc(100vh - 102px);
  }
}
