/* Reusable UI components */

/* --- App bar --- */
.appbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px 0 4px;
  min-height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 3;
}
.appbar.plain { border-bottom: none; }
.appbar.transparent {
  background: transparent;
  border-bottom: none;
  position: absolute;
  top: var(--top-inset);
  left: 0; right: 0;
  z-index: 10;
}
.appbar .title {
  flex: 1;
  font-weight: 700;
  font-size: 15px;
  padding: 0 8px;
}
.appbar .title .sub { display: block; font-size: 10px; font-weight: 500; color: var(--text-sub); letter-spacing: 0; }
.appbar .brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  letter-spacing: -0.02em;
  padding-left: 14px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.appbar .brand::before {
  content: "";
  width: 11px; height: 11px;
  background: var(--accent);
  display: inline-block;
  transform: skewX(-16deg);
}
.iconbtn {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: none; border: none;
  color: var(--text);
  cursor: pointer;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.iconbtn:active { background: var(--surface-3); }
.iconbtn.on-hero { color: #fff; }
.iconbtn .badge {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  min-width: 14px;
  text-align: center;
  line-height: 1.3;
}

/* --- Scrollable body --- */
.body-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
.body-scroll.with-nav { padding-bottom: 92px; }
.body-scroll .stack { display: flex; flex-direction: column; gap: 16px; padding: 16px; }

/* --- Bottom Nav --- */
.tabbar {
  position: absolute;
  left: 8px; right: 8px; bottom: 12px;
  height: 62px;
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--card-shadow-lg);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 4px;
  z-index: 5;
}
.tab {
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  background: none; border: none;
  padding: 8px 6px;
  min-width: 56px; min-height: 46px;
  color: var(--text-sub);
  cursor: pointer;
  border-radius: 14px;
  transition: color .15s;
}
.tab:active { background: var(--surface-3); }
.tab .lbl { font-size: 10px; font-weight: 500; letter-spacing: 0.02em; }
.tab[aria-selected="true"] { color: var(--accent); }
.tab[aria-selected="true"] .lbl { font-weight: 700; }

/* --- Announce bar --- */
.announce {
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.announce .icon { flex-shrink: 0; opacity: 0.95; }

/* --- Segmented (top-level app tab) --- */
.segment {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
  flex-shrink: 0;
}
.segment button {
  flex: 1;
  background: none;
  border: none;
  padding: 12px 4px;
  color: var(--text-sub);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  min-height: 44px;
}
.segment button[aria-selected="true"] {
  color: var(--text);
  font-weight: 700;
}
.segment button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 20%; right: 20%; bottom: 0;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* Pill segment (in-content) */
.pillseg {
  display: inline-flex;
  background: var(--surface-3);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.pillseg button {
  background: none; border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  letter-spacing: 0.02em;
  min-height: 32px;
}
.pillseg button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
:root[data-theme="dark"] .pillseg button[aria-selected="true"],
:root:not([data-theme="light"]) .pillseg button[aria-selected="true"] { background: var(--surface); }

/* Day tabs (horizontal scroll) */
.daytabs {
  display: flex; gap: 4px;
  overflow-x: auto;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.daytabs button {
  background: var(--surface-3);
  border: none;
  padding: 8px 14px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 34px;
}
.daytabs button[aria-selected="true"] {
  background: var(--text);
  color: var(--surface);
}

/* --- Section head --- */
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 16px;
  margin-bottom: 12px;
}
.sec-head .titles { display: flex; align-items: baseline; gap: 12px; }
.sec-head .bar { width: 4px; height: 20px; background: var(--accent); border-radius: 2px; transform: translateY(3px); align-self: flex-start; }
.sec-head .bar.info { background: var(--info); }
.sec-head .bar.warn { background: var(--warning); }
.sec-head .bar.dark { background: var(--text); }
.sec-head h2 { margin: 0; font-size: 17px; font-weight: 900; letter-spacing: -0.01em; }
.sec-head .sub { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.sec-head .more {
  background: none; border: none;
  font-size: 12px; color: var(--text-sub);
  display: flex; align-items: center; gap: 2px;
  cursor: pointer; min-height: 32px;
}
.sec-head.display h2 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

/* --- Cards --- */
.card { background: var(--card); border-radius: 14px; box-shadow: var(--card-shadow); overflow: hidden; }
.card.flat { box-shadow: none; border: 1px solid var(--border); }

/* --- Chips --- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.chip-artist { background: var(--tag-artist-bg); color: var(--tag-artist-fg); }
.chip-caution { background: var(--accent); color: #fff; }
.chip-info { background: var(--info); color: #fff; }
.chip-dj { background: var(--warning); color: #fff; }
.chip-day { background: var(--tag-day-bg); color: var(--tag-day-fg); }
.chip-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-sub); padding: 2px 7px; }
.chip-special { background: linear-gradient(135deg, #f28c38, #e5273e); color: #fff; }
.chip-new { background: var(--accent); color: #fff; }

/* --- Buttons --- */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  min-height: 48px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-primary:active { background: var(--accent-lo); }
.btn-primary:disabled { background: var(--border-strong); color: var(--text-sub); cursor: not-allowed; }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--text);
  padding: 12px 20px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}
.btn-outline .brand-icon { width: 18px; height: 18px; }
.btn-ghost {
  background: var(--surface-3);
  color: var(--text);
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  padding: 8px 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  min-height: 36px;
}

/* --- Icon SVG --- */
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon.sm { width: 16px; height: 16px; stroke-width: 2.2; }
.icon.xs { width: 12px; height: 12px; stroke-width: 2.4; }
.icon.lg { width: 28px; height: 28px; stroke-width: 1.8; }
.icon.xl { width: 40px; height: 40px; stroke-width: 1.5; }

/* --- Row list --- */
.rowlist { background: var(--card); border-radius: 14px; overflow: hidden; }
.rowlist .row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  min-height: 52px;
}
.rowlist .row + .row { border-top: 1px solid var(--border); }
.rowlist .row:active { background: var(--surface-3); }
.rowlist .row .label { flex: 1; }
.rowlist .row .sub { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.rowlist .row .val { font-size: 12px; color: var(--text-sub); font-family: var(--font-mono); }
.rowlist .row .icn { color: var(--text-caption); flex-shrink: 0; }
.rowlist .row .lead-icon { color: var(--text-sub); flex-shrink: 0; }

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-sub);
  padding: 20px 16px 8px;
  margin: 0;
}

/* --- Placeholder art (gradient tiles) --- */
.art {
  background: linear-gradient(135deg, #e5273e 0%, #7a1420 50%, #262626 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.art-warm { background: linear-gradient(135deg, #e5273e, #f28c38); }
.art-cool { background: linear-gradient(135deg, #274483, #007aff); }
.art-mono { background: linear-gradient(135deg, #1e1e20, #6b6b6d); }
.art-nova { background: linear-gradient(135deg, #f01c1c 0%, #b0193d 40%, #1e1e20 100%); }
.art-forest { background: linear-gradient(135deg, #16a34a, #065f46); }
.art-sunset { background: linear-gradient(135deg, #f28c38, #e5273e 60%, #274483); }
.art-noise::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.15) 1px, transparent 1px);
  background-size: 3px 3px;
  opacity: 0.25;
  pointer-events: none;
}

/* --- Form controls --- */
.input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  min-height: 48px;
}
.input:focus { outline: none; border-color: var(--accent); }
.input::placeholder { color: var(--text-caption); }
.label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
  margin-bottom: 6px;
}
.label .req { color: var(--accent); margin-right: 4px; }

.checkbox {
  width: 22px; height: 22px;
  border: 2px solid var(--border-strong);
  border-radius: 4px;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--surface);
}
.checkbox.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* --- Banner --- */
.banner-caution {
  background: color-mix(in oklab, var(--accent) 12%, var(--surface));
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding: 12px 14px;
  font-size: 12px;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.banner-info {
  background: var(--info-tint);
  color: var(--text);
  border-left: 3px solid var(--info);
  padding: 12px 14px;
  font-size: 12px;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* --- Ticket ornaments --- */
.ticket-notch {
  --notch: 12px;
  position: relative;
  background: var(--card);
  border-radius: 14px;
}
.ticket-notch::before, .ticket-notch::after {
  content: "";
  position: absolute;
  width: 24px; height: 24px;
  background: var(--surface);
  border-radius: 50%;
  top: calc(var(--notch-y, 60%) - 12px);
  z-index: 1;
}
.ticket-notch::before { left: -12px; }
.ticket-notch::after { right: -12px; }
.ticket-dotted {
  height: 1px;
  background-image: linear-gradient(to right, var(--border-strong) 50%, transparent 50%);
  background-size: 8px 1px;
  background-repeat: repeat-x;
}

/* Bottom sheet (static, for map) */
.bottomsheet {
  background: var(--card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  padding: 12px 16px 20px;
  position: absolute;
  left: 0; right: 0; bottom: 92px;
  z-index: 4;
}
.bottomsheet .handle {
  width: 40px; height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 0 auto 12px;
}

/* Tooltip callout */
.tooltip {
  position: absolute;
  background: var(--text);
  color: var(--surface);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 12;
}
.tooltip::after {
  content: "";
  position: absolute;
  border: 6px solid transparent;
  border-top-color: var(--text);
  top: 100%; left: 50%; transform: translateX(-50%);
}

/* Overlay dim */
.overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); z-index: 6; }

/* Text styles */
.h-display { font-family: var(--font-display); font-weight: 900; font-size: 32px; letter-spacing: -0.01em; line-height: 1.05; text-wrap: balance; }
.h-title { font-size: 20px; font-weight: 900; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
.h-heading { font-size: 15px; font-weight: 700; margin: 0; }
.h-body { font-size: 14px; line-height: 1.6; margin: 0; color: var(--text); }
.h-caption { font-size: 11px; color: var(--text-sub); }
.h-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
