: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: "Archivo", -apple-system, "Helvetica Neue", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* {
  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);
}

.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;
}

.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;
}

@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;
}

.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: 14px;
  align-items: center;
}

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

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

.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: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.pie-chart {
  width: 112px;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset 0 0 0 16px var(--paper), 0 0 0 1px var(--line);
}

.pie-legend {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.legend-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: #3c3c3a;
  font-size: 12px;
}

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

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

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

.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);
}

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

.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;
}

.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 40px;
  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;
}

.detail-cta {
  flex: none;
  padding: 14px 26px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.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: 20px;
  line-height: 1;
}

.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;
}
