:root {
  --ink: #15212f;
  --muted: #637084;
  --soft: #8b97a9;
  --line: #dce3ec;
  --line-strong: #c8d3df;
  --page: #f7f9fc;
  --paper: #ffffff;
  --paper-tint: #f2f6fb;
  --primary: #1e6b8f;
  --primary-strong: #164d68;
  --primary-soft: #d8edf6;
  --mint: #2c8f71;
  --mint-soft: #dff3ea;
  --amber: #aa6a13;
  --amber-soft: #fff0d1;
  --red: #b33a3a;
  --red-soft: #fde5e5;
  --blue-soft: #e6f0fb;
  --cat: var(--primary);
  --cat-soft: var(--primary-soft);
  --cat-ink: var(--primary-strong);
  --radius: 8px;
  --shadow: 0 18px 48px rgba(30, 65, 92, 0.12);
  font-family: "Segoe UI", "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(239, 247, 252, 0.95), rgba(247, 249, 252, 0.98) 34rem),
    url("assets/star-map.png");
  background-attachment: fixed;
  background-size: cover;
  color: var(--ink);
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  touch-action: manipulation;
}

a {
  color: var(--primary-strong);
}

:focus-visible {
  outline: 3px solid rgba(30, 107, 143, 0.45);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: white;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid rgba(199, 211, 224, 0.9);
  background: rgba(248, 251, 253, 0.92);
  backdrop-filter: blur(18px);
}

.topbar__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
  width: min(1440px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0;
}

.brand-block h1,
.summary-panel h2,
.panel-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand-block h1 {
  font-size: clamp(1.65rem, 4vw, 2.75rem);
  line-height: 1.06;
}

.kicker,
.section-eyebrow {
  margin: 0 0 0.25rem;
  color: var(--primary-strong);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.version-note {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
  align-items: center;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(4.8rem, 1fr));
  min-height: 44px;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(34, 65, 92, 0.07);
}

.segment {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.segment.is-active {
  background: var(--primary);
  color: white;
}

.switch,
.filter-toggle {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.switch input,
.filter-toggle input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--primary);
}

.switch__track {
  position: relative;
  width: 2.8rem;
  height: 1.55rem;
  border-radius: 999px;
  background: var(--line-strong);
  box-shadow: inset 0 0 0 1px rgba(21, 33, 47, 0.08);
}

.switch__track::after {
  position: absolute;
  top: 0.2rem;
  left: 0.2rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  background: white;
  box-shadow: 0 4px 12px rgba(21, 33, 47, 0.2);
  content: "";
  transition: transform 180ms ease, background 180ms ease;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch input:checked + .switch__track {
  background: var(--primary);
}

.switch input:checked + .switch__track::after {
  transform: translateX(1.25rem);
}

.app-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  width: min(1520px, calc(100% - 2rem));
  margin: 1.25rem auto 3rem;
}

.shell {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.summary-panel,
.task-panel,
.side-panel,
.sidebar,
.overview-panel,
.daily-page {
  border: 1px solid rgba(203, 214, 226, 0.88);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 6.5rem;
  max-height: calc(100dvh - 8rem);
  overflow: auto;
  padding: 1rem;
}

.sidebar__head {
  margin-bottom: 0.9rem;
}

.sidebar__head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.side-nav {
  display: grid;
  gap: 1rem;
}

.side-nav__section {
  display: grid;
  gap: 0.45rem;
}

.side-nav__section p {
  margin: 0;
  color: var(--soft);
  font-size: 0.76rem;
  font-weight: 900;
}

.side-nav__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  min-height: 54px;
  width: 100%;
  padding: 0.55rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.side-nav__item:hover,
.side-nav__item.is-active {
  border-color: color-mix(in srgb, var(--cat, var(--primary)) 28%, var(--line));
  background: color-mix(in srgb, var(--cat-soft, var(--primary-soft)) 66%, white);
}

.side-nav__text {
  display: grid;
  min-width: 0;
}

.side-nav__text strong,
.side-nav__text small {
  overflow-wrap: anywhere;
}

.side-nav__text small {
  color: var(--muted);
  font-size: 0.76rem;
}

.side-nav__count {
  min-width: 2.1rem;
  color: var(--cat-ink, var(--primary-strong));
  font-size: 0.8rem;
  font-weight: 900;
  text-align: right;
}

.custom-builder {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f7fbfd);
}

.custom-builder summary {
  min-height: 32px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.custom-builder__form {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.custom-builder__form label {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.custom-builder__form input,
.custom-builder__form select {
  width: 100%;
  min-height: 44px;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
}

.custom-builder__form input[type="file"] {
  padding: 0.55rem;
  font-size: 0.8rem;
}

.custom-builder__form .button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.image-check {
  margin: 0;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-tint);
  color: var(--muted);
  font-size: 0.78rem;
}

.image-check.is-ok {
  border-color: color-mix(in srgb, var(--mint) 34%, var(--line));
  background: var(--mint-soft);
  color: #17604a;
}

.image-check.is-error {
  border-color: color-mix(in srgb, var(--red) 28%, var(--line));
  background: var(--red-soft);
  color: var(--red);
}

.view-root {
  margin-top: 1rem;
  scroll-margin-top: 8rem;
}

.summary-panel {
  padding: 1.25rem;
}

.summary-panel__head,
.panel-heading,
.action-row,
.calendar-section__head,
.task-title-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

.range-pill,
.subtle-count {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-tint);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.stat-card {
  min-height: 124px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f7fbfd);
}

.stat-card p,
.stat-card span {
  margin: 0;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin: 0.25rem 0;
  color: var(--ink);
  font-size: clamp(1.3rem, 2.8vw, 2rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-card span {
  font-size: 0.86rem;
}

.action-row {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.file-actions,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.button {
  min-height: 44px;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 18px rgba(30, 107, 143, 0.18);
}

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

.button--danger {
  border-color: var(--red-soft);
  background: var(--red-soft);
  color: var(--red);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.38fr);
  gap: 1rem;
  align-items: start;
  margin-top: 1rem;
}

.task-panel,
.side-panel {
  padding: 1rem;
}

.overview-panel,
.daily-page {
  padding: 1rem;
}

.side-panel {
  position: sticky;
  top: 7.5rem;
}

.panel-heading {
  margin-bottom: 1rem;
}

.task-list {
  display: grid;
  gap: 1rem;
  justify-items: start;
  outline: none;
}

.task-group {
  display: grid;
  gap: 0.65rem;
}

.group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.15rem;
}

.group-title h3 {
  margin: 0;
  font-size: 1rem;
}

.task-card {
  --cat: var(--primary);
  --cat-soft: var(--primary-soft);
  --cat-ink: var(--primary-strong);
  --task-aspect: 2.6667;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 860px) 270px;
  gap: 0;
  width: min(100%, 1130px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  overflow: hidden;
}

.task-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--cat);
  content: "";
}

.overview-card__head {
  display: flex;
  min-width: 0;
  gap: 0.7rem;
  align-items: flex-start;
}

.category-mark,
.side-nav__mark {
  display: inline-grid;
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--cat) 34%, white);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--cat-soft) 74%, white);
  color: var(--cat-ink);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0;
}

.task-card--daily,
.side-nav__item--daily,
.overview-card--daily,
.category-view--daily {
  --cat: #26855f;
  --cat-soft: #e4f5ec;
  --cat-ink: #175f45;
}

.side-nav__item--favorite,
.overview-card--favorite,
.category-view--favorite {
  --cat: #a15a12;
  --cat-soft: #fff2dc;
  --cat-ink: #7a3f0a;
}

.task-card--exchange,
.side-nav__item--exchange,
.overview-card--exchange,
.category-view--exchange {
  --cat: #bd751b;
  --cat-soft: #fff0d7;
  --cat-ink: #85520e;
}

.task-card--story,
.side-nav__item--story,
.overview-card--story,
.category-view--story {
  --cat: #6f5ab8;
  --cat-soft: #f0ecff;
  --cat-ink: #51408f;
}

.task-card--map,
.side-nav__item--map,
.overview-card--map,
.category-view--map {
  --cat: #2a7f9b;
  --cat-soft: #e4f3f8;
  --cat-ink: #1a5b70;
}

.task-card--event,
.side-nav__item--event,
.overview-card--event,
.category-view--event {
  --cat: #c04d6b;
  --cat-soft: #fde8ef;
  --cat-ink: #8c2f49;
}

.task-card--challenge,
.side-nav__item--challenge,
.overview-card--challenge,
.category-view--challenge {
  --cat: #3f6db3;
  --cat-soft: #e7effc;
  --cat-ink: #2b518a;
}

.status-chip,
.reward-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin: 0.15rem 0.25rem 0.15rem 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-chip--done {
  background: var(--mint-soft);
  color: #17604a;
}

.status-chip--partial {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-chip--empty {
  background: var(--paper-tint);
  color: var(--muted);
}

.status-chip--over {
  background: var(--blue-soft);
  color: var(--primary-strong);
}

.reward-chip--astrite {
  background: #e8f2f8;
  color: #18516d;
}

.reward-chip--limited {
  background: #fff1d8;
  color: #85520e;
}

.reward-chip--standard {
  background: #e8f5ed;
  color: #1d654f;
}

.reward-chip--weapon {
  background: #f0ecff;
  color: #554199;
}

.reward-chip--empty {
  background: var(--paper-tint);
  color: var(--soft);
}

.progress-track {
  height: 8px;
  margin-top: 0.8rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--paper-tint);
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--mint));
  transition: width 180ms ease;
}

.task-card__media {
  display: grid;
  width: 100%;
  min-height: 0;
  aspect-ratio: var(--task-aspect);
  place-items: center;
  background: #111827;
  overflow: hidden;
}

.task-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111827;
}

.task-card__placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  gap: 0.4rem;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--cat-soft) 70%, white), white),
    var(--paper);
  color: var(--cat-ink);
  text-align: center;
}

.task-card__placeholder span {
  display: inline-grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--cat) 28%, var(--line));
  border-radius: var(--radius);
  background: white;
  font-weight: 950;
}

.task-card__placeholder strong {
  font-size: 0.95rem;
}

.task-record {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding: 0.72rem 0.78rem;
  border-left: 1px solid var(--record-border, var(--line));
  background: var(--record-bg, linear-gradient(180deg, color-mix(in srgb, var(--cat-soft) 52%, white), white 68%));
}

.task-record--empty {
  --record-bg: linear-gradient(180deg, #f4f7fb, #ffffff 72%);
  --record-border: #cdd8e5;
}

.task-record--partial {
  --record-bg: linear-gradient(180deg, #fff3d8, #ffffff 72%);
  --record-border: #d89b2d;
}

.task-record--complete {
  --record-bg: linear-gradient(180deg, #e4f5ec, #ffffff 72%);
  --record-border: #3e9f75;
}

.record-attrs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.record-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0.16rem 0.46rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.record-pill--type {
  background: color-mix(in srgb, var(--cat-soft) 74%, white);
  color: var(--cat-ink);
}

.favorite-toggle {
  display: inline-grid;
  min-width: 28px;
  min-height: 24px;
  place-items: center;
  margin-left: auto;
  border: 1px solid color-mix(in srgb, #a15a12 22%, var(--line));
  border-radius: 999px;
  background: white;
  color: #9a6a28;
  cursor: pointer;
  font-weight: 950;
}

.favorite-toggle.is-active {
  border-color: #c98925;
  background: #fff2dc;
  color: #7a3f0a;
}

.task-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  justify-content: space-between;
  margin: -0.15rem 0 1rem;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fbfd;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filter-group--categories {
  flex: 1 1 100%;
}

.filter-chip {
  min-height: 36px;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-weight: 850;
}

.filter-chip.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.filter-reset {
  min-height: 36px;
  padding: 0.4rem 0.75rem;
}

.record-field,
.confirm-field {
  display: grid;
  gap: 0.18rem;
  color: var(--muted);
  font-weight: 800;
}

.record-field span {
  font-size: 0.72rem;
}

.record-field input {
  width: 100%;
  min-height: 34px;
  padding: 0.32rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fbfdff;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.record-field input[readonly] {
  background: var(--paper-tint);
  color: var(--muted);
}

.confirm-field {
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 34px;
  padding: 0.36rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.confirm-field input {
  width: 0.9rem;
  height: 0.9rem;
  accent-color: var(--primary);
}

.task-record .button {
  min-height: 38px;
  padding: 0.42rem 0.65rem;
  font-size: 0.82rem;
}

.calendar-panel {
  display: grid;
  gap: 1rem;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.overview-card {
  --cat: var(--primary);
  --cat-soft: var(--primary-soft);
  --cat-ink: var(--primary-strong);
  display: grid;
  gap: 0.85rem;
  min-height: 238px;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--cat) 22%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--cat-soft) 58%, white), white 62%),
    var(--paper);
}

.overview-card.is-empty {
  opacity: 0.72;
}

.overview-card__head h3,
.overview-card__head p,
.daily-hero h2,
.daily-hero p {
  margin: 0;
}

.overview-card__head h3 {
  font-size: 1.18rem;
}

.overview-card__head p,
.daily-hero p {
  color: var(--muted);
}

.overview-card__numbers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.overview-card__numbers div {
  min-height: 74px;
  padding: 0.65rem;
  border: 1px solid color-mix(in srgb, var(--cat) 16%, var(--line));
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.overview-card__numbers span,
.overview-card__note {
  color: var(--muted);
  font-size: 0.8rem;
}

.overview-card__numbers strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--cat-ink);
  font-size: 1.18rem;
  font-variant-numeric: tabular-nums;
}

.overview-card__rewards {
  min-height: 34px;
}

.overview-card__note {
  margin: 0;
}

.daily-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary-soft) 54%, white), white 70%);
}

.daily-hero__stats {
  display: grid;
  min-width: 14rem;
  min-height: 82px;
  place-items: center;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  text-align: center;
}

.daily-hero__stats strong {
  color: var(--primary-strong);
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.daily-hero__stats span {
  color: var(--muted);
  font-size: 0.9rem;
}

.monthly-calendar-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 18rem);
  gap: 1rem;
  align-items: end;
  margin: -0.15rem 0 1rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, #a15a12 24%, var(--line));
  border-radius: var(--radius);
  background: linear-gradient(90deg, #fff7e8, #ffffff 74%);
}

.monthly-calendar-control h3,
.monthly-calendar-control p {
  margin: 0;
}

.monthly-calendar-control p {
  color: var(--muted);
}

.monthly-calendar-control label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-weight: 850;
}

.monthly-calendar-control input {
  min-height: 44px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
}

.monthly-calendar-control input:disabled {
  background: var(--paper-tint);
  color: var(--soft);
}

.daily-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.62fr);
  gap: 1rem;
  align-items: start;
}

.large-calendar {
  min-width: 0;
}

.calendar-section {
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f8fbfe);
}

.calendar-section__head {
  align-items: center;
  margin-bottom: 0.85rem;
}

.calendar-section__head h3,
.calendar-section__head p {
  margin: 0;
}

.calendar-section__head p {
  color: var(--muted);
  font-size: 0.9rem;
}

.calendar-section__head strong {
  color: var(--primary-strong);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.35rem;
}

.calendar-panel--large .calendar-section {
  padding: 1.15rem;
}

.calendar-panel--large .calendar-grid {
  gap: 0.55rem;
}

.calendar-panel--large .day-button {
  min-height: 68px;
  font-size: 0.95rem;
}

.day-button {
  display: grid;
  place-items: center;
  gap: 0.08rem;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.day-button small {
  color: currentColor;
  font-size: 0.74rem;
  font-weight: 900;
  opacity: 0.72;
}

.day-button.is-monthly:not(.is-checked) {
  border-color: #dfb15c;
  background: #fff8e8;
  color: #8a5a15;
}

.day-button.is-checked {
  border-color: rgba(30, 107, 143, 0.45);
  background: var(--primary);
  color: white;
  box-shadow: 0 8px 18px rgba(30, 107, 143, 0.18);
}

.source-card {
  margin-top: 1rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.source-card summary {
  min-height: 36px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 800;
}

.source-card p {
  margin: 0.65rem 0 0;
  color: var(--muted);
}

.empty-state {
  padding: 2rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-tint);
  text-align: center;
}

.empty-state p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 20;
  max-width: min(22rem, calc(100% - 2rem));
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(0.75rem);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 300px minmax(0, 1fr);
  }

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

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

  .side-panel {
    position: static;
  }

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

  .daily-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
    height: auto;
    overflow: visible;
  }

  .side-nav {
    gap: 0.75rem;
  }

  .side-nav__section {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .side-nav__section p {
    position: sticky;
    left: 0;
    z-index: 1;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    padding-right: 0.5rem;
    background: rgba(255, 255, 255, 0.92);
  }

  .side-nav__item {
    grid-template-columns: auto minmax(8.5rem, 1fr) auto;
    flex: 0 0 min(18rem, 78vw);
  }

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

  .toolbar {
    justify-content: stretch;
  }

  .segmented {
    width: 100%;
  }

  .summary-panel__head,
  .panel-heading,
  .action-row {
    flex-direction: column;
    align-items: stretch;
  }

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

  .task-card {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .task-record {
    border-left: 0;
    border-top: 1px solid var(--record-border, var(--line));
  }

  .task-card__media {
    min-height: auto;
  }

  .daily-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .monthly-calendar-control {
    grid-template-columns: 1fr;
  }

  .daily-hero__stats {
    min-width: 0;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .topbar__inner,
  .app-shell {
    width: min(100% - 1rem, 1440px);
  }

  .shell {
    width: 100%;
  }

  .summary-panel,
  .task-panel,
  .side-panel,
  .sidebar,
  .overview-panel,
  .daily-page {
    padding: 0.85rem;
  }

  .brand-block h1 {
    font-size: 1.75rem;
  }

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

  .file-actions,
  .button-row,
  .task-filterbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .filter-group,
  .filter-group--categories {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .calendar-grid {
    gap: 0.28rem;
  }

  .day-button {
    font-size: 0.74rem;
  }

  .calendar-panel--large .day-button {
    min-height: 54px;
    font-size: 0.82rem;
  }

  .overview-card__numbers {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
/* Fixed replica layout - four-card composition */
:root {
  --replica-scale: 1.25;
}

html {
  overflow-x: auto;
}

body {
  min-width: 2088px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  width: 100%;
  min-width: 2088px;
  height: 130px;
  min-height: 130px;
  max-height: 130px;
  overflow: visible;
  border-bottom: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.topbar__inner {
  display: grid;
  grid-template-columns: 760px 560px;
  gap: 100px;
  align-items: start;
  width: 1393px;
  min-width: 1393px;
  max-width: 1393px;
  height: 104px;
  margin: 0 0 0 190px;
  padding: 24px 0 0;
  zoom: var(--replica-scale);
}

.brand-block,
.toolbar {
  min-width: 0;
}

.brand-block h1 {
  max-width: none;
  white-space: nowrap;
  font-size: 44px;
  line-height: 1.05;
}

.kicker,
.version-note {
  white-space: nowrap;
}

.toolbar {
  flex-wrap: nowrap;
  justify-content: flex-end;
  padding-top: 9px;
}

.segmented {
  grid-template-columns: repeat(3, 76px);
  min-width: 236px;
}

.switch {
  flex: 0 0 auto;
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: 286px 1292px;
  gap: 12px;
  align-items: start;
  width: 1590px;
  min-width: 1590px;
  max-width: 1590px;
  margin: 36.8px 0 3rem 30.4px;
  zoom: var(--replica-scale);
}

.sidebar {
  position: sticky;
  top: 0;
  width: 286px;
  min-width: 286px;
  max-width: 286px;
  height: 747px;
  min-height: 747px;
  max-height: 747px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px 14px;
}

.sidebar__head {
  margin-bottom: 0.55rem;
}

.sidebar__head h2 {
  font-size: 1rem;
}

.side-nav {
  gap: 0.56rem;
}

.side-nav__section {
  gap: 0.26rem;
}

.side-nav__section p {
  font-size: 0.66rem;
}

.side-nav__item {
  min-height: 43px;
  gap: 0.48rem;
  padding: 0.38rem 0.5rem;
}

.side-nav__text strong {
  font-size: 0.86rem;
  line-height: 1.1;
}

.side-nav__text small {
  font-size: 0.66rem;
  line-height: 1.25;
}

.side-nav__count {
  min-width: 1.55rem;
  font-size: 0.72rem;
}

.custom-builder {
  padding: 0.52rem;
}

.custom-builder summary {
  min-height: 28px;
}

.shell {
  width: 1292px;
  min-width: 1292px;
  max-width: 1292px;
}

.summary-panel {
  width: 1188px;
  min-width: 1188px;
  max-width: 1188px;
  height: 222px;
  min-height: 222px;
  max-height: 222px;
  overflow: hidden;
  padding: 16px 20px 12px;
}

.summary-panel__head {
  min-height: 36px;
  align-items: flex-start;
}

.summary-panel h2 {
  font-size: 24px;
  line-height: 1.1;
}

.summary-panel .section-eyebrow {
  font-size: 10px;
  line-height: 1;
  margin-bottom: 4px;
}

.range-pill {
  min-height: 26px;
  padding: 0 12px;
}

.stat-grid {
  grid-template-columns: repeat(6, 166px);
  gap: 12px;
  margin-top: 10px;
}

.stat-card {
  width: 166px;
  min-width: 166px;
  max-width: 166px;
  height: 90px;
  min-height: 90px;
  max-height: 90px;
  padding: 10px 12px;
  overflow: hidden;
}

.stat-card strong {
  font-size: 24px;
  line-height: 1.05;
}

.stat-card span,
.stat-card small {
  line-height: 1.18;
}

.action-row {
  margin-top: 7px;
  padding-top: 6px;
  min-height: 30px;
}

.summary-panel .button {
  height: 28px;
  min-height: 28px;
  padding: 0.2rem 0.68rem;
}

.view-root {
  width: 1292px;
  min-width: 1292px;
  max-width: 1292px;
  margin-top: 10px;
}

.workspace {
  display: grid;
  grid-template-columns: 818px 464px;
  gap: 8px;
  align-items: start;
  width: 1290px;
  min-width: 1290px;
  max-width: 1290px;
  margin-top: 0;
}

.workspace > .task-panel {
  width: 818px;
  min-width: 818px;
  max-width: 818px;
  min-height: 530px;
  padding: 12px;
}

.workspace > .side-panel {
  position: static;
  width: 464px;
  min-width: 464px;
  max-width: 464px;
  height: 513px;
  min-height: 513px;
  max-height: 513px;
  overflow: hidden;
  padding: 12px;
}

.workspace .task-panel .panel-heading,
.workspace .side-panel .panel-heading {
  min-height: 38px;
  height: 38px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.workspace .task-panel .panel-heading h2,
.workspace .side-panel .panel-heading h2 {
  font-size: 24px;
  line-height: 1.05;
}

.workspace .task-panel .section-eyebrow,
.workspace .side-panel .section-eyebrow {
  font-size: 10px;
  line-height: 1;
  margin-bottom: 4px;
}

.workspace .subtle-count {
  min-height: 28px;
  padding: 0 10px;
}

.task-filterbar {
  min-height: 30px;
  height: 30px;
  margin-bottom: 8px;
  padding: 0 8px;
  gap: 8px;
  overflow: hidden;
  align-items: center;
}

.filter-group,
.filter-group--categories {
  gap: 6px;
}

.filter-chip {
  min-height: 24px;
  padding: 0 10px;
  font-size: 13px;
  line-height: 1;
}

.filter-reset {
  min-height: 26px;
  height: 26px;
  padding: 0 10px;
}

.workspace .task-list {
  width: 794px;
  min-width: 794px;
  max-width: 794px;
  gap: 16px;
}

.workspace .task-card {
  width: 794px;
  min-width: 794px;
  max-width: 794px;
  height: 329px;
  min-height: 329px;
  max-height: 329px;
  grid-template-columns: 525px 269px;
}

.workspace .task-card__media {
  width: 525px;
  min-width: 525px;
  max-width: 525px;
  height: 329px;
  min-height: 329px;
  max-height: 329px;
  aspect-ratio: auto;
}

.workspace .task-record {
  width: 269px;
  min-width: 269px;
  max-width: 269px;
  height: 329px;
  min-height: 329px;
  max-height: 329px;
  overflow: hidden;
  padding: 12px;
  gap: 7px;
}

.workspace .task-record__meta {
  gap: 6px;
}

.workspace .record-field {
  gap: 3px;
}

.workspace .record-field label,
.workspace .confirm-field {
  font-size: 12px;
}

.workspace .record-field input {
  min-height: 32px;
  height: 32px;
  padding: 0 9px;
}

.workspace .task-record .button,
.workspace .confirm-field {
  min-height: 32px;
  height: 32px;
}

.workspace .task-record .favorite-button {
  width: 28px;
  height: 28px;
}

.workspace .calendar-panel {
  gap: 10px;
}

.workspace .calendar-section {
  width: 440px;
  min-width: 440px;
  max-width: 440px;
  padding: 10px;
}

.workspace .calendar-section__head {
  margin-bottom: 8px;
}

.workspace .calendar-section__head h3 {
  font-size: 20px;
  line-height: 1.1;
}

.workspace .calendar-grid {
  grid-template-columns: repeat(7, 49px);
  gap: 6px;
}

.workspace .day-button {
  width: 49px;
  min-width: 49px;
  max-width: 49px;
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  aspect-ratio: auto;
  font-size: 12px;
}

.workspace .day-button small {
  font-size: 10px;
}

.workspace .source-card {
  margin-top: 10px;
}

.workspace .source-card summary {
  min-height: 36px;
}

@media (max-width: 1180px) {
  body,
  .topbar {
    min-width: 2088px;
  }

  .topbar__inner {
    width: 1393px;
  }

  .app-shell {
    grid-template-columns: 286px 1292px;
    width: 1590px;
  }

  .workspace {
    grid-template-columns: 818px 464px;
  }
}

@media (max-width: 820px) {
  body,
  .topbar {
    min-width: 2088px;
  }

  .topbar__inner {
    width: 1393px;
  }

  .app-shell {
    grid-template-columns: 286px 1292px;
    width: 1590px;
  }

  .sidebar {
    position: sticky;
    min-height: 747px;
    height: 747px;
  }

  .side-nav__section {
    display: grid;
    overflow: visible;
  }

  .side-nav__section p {
    position: static;
    display: block;
    background: transparent;
  }

  .side-nav__item {
    grid-template-columns: auto minmax(0, 1fr) auto;
    flex: initial;
  }

  .workspace .task-card {
    grid-template-columns: 525px 269px;
  }

  .workspace .task-record {
    border-left: 1px solid var(--record-border, var(--line));
    border-top: 0;
  }
}

@media (max-width: 560px) {
  .topbar__inner {
    width: 1393px;
  }

  .app-shell {
    width: 1590px;
  }

  .summary-panel,
  .workspace > .task-panel,
  .workspace > .side-panel,
  .sidebar {
    padding: revert;
  }

  .sidebar {
    padding: 16px 16px 14px;
  }

  .summary-panel {
    padding: 16px 20px 12px;
  }

  .workspace > .task-panel,
  .workspace > .side-panel {
    padding: 12px;
  }

  .stat-grid,
  .filter-group,
  .filter-group--categories {
    display: grid;
  }
}
