:root {
  color-scheme: dark;

  --ground: #161512;
  --paper: #211F1B;
  --ink: #F2EEE6;
  --muted: #A8A398;
  --hair: #38352E;
  --tone: #2E2B26;
  --inset: #2B2823;
  --shu: #F0603A;
  --on-shu: #161512;
  --lift: 0 0 0 1px #2C2A24;
}

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

html, body { height: 100%; background: var(--ground); }

body {
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

button, input, textarea { color: inherit; font: inherit; border: 0; background: none; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .55; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

.turbo-progress-bar { background: var(--ink); }

/* Screen */
.screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  margin: 0 auto;
  padding: max(env(safe-area-inset-top), 18px) 18px max(env(safe-area-inset-bottom), 18px);
}

.top { display: flex; flex-direction: column; gap: 10px; }
.bar { display: flex; justify-content: space-between; align-items: center; min-height: 48px; }
.tag { color: var(--muted); font-size: 15px; font-weight: 500; }

.time {
  font-size: 54px;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.sound {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--tone);
}
.sound svg { width: 20px; height: 20px; }
.sound[aria-pressed="true"] { background: var(--ink); color: var(--ground); }

.rail { height: 6px; border-radius: 99px; overflow: hidden; background: var(--tone); }
.rail i { display: block; height: 100%; width: var(--left); border-radius: 99px; background: var(--ink); }

/* Card */
.card {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 24px 22px;
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--lift);
}

.do { font-size: 33px; font-weight: 700; line-height: 1.14; letter-spacing: -.022em; text-wrap: pretty; }
.do.small { font-size: 27px; }
.big { font-size: 40px; font-weight: 700; line-height: 1.08; letter-spacing: -.028em; overflow-wrap: anywhere; }

.rule {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font-size: 16px;
  text-wrap: pretty;
}

.draft {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: var(--inset);
  font-size: 15px;
  white-space: pre-line;
}
.copy {
  align-self: flex-start;
  min-height: 36px;
  padding: 0 18px;
  border-radius: 99px;
  background: var(--tone);
  font-size: 14px;
  font-weight: 600;
}

.steps { display: flex; flex-direction: column; gap: 14px; padding-left: 26px; font-size: 19px; font-weight: 500; line-height: 1.25; }
.steps ::marker { color: var(--muted); font-weight: 600; }

/* Buttons */
.buttons { display: flex; flex-direction: column; gap: 10px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.button_to { display: flex; }

.btn {
  width: 100%;
  min-height: 52px;
  padding: 6px 10px;
  border-radius: 16px;
  background: var(--tone);
  font-size: 17px;
  font-weight: 600;
}
.btn.primary {
  min-height: 66px;
  border-radius: 20px;
  background: var(--ink);
  color: var(--ground);
  font-size: 21px;
  letter-spacing: -.01em;
}

.say {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 6px 0 18px;
  border-radius: 99px;
  background: var(--paper);
}
/* 16px keeps iOS from zooming the page when the field takes focus. */
.say input { flex: 1; min-width: 0; height: 48px; font-size: 16px; outline: none; }
.say input::placeholder { color: var(--muted); }
.send {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tone);
  color: var(--muted);
}
.send svg { width: 16px; height: 16px; }

/* Toast: sits over the rule for a moment so the instruction stays readable */
#toast:empty { display: none; }
.toast {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--ink);
  color: var(--ground);
  font-size: 15px;
  font-weight: 500;
}
.toast small { font-size: 13px; font-weight: 500; opacity: .72; }
.link { min-height: 44px; font-size: 15px; font-weight: 600; text-decoration: underline; text-align: left; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.choice { width: 100%; min-height: 44px; border-radius: 12px; background: var(--ground); color: var(--ink); font-size: 15px; font-weight: 600; }

/* Dump and login */
.dump { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.box {
  height: 190px;
  padding: 18px;
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--lift);
  font-size: 18px;
  resize: none;
}
.box.short { height: 60px; }
.box::placeholder { color: var(--muted); }

/* Urgency builds in two steps. Vermilion only ever means time. */
[data-urgency="narrowing"] .rail i { background: var(--shu); }
[data-urgency="now"] .time { color: var(--shu); }
[data-urgency="now"] .rail i { background: var(--shu); }
[data-urgency="now"] .card { box-shadow: 0 0 0 2px var(--shu); }
[data-urgency="now"] .btn.primary { background: var(--shu); color: var(--on-shu); }
