/* Deals & Codes Community — "Premium Editorial" public theme + dark admin.
   Warm paper + espresso + brass. Fraunces for display, Inter for UI/body.
   The old rainbow palette is retired from the public theme; the legacy
   variable names survive only as warm-toned aliases so admin rules that
   still reference them resolve to the new system. */
:root {
  --paper: #FAF6EF;
  --card: #FFFDF8;
  --ink: #211A13;
  --ink-soft: #6F6151;
  --hairline: #E6DAC6;
  --brass: #A67C2E;
  --brass-deep: #8A6520;
  --espresso: #1E1710;
  --ivory: #F7F1E5;
  --img-bg: #F2EBDD;
  --amber-bg: #F7ECD4;
  --amber-ink: #5C4310;
  --radius: 20px;
  /* Legacy aliases (admin leftovers only) — warm tones, no rainbow. */
  --pink: #D9A441;
  --orange: #A67C2E;
  --yellow: #E3B94E;
  --teal: #A67C2E;
  --purple: #8A6520;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- header / footer ---------- */
.site-header {
  background: var(--espresso);
  color: var(--ivory);
  text-align: center;
  padding: 34px 16px 26px;
}
.site-header h1 {
  margin: 0; font-size: 2.1rem; letter-spacing: .2px;
  font-family: "Fraunces", Georgia, serif; font-weight: 600;
}
.tagline {
  margin: 8px 0 0; font-weight: 600; color: #D8C9AE;
  text-transform: uppercase; letter-spacing: .14em; font-size: .82rem;
}
.ad-label {
  display: inline-block; margin-top: 12px; padding: 3px 12px;
  border: 1px solid var(--brass); border-radius: 999px;
  color: #E7D3A1; background: transparent;
  font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
}
.site-footer {
  text-align: center; padding: 30px 16px 38px; color: var(--ink-soft); font-size: .92rem;
}
.site-footer a { color: var(--brass-deep); font-weight: 600; }

main { max-width: 1180px; margin: 0 auto; padding: 26px 16px 8px; }

/* ---------- controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--hairline); background: var(--card); color: var(--ink);
  padding: 6px 14px; border-radius: 999px; font-weight: 600; cursor: pointer;
  transition: border-color .22s ease, background .22s ease, color .22s ease;
}
.chip:hover { border-color: var(--brass); }
.chip.active { background: var(--espresso); color: var(--ivory); border-color: var(--espresso); }
#search {
  flex: 1 1 200px; padding: 11px 16px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--card);
  font-size: 1rem; font-family: inherit; color: var(--ink);
  transition: border-color .22s ease, box-shadow .22s ease;
}
#search:focus {
  outline: none; border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(166, 124, 46, .18);
}
.layout-toggle {
  display: flex; margin-left: auto;
  border: 1px solid var(--hairline); border-radius: 999px;
  overflow: hidden; background: var(--card);
}
.layout-toggle button {
  border: none; background: transparent; color: var(--ink-soft);
  padding: 7px 14px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: background .22s ease, color .22s ease;
}
.layout-toggle button + button { border-left: 1px solid var(--hairline); }
.layout-toggle button.active { background: var(--espresso); color: var(--ivory); }
.filter-row {
  flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.result-count { font-weight: 600; color: var(--ink-soft); }
/* Sort control (public only): premium paper/ink/brass system, native
   select so it stays keyboard accessible with platform behaviour. */
.sort-control { display: inline-flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; }
.sort-control label { font-weight: 600; color: var(--ink-soft); font-size: .95rem; white-space: nowrap; }
#sort-select {
  padding: 10px 12px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--card);
  font-size: .95rem; font-family: inherit; font-weight: 600; color: var(--ink);
  max-width: 230px; cursor: pointer;
  transition: border-color .22s ease, box-shadow .22s ease;
}
#sort-select:focus {
  outline: none; border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(166, 124, 46, .18);
}
.filters-toggle {
  border: 1px solid var(--espresso); background: var(--espresso); color: var(--ivory);
  padding: 8px 18px; border-radius: 999px; font-weight: 700; cursor: pointer;
  font-size: 1rem; font-family: inherit; display: inline-flex; align-items: center; gap: 8px;
  transition: background .22s ease, border-color .22s ease;
}
.filters-toggle:hover { background: var(--brass-deep); border-color: var(--brass-deep); }
.filter-badge {
  background: var(--brass); color: var(--espresso); font-weight: 800; font-size: .8rem;
  min-width: 22px; height: 22px; line-height: 22px; text-align: center;
  border-radius: 999px; padding: 0 6px;
}
.filter-badge[hidden] { display: none; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.filters-panel {
  flex: 1 1 100%; width: 100%; background: var(--card);
  border: 1px solid var(--hairline); border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(33,26,19,.05), 0 16px 40px rgba(33,26,19,.10);
  padding: 20px; display: flex; flex-direction: column; gap: 18px;
  max-height: 75vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: panel-in .25s ease;
}
.filters-panel[hidden] { display: none; }
.filters-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.filters-panel-head h2 {
  margin: 0; font-size: 1.3rem;
  font-family: "Fraunces", Georgia, serif; font-weight: 600;
}
.filters-close {
  border: 1px solid var(--hairline); background: var(--card); color: var(--ink);
  padding: 6px 14px; border-radius: 999px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: border-color .22s ease;
}
.filters-close:hover { border-color: var(--brass); }
.filter-section h3 {
  margin: 0 0 8px; font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em; color: var(--ink-soft);
}
.filter-check {
  display: flex; align-items: center; gap: 9px;
  font-weight: 500; padding: 6px 2px; cursor: pointer;
}
.filter-check input { width: 18px; height: 18px; accent-color: var(--brass); flex: none; }
.filters-panel .clear-filters { align-self: flex-start; }
.coded-note {
  grid-column: 1 / -1; margin: 0;
  background: var(--amber-bg); border: 1px dashed var(--brass-deep); color: var(--amber-ink);
  padding: 10px 13px; border-radius: 10px; font-weight: 600; font-size: .95rem;
}

/* ---------- small screens ---------- */
/* Keep the discount filter plainly in the first screenful: the filter row
   is first in the controls (see index.html), the header is tighter, and
   the category chips become one horizontally scrollable row instead of
   wrapping into ~5 rows that push everything else down. */
@media (max-width: 640px) {
  .site-header { padding: 20px 12px 16px; }
  .site-header h1 { font-size: 1.6rem; }
  main { padding: 14px 12px 8px; }
  #chips {
    flex-wrap: wrap; max-width: 100%;
  }
  .filters-panel { max-height: 80vh; padding: 14px 12px; }
  /* Mobile controls layout (MOBILE_CONTROLS_CRITERIA): three compact
     rows inside .filter-row via flex order — DOM order and every JS
     contract (ids/classes) are unchanged, desktop is untouched.
       row 1: Filters (left) + Sort (compact pill, right, flexible)
       row 2: Search, full width on its own row
       row 3: result count (left) + Grid/List/Feed picker (right) */
  #filters-toggle { order: 1; flex: 0 0 auto; padding: 8px 14px; }
  .sort-control {
    order: 2; flex: 1 1 0; min-width: 0; position: relative; gap: 0;
  }
  /* The visible "Sort" label yields its width to the select on small
     screens; it stays in the DOM associated with the select, and the
     select keeps its aria-label="Sort deals" accessible name. */
  .sort-control label {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  }
  /* Sort as a pill matching the Filters button: same espresso
     background, 1px solid espresso border, 999px radius, and an
     explicit 40px height equal to the Filters button's rendered
     height. It remains a real native <select>; appearance is reset
     only so the pill + chevron can be drawn, and the dropdown list
     itself stays native (options keep light ink-on-card colours). */
  #sort-select {
    flex: 1 1 auto; min-width: 0; width: 100%; max-width: none;
    height: 40px; padding: 0 28px 0 14px;
    appearance: none; -webkit-appearance: none;
    background-color: var(--espresso); color: var(--ivory);
    border: 1px solid var(--espresso); border-radius: 999px;
    font-size: .92rem; font-weight: 700;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23F7F1E5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 11px center;
    background-size: 12px 8px;
  }
  #sort-select option { background: var(--card); color: var(--ink); font-weight: 600; }
  #search { order: 3; flex: 1 1 100%; }
  .result-count { order: 4; flex: 0 1 auto; }
  .layout-toggle { order: 5; flex: 0 0 auto; margin-left: auto; }
  .layout-toggle button { padding: 6px 10px; font-size: .9rem; }
}
/* Narrow phones (<=360px, e.g. 320px) — fix1 for the combined state:
   with a nonzero Filters badge the toggle grows ~30px and squeezes the
   Sort select to ~158px, clipping the longest option "Biggest savings
   ($)" (needs ~177px at the 640px styling). Compact ONLY this row:
   tighter toggle padding/gap/type, a slimmer badge, a smaller
   horizontal row gap (row-gap untouched, so .controls height stays
   139px), and slightly smaller Sort type/padding (chevron keeps its
   own space at right 8px inside the 24px right padding). At 390px and
   above nothing changes; desktop is untouched. */
@media (max-width: 360px) {
  .filter-row { column-gap: 6px; }
  #filters-toggle { padding: 8px 10px; gap: 5px; font-size: .9rem; height: 40px; }
  .filter-badge { min-width: 20px; padding: 0 4px; font-size: .75rem; }
  #sort-select {
    font-size: .85rem; padding: 0 24px 0 10px;
    background-position: right 8px center;
  }
}
.clear-filters {
  border: 1px solid var(--brass); background: transparent; color: var(--brass-deep);
  padding: 6px 14px; border-radius: 999px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background .22s ease;
}
.clear-filters:hover { background: rgba(166, 124, 46, .08); }
.clear-filters[hidden] { display: none; }

/* ---------- layouts (swap via body class) ---------- */
.layout-grid .deals {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.layout-list .deals { display: flex; flex-direction: column; gap: 14px; }
.layout-list .card { flex-direction: row; }
.layout-list .card img, .layout-list .placeholder-tile { width: 180px; height: auto; flex: none; }
.layout-feed .deals {
  display: flex; flex-direction: column; gap: 22px;
  max-width: 560px; margin: 0 auto;
}

/* ---------- deal cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(33,26,19,.05), 0 10px 30px rgba(33,26,19,.07);
  overflow: hidden; display: flex; flex-direction: column; position: relative;
  transition: transform .25s ease, box-shadow .25s ease;
}
@media (hover: hover) and (pointer: fine) {
  .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 2px 4px rgba(33,26,19,.06), 0 18px 44px rgba(33,26,19,.13);
  }
}
.card img { width: 100%; height: 190px; object-fit: cover; background: var(--img-bg); }
.placeholder-tile {
  height: 190px; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #F2EBDD, #F2EBDD 16px, #EADFC8 16px, #EADFC8 32px);
  color: rgba(111, 97, 81, .45);
  font-size: 3rem;
}
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.badge-off {
  position: absolute; top: 12px; left: 12px;
  background: var(--brass); color: var(--ivory);
  font-family: "Fraunces", Georgia, serif; font-weight: 600; font-size: 1.05rem;
  padding: 6px 12px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(30,23,16,.25);
}
.card h3 { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.4; }
.deal-type {
  font-weight: 700; color: var(--brass-deep); font-size: .72rem;
  text-transform: uppercase; letter-spacing: .12em;
}
.price-line { margin: 0; }
.price-now {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.6rem; font-weight: 600; color: var(--ink);
}
.price-was { text-decoration: line-through; color: var(--ink-soft); margin-left: 6px; }
.price-note { display: block; font-size: .8rem; color: var(--ink-soft); margin-top: 2px; }
.age { font-size: .85rem; color: var(--ink-soft); margin: 0; }
.stale-note {
  background: var(--amber-bg); border: 1px dashed var(--brass-deep); color: var(--amber-ink);
  padding: 7px 10px; border-radius: 10px; font-weight: 600; font-size: .88rem; margin: 0;
}
/* ---------- stack evidence + variant notes (C6/C9/C10) ---------- */
.stack-block {
  background: var(--amber-bg); border: 1px solid var(--hairline);
  border-left: 3px solid var(--brass); border-radius: 12px;
  padding: 8px 11px; display: flex; flex-direction: column; gap: 2px;
}
.stack-block p { margin: 0; }
.stack-line { font-weight: 600; font-size: .9rem; color: var(--amber-ink); }
.stack-aslow { font-weight: 700; font-size: .9rem; color: var(--ink); }
.stack-note { font-size: .85rem; font-weight: 600; color: var(--amber-ink); }
.variant-note {
  margin: 0; background: var(--img-bg); border: 1px solid var(--hairline);
  color: var(--ink); padding: 7px 10px; border-radius: 10px;
  font-weight: 600; font-size: .88rem;
}
.fixture-tag {
  align-self: flex-start; background: var(--img-bg); color: var(--ink-soft);
  border: 1px solid var(--hairline);
  font-size: .75rem; font-weight: 700; padding: 2px 9px; border-radius: 999px;
}
.card-actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.btn-shop {
  display: block; text-align: center; text-decoration: none;
  background: var(--espresso);
  color: var(--ivory); font-weight: 700; padding: 11px; border-radius: 12px; font-size: 1.02rem;
  transition: background .22s ease;
}
.btn-shop:hover { background: var(--brass-deep); }
.btn-shop.disabled { background: #D8CDB6; color: var(--ink-soft); pointer-events: none; }
.btn {
  border: none; border-radius: 12px; padding: 10px; font-weight: 700;
  cursor: pointer; font-size: .95rem; font-family: inherit;
  background: var(--brass); color: var(--ivory);
  transition: background .22s ease;
}
.btn:hover { background: var(--brass-deep); }
.btn:disabled { background: #D8CDB6; color: var(--ink-soft); cursor: default; }
.code-area { display: flex; flex-direction: column; gap: 8px; }
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-box {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: var(--paper); border: 1.5px dashed var(--brass); border-radius: 12px;
  font-family: ui-monospace, Menlo, monospace; font-weight: 700; padding: 8px 6px;
  word-break: break-all; text-align: center;
}
.chip-note {
  background: var(--img-bg); color: var(--ink-soft); font-weight: 600; text-align: center;
  padding: 8px; border-radius: 12px; font-size: .9rem;
}
.codes-left { font-size: .85rem; font-weight: 700; color: var(--brass-deep); text-align: center; margin: 0; }
.claim-warning { font-size: .82rem; color: #7A5A14; margin: 0; text-align: center; }
.report-row { display: flex; gap: 6px; }
.report-btn {
  flex: 1; background: transparent; border: 1px solid var(--hairline); color: var(--ink-soft);
  border-radius: 10px; padding: 6px 2px; font-size: .8rem; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: border-color .22s ease, color .22s ease;
}
.report-btn:hover { border-color: var(--brass); color: var(--ink); }
.report-btn.thanks { border-color: var(--brass); color: var(--brass-deep); }
.loading, .empty { text-align: center; color: var(--ink-soft); padding: 30px 0; }

/* ---------- terms ---------- */
.terms { max-width: 760px; }
.terms h2, .terms h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; }
.terms h3 { margin-bottom: 4px; }
.terms p { line-height: 1.65; }
.draft-note {
  background: var(--amber-bg); color: var(--amber-ink);
  border-radius: 10px; padding: 9px 13px; font-weight: 600;
}

/* ---------- admin: Orbit style (ORBIT_STYLE_CRITERIA P1–P9, A1–A6) ---------- */
/* ORBIT TOKEN MAPPING (auditable translation — see ORBIT_PRINCIPLES.md):
   Orbit's FamilyPalette neutrals are Apple SYSTEM colours with no hex
   values by design; the web equivalents below are Apple's documented
   light-mode values for those exact named colours:
     FamilyPalette.groundGrouped (systemGroupedBackground)      -> #F2F2F7
     FamilyPalette.card (secondarySystemGroupedBackground)      -> #FFFFFF
     FamilyPalette.raised (tertiarySystemGroupedBackground)     -> #F2F2F7
     FamilyPalette.fill (tertiarySystemFill)                    -> rgba(118,118,128,0.12)
     FamilyPalette.separator (separator)                        -> rgba(60,60,67,0.29)
     FamilyPalette.ink (label)                                  -> #000000
     FamilyPalette.inkSecondary (secondaryLabel)                -> rgba(60,60,67,0.6)
     FamilyPalette.inkTertiary (tertiaryLabel)                  -> rgba(60,60,67,0.3)
   Orbit brand tokens (Theme.swift, verbatim hex): brand #6366F1,
   brandViolet #8B5CF6, brandPink #EC4899, brandTeal #14B8A6,
   brandAmber #F59E0B. Primary gradient = Theme.Gradients.brand
   (brand -> brandViolet, topLeading -> bottomTrailing).
   Semantic states (Orbit has NO semantic tokens; Triage uses SwiftUI
   system colours inline): green #34C759, orange #FF9500, red #FF3B30.
   Spacing Theme.Spacing xs4/s8/m16/l24/xl32; Radius chip8/card14/sheet20;
   stat tile radius 10 (chip+2), inner row radius 12 (card-2), icon badge
   radius 8.4 (0.3 x 28). Type: system stack only (P8); numbers tabular. */
body.admin {
  background: #F2F2F7; color: #000000;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
}
.admin-header { padding: 24px 16px 8px; max-width: 1100px; margin: 0 auto; }
.admin-header h1 { margin: 0; font-size: 22px; font-weight: 700; color: #000000; }
.admin-sub { color: rgba(60,60,67,.6); font-size: 12px; margin: 6px 0 0; line-height: 1.5; }
.admin-actions { margin: 10px 0 0; }
.sign-out {
  display: inline-block; color: #6366F1; background: rgba(99,102,241,.14);
  padding: 4px 9px; border-radius: 999px; text-decoration: none;
  font-size: 11px; font-weight: 500;
}
.admin-main { max-width: 1100px; }
body.admin [hidden] { display: none !important; }
.sample-banner {
  background: rgba(245,158,11,.16); color: #000000; border: 1px solid rgba(60,60,67,.29);
  font-weight: 600; text-align: center; padding: 10px 16px; border-radius: 14px;
  margin-bottom: 16px; font-size: 15px;
}
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin-bottom: 16px; }
.total-card {
  background: #FFFFFF; border: 1px solid rgba(60,60,67,.29); border-radius: 10px;
  padding: 10px 4px; text-align: center;
}
.total-card .num {
  font-size: 20px; font-weight: 600; display: block; color: #000000;
  font-variant-numeric: tabular-nums; line-height: 1.25;
}
.total-card .lbl { color: rgba(60,60,67,.6); font-weight: 500; font-size: 11px; }
.chart-block {
  background: #FFFFFF; border: 1px solid rgba(60,60,67,.29); border-radius: 14px;
  padding: 16px; margin-bottom: 16px; overflow-x: auto;
}
.orbit-section-head { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.orbit-section-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: #000000; }
.sec-badge {
  width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 8.4px; font-size: 14px; font-weight: 600;
}
.sec-brand { background: rgba(99,102,241,.16); color: #6366F1; }
.sec-teal { background: rgba(20,184,166,.16); color: #14B8A6; }
.sec-violet { background: rgba(139,92,246,.16); color: #8B5CF6; }
.sec-amber { background: rgba(245,158,11,.16); color: #F59E0B; }
.sec-red { background: rgba(255,59,48,.16); color: #FF3B30; }
.sec-green { background: rgba(52,199,89,.16); color: #34C759; }
.sec-count {
  margin-left: auto; font-size: 12px; font-weight: 500;
  color: rgba(60,60,67,.6); font-variant-numeric: tabular-nums;
}
.sec-desc { color: rgba(60,60,67,.6); font-size: 12px; margin: 0 0 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; font-size: 11px; font-weight: 500; }
.legend span { background: rgba(118,118,128,.12); padding: 4px 9px; border-radius: 999px; }
.legend span::before { content: "■ "; }
body.admin .site-footer { color: rgba(60,60,67,.6); }
body.admin .site-footer a { color: #6366F1; }
body.admin svg text { fill: rgba(60,60,67,.6); font-size: 11px; }
body.admin svg .bar-label { fill: #000000; font-weight: 600; }
.empty-line { color: rgba(60,60,67,.6); font-size: 15px; margin: 0; }
.load-error { color: #FF3B30; font-weight: 600; font-size: 15px; margin: 0; }

/* ---------- admin: post a deal (Orbit, A6) ---------- */
.post-deal-block { margin-bottom: 16px; }
.post-deal-btn {
  display: block; width: 100%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #FFFFFF; font-weight: 600; font-size: 15px; font-family: inherit;
  padding: 10px 16px; border-radius: 10px;
}
.post-deal-form {
  background: #FFFFFF; border: 1px solid rgba(60,60,67,.29); border-radius: 14px;
  padding: 16px; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 14px 16px;
}
.pd-field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 200px; min-width: 0; }
.pd-wide { flex-basis: 100%; }
.pd-field > span, .pd-field > legend, .pd-codes-label { font-weight: 600; color: rgba(60,60,67,.6); font-size: 12px; }
.pd-required { color: #FF3B30; }
.post-deal-form input[type="text"],
.post-deal-form input[type="url"],
.post-deal-form input[type="number"],
.post-deal-form select {
  background: rgba(118,118,128,.12); color: #000000; border: 1px solid transparent;
  border-radius: 8px; padding: 9px 12px; font-size: 16px; width: 100%; font-family: inherit;
}
.post-deal-form input:focus, .post-deal-form select:focus { border-color: #6366F1; outline: none; background: #FFFFFF; }
.pd-note { color: #FF9500; font-weight: 600; font-size: 12px; }
.pd-found { color: #34C759; font-weight: 600; font-size: 12px; }
.pd-kinds {
  border: 1px solid rgba(60,60,67,.29); border-radius: 8px; padding: 12px; margin: 0;
  flex-direction: row; flex-wrap: wrap; align-items: center;
}
.pd-kinds legend { padding: 0 4px; }
.pd-kind {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 11px;
  padding: 4px 9px; cursor: pointer; background: rgba(118,118,128,.12);
  color: rgba(60,60,67,.6); border-radius: 999px;
}
.pd-kind input { width: 16px; height: 16px; accent-color: #6366F1; flex: none; margin: 0; }
.pd-kind:has(input:checked) { background: rgba(99,102,241,.18); color: #6366F1; }
#pd-codes-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.pd-add-code {
  align-self: flex-start; border: none; background: rgba(99,102,241,.14);
  color: #6366F1; padding: 4px 9px; border-radius: 999px; font-weight: 500;
  font-size: 11px; cursor: pointer; font-family: inherit;
}
.pd-error {
  flex-basis: 100%; margin: 0; background: rgba(255,59,48,.12); color: #FF3B30;
  border: 1px solid rgba(255,59,48,.4); padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: 15px;
}
.pd-success {
  flex-basis: 100%; margin: 0; background: rgba(52,199,89,.12); color: #34C759;
  border: 1px solid rgba(52,199,89,.4); padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: 15px;
}
.pd-success a { color: #6366F1; }
.post-deal-submit {
  flex-basis: 100%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #6366F1, #8B5CF6); color: #FFFFFF;
  font-weight: 600; font-size: 15px; font-family: inherit;
  padding: 10px 16px; border-radius: 10px;
}
.post-deal-submit:disabled { background: rgba(118,118,128,.12); color: rgba(60,60,67,.3); cursor: default; }
.manual-deal-row {
  display: flex; align-items: center; gap: 8px;
  background: #F2F2F7; border-radius: 12px;
  padding: 9px 14px; margin-bottom: 8px;
}
.manual-deal-row:last-child { margin-bottom: 0; }
.row-badge {
  width: 28px; height: 28px; flex: none; display: inline-flex; align-items: center;
  justify-content: center; border-radius: 8.4px; font-size: 14px; font-weight: 600;
}
.row-badge-red { background: rgba(255,59,48,.16); color: #FF3B30; }
.kind-drop .row-badge { background: rgba(20,184,166,.16); color: #14B8A6; }
.kind-multi .row-badge { background: rgba(99,102,241,.16); color: #6366F1; }
.kind-single .row-badge { background: rgba(139,92,246,.16); color: #8B5CF6; }
.kind-soon .row-badge { background: rgba(245,158,11,.16); color: #F59E0B; }
.manual-deal-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.manual-deal-info strong { font-size: 15px; font-weight: 600; color: #000000; }
.manual-deal-meta { color: rgba(60,60,67,.6); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kind-chip { flex: none; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.kind-drop .kind-chip { background: rgba(20,184,166,.14); color: #14B8A6; }
.kind-multi .kind-chip { background: rgba(99,102,241,.14); color: #6366F1; }
.kind-single .kind-chip { background: rgba(139,92,246,.14); color: #8B5CF6; }
.kind-soon .kind-chip { background: rgba(245,158,11,.14); color: #F59E0B; }
.pd-remove {
  flex: none; border: none; background: transparent; color: #FF3B30;
  padding: 4px 9px; font-weight: 600; font-size: 12px; cursor: pointer; font-family: inherit;
}
.retired-restore {
  flex: none; border: none; background: transparent; color: #6366F1;
  padding: 4px 9px; font-weight: 600; font-size: 12px; cursor: pointer; font-family: inherit;
}
.retired-restore:disabled { color: rgba(60,60,67,.3); cursor: default; }
@media (max-width: 640px) {
  .pd-field { flex-basis: 100%; }
  .manual-deal-row { flex-wrap: wrap; }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
  .card:hover { transform: none; }
}

/* ---------- account nav (header) ---------- */
.account-nav { margin-top: 14px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.account-nav a {
  color: #E7D3A1; border: 1px solid var(--brass); padding: 5px 14px;
  border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .88rem;
  transition: background .22s ease;
}
.account-nav a:hover { background: rgba(166, 124, 46, .18); }
