/* Ringmast4r's Wares & Goods — house style (Net Works Site Style SOP) + playbill flourishes
   White paper, black ink, one spot colour (Oxblood). Borders over shadows, small radii, no emojis. */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700;1,900&display=swap');

/* ── 1. Tokens ─────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* neutrals (house, do not change) */
  --bg: #ffffff;        --bg-alt: #fafafa;
  --text: #1a1a1a;      --text-muted: #666666;
  --border: #e5e5e5;    --border-strong: #d0d0d0;
  --code-bg: #f4f4f4;   --table-header: #f8f8f8;  --table-stripe: #fbfbfb;

  /* the ONE accent: Oxblood (velvet-curtain red on white paper) */
  --accent: #8a2b2b;
  --accent-weak: #8a2b2b14;
  --accent-ink: #ffffff;

  /* semantic (kept neutral-leaning) */
  --ok: #2f6b4f;  --warn: #a86a12;  --danger: #8a2b2b;
  --callout-bg: #fffaea;  --callout-rule: #d4a017;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: "SF Mono", Monaco, Menlo, Consolas, monospace;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --radius: 4px;
  --nav-h: 64px;

  /* legacy aliases — page-level <style> blocks and inline styles still use these names */
  --bg-card: var(--bg-alt);   --bg-hover: var(--code-bg);   --bg-input: var(--bg);
  --primary: var(--accent);   --primary-dim: var(--accent); --primary-bg: var(--accent-weak);
  --border-glow: var(--accent-weak);
  --text-dim: var(--text-muted);  --text-bright: var(--text);
  --warning: var(--warn);  --shadow: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131313;      --bg-alt: #1a1a1a;
    --text: #ededed;    --text-muted: #9a9a9a;
    --border: #2b2b2b;  --border-strong: #3a3a3a;
    --code-bg: #1e1e1e; --table-header: #1c1c1c; --table-stripe: #171717;
    --accent: #d98a8a;  --accent-weak: #d98a8a1f; --accent-ink: #131313;
    --ok: #66b48c;  --warn: #e0a94a;  --danger: #d98a8a;
    --callout-bg: #26200e;  --callout-rule: #d4a017;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #131313;      --bg-alt: #1a1a1a;
  --text: #ededed;    --text-muted: #9a9a9a;
  --border: #2b2b2b;  --border-strong: #3a3a3a;
  --code-bg: #1e1e1e; --table-header: #1c1c1c; --table-stripe: #171717;
  --accent: #d98a8a;  --accent-weak: #d98a8a1f; --accent-ink: #131313;
  --ok: #66b48c;  --warn: #e0a94a;  --danger: #d98a8a;
  --callout-bg: #26200e;  --callout-rule: #d4a017;
}
:root[data-theme="light"] { color-scheme: light; }

/* ── 2. Base ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3, h4, h5 { margin: 0 0 12px; line-height: 1.2; color: var(--text); }
h1 { font-family: var(--font-display); font-size: 32px; font-weight: 700; letter-spacing: -0.5px; }
h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; padding-bottom: 8px; border-bottom: 2px solid var(--border-strong); }
h3 { font-size: 18px; font-weight: 600; }
h4 { font-size: 15px; font-weight: 600; }
h5, .kicker { font-family: var(--font-sans); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin: 0 0 8px; }
p { margin: 0 0 14px; }
code, kbd { font-family: var(--font-mono); font-size: 13px; background: var(--code-bg); padding: 2px 6px; border-radius: 3px; }
pre { font-family: var(--font-mono); font-size: 13px; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; }
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.sl { color: var(--text-muted); font-weight: 400; }          /* dimmed "//" slashes */
.wm { font-family: var(--font-display); font-weight: 700; }   /* wordmark word */
.lede { font-size: 17px; color: var(--text-muted); max-width: 68ch; }
.prose { max-width: 74ch; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* Tables (house spec) */
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { background: var(--table-header); font-weight: 600; font-size: 13px; white-space: nowrap; text-align: left; }
th, td { padding: 10px 14px; border: 1px solid var(--border); vertical-align: top; }
tbody tr:nth-child(even) { background: var(--table-stripe); }

/* Ornamental rule: hairline with a centre fleuron */
.rule-orn { display: flex; align-items: center; gap: 14px; margin: 28px 0; color: var(--text-muted); }
.rule-orn::before, .rule-orn::after { content: ''; flex: 1; border-top: 1px solid var(--border-strong); }
.rule-orn svg { width: 18px; height: 18px; flex: none; }
.rule-orn.accent { color: var(--accent); }

/* ── 3. Nav (header bar, SOP pattern B) ───────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--text);
  padding: 0 24px;
}
.nav-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; height: var(--nav-h); }
.nav-brand { display: inline-flex; align-items: baseline; gap: 8px; color: var(--text); font-size: 17px; font-weight: 600; white-space: nowrap; letter-spacing: -0.2px; }
.nav-brand:hover { text-decoration: none; }
.nav-brand .wm { font-size: 20px; }
.nav-brand .sl { font-family: var(--font-mono); }
.nav-brand span:not(.wm):not(.sl) { color: var(--text-muted); font-weight: 400; }  /* legacy "<span>Emporium</span>" markup */
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { display: inline-block; padding: 6px 10px; border-radius: 3px; color: var(--text-muted); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; background: var(--bg-alt); }
.nav-links a.active { color: var(--accent); background: var(--accent-weak); }
.nav-links a.ext { color: var(--text-muted); font-size: 13px; }
.nav-auth { display: flex; align-items: center; gap: 10px; }
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid transparent; border-radius: 3px; background: none; color: var(--text-muted); cursor: pointer; position: relative; padding: 0; }
.nav-icon:hover { color: var(--text); border-color: var(--border-strong); }
.nav-icon svg { width: 18px; height: 18px; }
.nav-icon .count { position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-family: var(--font-mono); font-size: 10px; line-height: 16px; text-align: center; }
.hamburger { display: none; background: none; border: 1px solid var(--border-strong); border-radius: 3px; color: var(--text); width: 38px; height: 34px; cursor: pointer; align-items: center; justify-content: center; padding: 0; }
.hamburger svg { width: 20px; height: 20px; }
.nav-settings-mobile { display: none; }

/* Floating panels (notifications, search, settings) */
.panel-float { position: fixed; top: calc(var(--nav-h) + 8px); right: 16px; z-index: 9999; background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 12px; }
.settings-panel { position: fixed; top: calc(var(--nav-h) + 8px); right: 16px; z-index: 200; background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 14px 16px; width: 240px; display: none; }
.settings-panel.open { display: block; }
.settings-panel h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 8px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.toggle-switch { position: relative; width: 36px; height: 20px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-alt); cursor: pointer; }
.toggle-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-muted); transition: left .2s, background .2s; }
.toggle-switch.active { border-color: var(--accent); background: var(--accent-weak); }
.toggle-switch.active::after { left: 18px; background: var(--accent); }

/* ── 4. Buttons, badges, boxes ────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: var(--radius);
  font-family: var(--font-sans); font-size: 14px; font-weight: 600; line-height: 1.2;
  cursor: pointer; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text);
  text-decoration: none; transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { text-decoration: none; border-color: var(--text-muted); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-secondary { background: transparent; color: var(--accent); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--accent); background: var(--accent-weak); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn-ghost:hover { border-color: var(--border-strong); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 26px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 3px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; background: var(--accent); color: var(--accent-ink); line-height: 1.4; vertical-align: middle; }
.badge.ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border-strong); }
.badge.ink { background: var(--text); color: var(--bg); }
.stamp { display: inline-block; padding: 4px 10px; border: 2px solid currentColor; border-radius: 3px; font-family: var(--font-mono); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--accent); transform: rotate(-3deg); }

.note { background: var(--bg-alt); border-left: 3px solid var(--border-strong); border-radius: 0 4px 4px 0; padding: 14px 18px; margin: 0 0 20px; }
.note.primary { border-left-color: var(--accent); }
.callout { background: var(--callout-bg); border-left: 3px solid var(--callout-rule); border-radius: 0 4px 4px 0; padding: 14px 18px; margin: 0 0 20px; }
.card, .f-item { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.frame { border: 1px solid var(--text); outline: 1px solid var(--border-strong); outline-offset: 4px; }

.alert { padding: 12px 16px; border-radius: 0 4px 4px 0; margin-bottom: 20px; font-size: 14px; background: var(--bg-alt); border-left: 3px solid var(--border-strong); }
.alert-error { border-left-color: var(--danger); color: var(--danger); }
.alert-success { border-left-color: var(--ok); color: var(--ok); }

/* ── 5. Forms ─────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label, label.lbl { display: block; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 6px; }
.form-input, textarea.form-input, select.form-input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], textarea, select {
  width: 100%; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border-strong); border-radius: 3px;
  color: var(--text); font: inherit; font-size: 15px; transition: border-color .15s;
}
.form-input:hover, textarea:hover, select:hover { border-color: var(--text-muted); }
.form-input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--border-strong); }
.form-error { color: var(--danger); font-size: 13px; margin-top: 6px; }
.form-hint { color: var(--text-muted); font-size: 13px; margin-top: 6px; }

/* ── 6. Playbill hero ─────────────────────────────────────────────────── */
.playbill { max-width: 960px; margin: 40px auto 16px; padding: 0 24px; text-align: center; }
.playbill-frame { border: 3px double var(--text); padding: 44px 32px 36px; position: relative; }
.playbill-frame::before { content: ''; position: absolute; inset: 6px; border: 1px solid var(--border-strong); pointer-events: none; }
.playbill .kicker { margin-bottom: 18px; }
.playbill-title { font-family: var(--font-display); font-weight: 900; font-size: clamp(40px, 7vw, 76px); line-height: 1; letter-spacing: -1px; margin: 0 0 10px; }
.playbill-title .playbill-name { display: block; font-size: .42em; font-weight: 700; font-style: italic; letter-spacing: 0; color: var(--text-muted); margin-bottom: 8px; }
.playbill-title .amp { font-style: italic; font-weight: 700; color: var(--accent); }
.playbill-lede { font-size: 17px; color: var(--text-muted); max-width: 60ch; margin: 14px auto 26px; }
.bill-stats { display: flex; justify-content: center; gap: 40px; margin: 0 0 26px; padding: 14px 0; border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong); }
.bill-stats > div { text-align: center; }
.bill-stats dt { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.bill-stats dd { margin: 2px 0 0; font-family: var(--font-mono); font-size: 26px; font-weight: 700; color: var(--accent); }
.playbill-cta { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
/* legacy hero classes used by older pages */
.hero { text-align: center; padding: 60px 24px 30px; max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: 40px; }
.hero p { color: var(--text-muted); font-size: 17px; max-width: 60ch; margin: 0 auto 24px; }
.hero-stats { display: flex; justify-content: center; gap: 40px; margin-top: 24px; }
.hero-stat .number { font-family: var(--font-mono); font-size: 26px; font-weight: 700; color: var(--accent); }
.hero-stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }

.marquee-bar { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg-alt); padding: 8px 24px; text-align: center; font-size: 13px; color: var(--text); }

/* ── 7. Sections & catalogue ──────────────────────────────────────────── */
.section { max-width: 1200px; margin: 0 auto; padding: 40px 24px; }
.section-header { margin-bottom: 24px; }
.section-header h2 { margin-bottom: 6px; }
.section-header p { color: var(--text-muted); }
.section-header .kicker { margin-bottom: 4px; }

.bill-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 20px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.bill-controls .search { max-width: 320px; }
.category-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.category-filter .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); align-self: center; margin-right: 4px; }
.filter-btn { padding: 6px 12px; border-radius: 3px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text-muted); font: inherit; font-size: 13px; cursor: pointer; }
.filter-btn:hover { border-color: var(--text-muted); color: var(--text); }
.filter-btn.active { color: var(--accent); border-color: var(--accent); background: var(--accent-weak); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }

/* Ticket card: perforated stub on the left, body on the right */
.product-card { display: flex; background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: border-color .15s; min-height: 168px; }
.product-card:hover { border-color: var(--text); }
.product-thumb { flex: none; width: 88px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 12px 8px; background: var(--bg-alt); border-right: 1px dashed var(--border-strong); color: var(--text-muted); text-align: center; position: relative; }
.product-thumb .ticket-no { font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--text-muted); }
.product-thumb .ticket-icon { color: var(--text); }
.product-thumb .ticket-icon svg { width: 30px; height: 30px; }
.product-thumb .ticket-cat { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 2px; color: var(--accent); writing-mode: vertical-rl; transform: rotate(180deg); }
.product-card::before, .product-card::after { content: ''; position: absolute; }
.product-body { flex: 1; padding: 14px 16px; display: flex; flex-direction: column; min-width: 0; }
.product-category { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.product-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text); margin: 0 0 6px; line-height: 1.25; }
.product-desc { font-size: 14px; color: var(--text-muted); flex: 1; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.product-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.product-price { font-family: var(--font-mono); font-size: 17px; font-weight: 700; color: var(--accent); }
.product-card.coming-soon { cursor: default; pointer-events: none; }
.product-card.coming-soon .product-title, .product-card.coming-soon .product-desc { color: var(--text-muted); }
.product-card.coming-soon .product-price { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.stars { color: var(--warn); letter-spacing: 1px; font-size: 12px; }
.stars .off { color: var(--border-strong); }

.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty-state h3 { color: var(--text); margin-bottom: 6px; }
.empty-state .icon { display: none; }

/* ── 8. Product detail (box office) ───────────────────────────────────── */
.product-detail { max-width: 1040px; margin: 40px auto; padding: 0 24px; }
.crumb { font-size: 13px; color: var(--text-muted); }
.product-detail h1 { font-size: 38px; margin: 8px 0 10px; }
.product-detail .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; font-size: 13px; color: var(--text-muted); }
.product-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.product-detail .description { line-height: 1.75; white-space: pre-line; max-width: 74ch; }
.price-box { border: 1px solid var(--text); outline: 1px solid var(--border-strong); outline-offset: 4px; padding: 24px; text-align: center; background: var(--bg); position: sticky; top: calc(var(--nav-h) + 24px); }
.price-box .kicker { margin-bottom: 6px; }
.price-box .price { font-family: var(--font-mono); font-size: 34px; font-weight: 700; color: var(--accent); margin-bottom: 14px; }
.price-box .fine { font-size: 12px; color: var(--text-muted); margin: 10px 0 0; }
.coupon-box { display: flex; gap: 6px; margin-top: 14px; }
.coupon-box input { flex: 1; font-family: var(--font-mono); font-size: 13px; text-transform: uppercase; padding: 8px 10px; }
.coupon-result { font-size: 13px; margin-top: 8px; min-height: 18px; }
.coupon-result.success { color: var(--ok); }
.coupon-result.error { color: var(--danger); }

/* Notices (reviews) */
.notices { margin-top: 40px; }
.star-rating { display: inline-flex; gap: 4px; }
.star-rating .star { font-size: 20px; line-height: 1; color: var(--border-strong); cursor: pointer; user-select: none; }
.star-rating .star.filled, .star-rating .star.hover { color: var(--warn); }
.star-rating-display { display: inline-flex; gap: 1px; font-size: 14px; }
.star-rating-display .star { color: var(--border-strong); }
.star-rating-display .star.filled { color: var(--warn); }
.review-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; background: var(--bg-alt); }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 8px; flex-wrap: wrap; }
.review-author { font-weight: 600; font-size: 14px; }
.review-date { font-size: 12px; color: var(--text-muted); }
.review-body { font-size: 14px; }
#reviewForm { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px; background: var(--bg); }

/* course outline (legacy, kept for course products) */
.course-outline { margin-top: 32px; }
.outline-module { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.outline-module-header { padding: 12px 16px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; background: var(--bg-alt); }
.outline-lessons { border-top: 1px solid var(--border); padding: 6px 0; }
.outline-lesson { padding: 8px 16px 8px 32px; font-size: 14px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
.type-badge { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; background: var(--accent-weak); color: var(--accent); }

/* ── 9. Auth & flow pages ─────────────────────────────────────────────── */
.auth-container { max-width: 440px; margin: 56px auto; padding: 0 24px; }
.auth-card { border: 1px solid var(--text); outline: 1px solid var(--border-strong); outline-offset: 4px; padding: 36px 32px; background: var(--bg); }
.auth-card h1 { font-size: 30px; margin-bottom: 4px; }
.auth-card .subtitle { color: var(--text-muted); margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 20px; color: var(--text-muted); font-size: 14px; }
.success-container { text-align: center; max-width: 540px; margin: 80px auto; padding: 0 24px; }
.success-icon { display: flex; justify-content: center; margin-bottom: 20px; color: var(--accent); }
.success-icon svg { width: 56px; height: 56px; }
.success-container h1 { font-size: 34px; }

/* ── 10. Dashboard / purchases / profile shared ───────────────────────── */
.dashboard-header { padding: 40px 24px 0; max-width: 1200px; margin: 0 auto; }
.dashboard-header h1 { font-size: 30px; }
.dashboard-header p { color: var(--text-muted); }
.dash-tabs, .forum-tabs, .tab-row { display: flex; gap: 2px; border-bottom: 1px solid var(--border-strong); margin-bottom: 24px; overflow-x: auto; }
.dash-tab, .forum-tab, .admin-tab { padding: 10px 16px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--text-muted); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.dash-tab:hover, .forum-tab:hover, .admin-tab:hover { color: var(--text); }
.dash-tab.active, .forum-tab.active, .admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.purchase-card { display: flex; align-items: center; gap: 16px; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; background: var(--bg-alt); }
.purchase-card:hover { border-color: var(--border-strong); }
.purchase-icon { width: 48px; height: 48px; border-radius: 3px; border: 1px dashed var(--border-strong); display: flex; align-items: center; justify-content: center; flex: none; color: var(--text); }
.purchase-icon svg { width: 22px; height: 22px; }
.purchase-info { flex: 1; min-width: 0; }
.purchase-info h3 { font-size: 16px; margin: 0 0 2px; }
.purchase-info p { font-size: 13px; color: var(--text-muted); margin: 0; }
.purchase-actions { display: flex; gap: 8px; }
.progress-bar { width: 100%; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; background: var(--accent); transition: width .4s; }
.progress-text { font-family: var(--font-mono); font-size: 12px; color: var(--accent); margin-top: 4px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 20px; }
.stat-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-alt); padding: 14px 16px; }
.stat-card .value { font-family: var(--font-mono); font-size: 24px; font-weight: 700; color: var(--accent); }
.stat-card .label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.badge-card { display: flex; gap: 12px; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--bg-alt); }
.badge-card.earned { border-color: var(--accent); }
.badge-icon { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; flex: none; font-family: var(--font-mono); font-size: 12px; }
.badge-info h4 { margin: 0 0 2px; font-size: 14px; }
.badge-info p { margin: 0; font-size: 12px; color: var(--text-muted); }
.profile-avatar { width: 96px; height: 96px; border-radius: 50%; border: 1px solid var(--border-strong); overflow: hidden; background: var(--bg-alt); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 32px; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload { position: relative; cursor: pointer; }
.avatar-upload input[type="file"] { display: none; }
.avatar-upload .avatar-overlay { position: absolute; inset: 0; border-radius: 50%; background: rgba(26,26,26,.7); color: #fff; display: flex; align-items: center; justify-content: center; opacity: 0; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; transition: opacity .15s; }
.avatar-upload:hover .avatar-overlay { opacity: 1; }
.notes-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.notes-textarea { min-height: 120px; resize: vertical; }
.notes-status { font-size: 12px; color: var(--text-muted); margin-top: 6px; min-height: 16px; }
.notes-status.saved { color: var(--ok); }

/* ── 11. Articles, legal, misc ────────────────────────────────────────── */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.article-card { border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.article-card:hover { border-color: var(--text); }
.article-img { width: 100%; height: 170px; object-fit: cover; border-bottom: 1px solid var(--border); background: #fff; }
.article-body { padding: 14px 16px; display: flex; flex-direction: column; flex: 1; }
.article-date { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.article-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.article-excerpt { font-size: 14px; color: var(--text-muted); flex: 1; }
.article-read { margin-top: 10px; font-size: 13px; }
.substack-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 24px; background: var(--bg-alt); }
.legal { max-width: 74ch; margin: 40px auto; padding: 0 24px; }
.legal h1 { font-size: 32px; }
.legal h2 { font-size: 20px; margin-top: 32px; }
.legal p, .legal li { font-size: 15px; }
.legal .updated { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.sec-table { font-size: 14px; }
.sec-badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; border: 1px solid var(--border-strong); color: var(--text-muted); }
.sec-badge.green, .sec-badge.ok { color: var(--ok); border-color: var(--ok); }
.skeleton { background: linear-gradient(90deg, var(--bg-alt) 25%, var(--code-bg) 50%, var(--bg-alt) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0 } 100% { background-position: -200% 0 } }
.cursor-blink::after { content: ''; }

/* Toasts */
.toast-container { position: fixed; top: calc(var(--nav-h) + 12px); right: 16px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; min-width: 260px; max-width: 360px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--text); border-left: 4px solid var(--accent); border-radius: var(--radius); animation: toastIn .3s ease; pointer-events: auto; }
.toast.toast-exit { animation: toastOut .25s ease forwards; }
.toast-icon { font-family: var(--font-mono); font-size: 13px; color: var(--accent); flex: none; }
.toast-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); }
.toast-message { font-size: 14px; }
@keyframes toastIn { from { transform: translateX(24px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes toastOut { to { transform: translateX(24px); opacity: 0 } }

/* Loading */
.loading-spinner { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; gap: 12px; color: var(--text-muted); }
.spinner { width: 28px; height: 28px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }
.loading-spinner .loading-text { font-size: 13px; }

/* Curtain reveal (home page, once per session) */
.curtain { position: fixed; inset: 0; z-index: 100000; pointer-events: none; display: flex; }
.curtain > div { flex: 1; background: var(--accent); border-top: 6px solid var(--text); transition: transform .8s cubic-bezier(.7,0,.3,1); }
.curtain.open > div:first-child { transform: translateX(-102%); }
.curtain.open > div:last-child { transform: translateX(102%); }

/* ── 11b. Cart ────────────────────────────────────────────────────────── */
.product-footer { flex-wrap: wrap; }
.product-actions { display: inline-flex; gap: 6px; align-items: center; }
.btn.in-cart { color: var(--text-muted); border-color: var(--border); background: var(--bg-alt); }
.nav-icon.active { color: var(--accent); border-color: var(--accent); }
.cart-page { max-width: 1040px; }
.cart-page h1 { font-size: 38px; margin-bottom: 20px; }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.cart-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); margin-bottom: 10px; overflow: hidden; }
.cart-row .stub { align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px; background: var(--bg-alt); border-right: 1px dashed var(--border-strong); font-family: var(--font-mono); font-size: 10px; letter-spacing: 1px; color: var(--text-muted); }
.cart-row .stub svg { width: 22px; height: 22px; color: var(--text); }
.cart-row .info { padding: 10px 0; min-width: 0; }
.cart-row .title { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.cart-row .product-category { margin: 0; }
.cart-row .price { font-family: var(--font-mono); font-size: 16px; font-weight: 700; color: var(--accent); }
.cart-row .remove { margin-right: 10px; color: var(--text-muted); }
.cart-row .remove svg { width: 16px; height: 16px; }
.cart-row .remove:hover { color: var(--danger); }
.cart-total { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 6px 0; border-top: 1px solid var(--border); text-align: left; }
.cart-total.grand { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--accent); border-top: 1px solid var(--text); margin-top: 6px; padding-top: 10px; }
#cartSummary { text-align: left; }
#cartSummary .kicker { text-align: center; }
#cartSummary .fine { text-align: center; }

/* ── 12. Footer ───────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--text); margin-top: 64px; padding: 32px 24px 40px; color: var(--text-muted); font-size: 13px; }
.footer-inner { max-width: 1400px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer-mark { font-size: 15px; color: var(--text); margin: 0; }
.footer-mark .wm { font-size: 17px; }
.footer p { margin: 0; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--text); }
.footer .fine { flex-basis: 100%; font-size: 12px; }

/* ── 13. Responsive ───────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .product-layout, .cart-layout { grid-template-columns: 1fr; }
  .price-box { position: static; }
}
@media (max-width: 900px) {
  .hamburger { display: inline-flex; }
  .nav-links { display: none; }
  .nav-links.open { display: flex; flex-direction: column; align-items: stretch; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--text); padding: 12px 24px 16px; gap: 2px; z-index: 99; }
  .nav-links.open a { display: block; padding: 10px 8px; font-size: 15px; }
  .nav-settings-mobile { display: block; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-muted); }
  .settings-panel { display: none !important; }
  .playbill-frame { padding: 32px 20px 28px; }
  .bill-stats { gap: 24px; }
  .product-grid { grid-template-columns: 1fr; }
  .section { padding: 32px 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .nav { padding: 0 14px; }
  .nav-brand { font-size: 15px; }
  .nav-brand .wm { font-size: 17px; }
  .nav-auth .btn-sm { padding: 6px 10px; font-size: 12px; }
  .playbill { margin-top: 20px; padding: 0 14px; }
  .playbill-lede { font-size: 15px; }
  .product-card { flex-direction: column; }
  .product-thumb { width: auto; flex-direction: row; justify-content: space-between; border-right: 0; border-bottom: 1px dashed var(--border-strong); padding: 8px 12px; }
  .product-thumb .ticket-cat { writing-mode: horizontal-tb; transform: none; }
  .product-detail h1, .cart-page h1 { font-size: 28px; }
  .cart-row { grid-template-columns: 60px minmax(0, 1fr); }
  .cart-row .price, .cart-row .remove { grid-column: 2; justify-self: start; margin: 0 0 10px; }
  .auth-card { padding: 24px 20px; }
  .section { padding: 24px 14px; }
  .toast-container { left: 12px; right: 12px; }
  .toast { max-width: none; }
}
@media (hover: none) and (pointer: coarse) {
  .btn, .filter-btn, .nav-icon { min-height: 40px; }
  .form-input, textarea, select { font-size: 16px; }
  .avatar-upload .avatar-overlay { opacity: .7; }
}
@media print {
  .nav, .footer, .playbill-cta, .bill-controls, .settings-panel { display: none !important; }
}

/* ── 14. Phone hardening (audited at 390px: nav must never exceed the viewport; 44px tap targets) ── */
.nav-inner, .nav-brand { min-width: 0; }
.nav-brand { overflow: hidden; text-overflow: ellipsis; }
.nav-auth { flex: none; }
.nav-settings-mobile a { display: block; padding: 10px 8px; }
.nav-settings-mobile a.strong { color: var(--accent); font-weight: 600; }
@media (max-width: 640px) {
  .nav-auth .nav-auth-text, .nav-auth .nav-icon-gear { display: none; }   /* sign in / join / settings live in the menu */
  .nav-auth { gap: 4px; }
  .nav-icon { width: 40px; height: 40px; }
  .hamburger { width: 40px; height: 40px; }
  .toast-container { left: 12px; right: 12px; top: calc(var(--nav-h) + 8px); }
  .toast { min-width: 0; max-width: none; }
  .settings-panel { display: none !important; }
  .footer-links a, .crumb { display: inline-block; padding: 10px 0; }
  .footer-links { gap: 0 18px; }
  .product-card .product-actions { flex-wrap: wrap; }
  .product-footer .btn { min-height: 40px; }
  .price-box { outline-offset: 3px; }
  html, body { overflow-x: hidden; }
}
@media (max-width: 420px) {
  .nav { padding: 0 10px; }
  .nav-inner { gap: 8px; }
  .nav-brand { font-size: 14px; gap: 5px; }
  .nav-brand .wm { font-size: 16px; }
  .playbill-title { font-size: 34px; }
  .playbill-frame { padding: 26px 14px 22px; }
  .bill-stats { gap: 16px; }
  .bill-stats dd { font-size: 22px; }
  .playbill-cta .btn { width: 100%; }
  .bill-controls .search { max-width: none; width: 100%; }
}
