*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #000000;
  --sf: #0f0f0f;
  --sf2: #1b1b1d;
  --sf3: #232327;
  --bd: #26272d;
  --bd-strong: #33333f;
  --tx: #ffffff;
  --tx2: #bbcbb2;
  --tx3: #838a7b;
  --ac: #2fe92b;
  --ac-soft: rgba(47, 233, 43, 0.1);
  --ac-line: rgba(47, 233, 43, 0.35);
  --ac2: #ff9821;
  --ac2-line: #3b2c14;
  --dn: #ff5102;
  --dn-soft: rgba(255, 81, 2, 0.12);
  --glow: rgba(47, 233, 43, 0.45);
  --glow-warn: rgba(255, 152, 33, 0.4);
  --glow-dn: rgba(255, 81, 2, 0.55);
  --scrim: rgba(0, 0, 0, 0.74);
  --r: 6px;
  --r2: 9px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --sidebar-w: clamp(206px, 15.5vw, 236px);
  --panel-w: clamp(304px, 24vw, 372px);
  --view-pad: clamp(20px, 1.9vw, 34px);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  color-scheme: dark;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--tx);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

input {
  font: inherit;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

svg {
  display: block;
}

strong {
  font-weight: 600;
}

[hidden] {
  display: none;
}

::selection {
  background: var(--ac-soft);
  color: var(--ac);
}

:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 2px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--bd-strong) transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--bd-strong);
  border: 3px solid var(--bg);
  border-radius: 99px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.app {
  display: flex;
  align-items: stretch;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.app-notice {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  max-width: min(340px, calc(100vw - 32px));
  padding: 12px 15px;
  border: 1px solid var(--bd-strong);
  border-radius: var(--r2);
  background: var(--sf2);
  color: var(--tx2);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.62);
  pointer-events: none;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease), visibility 0s;
}

.app-notice:empty {
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease), visibility 0s 0.24s;
}

.app-notice.is-error {
  border-color: var(--dn);
  color: var(--dn);
}

.sidebar {
  flex: 0 0 var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  border-right: 1px solid var(--bd);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: var(--r2);
  background: var(--ac);
  color: var(--bg);
  font-size: 17px;
  font-weight: 700;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.brand-sub {
  font-size: 11px;
  color: var(--tx3);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: var(--r2);
  color: var(--tx2);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.nav-item .icon {
  width: 17px;
  height: 17px;
}

.nav-item:hover {
  background: var(--sf);
  color: var(--tx);
}

.nav-item.is-active {
  background: var(--sf2);
  border-color: var(--bd);
  color: var(--ac);
  font-weight: 600;
}

.nav-label {
  white-space: nowrap;
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--bd);
}

.foot-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--r2);
  color: var(--tx3);
  font-size: 12.5px;
  text-align: left;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.foot-btn .icon {
  width: 15px;
  height: 15px;
}

.foot-btn:hover {
  background: var(--sf);
  color: var(--tx2);
}

.foot-label {
  white-space: nowrap;
}

.content {
  flex: 1;
  min-width: 0;
  padding: var(--view-pad);
  overflow-y: auto;
  background-image: radial-gradient(115% 60% at 32% -10%, #0e0e12 0%, var(--bg) 58%);
  background-attachment: fixed;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

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

.view-head-text {
  min-width: 0;
}

.view-title {
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

.view-sub {
  margin-top: 5px;
  max-width: 64ch;
  font-size: 13px;
  color: var(--tx3);
}

.chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--bd);
  border-radius: 99px;
  background: var(--sf2);
  color: var(--ac);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--r2);
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), filter 0.15s var(--ease);
}

.btn-wide {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  background: var(--sf2);
  border-color: var(--bd);
  color: var(--tx2);
}

.btn-wide:hover {
  border-color: var(--ac);
  color: var(--ac);
}

.btn-add {
  width: 100%;
  margin-top: 4px;
  background: var(--ac);
  color: var(--bg);
  font-weight: 700;
}

.btn-add .icon {
  width: 16px;
  height: 16px;
}

.btn-save {
  width: 100%;
  margin-top: 4px;
  background: var(--sf2);
  border-color: var(--ac);
  color: var(--ac);
  font-weight: 700;
}

.btn-save:hover {
  background: var(--ac-soft);
}

.btn-add:hover,
.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-primary {
  width: 100%;
  background: var(--ac);
  color: var(--bg);
  font-weight: 700;
}

.btn-ghost {
  width: 100%;
  margin-top: 8px;
  color: var(--tx3);
}

.btn-ghost:hover {
  background: var(--sf);
  color: var(--tx2);
}

.free-day {
  display: none;
  padding: 44px 32px;
  border: 1px solid var(--bd);
  border-radius: var(--r2);
  background: var(--sf);
  text-align: center;
}

.view.is-sunday .free-day {
  display: block;
}

.view.is-sunday .checklist,
.view.is-sunday .btn-wide {
  display: none;
}

.free-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--tx2);
}

.free-sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--tx3);
}

.checklist {
  column-count: 2;
  column-gap: 14px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--bd);
  border-radius: var(--r2);
  background: var(--sf);
  break-inside: avoid;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.check-row:hover {
  border-color: var(--bd-strong);
}

.check-row.is-checked {
  background: var(--sf2);
  border-color: var(--ac);
}

.row-check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 2px solid var(--bd-strong);
  border-radius: calc(var(--r) + 1px);
  color: var(--bg);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.row-check .icon {
  width: 15px;
  height: 15px;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}

.row-check:hover {
  border-color: var(--tx3);
}

.check-row.is-checked .row-check {
  background: var(--ac);
  border-color: var(--ac);
  box-shadow: 0 0 14px var(--glow);
}

.check-row.is-checked .row-check .icon {
  opacity: 1;
}

@keyframes check-pop {
  0% { transform: scale(0.55); }
  45% { transform: scale(1.22); }
  70% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

@keyframes check-ring {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(2.1); opacity: 0; }
}

@keyframes check-draw {
  0% { transform: scale(0.2) rotate(-30deg); opacity: 0; }
  60% { transform: scale(1.25) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes row-flash {
  0% { box-shadow: 0 0 0 0 rgba(47, 233, 43, 0.55); }
  100% { box-shadow: 0 0 0 12px rgba(47, 233, 43, 0); }
}

.row-check {
  position: relative;
}

.check-row.is-checked {
  animation: row-flash 0.5s var(--ease);
}

.check-row.is-checked .row-check {
  animation: check-pop 0.45s var(--ease);
}

.check-row.is-checked .row-check::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 2px solid var(--ac);
  border-radius: inherit;
  pointer-events: none;
  animation: check-ring 0.5s var(--ease) forwards;
}

.check-row.is-checked .row-check .icon {
  animation: check-draw 0.4s var(--ease);
}

.row-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.row-name {
  font-size: 13.5px;
  font-weight: 600;
}

.check-row.is-checked .row-name {
  color: var(--ac);
}

.row-phone {
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.6px;
  color: var(--tx3);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--bd);
  border-radius: var(--r);
  background: var(--sf2);
  color: var(--tx2);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.icon-btn .icon {
  width: 15px;
  height: 15px;
}

.icon-btn:hover {
  background: var(--sf3);
  color: var(--tx);
}

.icon-btn-copy {
  color: var(--ac);
}

.icon-btn-copy:hover {
  background: var(--ac-soft);
  border-color: var(--ac);
  color: var(--ac);
}

.icon-btn-danger {
  color: var(--dn);
}

.icon-btn-danger:hover {
  background: var(--dn-soft);
  border-color: var(--dn);
  color: var(--dn);
}

.is-revealed .row-phone {
  color: var(--ac);
  letter-spacing: 0.2px;
}

.icon-btn.is-revealed {
  background: var(--ac-soft);
  border-color: var(--ac);
  color: var(--ac);
}

.icon-btn.is-copied {
  background: var(--ac-soft);
  border-color: var(--ac);
  color: var(--ac);
  animation: copy-pop 0.28s var(--ease);
}

@keyframes copy-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(0.86);
  }
  100% {
    transform: scale(1);
  }
}

.cal-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid var(--bd);
  border-radius: var(--r2);
  background: var(--sf2);
  color: var(--tx2);
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.cal-nav-btn .icon {
  width: 15px;
  height: 15px;
}

.cal-nav-btn:hover {
  background: var(--sf3);
  border-color: var(--bd-strong);
  color: var(--tx);
}

.field {
  margin-bottom: 12px;
}

.field-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--tx3);
}

.input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--bd);
  border-radius: var(--r2);
  background: var(--sf2);
  color: var(--tx);
  font-size: 13.5px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.input::placeholder {
  color: var(--tx3);
}

.input:hover {
  border-color: var(--bd-strong);
}

.input:focus {
  outline: none;
  border-color: var(--ac);
  box-shadow: 0 0 0 3px var(--ac-soft);
}

.input-mono {
  font-family: var(--mono);
  letter-spacing: 0.5px;
}

.note {
  margin-top: 10px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--tx3);
}

.note strong {
  color: var(--tx2);
}

.panel-column {
  flex: 0 0 var(--panel-w);
  display: flex;
  flex-direction: column;
  padding: 26px 22px;
  border-left: 1px solid var(--bd);
  overflow-y: auto;
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.ring-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 0 20px;
}

.ring-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.ring-svg {
  filter: drop-shadow(0 0 18px var(--glow));
}

.ring-track {
  stroke: var(--sf2);
}

.ring-progress {
  stroke: var(--ac);
  transition: stroke-dashoffset 1s linear, stroke-dasharray 1s linear, stroke 0.35s var(--ease);
}

.ring-wrap:has(.timer--warn) .ring-progress {
  stroke: var(--ac2);
  animation: ring-breathe 2.8s var(--ease) infinite;
}

.ring-wrap:has(.timer--warn) .ring-svg {
  filter: drop-shadow(0 0 18px var(--glow-warn));
}

.ring-wrap:has(.timer--danger) .ring-progress {
  stroke: var(--dn);
  animation: ring-breathe 1.1s var(--ease) infinite;
}

.ring-wrap:has(.timer--danger) .ring-svg {
  filter: drop-shadow(0 0 22px var(--glow-dn));
}

@keyframes ring-breathe {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

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

.timer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.clock {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--ac);
  transition: color 0.3s var(--ease), text-shadow 0.3s var(--ease);
}

.reel {
  display: inline-block;
  width: 1ch;
  height: 1em;
  overflow: hidden;
}

.reel-track {
  display: flex;
  flex-direction: column;
  transform: translateY(calc(var(--d, 0) * -1em));
  transition: transform 0.45s var(--ease);
}

.reel-track b {
  display: block;
  height: 1em;
  line-height: 1em;
  font-weight: inherit;
  text-align: center;
}

.clock-sep {
  display: inline-block;
  width: 0.44em;
  text-align: center;
  animation: clock-blink 2s var(--ease) infinite;
}

.clock-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes clock-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.42;
  }
}

.clock-label {
  margin-top: 4px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--tx3);
}

.timer--ok .clock {
  color: var(--ac);
}

.timer--warn .clock {
  color: var(--ac2);
}

.timer--danger .clock {
  color: var(--dn);
  text-shadow: 0 0 22px var(--glow-dn);
  animation: clock-pulse 1.4s ease-in-out infinite;
}

@keyframes clock-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.58;
  }
}

.ring-sub {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--tx3);
  text-align: center;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.stat {
  padding: 11px 12px;
  border: 1px solid var(--bd);
  border-radius: var(--r2);
  background: var(--sf);
}

.stat-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--tx3);
}

.stat-value {
  margin-top: 5px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--tx);
}

.stat-unit {
  margin-left: 3px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--tx3);
}

.mini-cal {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--bd);
}

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

.mini-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--tx3);
}

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

.mini-nav .cal-nav-btn {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
}

.mini-nav .cal-nav-btn .icon {
  width: 13px;
  height: 13px;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.mini-weekday {
  font-size: 9px;
  font-weight: 600;
  color: var(--tx3);
  text-align: center;
  opacity: 0.8;
}

.mini-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-radius: var(--r);
  background: var(--sf);
  color: var(--tx3);
  font-size: 10.5px;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.mini-cell:hover {
  background: var(--sf2);
}

.mini-cell.is-outside {
  background: transparent;
  opacity: 0.3;
}

.mini-cell.is-future,
.mini-cell.is-sunday {
  background: transparent;
  opacity: 0.5;
}

.mini-cell.is-zero {
  background: var(--sf2);
  color: var(--tx3);
}

.mini-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--ac);
  color: var(--ac);
  font-weight: 700;
}

.mini-cell.is-full {
  background: var(--ac);
  color: var(--bg);
  font-weight: 700;
}

.mini-cell.is-partial {
  background: var(--ac2);
  color: var(--bg);
  font-weight: 700;
}

.mini-day {
  display: block;
  line-height: 1;
}

.pin-gate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--scrim);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.is-locked .pin-gate,
.pin-gate.is-visible {
  display: flex;
}

.pin-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 340px;
  padding: 26px 24px;
  border: 1px solid var(--bd);
  border-radius: var(--r2);
  background: var(--sf);
  box-shadow: 0 34px 70px rgba(0, 0, 0, 0.72);
}

.pin-card .input {
  padding: 13px 15px;
  font-size: 16px;
  letter-spacing: 4px;
  text-align: center;
}

.pin-card::after {
  content: "";
  display: block;
  min-height: 18px;
  margin-top: 10px;
}

.pin-card:has(.pin-error)::after {
  display: none;
}

.pin-error {
  min-height: 18px;
  margin-top: 10px;
  font-size: 12.5px;
  text-align: center;
  color: var(--dn);
}

.pin-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.pin-sub {
  margin: 6px 0 20px;
  font-size: 12.5px;
  color: var(--tx3);
}

.pin-card .note {
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
