@font-face {
  font-family: "Antonio";
  src: url("assets/fonts/antonio-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Antonio";
  src: url("assets/fonts/antonio-semibold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Antonio";
  src: url("assets/fonts/antonio-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("assets/fonts/atkinson-regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("assets/fonts/atkinson-bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("assets/fonts/atkinson-italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f0f2ee;
  --paper-raised: #fafbf8;
  --ink: #1b1c19;
  --ink-soft: #565950;
  --rule: #b9bdb4;
  --rule-dark: #6f736b;
  --signal: #ff5a36;
  --signal-dark: #b92d13;
  --tape: #f3d54e;
  --desk: #252824;
  --desk-deep: #171916;
  --success: #1f6b50;
  --danger: #a62b20;
  --focus: #005fcc;
  --shadow-sheet: 0 28px 70px rgba(5, 8, 5, 0.34);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --font-display: "Antonio", "Arial Narrow", sans-serif;
  --font-body: "Atkinson Hyperlegible", sans-serif;
}

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

html {
  min-height: 100%;
  background: var(--desk-deep);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 34%),
    var(--desk);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--tape);
  color: var(--ink);
}

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--desk-deep);
}

::-webkit-scrollbar-thumb {
  background: var(--rule-dark);
  border: 3px solid var(--desk-deep);
}

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

button,
label,
select,
input[type="checkbox"],
input[type="radio"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
}

button:not(:disabled),
label:has(input):not(:has(input:disabled)),
select:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

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

a {
  color: var(--signal-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
}

.app-frame {
  width: min(1240px, calc(100% - 40px));
  min-height: calc(100vh - 40px);
  min-height: calc(100dvh - 40px);
  margin: 20px auto;
  background: var(--paper);
  box-shadow: var(--shadow-sheet);
  overflow: clip;
}

.app-header {
  min-height: 68px;
  padding: 10px clamp(18px, 3vw, 36px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper);
}

.brand-button,
.text-button {
  min-height: 44px;
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.brand-button {
  font-family: var(--font-display);
  font-size: 1.18rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.brand-mark {
  width: 27px;
  height: 25px;
  display: grid;
  align-content: center;
  gap: 3px;
}

.brand-mark i {
  display: block;
  height: 5px;
  background: var(--signal);
}

.brand-mark i:nth-child(2) {
  width: 72%;
  background: var(--ink);
}

.brand-mark i:nth-child(3) {
  width: 86%;
  background: var(--tape);
}

.local-note {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.local-note.is-warning {
  color: var(--danger);
  font-weight: 700;
}

.header-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 350px);
}

fieldset,
.home-layout,
.pack-layout,
.trip-form,
.form-block,
.choice-rail,
.module-rail {
  min-width: 0;
}

.call-sheet {
  background: var(--paper);
}

.builder-sheet {
  min-width: 0;
  border-right: 1px solid var(--ink);
}

.sheet-heading {
  padding: clamp(30px, 5vw, 64px) clamp(22px, 5vw, 68px) 0;
}

.sheet-heading h1,
.trip-heading h1 {
  max-width: 11ch;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: clamp(3.7rem, 8vw, 6rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 0.92;
  text-transform: uppercase;
}

.sheet-heading > p {
  max-width: 56ch;
  margin-bottom: 38px;
  color: var(--ink-soft);
  font-size: clamp(1.05rem, 1.8vw, 1.23rem);
}

.phase-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.phase-preview > div {
  min-width: 0;
  padding: 18px 16px 20px 0;
}

.phase-preview > div + div {
  padding-left: 16px;
  border-left: 1px solid var(--ink);
}

.phase-preview > div:last-child {
  background-image:
    linear-gradient(90deg, rgba(240, 242, 238, 0.25), rgba(240, 242, 238, 0.68)),
    url("assets/materials/tape-warm-1.svg");
  background-size: 100% 100%;
}

.phase-preview strong,
.phase-preview span {
  display: block;
}

.phase-preview strong {
  margin-bottom: 5px;
  font-family: var(--font-display);
  font-size: 1.14rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.phase-preview span {
  color: var(--ink-soft);
  font-size: 0.83rem;
  line-height: 1.25;
}

.trip-form {
  padding: 0 clamp(22px, 5vw, 68px) clamp(28px, 5vw, 60px);
}

.form-block {
  margin: 0;
  padding: 36px 0 40px;
  border: 0;
  border-bottom: 1px solid var(--rule);
}

.form-block legend {
  width: 100%;
  margin-bottom: 22px;
  padding: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

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

.basics-block legend {
  grid-column: 1 / -1;
}

.basics-block .field-wide,
.duration-readout {
  grid-column: 1 / -1;
}

.duration-readout {
  min-height: 31px;
  padding-top: 1px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: var(--ink-soft);
}

.duration-readout strong {
  color: var(--signal-dark);
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.duration-readout span {
  font-size: inherit;
}

.duration-readout.is-error strong,
.duration-readout.is-error span {
  color: var(--danger);
}

.field {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
}

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

.field input,
.field select,
.rename-form input {
  width: 100%;
  min-height: 47px;
  padding: 8px 2px;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.06rem;
}

.field input::placeholder,
.rename-form input::placeholder {
  color: #686b63;
  opacity: 1;
}

.field input:focus,
.field select:focus,
.rename-form input:focus {
  border-bottom-color: var(--signal-dark);
  outline: 0;
  box-shadow: 0 3px 0 rgba(255, 90, 54, 0.24);
}

.choice-rail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.choice-tab,
.module-tab {
  position: relative;
  min-width: 0;
}

.choice-tab input,
.module-tab input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-tab > span {
  min-height: 76px;
  padding: 15px 16px;
  display: grid;
  align-content: center;
  border: 1px solid var(--rule-dark);
  background: var(--paper-raised);
  transition: background-color 130ms ease, color 130ms ease, transform 130ms ease;
}

.choice-tab strong,
.choice-tab small,
.module-tab strong,
.module-tab small {
  display: block;
}

.choice-tab strong {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.choice-tab small,
.module-tab small {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.25;
}

.choice-tab input:checked + span {
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-2px);
}

.choice-tab input:checked + span small {
  color: #d7dbd3;
}

.choice-tab input:focus-visible + span,
.module-tab input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.compact-tab > span {
  min-height: 52px;
}

.module-rail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 16px;
}

.module-tab > span {
  min-height: 69px;
  padding: 14px 18px;
  display: grid;
  align-content: center;
  border: 0;
  background: transparent url("assets/materials/tape-warm-1.svg") center / 100% 100% no-repeat;
  box-shadow: inset 0 0 0 1px rgba(93, 77, 6, 0.48);
  transition: filter 130ms ease, box-shadow 130ms ease, transform 130ms ease;
}

.module-tab:nth-child(even) > span {
  background-image: url("assets/materials/tape-warm-2.svg");
}

.module-tab input:checked + span {
  filter: saturate(1.12) contrast(1.03);
  box-shadow: inset 0 0 0 2px rgba(61, 50, 3, 0.72), 0 6px 10px rgba(64, 53, 4, 0.2);
  transform: translateY(-2px);
}

.line-check {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.line-check input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--signal-dark);
}

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

.line-check small {
  margin-top: 3px;
  color: var(--ink-soft);
}

.build-bar {
  margin-top: 34px;
  padding: 16px 16px 16px 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--ink);
  color: var(--paper);
}

.live-count {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-variant-numeric: tabular-nums;
}

.live-count strong {
  font-family: var(--font-display);
  font-size: 2.05rem;
  line-height: 1;
}

.live-count span {
  color: #cfd3cb;
  font-size: 0.85rem;
}

.primary-action,
.secondary-action {
  min-height: 48px;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--signal);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  transition: background-color 140ms ease, transform 140ms var(--ease-out);
}

.primary-action:hover,
.secondary-action:hover {
  background: #ff7658;
  transform: translateY(-2px);
}

.primary-action:active,
.secondary-action:active {
  transform: translateY(0);
}

.saved-calls {
  padding: clamp(28px, 4vw, 48px) 24px;
  background: #dfe2dc;
}

.section-title-line {
  margin-bottom: 18px;
  padding-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  border-bottom: 1px solid var(--ink);
}

.section-title-line h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.65rem;
  text-transform: uppercase;
}

.section-title-line span {
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.trip-ledger {
  border-top: 1px solid var(--rule-dark);
}

.ledger-row {
  width: 100%;
  min-height: 92px;
  padding: 15px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px 12px;
  align-items: center;
  border-bottom: 1px solid var(--rule-dark);
  background: transparent;
  text-align: left;
}

.ledger-row:hover {
  background: rgba(255, 255, 255, 0.35);
}

.ledger-date,
.ledger-name,
.ledger-progress {
  min-width: 0;
}

.ledger-date,
.ledger-progress {
  font-variant-numeric: tabular-nums;
}

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

.ledger-date {
  color: var(--signal-dark);
}

.ledger-date small,
.ledger-name small,
.ledger-progress small {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.ledger-name strong {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.2rem;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.ledger-progress {
  grid-column: 1;
}

.ledger-row > .icon {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.empty-ledger {
  min-height: 220px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.empty-ledger .icon {
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  color: var(--signal-dark);
}

.empty-ledger p {
  max-width: 27ch;
  color: var(--ink-soft);
}

.pack-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
}

.packing-sheet {
  min-width: 0;
  padding: clamp(28px, 5vw, 60px) clamp(20px, 5vw, 64px) clamp(40px, 6vw, 78px);
  border-right: 1px solid var(--ink);
  transform-origin: top center;
  transition: transform 420ms var(--ease-out), filter 420ms var(--ease-out), box-shadow 420ms var(--ease-out);
}

.packing-sheet.is-arriving {
  transform: translateY(-12px) scale(0.995);
  filter: blur(1.5px);
  box-shadow: 0 14px 32px rgba(27, 28, 25, 0.12);
}

.trip-heading {
  padding-bottom: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 30px;
  align-items: end;
  border-bottom: 1px solid var(--ink);
}

.call-time {
  margin-bottom: 12px;
  color: var(--signal-dark);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.trip-heading h1 {
  max-width: 14ch;
  margin-bottom: 12px;
}

.trip-heading-main > p:last-child {
  margin-bottom: 0;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.note-callout {
  min-width: 124px;
  padding-left: 18px;
  border-left: 1px solid var(--ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.note-callout strong,
.note-callout span {
  display: block;
}

.note-callout strong {
  font-family: var(--font-display);
  font-size: 3.35rem;
  font-weight: 600;
  line-height: 0.94;
}

.note-callout span {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.78rem;
}

.phase-tabs {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--ink);
}

.phase-tab {
  position: relative;
  min-width: 0;
  min-height: 64px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.phase-tab + .phase-tab {
  border-left: 1px solid var(--ink);
}

.phase-tab span {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.1;
  text-transform: uppercase;
}

.phase-tab strong {
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.phase-tab.is-active {
  z-index: 1;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-3px);
  box-shadow: 0 4px 0 var(--signal), 0 9px 14px rgba(27, 28, 25, 0.2);
}

.phase-tab.is-active::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: -10px;
  width: 40px;
  height: 10px;
  background: var(--signal);
  clip-path: polygon(0 0, 100% 0, 86% 100%, 9% 82%);
}

.phase-tab.is-active strong {
  color: var(--tape);
}

.phase-tab[data-phase="final"].is-active {
  background: var(--tape);
  color: var(--ink);
  box-shadow: 0 4px 0 #9f8720, 0 9px 14px rgba(61, 50, 3, 0.18);
}

.phase-tab[data-phase="final"].is-active::after {
  background: #9f8720;
}

.phase-tab[data-phase="final"].is-active strong {
  color: var(--ink);
}

.phase-intro {
  padding: 18px 0 17px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
}

.phase-intro p {
  max-width: 54ch;
  margin: 0;
}

.phase-intro span {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.cue-section {
  padding-top: 42px;
}

.cue-section > header {
  margin-bottom: 8px;
  padding-bottom: 9px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 2px solid var(--ink);
}

.cue-section h2,
.add-cue h2,
.empty-phase h2 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.cue-section > header span {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.cue-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cue-item {
  min-height: 62px;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--rule);
  transition: background-color 160ms ease, opacity 160ms ease;
}

.cue-item:hover {
  background: rgba(255, 255, 255, 0.34);
}

.cue-entry {
  min-width: 0;
  min-height: 45px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 13px;
}

.cue-marker {
  width: 18px;
  height: 4px;
  flex: 0 0 auto;
  background: var(--signal);
}

.item-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.item-label {
  position: relative;
  width: fit-content;
  max-width: 100%;
  font-size: 1.02rem;
}

.item-copy small {
  color: var(--ink-soft);
  font-size: 0.74rem;
}

.item-actions {
  display: flex;
  align-items: center;
  opacity: 0.82;
  transition: opacity 140ms ease;
}

.cue-item:hover .item-actions,
.cue-item:focus-within .item-actions {
  opacity: 1;
}

.item-actions button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink-soft);
}

.item-actions button:hover {
  color: var(--signal-dark);
}

.is-editing {
  padding: 12px 0;
}

.rename-form {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.rename-form button {
  min-height: 44px;
  padding: 8px 13px;
  background: var(--ink);
  color: var(--paper);
}

.rename-form button:last-child {
  background: transparent;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.add-cue {
  margin-top: 54px;
  padding-top: 26px;
  display: grid;
  grid-template-columns: minmax(170px, 0.6fr) minmax(0, 1.4fr);
  gap: 32px;
  border-top: 3px double var(--ink);
}

.add-cue > div p {
  max-width: 28ch;
  margin-top: 8px;
  color: var(--ink-soft);
}

.add-item-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0.8fr 0.72fr;
  gap: 16px;
}

.add-item-form .field-wide {
  grid-column: 1 / -1;
}

.add-item-form .secondary-action {
  align-self: end;
}

.empty-phase {
  min-height: 300px;
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.empty-phase .icon {
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  color: var(--success);
}

.empty-phase p {
  max-width: 36ch;
  margin-top: 10px;
  color: var(--ink-soft);
}

.trip-actions {
  position: sticky;
  top: 20px;
  padding: 24px;
  display: grid;
  gap: 1px;
}

.action-heading {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ink);
}

.action-heading strong,
.action-heading span {
  display: block;
}

.action-heading strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  text-transform: uppercase;
}

.action-heading span {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.trip-actions > button {
  min-height: 50px;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.trip-actions > button:hover {
  background: rgba(255, 255, 255, 0.4);
}

.trip-actions > .handoff-action {
  min-height: 64px;
  margin-bottom: 8px;
  padding: 13px 14px;
  border-bottom: 0;
  background: var(--signal);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-transform: uppercase;
}

.trip-actions > .handoff-action:hover {
  background: #ff7658;
}

.handoff-instruction {
  margin-top: 14px;
  padding-block: 12px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.trip-actions > .danger-action {
  margin-top: 16px;
  color: var(--danger);
}

.toast {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: min(480px, calc(100% - 32px));
  min-height: 54px;
  padding: 12px 14px 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity 180ms ease, transform 240ms var(--ease-out);
}

.toast[hidden] {
  display: none;
}

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

.toast button {
  min-height: 40px;
  padding: 6px 12px;
  background: var(--tape);
  color: var(--ink);
  font-weight: 700;
}

.boot-sheet {
  width: min(540px, calc(100% - 40px));
  min-height: 240px;
  margin: 20vh auto 0;
  display: grid;
  place-items: center;
  background: var(--paper);
  box-shadow: var(--shadow-sheet);
  font-family: var(--font-display);
  font-size: 1.2rem;
  text-transform: uppercase;
}

@media (max-width: 960px) {
  .home-layout,
  .pack-layout {
    grid-template-columns: 1fr;
  }

  .builder-sheet,
  .packing-sheet {
    border-right: 0;
  }

  .saved-calls,
  .trip-actions {
    border-top: 1px solid var(--ink);
  }

  .trip-ledger {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 22px;
  }

  .trip-actions {
    position: static;
    grid-template-columns: repeat(2, 1fr);
  }

  .trip-actions .action-heading {
    grid-column: 1 / -1;
  }

  .trip-actions > .handoff-action,
  .trip-actions > .handoff-instruction,
  .trip-actions > .danger-action {
    grid-column: 1 / -1;
  }

  .trip-actions > .danger-action {
    margin-top: 0;
  }
}

@media (max-width: 680px) {
  .app-frame {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    box-shadow: none;
  }

  .app-header {
    min-height: calc(62px + env(safe-area-inset-top));
    padding: calc(8px + env(safe-area-inset-top)) 18px 8px;
    gap: 12px;
  }

  .local-note {
    max-width: 16ch;
    font-size: 0.7rem;
    line-height: 1.12;
    text-align: right;
  }

  .header-actions {
    gap: 10px;
  }

  .sheet-heading {
    padding: 32px 20px 0;
  }

  .sheet-meta {
    margin-bottom: 25px;
  }

  .sheet-heading h1,
  .trip-heading h1 {
    font-size: clamp(3.3rem, 17vw, 5rem);
  }

  .sheet-heading > p {
    margin-bottom: 28px;
  }

  .phase-preview > div {
    padding: 13px 9px 15px 0;
  }

  .phase-preview > div + div {
    padding-left: 9px;
  }

  .phase-preview strong {
    font-size: 0.93rem;
  }

  .phase-preview span {
    font-size: 0.7rem;
  }

  .trip-form {
    padding: 0 20px 32px;
  }

  .form-block {
    padding: 30px 0 34px;
  }

  .basics-block {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .basics-block .field-wide {
    grid-column: 1 / -1;
  }

  .duration-readout {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .choice-rail {
    gap: 5px;
  }

  .choice-tab > span {
    min-height: 72px;
    padding: 12px 10px;
  }

  .compact-tab > span {
    min-height: 54px;
  }

  .choice-tab strong {
    font-size: 0.94rem;
  }

  .choice-tab small {
    font-size: 0.68rem;
  }

  .module-rail {
    grid-template-columns: 1fr;
  }

  .build-bar {
    position: sticky;
    z-index: 3;
    bottom: calc(8px + env(safe-area-inset-bottom));
    margin-inline: -10px;
    padding: 11px 11px 11px 15px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.27);
  }

  .primary-action {
    padding-inline: 13px;
    font-size: 0.94rem;
  }

  .saved-calls {
    padding: 30px 20px 50px;
  }

  .trip-ledger {
    display: block;
  }

  .packing-sheet {
    padding: 28px 18px calc(52px + env(safe-area-inset-bottom));
  }

  .trip-heading {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .note-callout {
    padding: 15px 0 0;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-top: 1px solid var(--rule);
    border-left: 0;
    text-align: left;
  }

  .note-callout strong {
    font-size: 2.8rem;
  }

  .phase-tabs {
    grid-template-columns: repeat(2, 1fr);
  }

  .phase-tab:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--ink);
  }

  .phase-tab:nth-child(4) {
    border-top: 1px solid var(--ink);
  }

  .phase-intro {
    display: block;
  }

  .phase-intro span {
    display: block;
    margin-top: 8px;
  }

  .cue-section {
    padding-top: 36px;
  }

  .cue-section h2,
  .add-cue h2 {
    font-size: 1.45rem;
  }

  .cue-item {
    align-items: flex-start;
  }

  .cue-entry {
    padding-block: 2px;
  }

  .item-actions {
    opacity: 1;
  }

  .item-actions button {
    width: 38px;
  }

  .add-cue {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .add-item-form {
    grid-template-columns: 1fr 1fr;
  }

  .add-item-form .field-wide,
  .add-item-form .secondary-action {
    grid-column: 1 / -1;
  }

  .trip-actions {
    padding: 24px 20px calc(40px + env(safe-area-inset-bottom));
    grid-template-columns: 1fr 1fr;
  }

  .trip-actions > button {
    align-items: flex-start;
    line-height: 1.2;
  }

  .rename-form {
    grid-template-columns: 1fr auto;
  }

  .rename-form label {
    grid-column: 1 / -1;
  }
}

@media (max-width: 390px) {
  .brand-button {
    font-size: 1rem;
  }

  .text-button {
    font-size: 0.86rem;
  }

  .sheet-heading h1,
  .trip-heading h1 {
    font-size: 3.25rem;
  }

  .phase-preview span {
    display: none;
  }

  .phase-preview > div {
    min-height: 52px;
    display: grid;
    align-items: center;
  }

  .phase-preview strong {
    margin: 0;
  }

  .live-count span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
