:root {
  color-scheme: light;
  --paper: #f4f0e7;
  --paper-deep: #e7e0d2;
  --surface: rgba(255, 253, 248, 0.86);
  --surface-solid: #fffdf8;
  --surface-raised: #ffffff;
  --ink: #202623;
  --ink-soft: #626963;
  --ink-faint: #92978f;
  --line: rgba(32, 38, 35, 0.1);
  --line-strong: rgba(32, 38, 35, 0.18);
  --coral: #ed6a4a;
  --coral-soft: #fde3da;
  --teal: #196f74;
  --teal-soft: #dcefed;
  --amber: #c47a24;
  --shadow: 0 24px 70px rgba(54, 47, 35, 0.12);
  --shadow-soft: 0 10px 30px rgba(54, 47, 35, 0.07);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family:
    "PingFang SC",
    "Hiragino Sans GB",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 2%, rgba(237, 106, 74, 0.13), transparent 31rem),
    radial-gradient(circle at 88% 9%, rgba(25, 111, 116, 0.12), transparent 28rem),
    linear-gradient(145deg, #f8f4ec 0%, #f2ede3 54%, #eee8dc 100%);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.1'/%3E%3C/svg%3E");
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(25, 111, 116, 0.26);
  outline-offset: 2px;
}

button {
  cursor: pointer;
}

.page-glow {
  position: fixed;
  z-index: -1;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
}

.page-glow--one {
  top: -11rem;
  right: -7rem;
  background: rgba(241, 177, 93, 0.16);
}

.page-glow--two {
  bottom: -13rem;
  left: -8rem;
  background: rgba(25, 111, 116, 0.1);
}

.app-shell {
  width: min(100% - 28px, 1000px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 calc(30px + var(--safe-bottom));
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 6px);
  align-items: end;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 15px;
  color: var(--surface-solid);
  background: var(--ink);
  box-shadow: 0 9px 24px rgba(32, 38, 35, 0.16);
}

.brand-mark span {
  display: block;
  border-radius: 99px;
  background: currentColor;
}

.brand-mark span:nth-child(1) {
  height: 9px;
  opacity: 0.6;
}

.brand-mark span:nth-child(2) {
  height: 19px;
}

.brand-mark span:nth-child(3) {
  height: 14px;
  opacity: 0.8;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 21px;
  font-weight: 760;
  letter-spacing: 0.08em;
}

.brand small {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.quiet-button,
.icon-button,
.secondary-button,
.primary-button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.quiet-button:active,
.icon-button:active,
.secondary-button:active,
.primary-button:active,
.day-cell:active,
.shift-option:active {
  transform: scale(0.97);
}

.quiet-button {
  padding: 0 17px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 650;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  background: rgba(255, 253, 248, 0.76);
  border: 1px solid var(--line);
}

.settings-icon {
  position: relative;
  width: 20px;
  height: 18px;
  background:
    linear-gradient(currentColor, currentColor) center 4px / 20px 1.7px no-repeat,
    linear-gradient(currentColor, currentColor) center 13px / 20px 1.7px no-repeat;
}

.settings-icon::before,
.settings-icon::after {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1.7px solid currentColor;
  border-radius: 50%;
  background: var(--surface-solid);
  content: "";
}

.settings-icon::before {
  top: 1px;
  left: 3px;
}

.settings-icon::after {
  right: 3px;
  bottom: 1px;
}

.close-icon {
  position: relative;
  width: 18px;
  height: 18px;
}

.close-icon::before,
.close-icon::after {
  position: absolute;
  top: 8px;
  left: 0;
  width: 18px;
  height: 1.8px;
  border-radius: 10px;
  background: currentColor;
  content: "";
  transform: rotate(45deg);
}

.close-icon::after {
  transform: rotate(-45deg);
}

.view-switcher {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 253, 248, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.view-switcher button {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 13px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 13px;
  font-weight: 720;
}

.view-switcher button.is-active {
  color: var(--surface-solid);
  background: var(--ink);
  box-shadow: 0 7px 18px rgba(32, 38, 35, 0.16);
}

.dashboard {
  display: grid;
  gap: 18px;
  animation: page-in 360ms ease both;
}

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

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  min-height: 241px;
  padding: 28px;
  overflow: hidden;
  color: #fffaf1;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 38%),
    #202623;
  box-shadow: var(--shadow);
}

.hero-card::before {
  position: absolute;
  right: -5rem;
  bottom: -7rem;
  width: 20rem;
  height: 20rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  content: "";
}

.hero-card::after {
  position: absolute;
  right: 1.5rem;
  bottom: -5rem;
  width: 14rem;
  height: 14rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  content: "";
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.eyebrow {
  margin: 0 0 10px;
  color: inherit;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  opacity: 0.63;
  text-transform: uppercase;
}

.hero-card h1 {
  max-width: 610px;
  margin: 0;
  font-family:
    "Songti SC",
    "STSong",
    "Noto Serif CJK SC",
    serif;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 13px;
  margin-top: 16px;
  font-size: 13px;
  opacity: 0.74;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.hero-meta span + span::before {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  content: "";
  opacity: 0.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.hero-actions button {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fffaf1;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 680;
}

.hero-actions button:first-child {
  color: var(--ink);
  background: #fffaf1;
}

.hero-orbit {
  position: relative;
  z-index: 1;
  display: flex;
  width: 188px;
  height: 188px;
  align-self: center;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.hero-orbit::before {
  position: absolute;
  inset: 15px;
  border: 1px dashed rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  content: "";
}

.orbit-core {
  display: grid;
  width: 126px;
  height: 126px;
  place-items: center;
  text-align: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(6px);
}

.orbit-core strong,
.orbit-core small {
  display: block;
}

.orbit-core strong {
  font-family:
    "Songti SC",
    "STSong",
    serif;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.orbit-core small {
  margin-top: 9px;
  font-size: 11px;
  opacity: 0.66;
}

.orbit-dot {
  position: absolute;
  top: 10px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orbit-color, var(--coral));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--orbit-color, var(--coral)) 20%, transparent);
  transform: translateX(-50%);
}

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

.summary-card {
  min-height: 132px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.summary-card small,
.summary-card strong,
.summary-card span {
  display: block;
}

.summary-card small {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 650;
}

.summary-card strong {
  margin-top: 15px;
  font-family:
    "Songti SC",
    "STSong",
    serif;
  font-size: 40px;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.summary-card strong em {
  margin-left: 5px;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
}

.summary-card span {
  margin-top: 11px;
  color: var(--ink-faint);
  font-size: 10px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.calendar-panel {
  padding: 20px;
}

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

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-family:
    "Songti SC",
    "STSong",
    serif;
}

.panel-head h2 {
  font-size: 24px;
}

.panel-head h3 {
  font-size: 19px;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.month-actions,
.date-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.round-arrow {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  font-size: 23px;
  line-height: 1;
}

.round-arrow.small {
  width: 38px;
  height: 38px;
  font-size: 20px;
}

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

.calendar-weekdays {
  margin-bottom: 6px;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.calendar-weekdays span {
  padding: 7px 0;
}

.calendar-grid {
  gap: 4px;
}

.day-cell {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 78px;
  padding: 9px 8px 8px;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
  text-align: left;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.day-cell:hover {
  background: rgba(255, 255, 255, 0.7);
  border-color: var(--line);
}

.day-cell.is-outside {
  opacity: 0.3;
}

.day-cell.is-selected {
  background: var(--surface-raised);
  border-color: var(--line-strong);
  box-shadow: 0 7px 18px rgba(44, 38, 28, 0.07);
}

.day-number {
  display: inline-grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  font-size: 12px;
  font-weight: 680;
}

.day-cell.is-today .day-number {
  color: #fff;
  background: var(--ink);
}

.day-shift {
  display: inline-flex;
  max-width: 100%;
  min-height: 20px;
  margin-top: auto;
  padding: 3px 7px;
  align-items: center;
  gap: 5px;
  border-radius: 7px;
  overflow: hidden;
  color: var(--shift-color, var(--ink-soft));
  background: color-mix(in srgb, var(--shift-color, #8a918b) 12%, transparent);
  font-size: 9px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-shift-group {
  display: flex;
  max-width: 100%;
  max-height: 39px;
  margin-top: auto;
  flex-wrap: wrap;
  gap: 3px;
  overflow: hidden;
}

.day-shift-tag {
  display: inline-flex;
  min-height: 18px;
  padding: 2px 5px;
  align-items: center;
  border-radius: 6px;
  overflow: hidden;
  color: var(--shift-color);
  background: color-mix(in srgb, var(--shift-color) 12%, transparent);
  font-size: 8px;
  font-weight: 740;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-shift-more {
  display: inline-flex;
  min-height: 18px;
  padding: 2px 5px;
  align-items: center;
  border-radius: 6px;
  color: var(--ink-soft);
  background: rgba(98, 105, 99, 0.08);
  font-size: 8px;
  font-weight: 700;
}

.day-shift::before {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.day-shift.is-off {
  color: var(--ink-faint);
  background: rgba(98, 105, 99, 0.07);
}

.day-override {
  position: absolute;
  top: 10px;
  right: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--coral);
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--legend-color);
}

.legend-item i.is-ring {
  background: transparent;
  border: 1px solid var(--coral);
}

.day-summary {
  padding: 21px;
}

.selected-date {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.schedule-stack {
  display: grid;
  gap: 10px;
}

.schedule-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

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

.schedule-accent {
  width: 9px;
  height: 36px;
  border-radius: 99px;
  background: var(--row-color);
}

.schedule-row strong,
.schedule-row small {
  display: block;
}

.schedule-row strong {
  font-size: 12px;
  font-weight: 720;
}

.schedule-row small {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 9px;
}

.schedule-time {
  color: var(--ink-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 620;
  white-space: nowrap;
}

.empty-day {
  padding: 24px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  text-align: center;
}

.empty-day span {
  display: block;
  font-family:
    "Songti SC",
    "STSong",
    serif;
  font-size: 26px;
}

.empty-day small {
  display: block;
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 10px;
}

.text-button {
  width: 100%;
  min-height: 42px;
  margin-top: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  font-weight: 700;
}

/* Timeline */
.timeline-layout {
  display: grid;
  gap: 18px;
}

.date-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 18px;
}

.date-chip {
  display: flex;
  min-width: 0;
  min-height: 74px;
  padding: 8px 4px;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  border-radius: 15px;
  background: transparent;
}

.date-chip.is-selected {
  color: #fffaf1;
  background: var(--ink);
}

.date-chip.is-today:not(.is-selected) {
  border-color: var(--line-strong);
}

.date-chip small {
  color: var(--ink-faint);
  font-size: 9px;
}

.date-chip.is-selected small {
  color: rgba(255, 250, 241, 0.58);
}

.date-chip strong {
  font-size: 15px;
  font-weight: 720;
}

.date-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chip-color, var(--ink-faint));
}

.date-chip.is-selected i {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16);
}

.timeline-panel {
  padding: 22px;
}

.allocation-card {
  margin-bottom: 20px;
  padding: 17px;
  border-radius: 20px;
  background: rgba(32, 38, 35, 0.055);
}

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

.allocation-head strong {
  font-size: 12px;
}

.allocation-head span {
  color: var(--ink-soft);
  font-size: 10px;
}

.allocation-bar {
  position: relative;
  height: 20px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(32, 38, 35, 0.07);
}

.allocation-segment {
  position: absolute;
  top: 0;
  bottom: 0;
  min-width: 2px;
  background: var(--segment-color);
}

.allocation-segment.is-break {
  background: repeating-linear-gradient(
    135deg,
    var(--surface-solid) 0 4px,
    var(--segment-color) 4px 8px
  );
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--segment-color) 32%, transparent);
}

.now-pin {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  border-radius: 99px;
  background: var(--coral);
  box-shadow: 0 0 0 2px rgba(237, 106, 74, 0.14);
}

.allocation-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.timeline-scroller {
  max-height: none;
  overflow-y: visible;
  overscroll-behavior: contain;
}

.timeline-track {
  position: relative;
  min-height: 960px;
  margin-top: 6px;
  padding-left: 52px;
}

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

.timeline-hour span {
  position: absolute;
  top: -7px;
  left: -50px;
  width: 40px;
  color: var(--ink-faint);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.timeline-hour.major {
  background: var(--line-strong);
}

.timeline-hour.major span {
  color: var(--ink-soft);
  font-weight: 650;
}

.time-block {
  position: absolute;
  z-index: 2;
  display: flex;
  min-height: 22px;
  padding: 9px 12px;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
  border-radius: 13px;
  color: var(--block-ink, #fff);
  background: var(--block-color, var(--ink));
  box-shadow: 0 7px 16px rgba(40, 35, 28, 0.1);
}

.time-block strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 760;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-block small {
  margin-top: 5px;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.25;
  opacity: 0.68;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-block.is-rest {
  z-index: 1;
  box-shadow: none;
}

.time-block.is-break {
  z-index: 3;
  padding: 7px 10px;
  color: var(--ink);
  background:
    repeating-linear-gradient(135deg, #fffaf0 0 7px, #f4e8d4 7px 14px);
  box-shadow: inset 0 0 0 1px rgba(196, 122, 36, 0.22);
}

.time-block.is-break small {
  margin-top: 3px;
}

.timeline-now {
  position: absolute;
  z-index: 6;
  right: 0;
  left: 38px;
  height: 2px;
  background: var(--coral);
}

.timeline-now::before {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface-solid);
  border-radius: 50%;
  background: var(--coral);
  content: "";
  transform: translate(-50%, -50%);
}

.timeline-now span {
  position: absolute;
  top: -25px;
  left: 2px;
  padding: 4px 7px;
  border-radius: 7px;
  color: #fff;
  background: var(--coral);
  font-size: 8px;
  font-weight: 700;
}

.timeline-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 15px;
  padding: 13px 15px;
  border-radius: 15px;
  color: var(--ink-soft);
  background: rgba(25, 111, 116, 0.07);
  font-size: 10px;
  line-height: 1.6;
}

.timeline-note::before {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal);
  content: "i";
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 700;
}

/* Dialogs and forms */
.sheet {
  width: min(100% - 22px, 560px);
  max-height: min(88vh, 850px);
  margin: auto auto 0;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 28px 28px 0 0;
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: 0 30px 90px rgba(28, 25, 20, 0.28);
}

.settings-sheet {
  width: min(100% - 22px, 1080px);
}

.day-sheet {
  width: min(100% - 22px, 780px);
}

.sheet::backdrop {
  background: rgba(27, 29, 27, 0.38);
  backdrop-filter: blur(5px);
}

.sheet[open] {
  animation: sheet-in 220ms ease both;
}

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

.sheet > div,
.sheet > form {
  padding: 12px 22px calc(24px + var(--safe-bottom));
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 17px;
  border-radius: 99px;
  background: rgba(32, 38, 35, 0.14);
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.sheet-header .eyebrow {
  margin-bottom: 6px;
  color: var(--coral);
  opacity: 1;
}

.sheet h2 {
  margin: 0;
  font-family:
    "Songti SC",
    "STSong",
    serif;
  font-size: 28px;
  line-height: 1.2;
}

.sheet-subtitle {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.6;
}

.shift-options {
  display: grid;
  gap: 9px;
}

.selected-day-summary {
  display: grid;
  gap: 5px;
  margin-bottom: 18px;
  padding: 15px 16px;
  border: 1px solid color-mix(in srgb, var(--teal) 20%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--teal) 7%, white);
}

.selected-day-summary span,
.selected-day-summary small {
  color: var(--ink-soft);
  font-size: 9px;
}

.selected-day-summary strong {
  font-size: 14px;
  font-weight: 760;
}

.selected-day-summary.is-rest {
  border-color: var(--line);
  background: rgba(32, 38, 35, 0.045);
}

.day-preset-area {
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(32, 38, 35, 0.045);
}

.preset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-chip {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.preset-chip > button:first-child {
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 10px;
  font-weight: 720;
}

.preset-delete {
  width: 34px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--ink-faint);
  background: transparent;
  font-size: 15px;
}

.preset-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 11px;
}

.preset-create input,
.preset-create button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 11px;
}

.preset-create input {
  min-width: 0;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-size: 14px;
}

.preset-create button {
  padding: 0 14px;
  color: var(--teal);
  background: var(--teal-soft);
  font-weight: 720;
}

.preset-create button:disabled,
.preset-create input:disabled {
  opacity: 0.48;
}

.day-shift-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.day-shift-category {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: color-mix(in srgb, var(--category-color) 4%, white);
}

.day-shift-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
  padding: 0 2px;
}

.day-shift-category-head strong {
  color: color-mix(in srgb, var(--category-color) 82%, var(--ink));
  font-size: 11px;
}

.day-shift-category-head span {
  color: var(--ink-faint);
  font-size: 8px;
}

.day-shift-buttons {
  display: grid;
  gap: 7px;
}

.shift-option.compact {
  grid-template-columns: 9px minmax(0, 1fr) 20px;
  gap: 9px;
  min-height: 58px;
  padding: 10px;
  border-radius: 13px;
}

.shift-option.compact strong {
  font-size: 11px;
}

.shift-option.compact small {
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-empty {
  margin: 0;
  padding: 15px 8px;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.6;
  text-align: center;
}

.shift-option {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 12px 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.74);
  text-align: left;
}

.shift-option.is-selected {
  border-color: color-mix(in srgb, var(--option-color, var(--ink)) 45%, transparent);
  background: color-mix(in srgb, var(--option-color, var(--ink)) 7%, white);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--option-color, var(--ink)) 12%, transparent);
}

.shift-option-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--option-color, var(--ink-faint));
}

.shift-option strong,
.shift-option small {
  display: block;
}

.shift-option strong {
  font-size: 13px;
  font-weight: 750;
}

.shift-option small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 10px;
}

.option-check {
  display: inline-grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: transparent;
  font-size: 11px;
}

.shift-option.is-selected .option-check {
  color: #fff;
  border-color: var(--option-color, var(--ink));
  background: var(--option-color, var(--ink));
}

.edit-default-note {
  margin: 14px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
  line-height: 1.6;
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.secondary-button,
.primary-button {
  padding: 0 22px;
  font-size: 12px;
  font-weight: 750;
}

.primary-button {
  color: #fffaf1;
  background: var(--ink);
  box-shadow: 0 10px 20px rgba(32, 38, 35, 0.14);
}

.secondary-button {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.danger-button {
  color: #a33e26;
}

.grow {
  flex: 1;
}

.ghost-link {
  min-height: 40px;
  padding: 0;
  border: 0;
  color: var(--teal);
  background: transparent;
  font-size: 10px;
  font-weight: 720;
}

.settings-section {
  padding: 19px 0;
  border-top: 1px solid var(--line);
}

.settings-section:first-of-type {
  border-top: 0;
}

.settings-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 13px;
}

.settings-section-head h3 {
  margin: 0;
  font-size: 13px;
}

.settings-section-head p {
  margin: 5px 0 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.add-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.66);
  font-size: 10px;
  font-weight: 720;
}

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

.shift-library-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.library-column {
  display: flex;
  min-width: 0;
  min-height: 400px;
  padding: 13px;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--category-color) 8%, white),
      rgba(255, 255, 255, 0.76) 36%
    );
}

.library-column-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 12px;
}

.library-column-head strong,
.library-column-head small {
  display: block;
}

.library-column-head strong {
  color: color-mix(in srgb, var(--category-color) 84%, var(--ink));
  font-family:
    "Songti SC",
    "STSong",
    serif;
  font-size: 17px;
}

.library-column-head small {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 8px;
}

.library-column-head > button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--category-color) 18%, transparent);
  border-radius: 50%;
  color: var(--category-color);
  background: rgba(255, 255, 255, 0.72);
  font-size: 17px;
}

.library-items {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 8px;
}

.library-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 9px;
  width: 100%;
  min-height: 77px;
  padding: 11px;
  align-items: center;
  border: 1px solid rgba(32, 38, 35, 0.08);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
}

.library-item-dot {
  width: 7px;
  height: 42px;
  border-radius: 99px;
  background: var(--shift-color);
}

.library-item strong,
.library-item small {
  display: block;
}

.library-item strong {
  font-size: 12px;
}

.library-item small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-item em {
  color: var(--teal);
  font-size: 8px;
  font-style: normal;
  font-weight: 720;
}

.library-empty {
  margin: 0;
  padding: 20px 10px;
  color: var(--ink-faint);
  font-size: 9px;
  text-align: center;
}

.library-column-stack {
  background:
    linear-gradient(180deg, rgba(25, 111, 116, 0.08), rgba(255, 255, 255, 0.76) 48%);
}

.rest-library-block {
  display: flex;
  gap: 11px;
  margin-top: 12px;
  padding: 14px;
  align-items: flex-start;
  border: 1px dashed rgba(32, 38, 35, 0.18);
  border-radius: 15px;
  background: rgba(247, 247, 243, 0.72);
}

.rest-symbol {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--surface-solid);
  background: var(--ink-soft);
  font-family:
    "Songti SC",
    "STSong",
    serif;
  font-size: 16px;
}

.rest-library-block strong,
.rest-library-block small {
  display: block;
}

.rest-library-block strong {
  font-size: 11px;
}

.rest-library-block small {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 8px;
  line-height: 1.55;
}

.settings-presets {
  padding: 4px 0;
}

.shift-list-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 11px;
  padding: 13px 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.62);
}

.shift-list-item > i {
  width: 9px;
  height: 38px;
  border-radius: 99px;
  background: var(--shift-color);
}

.shift-list-item strong,
.shift-list-item small {
  display: block;
}

.shift-list-item strong {
  font-size: 12px;
}

.shift-list-item small {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 9px;
}

.mini-edit {
  min-width: 44px;
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  color: var(--teal);
  background: var(--teal-soft);
  font-size: 10px;
  font-weight: 720;
}

.week-settings {
  display: grid;
  gap: 7px;
}

.week-setting-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.week-setting-row span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
  text-align: center;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 15px;
}

.field > span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
}

.field input,
.field select,
.week-setting-row select {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
}

.week-setting-row select {
  min-height: 44px;
  font-size: 12px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-row .field {
  margin-bottom: 0;
}

.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(32, 38, 35, 0.055);
}

.category-option {
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 11px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
  font-weight: 720;
}

.category-option.is-selected {
  color: var(--surface-solid);
  background: var(--ink);
  box-shadow: 0 6px 14px rgba(32, 38, 35, 0.14);
}

.breaks-editor {
  margin-top: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.breaks-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.breaks-editor-head strong,
.breaks-editor-head small {
  display: block;
}

.breaks-editor-head strong {
  font-size: 11px;
}

.breaks-editor-head small {
  margin-top: 4px;
  color: var(--ink-faint);
  font-size: 9px;
}

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

.break-empty-hint {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 13px;
  color: var(--ink-faint);
  background: rgba(32, 38, 35, 0.025);
  font-size: 9px;
  text-align: center;
}

.break-row {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) minmax(0, 1fr) 34px;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(32, 38, 35, 0.035);
}

.break-index {
  align-self: center;
  color: var(--ink-faint);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.break-row label {
  display: grid;
  gap: 5px;
}

.break-row label span {
  color: var(--ink-faint);
  font-size: 8px;
}

.break-row input {
  width: 100%;
  min-width: 0;
  min-height: 41px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
}

.break-remove {
  display: grid;
  width: 34px;
  height: 41px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 10px;
  color: #a33e26;
  background: rgba(163, 62, 38, 0.07);
  font-size: 16px;
}

.color-swatch {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 3px solid var(--surface-solid);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line);
}

.color-swatch.is-selected {
  box-shadow:
    0 0 0 2px var(--surface-solid),
    0 0 0 4px var(--swatch);
}

.check-row {
  display: flex;
  gap: 11px;
  margin: 17px 0;
  padding: 13px 14px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(25, 111, 116, 0.045);
}

.check-row input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--teal);
}

.check-row strong,
.check-row small {
  display: block;
}

.check-row strong {
  font-size: 11px;
}

.check-row small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 9px;
}

.form-error {
  min-height: 16px;
  margin: 10px 0 0;
  color: #a33e26;
  font-size: 10px;
}

.storage-note {
  padding: 14px;
  border-radius: 14px;
  color: var(--ink-soft);
  background: rgba(32, 38, 35, 0.045);
  font-size: 9px;
  line-height: 1.65;
}

.reset-data-button {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  border: 0;
  border-radius: 12px;
  color: #a33e26;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 50%;
  bottom: calc(26px + var(--safe-bottom));
  max-width: calc(100% - 36px);
  padding: 11px 16px;
  border-radius: 999px;
  color: #fffaf1;
  background: rgba(32, 38, 35, 0.92);
  box-shadow: 0 10px 30px rgba(32, 38, 35, 0.2);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 8px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(50%, 0);
}

.app-footer {
  display: flex;
  min-height: 58px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 12px 0;
  color: var(--ink-faint);
  font-size: 9px;
}

.app-footer button {
  padding: 0;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

@media (min-width: 760px) {
  .app-shell {
    padding-top: 34px;
  }

  .hero-card {
    min-height: 278px;
    padding: 34px;
  }

  .calendar-panel {
    padding: 25px;
  }

  .day-cell {
    min-height: 92px;
    padding: 11px;
  }

  .day-shift {
    padding: 4px 8px;
    font-size: 10px;
  }

  .timeline-panel {
    padding: 28px;
  }

  .sheet {
    margin: auto;
    border-radius: 28px;
  }

  .sheet > div,
  .sheet > form {
    padding-top: 25px;
  }

  .sheet-handle {
    display: none;
  }
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 20px, 620px);
  }

  .brand small {
    display: none;
  }

  .topbar {
    margin-bottom: 15px;
  }

  .hero-card {
    grid-template-columns: minmax(0, 1fr);
    min-height: 260px;
    padding: 24px;
  }

  .hero-orbit {
    position: absolute;
    top: 22px;
    right: 16px;
    width: 124px;
    height: 124px;
    opacity: 0.82;
  }

  .hero-orbit::before {
    inset: 10px;
  }

  .orbit-core {
    width: 84px;
    height: 84px;
  }

  .orbit-core strong {
    font-size: 29px;
  }

  .hero-card h1 {
    max-width: calc(100% - 92px);
    font-size: clamp(29px, 9vw, 40px);
  }

  .hero-meta {
    max-width: 75%;
  }

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

  .summary-card {
    min-height: 108px;
    padding: 15px 14px;
    border-radius: 19px;
  }

  .summary-card strong {
    font-size: 31px;
  }

  .calendar-panel {
    padding: 16px 12px;
  }

  .panel-head {
    padding: 0 5px;
  }

  .day-cell {
    min-height: 67px;
    padding: 7px 5px 5px;
    border-radius: 12px;
  }

  .day-shift {
    max-width: 100%;
    padding: 3px 5px;
    font-size: 8px;
  }

  .day-shift::before {
    display: none;
  }

  .day-number {
    width: 22px;
    height: 22px;
    font-size: 11px;
  }

  .calendar-legend {
    padding-right: 5px;
    padding-left: 5px;
  }

  .day-summary {
    padding: 19px;
  }

  .timeline-panel {
    padding: 18px 15px;
  }

  .settings-sheet,
  .day-sheet {
    width: min(100% - 12px, 620px);
  }

  .shift-library-board {
    grid-template-columns: none;
    grid-auto-columns: minmax(248px, 82vw);
    grid-auto-flow: column;
    margin-right: -22px;
    padding-right: 22px;
    padding-bottom: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .library-column {
    min-height: 390px;
    scroll-snap-align: start;
  }

  .day-shift-matrix {
    grid-template-columns: 1fr;
  }

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

  .shift-option.compact {
    min-height: 64px;
  }

  .selected-day-summary {
    padding: 13px 14px;
  }

  .day-preset-area {
    padding: 14px;
  }

  .date-strip {
    gap: 2px;
  }

  .date-chip {
    min-height: 69px;
    border-radius: 12px;
  }

}

@media (max-width: 390px) {
  .quiet-button {
    display: none;
  }

  .hero-card {
    min-height: 272px;
  }

  .hero-orbit {
    opacity: 0.5;
  }

  .summary-grid {
    gap: 8px;
  }

  .summary-card {
    padding: 13px 11px;
  }

  .summary-card small {
    font-size: 9px;
  }

  .summary-card strong {
    font-size: 27px;
  }

  .summary-card span {
    font-size: 8px;
  }

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

  .break-row {
    grid-template-columns: 24px 1fr 1fr 30px;
    gap: 6px;
    padding: 8px;
  }

  .break-remove {
    width: 30px;
  }

  .break-row input {
    padding: 0 6px;
    font-size: 13px;
  }

  .day-shift-buttons {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 340px) {
  .summary-card strong {
    font-size: 21px;
  }

  .summary-card strong em {
    margin-left: 2px;
    font-size: 9px;
  }
}

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