/* Pocket — standalone stylesheet (does NOT link huisstijl.css).
   Dark theme only, one column, mobile first. */

@font-face {
  font-family: 'Inter';
  src: url('/pocket/fonts/inter-var-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('/pocket/fonts/space-grotesk-var-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* Mirrors huisstijl.css :root. Keep in sync. */
:root {
  --stage-black:    #0A0F1A;
  --stage-ink:      #121D31;
  --paper:          #F2EDE3;
  --amber-hi:       #FFB020;
  --ash:            #8D98AD;

  --bg-body:     var(--stage-black);
  --bg-level-1:  var(--stage-ink);
  --bg-level-2:  #0E1522;
  --bg-level-3:  #1A2436;
  --bg-level-4:  #1C2840;

  --border-subtle:   #1A2436;
  --border-default:  #233049;

  --fg-primary:    #F1F4F9;
  --fg-secondary:  #B9C2D3;
  --fg-tertiary:   var(--ash);
  --fg-quaternary: #7F8BA3;

  --accent:        var(--amber-hi);
  --accent-hover:  #FFC04A;
  --accent-tint:   #2A1F0A;

  --status-ok:     #4CAF50;
  --status-warn:   #F59E0B;
  --status-error:  #EF4444;

  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;

  --radius-sm:  4px;
  --radius-md:  6px;
  --radius-lg:  8px;

  --font-family:  'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;

  --text-xs:   12px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   16px;
  --text-lg:   18px;
  --text-xl:   22px;
  --text-2xl:  27px;

  --overlay-bg:  rgba(0, 0, 0, .50);
  --shadow-md:   0 4px 16px rgba(0, 0, 0, .35);
}
/* End of mirrored tokens. */

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

html { color-scheme: dark; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-body);
  color: var(--fg-secondary);
  font-family: var(--font-family);
  font-size: var(--text-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible { outline: none; }

button { font: inherit; color: inherit; }

a { color: var(--accent); }

/* ── Layout ───────────────────────────────────────────── */

.app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding:
    env(safe-area-inset-top)
    calc(var(--space-4) + env(safe-area-inset-right))
    calc(var(--space-6) + env(safe-area-inset-bottom))
    calc(var(--space-4) + env(safe-area-inset-left));
}

.topbar {
  display: flex;
  align-items: center;
  min-height: 56px;
  gap: var(--space-2);
}

.band-switch {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  padding: var(--space-1) var(--space-2);
  margin-left: calc(-1 * var(--space-2));
  background: none;
  border: 0;
  border-radius: var(--radius-md);
  color: var(--fg-primary);
  text-align: left;
  cursor: pointer;
}
.band-switch-text { display: flex; flex-direction: column; min-width: 0; }
.band-switch-row { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.band-switch-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
}
.band-switch svg { flex: none; color: var(--fg-tertiary); }
.band-switch-role { color: var(--fg-tertiary); font-size: var(--text-sm); }

.topbar .offline-badge {
  margin-left: auto;
  padding: 2px var(--space-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--fg-tertiary);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.topbar .refresh { margin-left: auto; flex: none; }
.topbar .offline-badge + .refresh { margin-left: 0; }
.refresh.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .refresh.spinning svg { animation: none; } }

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-top: var(--space-6);
}
.screen.centered { justify-content: center; padding-top: 0; }

.brand {
  display: block;
  width: 40px;
  height: 40px;
}

h1 {
  margin: 0;
  color: var(--fg-primary);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.25;
}

p { margin: 0; }
.muted { color: var(--fg-tertiary); }
.small { font-size: var(--text-sm); }
.strong { color: var(--fg-primary); font-weight: 600; }

/* ── Forms ────────────────────────────────────────────── */

.field { display: flex; flex-direction: column; gap: var(--space-2); }

label { color: var(--fg-secondary); font-size: var(--text-base); }

.input {
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-level-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--fg-primary);
  font-family: var(--font-family);
  font-size: var(--text-md);   /* ≥16px keeps iOS Safari from zooming on focus */
}
.input:focus { border-color: var(--accent); outline: none; }
.input[aria-invalid="true"] { border-color: var(--status-error); }

.input.code {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: .3em;
  text-align: center;
  text-transform: uppercase;
}

.field-error {
  color: var(--status-error);
  font-size: var(--text-sm);
}
.field-error:empty { display: none; }

/* ── Buttons ──────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--text-md);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--accent);
  color: var(--stage-black);   /* brand rule: amber button = stage-black text */
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled {
  background: var(--bg-level-4);
  color: var(--fg-quaternary);
  cursor: default;
}
.btn-secondary {
  background: var(--bg-level-3);
  border-color: var(--border-default);
  color: var(--fg-primary);
}
.btn-danger {
  background: none;
  border-color: var(--border-default);
  color: var(--status-error);
}
.btn-block { width: 100%; }

.link-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--accent);
  font-size: var(--text-base);
  cursor: pointer;
  align-self: flex-start;
}

/* ── Loading ─────────────────────────────────────────── */

.loading {
  color: var(--fg-tertiary);
  font-size: var(--text-base);
}

/* ── Band menu sheet ──────────────────────────────────── */

.sheet-backdrop {
  position: fixed;
  /* Sized to the dynamic viewport, not inset:0 — on iOS Safari the layout
     viewport runs on behind the bottom toolbar, which hid the last sheet button. */
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: var(--overlay-bg);
}
.sheet-backdrop[hidden] { display: none; }

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  padding: var(--space-4) var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom));
  background: var(--bg-level-1);
  border: 1px solid var(--border-subtle);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sheet-title {
  margin: 0;
  color: var(--fg-primary);
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 600;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: 0;
  border-radius: var(--radius-md);
  color: var(--fg-tertiary);
  cursor: pointer;
}

.section-label {
  color: var(--fg-tertiary);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.band-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }

.band-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 52px;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-level-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
}
.band-item[aria-current="true"] {
  background: var(--accent-tint);
  border-color: var(--accent);
}
.band-item-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.band-item-name { color: var(--fg-primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.band-item-meta { color: var(--fg-tertiary); font-size: var(--text-sm); }
.band-item .check { color: var(--accent); flex: none; }

.sheet-actions { display: flex; flex-direction: column; gap: var(--space-2); }

.confirm {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-level-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}
.confirm-row { display: flex; gap: var(--space-2); }
.confirm-row .btn { flex: 1; }

.app-note {
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  color: var(--fg-tertiary);
  font-size: var(--text-sm);
}

/* ── Dashboard (chat 2) ─────────────────────────────────── */

.screen.dashboard { gap: var(--space-3); padding-top: var(--space-2); }

.eyebrow {
  color: var(--fg-tertiary);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow.strong { color: var(--fg-primary); }

.chip {
  display: inline-block;
  padding: 1px var(--space-2);
  background: var(--bg-level-4);
  border-radius: var(--radius-sm);
  color: var(--fg-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  white-space: nowrap;
}
.chip.dimmed { color: var(--fg-quaternary); }

/* Same-day signal */
.same-day {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  background: var(--bg-level-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--fg-secondary);
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
}
.same-day.warn { color: var(--status-warn); }
.same-day-text { flex: 1; min-width: 0; }
.same-day > svg:last-child { color: var(--border-default); flex: none; }

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  background: var(--bg-level-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.hero-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.hero-title {
  margin: 0;
  color: var(--fg-primary);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Times */
.times { display: flex; flex-direction: column; gap: var(--space-1); }
.time-big {
  color: var(--fg-primary);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.time-row { display: flex; flex-wrap: wrap; column-gap: var(--space-4); row-gap: var(--space-1); }
.time-unit { display: inline-flex; gap: var(--space-1); white-space: nowrap; font-size: var(--text-sm); }
.time-label { color: var(--fg-tertiary); }
.time-value { color: var(--fg-tertiary); font-variant-numeric: tabular-nums; }
.time-unit.emphasis { font-size: var(--text-base); }
.time-unit.emphasis .time-value { color: var(--fg-primary); }

/* Venue + Route */
.venue { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.venue-text { flex: 1 1 180px; min-width: 0; }
.venue-name { color: var(--fg-secondary); font-size: var(--text-base); }
.venue-address { color: var(--fg-tertiary); font-size: var(--text-sm); overflow-wrap: anywhere; }

/* Buttons: Route / Call / Message / Email */
.action-row { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  background: var(--bg-level-4);
  border: 0;
  border-radius: var(--radius-md);
  color: var(--fg-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.icon-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--fg-secondary);
  text-decoration: none;
  cursor: pointer;
}
.icon-action svg {
  box-sizing: content-box;
  padding: 11px;
  background: var(--bg-level-4);
  border-radius: 50%;
  width: 16px;
  height: 16px;
}
.icon-action.star svg { background: none; width: 20px; height: 20px; padding: 0; }
.icon-action.star { color: var(--fg-quaternary); }
.icon-action.star.on { color: var(--fg-primary); }

/* Primary contact on the hero */
.primary { display: flex; flex-direction: column; gap: var(--space-1); }
.primary-name { display: flex; align-items: center; gap: var(--space-2); color: var(--fg-primary); font-weight: 600; }
.primary-star { display: inline-flex; color: var(--fg-tertiary); }
.primary-star svg { width: 12px; height: 12px; }
.primary .action-row { margin-top: var(--space-2); }

/* Disclosure sections */
.section {
  background: var(--bg-level-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-4);
  background: none;
  border: 0;
  cursor: pointer;
}
.section-toggle svg, .row-chevron svg { color: var(--fg-tertiary); transition: transform .18s ease; transform: rotate(-90deg); }
.section-toggle[aria-expanded="true"] svg, .row-head[aria-expanded="true"] .row-chevron svg { transform: rotate(0deg); }
.section-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0 var(--space-4) var(--space-4);
}
.section-body[hidden], .row-detail[hidden] { display: none; }

.fields { display: flex; flex-direction: column; gap: var(--space-2); }
.field-line { display: flex; flex-direction: column; gap: 2px; }
.field-label { color: var(--fg-tertiary); font-size: var(--text-xs); font-weight: 600; }
.field-value { color: var(--fg-secondary); font-size: var(--text-sm); white-space: pre-line; overflow-wrap: anywhere; }

/* Contacts */
.contact-group { display: flex; flex-direction: column; gap: var(--space-1); }
.contact-row { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; }
.contact-names { flex: 1; min-width: 0; }
.contact-name { color: var(--fg-primary); font-size: var(--text-base); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-role { color: var(--fg-tertiary); font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-actions { display: flex; align-items: center; flex: none; }

/* Upcoming list */
.list-label { padding-top: var(--space-3); }
.gig-list { display: flex; flex-direction: column; gap: var(--space-2); }
.gig-row {
  background: var(--bg-level-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.gig-row.open { background: var(--bg-level-3); }
.row-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 60px;
  padding: var(--space-3) var(--space-4);
  background: none;
  border: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.row-date { display: flex; flex-direction: column; align-items: center; flex: none; width: 40px; }
.row-month { color: var(--fg-tertiary); font-size: var(--text-xs); font-weight: 600; }
.row-day { color: var(--fg-primary); font-size: var(--text-lg); font-weight: 700; font-variant-numeric: tabular-nums; }
.row-text { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.row-title { color: var(--fg-primary); font-size: var(--text-base); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--fg-tertiary); font-size: var(--text-sm); }
.row-chips { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1); flex: none; }
.row-chevron { display: inline-flex; flex: none; }
.gig-row.not-playing:not(.open) .row-day,
.gig-row.not-playing:not(.open) .row-title,
.gig-row.not-playing:not(.open) .row-sub { color: var(--fg-quaternary); }
.row-detail {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin: 0 var(--space-4);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border-subtle);
}
.row-status { display: flex; align-items: center; gap: var(--space-3); }

.show-more {
  width: 100%;
  min-height: 48px;
  background: none;
  border: 0;
  color: var(--fg-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-10) var(--space-4);
  color: var(--fg-tertiary);
  text-align: center;
}
.empty svg { color: var(--border-default); }
.empty p { margin: 0; }

.stamp {
  padding-top: var(--space-3);
  color: var(--fg-quaternary);
  font-size: var(--text-xs);
  text-align: center;
}
.stamp:empty { display: none; }

.sheet a.btn { text-decoration: none; }
