:root {
  --paper: #ffffff;
  --mist: #f7f7f5;
  --wash: #ececea;
  --line: #eaeae7;
  --line-dark: #d8d8d4;
  --gray: #8c8c88;
  --gray-2: #b4b4b0;
  --ink: #151514;
  --ok: #55735d;
  --warn: #996d2f;
  --danger: #a84d4d;
  --radius: 18px;
  --num: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #181817;
    --mist: #222220;
    --card: #1f1f1d;
    --line: #33332f;
    --line-dark: #4a4a45;
    --ink: #f2f0eb;
    --gray: #aaa69d;
    --muted: #8e8a82;
  }

  body {
    background: #0f0f0e;
  }

  .phone,
  .app-view,
  .auth-view {
    background: var(--paper);
  }

  svg path {
    stroke: currentColor;
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family: var(--sans);
  letter-spacing: 0;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.hidden {
  display: none !important;
}

.phone {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  background: var(--paper);
  position: relative;
  overflow: hidden;
}

@media (min-width: 480px) {
  body {
    padding: 24px 0;
  }

  .phone {
    min-height: calc(100vh - 48px);
    max-height: 900px;
    border: 1px solid var(--line);
    border-radius: 40px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .14);
  }
}

.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  padding: 16px 26px 4px;
  font-family: var(--num);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .04em;
}

.status-icons {
  display: flex;
  gap: 5px;
  align-items: center;
}

.status-icons i {
  display: block;
  width: 12px;
  height: 7px;
  border-radius: 999px;
  background: var(--ink);
}

.auth-view {
  min-height: calc(100vh - 38px);
  padding: 34px 26px 28px;
  display: grid;
  align-content: center;
  gap: 24px;
}

.auth-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--paper);
}

.auth-card label {
  display: grid;
  gap: 8px;
  color: var(--gray);
  font-size: 12px;
}

input,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  outline: none;
  padding: 12px 13px;
}

input:focus,
textarea:focus {
  border-color: var(--ink);
}

input::placeholder,
textarea::placeholder {
  color: rgba(43, 38, 33, 0.36);
}

.app-view {
  height: calc(100vh - 38px);
  min-height: 640px;
  display: flex;
  flex-direction: column;
}

@media (min-width: 480px) {
  .app-view {
    height: calc(100vh - 86px);
    max-height: 852px;
  }
}

.pages {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.running-bar {
  position: sticky;
  top: 8px;
  z-index: 30;
  width: calc(100% - 24px);
  margin: 0 12px 10px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .08);
}

.running-bar.hidden {
  display: none;
}

.page {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  padding: 10px 26px 112px;
  scrollbar-width: none;
}

.page::-webkit-scrollbar,
.detail-body::-webkit-scrollbar {
  display: none;
}

.page.active {
  display: block;
  animation: fade .24s ease;
}

.page.active:has(#workshop-pane-today:not(.hidden)) {
  overflow-y: hidden;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page.active {
    animation: none;
  }

  * {
    transition: none !important;
  }
}

.page-head {
  padding: 22px 0 20px;
}

.page-head.compact {
  padding-top: 8px;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--gray);
  font-family: var(--num);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
}

.sub {
  margin: 8px 0 0;
  color: var(--gray);
  font-size: 13px;
  line-height: 1.6;
}

.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 26px 0 14px;
}

.section-label b {
  font-size: 14px;
  font-weight: 600;
}

.section-label span {
  color: var(--gray);
  font-size: 12px;
}

.today-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--mist);
}

.today-cell {
  min-width: 0;
  padding: 16px 14px;
  border-right: 1px solid var(--line);
}

.today-cell:last-child {
  border-right: 0;
}

.today-cell .n {
  font-family: var(--num);
  font-size: 24px;
  font-weight: 300;
}

.today-cell small {
  margin-left: 2px;
  color: var(--gray);
  font-size: 12px;
}

.today-cell .l {
  margin-top: 4px;
  color: var(--gray);
  font-size: 11px;
}

.stack-list {
  display: grid;
  gap: 14px;
}

.ws-card,
.sop-card,
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--paper);
}

.ws-card {
  transition: border-color .2s, transform .15s;
}

.ws-card:active {
  transform: scale(.985);
}

.ws-card:hover {
  border-color: var(--line-dark);
}

.ws-top,
.sop-head,
.station-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.ws-name,
.sop-name {
  font-size: 17px;
  font-weight: 600;
}

.ws-meta,
.sop-scene {
  margin-top: 5px;
  color: var(--gray);
  font-size: 12px;
  line-height: 1.45;
}

.ws-time,
.sop-dur,
.next-row .du,
.todo-when {
  color: var(--gray);
  font-family: var(--num);
  font-size: 12px;
  white-space: nowrap;
}

.chain {
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-top: 16px;
}

.chain-node {
  flex: none;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 7px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: var(--paper);
  font-size: 12px;
}

.chain-node.done {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.chain-link {
  flex: none;
  width: 14px;
  height: 1px;
  background: var(--line-dark);
}

.ws-foot,
.sop-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.btn-start,
.btn-solid,
.btn-big {
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 500;
}

.btn-start {
  padding: 9px 20px;
  font-size: 13px;
}

.btn-solid,
.btn-ghost {
  flex: 1;
  min-height: 38px;
  padding: 9px 14px;
  font-size: 13px;
}

.btn-big {
  width: 100%;
  min-height: 52px;
  padding: 15px 20px;
  font-size: 15px;
}

.btn-ghost {
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
}

.btn-ghost.wide {
  width: 100%;
  flex: none;
}

.btn-solid.danger {
  background: var(--danger);
}

.sync-badge {
  border: 1px solid var(--warn);
  border-radius: 999px;
  background: transparent;
  color: var(--warn);
  font-size: 10px;
  line-height: 1;
  padding: 3px 8px;
  margin-left: 6px;
  vertical-align: middle;
}

.chip.unsynced::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--warn);
}

.confirm-text {
  margin: 0;
  color: var(--gray);
  font-size: 13px;
  line-height: 1.6;
}

.ws-new {
  width: 100%;
  margin-top: 14px;
  padding: 18px;
  border: 1px dashed var(--line-dark);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--gray);
  font-size: 13px;
  text-align: center;
}

.sop-dur {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

.sop-steps {
  margin-top: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--line-dark);
}

.sop-step {
  position: relative;
  padding: 5px 0;
  color: #3c3c3a;
  font-size: 13px;
  line-height: 1.5;
}

.sop-step::before {
  content: "";
  position: absolute;
  left: -19.5px;
  top: 13px;
  width: 6px;
  height: 6px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.sop-step:first-child::before {
  background: var(--ink);
}

.sop-step em {
  margin-left: 8px;
  color: var(--gray-2);
  font-family: var(--num);
  font-size: 11px;
  font-style: normal;
}

.gen-box {
  margin-bottom: 26px;
  padding: 18px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--mist);
}

.gen-box label {
  display: block;
  margin-bottom: 10px;
  color: var(--gray);
  font-size: 12px;
}

.gen-row,
.todo-input {
  display: flex;
  gap: 10px;
  align-items: center;
}

.gen-row input,
.todo-input input {
  flex: 1;
  border: 0;
  border-bottom: 1px solid var(--line-dark);
  border-radius: 0;
  background: transparent;
}

.gen-row button,
.todo-input button {
  flex: none;
  width: 44px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  font-size: 17px;
}

.form-note {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--gray);
  font-size: 12px;
  line-height: 1.45;
}

.form-note.error {
  color: var(--danger);
}

.form-note.ok {
  color: var(--ok);
}

.proj-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  width: 100%;
  margin-top: 28px;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.proj-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 16px;
  font-size: 13px;
  white-space: nowrap;
}

.chip.on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.chip.add {
  border-style: dashed;
  color: var(--gray);
}

.proj-input {
  display: none;
  gap: 8px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--mist);
}

.proj-input.open {
  display: flex;
}

.proj-input input {
  min-width: 0;
  flex: 1;
  border-color: var(--line);
  background: var(--paper);
}

.proj-input .mins {
  flex: none;
  width: 72px;
}

.proj-input button {
  flex: none;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
  padding: 0 14px;
}

.timer-pane {
  display: none;
}

.timer-pane.on {
  display: block;
}

.timer-mode {
  margin-top: 14px;
}

.timer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 28px;
}

.timer-scene {
  margin-bottom: 14px;
  text-align: center;
}

.timer-task {
  font-size: 22px;
  text-align: center;
}

.timer-ring {
  position: relative;
  width: 264px;
  height: 264px;
  margin: 52px 0 40px;
}

.timer-ring svg {
  transform: rotate(-90deg);
}

.timer-digits {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.timer-digits .t {
  font-family: var(--num);
  font-size: 56px;
  font-weight: 200;
  font-variant-numeric: tabular-nums;
}

.timer-digits .s {
  margin-top: 6px;
  color: var(--gray);
  font-size: 12px;
}

.timer-ctrl {
  display: flex;
  gap: 12px;
  align-items: center;
}

.quick-start-btn {
  width: 100%;
  margin-top: 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  padding: 12px;
  font-weight: 600;
}

.tc-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-size: 0;
}

.tc-btn.main {
  width: 58px;
  height: 58px;
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.tc-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tc-btn.main svg {
  width: 20px;
  height: 20px;
}

.tc-btn .icon-play {
  fill: currentColor;
  stroke: none;
}

.timer-next {
  width: 100%;
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.next-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  font-size: 13px;
}

.next-row .no {
  width: 28px;
  color: var(--gray-2);
  font-family: var(--num);
}

.next-row .nm {
  flex: 1;
  color: #3c3c3a;
}

.next-row.cur .nm,
.next-row.cur .no {
  color: var(--ink);
  font-weight: 600;
}

.stat-card {
  margin-bottom: 14px;
}

.stat-tabs {
  display: flex;
  gap: 12px;
  margin: 8px 0 24px;
}

.stat-tab {
  min-width: 72px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: var(--paper);
  color: #3c3c3a;
  padding: 9px 18px;
  font-size: 14px;
}

.stat-tab.on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.stat-card > .t {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
}

.stat-card > .t span {
  color: var(--gray);
  font-size: 11px;
  font-weight: 400;
}

.pie-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-items: center;
  gap: 22px;
  padding-top: 8px;
}

.pie-chart {
  width: min(72vw, 292px);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
}

.pie-legend {
  width: 100%;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.legend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  padding: 0 14px;
  color: #3c3c3a;
  font-size: 14px;
}

.legend-row i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-row b {
  font-family: var(--num);
  font-weight: 500;
}

.project-legend-row {
  grid-template-columns: minmax(88px, auto) minmax(0, 1fr) 58px;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: #626260;
  font-size: 17px;
}

.project-legend-row b {
  justify-self: start;
  color: #5b5b59;
  font-size: 18px;
}

.project-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  max-width: 118px;
  min-height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pie-percent {
  color: var(--gray);
  font-family: var(--num);
  font-size: 12px;
  font-style: normal;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  gap: 12px;
  align-items: center;
  padding: 7px 0;
  font-size: 13px;
}

.bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--mist);
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--ink);
}

.heat-grid {
  display: grid;
  grid-template-rows: repeat(7, 12px);
  grid-auto-flow: column;
  grid-auto-columns: 12px;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.heat-cell {
  border-radius: 3px;
  background: var(--mist);
}

.heat-cell.h1 {
  background: #e2e2df;
}

.heat-cell.h2 {
  background: #bdbdb9;
}

.heat-cell.h3 {
  background: #6e6e6a;
}

.heat-cell.h4 {
  background: var(--ink);
}

.cal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--gray);
  font-size: 12px;
}

.cal-head b {
  color: var(--ink);
  font-size: 15px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-grid em {
  color: var(--gray-2);
  font-size: 11px;
  font-style: normal;
  text-align: center;
}

.cal-cell {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--num);
  font-size: 12px;
}

.cal-cell.muted {
  background: transparent;
}

.cal-cell.h1 {
  background: #e2e2df;
}

.cal-cell.h2 {
  background: #bdbdb9;
}

.cal-cell.h3 {
  background: #6e6e6a;
  color: var(--paper);
}

.cal-cell.h4 {
  background: var(--ink);
  color: var(--paper);
}

.range-strip,
.stat-range-bar,
.calendar-view-bar,
.heatmap-view-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-range-bar,
.calendar-view-bar,
.heatmap-view-bar {
  justify-content: space-between;
  margin: -10px 0 12px;
}

.range-chip {
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: var(--paper);
  color: var(--gray);
  padding: 7px 11px;
  font-size: 12px;
}

.range-chip.active,
.range-chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.range-nav {
  display: inline-flex;
  gap: 6px;
}

.range-nav button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--mist);
  color: var(--ink);
}

.range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: -4px 0 14px;
}

.range-inputs input,
.project-dialog input,
.project-dialog textarea,
.editor-form input,
.editor-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--mist);
  padding: 11px 12px;
  color: var(--ink);
}

.input-hint {
  margin: 6px 0 10px;
  color: var(--gray);
  font-size: 11px;
  line-height: 1.55;
}

.stat-pie {
  position: relative;
}

.pie-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.pie-track,
.pie-segment {
  fill: none;
  stroke-width: 16;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.pie-track {
  stroke: #dededb;
}

.pie-segment {
  stroke-linecap: butt;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.75));
}

.pie-segment-label {
  fill: #fff;
  font-family: var(--num);
  font-size: 6px;
  font-weight: 500;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.1);
  stroke-width: 0.8px;
}

.calendar-week-label {
  white-space: nowrap;
}

.calendar-week-date {
  display: block;
}

.pie-inner {
  position: absolute;
  inset: clamp(58px, 18vw, 86px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--num);
  font-size: 15px;
  box-shadow: 0 0 0 1px rgba(214, 214, 210, 0.8), 0 0 0 8px rgba(255, 255, 255, 0.38);
}

.pie-inner span {
  color: var(--gray);
  font-family: var(--sans);
  font-size: 10px;
}

.pie-inner b {
  font-weight: 600;
}

.compact-calendar {
  --calendar-hour-height: 52px;
}

.calendar-day-view {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.calendar-time-axis {
  display: grid;
  grid-template-rows: repeat(25, var(--calendar-hour-height));
  color: var(--gray-2);
  font-size: 10px;
}

.calendar-day-grid,
.calendar-week-column {
  position: relative;
  min-height: calc(var(--calendar-hour-height) * 24);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--mist);
  overflow: hidden;
}

.calendar-hour-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
}

.calendar-time-block {
  position: absolute;
  left: 8px;
  right: 8px;
  min-height: 28px;
  border-radius: 8px;
  padding: 5px 7px;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}

.calendar-time-block.level-2 { background: #4a4a47; }
.calendar-time-block.level-3 { background: #74746f; }
.calendar-time-block.level-4 { background: #a4a49f; color: var(--ink); }

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

.calendar-time-block.compact strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.calendar-time-block strong { font-size: 11px; }
.calendar-time-block span { font-size: 10px; opacity: .8; }

.calendar-empty-note {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  color: var(--gray);
  white-space: nowrap;
}

.calendar-week-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.calendar-week-view {
  min-width: calc(32px + 7 * 120px + 6 * 4px);
}

.calendar-week-head,
.calendar-week-body {
  display: grid;
  grid-template-columns: 32px repeat(7, minmax(120px, 120px));
  gap: 4px;
}

.calendar-week-day,
.calendar-month-cell {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
}

.calendar-week-day {
  min-height: 42px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  padding: 5px 1px;
}

.calendar-week-day span {
  display: block;
  max-width: 100%;
  font-size: clamp(7px, 1.8vw, 9px);
  line-height: 1;
  white-space: nowrap;
  writing-mode: horizontal-tb;
}

.calendar-week-label {
  display: block;
  max-width: 100%;
  font-size: clamp(7px, 1.8vw, 9px);
  line-height: 1;
  white-space: nowrap;
  writing-mode: horizontal-tb;
}

.calendar-week-day strong {
  display: block;
  font-family: var(--num);
  font-size: clamp(11px, 3vw, 14px);
  line-height: 1.05;
  font-weight: 500;
}

.calendar-week-date {
  display: block;
  font-family: var(--num);
  font-size: clamp(11px, 3vw, 14px);
  line-height: 1.05;
  font-weight: 500;
}

.calendar-week-day.active,
.calendar-month-cell.active {
  border-color: var(--ink);
}

.calendar-week-axis {
  position: relative;
  min-height: calc(var(--calendar-hour-height) * 24);
  color: var(--gray-2);
  font-size: 10px;
}

.calendar-week-axis span {
  position: absolute;
  right: 3px;
}

.calendar-month-view,
.heatmap-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-month-weekday,
.heatmap-weekday {
  color: var(--gray-2);
  font-size: 10px;
  text-align: center;
}

.calendar-month-cell {
  min-height: 58px;
  padding: 6px;
  text-align: left;
}

.calendar-month-cell.muted,
.heatmap-month-cell.muted,
.heatmap-cell.muted {
  opacity: .28;
}

.calendar-month-date,
.calendar-month-bars {
  display: grid;
  gap: 3px;
  font-size: 11px;
}

.calendar-month-bars span {
  border-radius: 5px;
  padding: 2px 4px;
  background: var(--wash);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heatmap-year-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: 460px;
  overflow: auto;
}

.heatmap-year-month {
  display: grid;
  gap: 5px;
}

.heatmap-year-month > strong {
  font-size: 11px;
  color: var(--gray);
}

.heatmap-year-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.heatmap-cell,
.heatmap-month-cell {
  border: 1px solid var(--line);
  background: var(--mist);
}

.heatmap-cell {
  aspect-ratio: 1;
  border-radius: 3px;
}

.heatmap-month-cell {
  min-height: 42px;
  border-radius: 8px;
  padding: 5px;
  display: grid;
  align-content: space-between;
  font-size: 11px;
}

.heatmap-cell.level-1,
.heatmap-month-cell.level-1 { background: #e2e2df; }
.heatmap-cell.level-2,
.heatmap-month-cell.level-2 { background: #bdbdb9; }
.heatmap-cell.level-3,
.heatmap-month-cell.level-3 { background: #6e6e6a; }
.heatmap-cell.level-4,
.heatmap-month-cell.level-4 { background: var(--ink); color: var(--paper); }

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  color: var(--gray);
  font-size: 11px;
}

.heatmap-legend .heatmap-cell {
  width: 12px;
  height: 12px;
}

.time-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--ink);
  background: var(--paper);
  font-size: 11px;
  white-space: nowrap;
}

.time-pill.muted,
.picked-list .muted {
  color: var(--gray);
}

.sop-time-row {
  margin-bottom: 8px;
}

.sop-sync-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.today-deck-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
}

.today-deck-head b,
.today-deck-count b {
  display: block;
  font-size: 16px;
}

.today-deck-head span,
.today-deck-count span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.today-deck-count {
  text-align: right;
  white-space: nowrap;
}

.today-workshop-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 8px;
  margin: -2px 0 10px;
  scrollbar-width: none;
}

.today-workshop-picker::-webkit-scrollbar {
  display: none;
}

.today-picker-chip {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 11px;
  font-size: 12px;
}

.today-picker-chip.add {
  border-color: var(--ink);
}

.today-deck-panel {
  height: min(58vh, 520px);
  min-height: 360px;
  display: grid;
  place-items: stretch;
  overflow: hidden;
}

.template-box {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.template-save {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.template-save input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: 10px 12px;
  font: inherit;
}

.template-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.template-chip {
  flex: none;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: var(--paper);
  padding: 7px 10px;
  font-size: 12px;
}

.template-empty {
  color: var(--muted);
  font-size: 12px;
}

.today-sop-card,
.today-done-card {
  min-height: 0;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  touch-action: pan-y;
  overflow: hidden;
  position: relative;
  transition: transform .18s ease;
}

.today-sop-card::before,
.today-sop-card::after {
  position: absolute;
  top: 18px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}

.today-sop-card::before {
  content: "✓ 完成";
  left: 18px;
  background: #DDEADF;
  color: #3E6A45;
}

.today-sop-card::after {
  content: "今天不做";
  right: 18px;
  background: #ECEAE4;
  color: #6F6A61;
}

.today-sop-card[data-swipe-hint="done"]::before,
.today-sop-card[data-swipe-hint="skipped"]::after {
  opacity: 1;
  transform: translateY(0);
}

.today-card-meta {
  color: var(--muted);
  font-size: 12px;
}

.today-sop-card h2 {
  font-size: 28px;
  line-height: 1.15;
  margin: 0;
}

.today-card-content {
  line-height: 1.75;
  color: var(--ink);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
}

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

.today-sop-card.locked {
  border-color: var(--ink);
}

.today-done-card {
  align-items: center;
  text-align: center;
}

.member-row {
  border-color: var(--ink);
  background: linear-gradient(135deg, var(--paper), var(--mist));
}

.member-hero,
.member-panel,
.member-result {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 18px;
  margin-bottom: 14px;
}

.member-hero {
  border-color: var(--ink);
  background: linear-gradient(135deg, #F7F1E4, #E8EEE8);
}

.member-kicker {
  color: #7E6E57;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.member-hero h2 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.05;
}

.member-hero p,
.member-result span,
.price-grid span {
  color: var(--gray);
  font-size: 13px;
  line-height: 1.6;
}

.scene-pill-row {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.scene-pill-row span {
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: var(--paper);
  padding: 7px 10px;
  font-size: 12px;
}

.scene-pill-row .on {
  background: var(--ink);
  color: var(--paper);
}

.member-panel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.member-compare {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(70px, .85fr) minmax(94px, 1fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper);
}

.member-compare > * {
  min-width: 0;
  padding: 11px 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.member-compare > *:nth-child(3n) {
  border-right: 0;
}

.member-compare > *:nth-last-child(-n+3) {
  border-bottom: 0;
}

.member-compare b,
.member-compare strong {
  text-align: center;
}

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

.member-result {
  background: #F0F3EE;
}

.member-result b {
  display: block;
  margin-bottom: 6px;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.price-grid article {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 14px 10px;
  min-height: 112px;
}

.price-grid article b,
.price-grid article strong,
.price-grid article span {
  display: block;
}

.price-grid article strong {
  margin: 14px 0 6px;
  font-size: 22px;
}

.price-grid .recommended {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.price-grid .recommended span {
  color: #E8E0D0;
}

.price-grid em {
  position: absolute;
  right: 8px;
  top: -10px;
  border-radius: 999px;
  background: #D6B16E;
  color: var(--ink);
  padding: 4px 8px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.weekly-report-card {
  display: grid;
  gap: 14px;
}

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

.weekly-metrics div {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  padding: 12px 10px;
}

.weekly-metrics b,
.weekly-metrics span {
  display: block;
}

.weekly-metrics b {
  font-family: var(--num);
  font-size: 18px;
}

.weekly-metrics span,
.weekly-insight p,
.weekly-insight li {
  color: var(--gray);
  font-size: 12px;
  line-height: 1.6;
}

.weekly-insight {
  border-left: 2px solid var(--ink);
  padding-left: 12px;
}

.weekly-insight b {
  display: block;
  margin-bottom: 6px;
}

.weekly-insight p,
.weekly-insight ul {
  margin: 0;
}

.weekly-insight ul {
  padding-left: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 18px 14px calc(96px + env(safe-area-inset-bottom));
  background: rgba(21, 21, 20, .28);
}

.project-dialog {
  width: 100%;
  max-height: 82vh;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  padding: 18px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, .18);
}

.project-dialog h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.profile-dialog {
  max-width: 420px;
}

.profile-field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--gray);
  font-size: 12px;
}

.avatar-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.avatar-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  white-space: nowrap;
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.profile-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 4px 0 2px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--mist);
}

.profile-preview .avatar {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.profile-preview div:last-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-preview b,
.profile-preview span {
  overflow-wrap: anywhere;
}

.profile-preview span {
  color: var(--gray);
  font-size: 12px;
}

.project-dialog label,
.editor-form label,
.field-row {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--gray);
  font-size: 12px;
}

.field-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.dialog-actions button {
  flex: 1 1 auto;
}

.btn-ghost.danger {
  border-color: #e0caca;
  color: var(--danger);
}

.back-btn.inline {
  width: fit-content;
  margin-bottom: 14px;
}

.editor-form,
.archive-page {
  display: grid;
  gap: 12px;
  padding-bottom: 18px;
}

.editor-form {
  margin-top: 10px;
}

.workshop-card-manager {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.workshop-card-list {
  display: grid;
  gap: 8px;
}

.workshop-card-row {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--mist);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.workshop-card-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.workshop-card-main b {
  overflow-wrap: anywhere;
}

.workshop-card-main span {
  color: var(--gray);
  font-size: 12px;
}

.workshop-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.workshop-card-actions button {
  flex: 1 1 88px;
}

.picked-list,
.picker-list,
.archive-list {
  display: grid;
  gap: 8px;
}

.picked-list span {
  display: inline-flex;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
}

.picker-row,
.archive-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--mist);
  padding: 12px;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.picker-row.on {
  border-color: var(--ink);
  background: var(--paper);
}

.archive-section {
  display: grid;
  gap: 8px;
}

.archive-section b {
  margin-top: 8px;
}

.archive-row button {
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  background: var(--paper);
  padding: 6px 9px;
  font-size: 11px;
}

.todo-input {
  margin-bottom: 24px;
  padding: 6px 6px 6px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--mist);
  flex-wrap: wrap;
}

.todo-input input {
  flex: 1 1 100%;
  min-width: 0;
}

.todo-input input:nth-child(2),
.todo-input input:nth-child(3) {
  flex-basis: calc(50% - 34px);
  font-size: 13px;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
}

.todo-check {
  flex: none;
  width: 21px;
  height: 21px;
  border: 1.5px solid var(--line-dark);
  border-radius: 50%;
}

.todo-item.done .todo-check {
  border-color: var(--ink);
  background: var(--ink);
}

.todo-body {
  flex: 1;
  min-width: 0;
}

.todo-title {
  font-size: 14px;
}

.todo-item.done .todo-title {
  color: var(--gray-2);
  text-decoration: line-through;
}

.todo-tag {
  margin-top: 3px;
  color: var(--gray);
  font-size: 11px;
}

.todo-delete {
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--gray-2);
  font-size: 18px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 26px 0 6px;
}

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-size: 24px;
  font-weight: 600;
}

.profile-name {
  font-size: 22px;
  font-weight: 600;
}

.profile-sub {
  margin-top: 5px;
  color: var(--gray);
  font-size: 12px;
}

.profile-dialog {
  display: grid;
  gap: 12px;
}

.profile-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--mist);
}

.profile-preview span {
  display: block;
  margin-top: 4px;
  color: var(--gray);
  font-size: 12px;
}

.pf-list {
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  text-align: left;
}

.pf-row:last-child {
  border-bottom: 0;
}

.pf-row .v {
  color: var(--gray);
  font-size: 12px;
}

.switch {
  position: relative;
  flex: none;
  width: 50px;
  height: 30px;
  border-radius: 999px;
  background: var(--line-dark);
  transition: background .2s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
  transition: transform .2s;
}

.switch.on {
  background: var(--ink);
}

.switch.on::after {
  transform: translateX(20px);
}

.widget-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--mist);
}

.widget-card b,
.widget-card span {
  display: block;
}

.widget-card span {
  margin-top: 5px;
  color: var(--gray);
  font-size: 12px;
}

.widget-card button {
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
}

.detail {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.32, .72, .24, 1);
}

.detail.open {
  transform: none;
}

.detail-head {
  flex: none;
  padding: 20px 26px 0;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--gray);
  padding: 8px 0;
  font-size: 13px;
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 26px calc(24px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}

.rail {
  position: relative;
  margin: 30px 0 10px;
  padding-left: 34px;
}

.rail::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 10px;
  bottom: 10px;
  width: 1.5px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 5px, transparent 5px 11px);
}

.station {
  position: relative;
  margin-bottom: 16px;
}

.station::before {
  content: "";
  position: absolute;
  left: -29.5px;
  top: 22px;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.station.done::before {
  background: var(--ink);
}

.station-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  padding: 16px 18px;
}

.station.done .station-card {
  background: var(--mist);
}

.station-top b {
  font-size: 15px;
  font-weight: 600;
}

.station.done b {
  color: var(--gray);
  text-decoration: line-through;
}

.station-sub {
  margin-top: 5px;
  color: var(--gray);
  font-size: 12px;
  line-height: 1.5;
}

.seg {
  display: flex;
  gap: 4px;
  width: max-content;
  margin: 14px 0 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--mist);
}

.seg.full {
  width: 100%;
}

.seg button {
  flex: 1;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--gray);
  padding: 8px 18px;
  font-size: 13px;
}

.seg button.on {
  background: var(--paper);
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .07);
}

.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(18px);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 56px;
  border: 0;
  background: transparent;
  color: var(--gray-2);
  padding: 4px 0;
  font-size: 10px;
}

.tab-icon {
  font-size: 14px;
  line-height: 1;
  font-weight: 400;
}

.tab.on {
  color: var(--ink);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 110px;
  z-index: 80;
  max-width: calc(100% - 52px);
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  border-radius: 999px;
  background: rgba(21, 21, 20, .92);
  color: var(--paper);
  padding: 10px 16px;
  font-size: 13px;
  line-height: 1.35;
  transition: opacity .2s, transform .2s;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%);
}

.empty-state {
  padding: 20px 16px;
  border: 1px dashed var(--line-dark);
  border-radius: var(--radius);
  background: var(--mist);
  color: var(--gray);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}
