:root {
  color-scheme: dark;
  --field: #09150d;
  --field-soft: #122318;
  --paper: #f5f1e6;
  --paper-deep: #eee8da;
  --ink: #213029;
  --muted: rgba(33, 48, 41, 0.5);
  --forest: #315b48;
  --sage: #acd082;
  --line: rgba(33, 48, 41, 0.13);
  --serif: Iowan Old Style, "Palatino Linotype", Palatino, Georgia, serif;
  --sans: ui-rounded, "SF Pro Rounded", "Avenir Next", Avenir, system-ui, sans-serif;
  font-family: var(--sans);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: #eef4e8;
  background:
    radial-gradient(circle at 72% 0%, rgba(142, 177, 95, 0.2), transparent 31rem),
    linear-gradient(155deg, #071009 0%, #0d1d12 58%, #08120b 100%);
}

button,
input {
  color: inherit;
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(172, 208, 130, 0.75);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.probe-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
}

.phone-stage {
  position: relative;
  display: flex;
  width: min(100%, 430px);
  height: min(100vh, 880px);
  height: min(100dvh, 880px);
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  flex-direction: column;
  background:
    radial-gradient(circle at 105% -2%, rgba(172, 208, 130, 0.18), transparent 19rem),
    var(--field);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.48);
}

.topbar {
  display: flex;
  min-height: 54px;
  padding: 2px 7px 10px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  display: flex;
  margin: 0;
  align-items: center;
  gap: 9px;
  color: rgba(238, 244, 232, 0.88);
  font-family: var(--serif);
  font-size: 17px;
}

.wren-mark {
  width: 27px;
  height: 27px;
  overflow: visible;
  fill: none;
  stroke: var(--sage);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.wren-mark circle {
  fill: var(--sage);
  stroke: none;
}

.held-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(222, 236, 209, 0.14);
  border-radius: 999px;
  color: rgba(238, 244, 232, 0.72);
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.held-button span {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  margin-left: 4px;
  padding: 0 5px;
  place-items: center;
  border-radius: 99px;
  color: #102016;
  background: var(--sage);
  font-size: 9px;
}

.paper {
  position: relative;
  display: flex;
  min-height: 0;
  padding: clamp(26px, 7vw, 34px) clamp(22px, 7vw, 32px) 18px;
  overflow: hidden;
  flex: 1 1 auto;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 28px 28px 10px 10px;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.27), transparent 26%),
    radial-gradient(rgba(50, 55, 47, 0.065) 0.55px, transparent 0.7px),
    var(--paper);
  background-size: auto, 14px 14px, auto;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34), inset 0 1px rgba(255, 255, 255, 0.8);
}

.screen {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
}

.eyebrow {
  margin: 0 0 18px;
  color: rgba(49, 91, 72, 0.72);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.screen h1 {
  max-width: 340px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(41px, 12vw, 56px);
  font-weight: 400;
  letter-spacing: -0.048em;
  line-height: 0.99;
}

.empty-copy {
  max-width: 300px;
  margin: 24px 0 0;
  color: rgba(33, 48, 41, 0.62);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.48;
}

.begin-form {
  display: grid;
  margin-top: auto;
  padding-top: 38px;
  gap: 14px;
}

.begin-form label,
.sheet-form label {
  color: var(--muted);
  font-size: 10px;
}

.begin-form input,
.sheet-form input {
  width: 100%;
  min-height: 52px;
  padding: 9px 1px;
  border: 0;
  border-bottom: 1px solid rgba(33, 48, 41, 0.2);
  border-radius: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--serif);
  font-size: 19px;
}

.begin-form input::placeholder,
.sheet-form input::placeholder {
  color: rgba(33, 48, 41, 0.34);
}

.begin-form button,
.sheet-primary {
  min-height: 50px;
  border: 1px solid var(--forest);
  border-radius: 999px;
  color: #f8f5ec;
  background: var(--forest);
  font-size: 12px;
  cursor: pointer;
}

.active-title {
  max-width: 100%;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(43px, 13vw, 59px);
  font-weight: 400;
  letter-spacing: -0.052em;
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.active-heading {
  display: flex;
  min-height: 21px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.active-heading .eyebrow {
  margin-bottom: 0;
}

.screen-finish {
  min-height: 32px;
  margin: -9px -5px 0 0;
  padding: 0 5px;
  border: 0;
  color: rgba(49, 91, 72, 0.58);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.active-heading + .active-title {
  margin-top: 18px;
}

.foothold {
  margin-top: clamp(34px, 7vh, 58px);
  padding: 2px 0 2px 17px;
  border-left: 1px solid rgba(49, 91, 72, 0.28);
}

.foothold span {
  display: block;
  margin-bottom: 7px;
  color: rgba(49, 91, 72, 0.65);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.foothold p {
  margin: 0;
  color: rgba(33, 48, 41, 0.74);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.42;
}

.foothold.is-empty p {
  color: rgba(33, 48, 41, 0.36);
  font-style: italic;
}

.caught-marker {
  width: fit-content;
  margin-top: 26px;
  padding: 8px 11px;
  border: 1px solid rgba(33, 48, 41, 0.09);
  border-radius: 999px;
  color: rgba(33, 48, 41, 0.47);
  background: rgba(49, 91, 72, 0.035);
  font-size: 9px;
}

.active-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 8px;
  padding-top: 22px;
}

.active-actions button {
  min-height: 48px;
  border: 1px solid rgba(33, 48, 41, 0.13);
  border-radius: 999px;
  color: rgba(33, 48, 41, 0.68);
  background: rgba(255, 255, 255, 0.18);
  font-size: 11px;
  cursor: pointer;
}

.active-actions .primary-action {
  border-color: var(--forest);
  color: #f8f5ec;
  background: var(--forest);
}

.sheet-scrim {
  position: fixed;
  z-index: 10;
  inset: 0;
  border: 0;
  background: rgba(1, 6, 3, 0.58);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
  backdrop-filter: blur(3px);
}

.sheet-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  z-index: 12;
  right: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, 430px);
  max-height: min(88vh, 760px);
  padding: 12px 22px max(26px, env(safe-area-inset-bottom));
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-width: 1px 1px 0;
  border-radius: 27px 27px 0 0;
  color: var(--ink);
  background:
    radial-gradient(rgba(50, 55, 47, 0.055) 0.55px, transparent 0.7px),
    #f4efe3;
  background-size: 14px 14px, auto;
  box-shadow: 0 -20px 70px rgba(0, 0, 0, 0.34);
  opacity: 0;
  transform: translate(-50%, 105%);
  transition: opacity 180ms ease, transform 300ms cubic-bezier(0.22, 0.75, 0.22, 1);
}

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

.sheet:focus {
  outline: 0;
}

.sheet-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 8px;
  border-radius: 99px;
  background: rgba(33, 48, 41, 0.14);
}

.sheet-close {
  display: block;
  min-height: 38px;
  margin: 0 0 0 auto;
  padding: 0 4px;
  border: 0;
  color: rgba(33, 48, 41, 0.48);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.sheet .eyebrow {
  margin-bottom: 10px;
}

.sheet h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 35px;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.sheet-copy {
  margin: 13px 0 0;
  color: rgba(33, 48, 41, 0.58);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.45;
}

.sheet-form {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.held-list,
.caught-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.held-card {
  position: relative;
  display: grid;
  min-height: 126px;
  padding: 19px;
  border: 1px solid rgba(33, 48, 41, 0.12);
  border-radius: 15px 15px 7px 7px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.62);
  box-shadow: 0 10px 28px rgba(39, 35, 26, 0.07);
}

.held-card:nth-child(even) {
  transform: rotate(0.35deg);
}

.held-card h3 {
  max-width: calc(100% - 74px);
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  line-height: 1.12;
}

.held-card p {
  margin: 12px 0 0;
  color: rgba(33, 48, 41, 0.55);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.35;
}

.held-card button {
  position: absolute;
  top: 17px;
  right: 16px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(49, 91, 72, 0.18);
  border-radius: 999px;
  color: var(--forest);
  background: rgba(49, 91, 72, 0.04);
  font-size: 9px;
  cursor: pointer;
}

.sheet-empty {
  margin: 30px 0 12px;
  color: rgba(33, 48, 41, 0.48);
  font-family: var(--serif);
  font-size: 15px;
}

.caught-item {
  padding: 11px 0;
  border-top: 1px solid rgba(33, 48, 41, 0.08);
  color: rgba(33, 48, 41, 0.68);
  font-family: var(--serif);
  font-size: 14px;
}

.finish-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 9px;
  margin-top: 28px;
}

.finish-actions button {
  min-height: 48px;
  border: 1px solid rgba(33, 48, 41, 0.13);
  border-radius: 999px;
  color: rgba(33, 48, 41, 0.65);
  background: transparent;
  font-size: 11px;
  cursor: pointer;
}

.finish-actions .sheet-primary {
  color: #f8f5ec;
  background: var(--forest);
}

.toast {
  position: fixed;
  z-index: 20;
  bottom: max(88px, calc(16px + env(safe-area-inset-bottom)));
  left: 50%;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border: 1px solid rgba(235, 245, 225, 0.14);
  border-radius: 999px;
  color: #eef4e8;
  background: rgba(12, 29, 18, 0.94);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.34);
  font-size: 10px;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 160ms ease, transform 180ms ease;
  pointer-events: none;
}

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

@media (min-width: 431px) {
  .phone-stage {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 38px;
  }
}

@media (max-height: 700px) {
  .paper {
    padding-top: 22px;
  }

  .foothold {
    margin-top: 27px;
  }

  .screen h1,
  .active-title {
    font-size: 39px;
  }
}

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