/* RailDate — Timetable Edition. Design tokens. */
:root {
  --paper:        #F4EDE0;
  --paper-warm:   #EFE6D4;
  --paper-deep:   #E6DCC4;
  --ink:          #1A1715;
  --ink-soft:     #5C544D;
  --ink-faint:    #8A7F73;
  --line:         rgba(26, 23, 21, 0.14);
  --line-strong:  rgba(26, 23, 21, 0.32);
  --line-dotted:  rgba(26, 23, 21, 0.45);
  --stamp:        #C84B31;
  --stamp-deep:   #9E3A26;
  --mint:         #3A6B5C;
  --amber:        #B8841F;

  --serif:  'DM Serif Display', 'GFS Didot', Georgia, serif;
  --sans:   'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:   'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

/* Reset within the artboard scope */
.rd-screen, .rd-screen *, .rd-screen *::before, .rd-screen *::after {
  box-sizing: border-box;
}

/* Phone artboard wrapper */
.rd-screen {
  width: 390px;
  height: 720px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-feature-settings: "ss01", "ss02";
  -webkit-font-smoothing: antialiased;
}

/* Subtle paper grain — fine, additive */
.rd-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(26,23,21,0.018) 0, transparent 38%),
    radial-gradient(circle at 88% 72%, rgba(26,23,21,0.022) 0, transparent 42%);
  pointer-events: none;
  z-index: 0;
}

/* All screen content sits above grain */
.rd-screen > * { position: relative; z-index: 1; }

/* Status bar */
.rd-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.rd-status-right { display: flex; gap: 6px; align-items: center; }

/* Top label bar — like a ticket header */
.rd-toprule {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 18px 24px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.rd-toprule-section {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.rd-toprule-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

/* Wordmark */
.rd-wordmark {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.rd-wordmark .dot { color: var(--stamp); }

/* Big editorial display */
.rd-display {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 56px;
  line-height: 0.92;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.rd-display.small { font-size: 38px; }
.rd-display.xsmall { font-size: 28px; }

/* Mono data labels */
.rd-label {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.rd-label.tight { letter-spacing: 0.08em; }

.rd-value {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0;
}
.rd-value.tab { font-variant-numeric: tabular-nums; }

/* Data row — label LEFT, dotted leader, value RIGHT */
.rd-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
}
.rd-row-leader {
  flex: 1;
  border-bottom: 1px dotted var(--line-dotted);
  margin-bottom: 3px;
}

/* Ticket card — perforated top + bottom */
.rd-ticket {
  background: var(--paper-warm);
  position: relative;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.rd-ticket::before,
.rd-ticket::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  background-image: radial-gradient(circle at 4px 4px, var(--paper) 3px, transparent 3.5px);
  background-size: 12px 8px;
  background-repeat: repeat-x;
}
.rd-ticket::before { top: -1px; }
.rd-ticket::after { bottom: -1px; transform: rotate(180deg); }

/* Stamp */
.rd-stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 5px;
  border: 1.5px solid var(--stamp);
  color: var(--stamp);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transform: rotate(-3deg);
  background: transparent;
}
.rd-stamp.mint { border-color: var(--mint); color: var(--mint); }
.rd-stamp.straight { transform: none; }

/* Status pill (rail-status style) */
.rd-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px 3px;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.rd-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
}
.rd-pill.ontime { color: var(--mint); }
.rd-pill.late   { color: var(--stamp); }
.rd-pill.board  { color: var(--amber); }

/* CTA button — square ticket-stub */
.rd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  border: none;
  cursor: pointer;
  text-align: center;
}
.rd-btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.rd-btn.stamp {
  background: var(--stamp);
  color: var(--paper);
}
.rd-btn.full { width: 100%; }

/* Field */
.rd-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rd-field input,
.rd-field textarea,
.rd-field select {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  padding: 8px 0 8px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  outline: none;
  border-radius: 0;
  width: 100%;
}
.rd-field input::placeholder { color: var(--ink-faint); }

/* Bottom nav — minimal mono tabs */
.rd-tabs {
  display: flex;
  padding: 0 0 14px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  background: var(--paper);
}
.rd-tab {
  flex: 1;
  text-align: center;
  padding: 14px 0 8px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: none;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.rd-tab.active { color: var(--ink); }
.rd-tab.active::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: 32px;
  height: 2px;
  background: var(--ink);
  transform: translateX(-50%);
}

/* SVG photo placeholder */
.rd-photo {
  position: relative;
  background: var(--paper-deep);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.rd-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0,
    transparent 6px,
    rgba(26,23,21,0.06) 6px,
    rgba(26,23,21,0.06) 7px
  );
}
.rd-photo span { position: relative; z-index: 1; padding: 4px 8px; background: var(--paper); }

/* Dashed divider */
.rd-dash {
  border: none;
  border-top: 1px dashed var(--line-strong);
  margin: 0;
}

/* Scroll area helper */
.rd-scroll { flex: 1; overflow-y: auto; }
.rd-scroll::-webkit-scrollbar { display: none; }
