/* Cleared to Bid — Post 8 aviation theme. Mobile first; WCAG 2.2 AA colors. */
:root {
  --navy: #0b2545; --navy-2: #13315c; --sky: #8da9c4; --cream: #f7f3ea; --paper: #ffffff;
  --amber: #f2a541; --amber-ink: #7a4a00; --red: #b3261e; --green: #1f7a4d; --ink: #1b1f24; --muted: #5b6573;
  --line: #d9dee5; --focus: #1d6fe0; --radius: 14px; --shadow: 0 2px 10px rgba(11, 37, 69, .08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
.night-ops {
  --cream: #0d1726; --paper: #14223a; --ink: #eef2f8; --muted: #a9b6c8; --line: #2b3d5c; --navy-2: #1f3b66;
  --shadow: none; color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.5; color: var(--ink); background: var(--cream); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-2); }
.night-ops a { color: #9cc3ff; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--amber); color: #000; padding: .5rem 1rem; z-index: 99; }
.skip:focus { left: 0; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); }

/* Header */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; box-shadow: 0 2px 0 var(--amber); }
.site-header a { color: #fff; text-decoration: none; }
.bar { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .02em; }
.brand img { height: 38px; width: auto; }
.brand small { display: block; font-weight: 500; font-size: .72rem; color: var(--amber); letter-spacing: .12em; text-transform: uppercase; }
.nav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.nav a, .nav button.linklike { padding: 8px 10px; border-radius: 10px; font-weight: 600; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); }
.badge { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 999px; background: var(--amber); color: #000; font-size: .75rem; font-weight: 800; text-align: center; }
.whoami { background: var(--navy-2); color: #fff; font-size: .85rem; }
.whoami .wrap { display: flex; gap: 8px; align-items: center; padding-top: 4px; padding-bottom: 4px; flex-wrap: wrap; }
.whoami form { display: inline; }
.whoami button { background: none; border: 0; color: var(--amber); font: inherit; text-decoration: underline; cursor: pointer; padding: 4px; }
.menu-toggle { display: none; }
@media (max-width: 760px) {
  .nav { display: none; position: absolute; top: 60px; right: 0; left: 0; background: var(--navy); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; }
  .nav.open { display: flex; }
  .menu-toggle { display: inline-flex; margin-left: auto; background: none; border: 2px solid rgba(255,255,255,.4); color: #fff; border-radius: 10px; padding: 6px 12px; font-weight: 700; }
}

/* Flash and banners */
.flash { margin: 16px 0; padding: 12px 16px; border-radius: 12px; border-left: 6px solid var(--sky); background: var(--paper); box-shadow: var(--shadow); }
.flash.success { border-color: var(--green); }
.flash.error { border-color: var(--red); }
.flash.info { border-color: var(--amber); }
.banner { background: var(--amber); color: #1a1200; padding: 8px 0; font-weight: 600; }
.stale { display: none; background: #fff4d6; color: #5c3b00; padding: 8px 12px; border-radius: 10px; margin: 8px 0; }
.stale.show { display: block; }

/* Buttons and forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border-radius: 12px;
  border: 2px solid var(--navy); background: var(--navy); color: #fff; font: 700 1rem var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { filter: brightness(1.1); }
.btn.amber { background: var(--amber); border-color: var(--amber); color: #1a1200; }
.btn.ghost { background: transparent; color: var(--navy); }
.night-ops .btn.ghost { color: #fff; border-color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
.hint { font-weight: 400; color: var(--muted); font-size: .875rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=search], input[type=url], input[type=datetime-local], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; font: inherit; background: var(--paper); color: var(--ink); }
textarea { min-height: 110px; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin: 10px 0; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.field-error { color: var(--red); font-size: .9rem; margin-top: 4px; }
.has-error input, .has-error select { border-color: var(--red); }
.grid2 { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
.grid3 { display: grid; gap: 0 16px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: 1fr 1fr 1fr; } }
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border: 1px solid var(--line); }
.narrow { max-width: 520px; margin: 24px auto; }
.hp { position: absolute; left: -5000px; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px 16px; margin: 16px 0; }
legend { font-weight: 800; padding: 0 6px; }

/* Hero */
.hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 70%); color: #fff; padding: 28px 0 22px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -40px; bottom: -30px; width: 280px; height: 180px; opacity: .12;
  background: url("../img/plane.svg") no-repeat center / contain; transform: rotate(-12deg); }
.hero .tag { color: var(--amber); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .8rem; }
.hero-grid { display: grid; gap: 18px; }
@media (min-width: 860px) { .hero-grid { grid-template-columns: 1.4fr 1fr; align-items: center; } }
.status-chip { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.st-live, .st-boarding { background: #d7f5e3; color: #0f5132; }
.st-preview { background: #e5ecf6; color: var(--navy); }
.st-final, .st-finalcall { background: #ffe2b8; color: #6b3d00; }
.st-delayed { background: #ffd9d4; color: #7a1a10; }
.st-departed, .st-closed { background: #e4e6ea; color: #333; }
.st-paused { background: #fff1b8; color: #5c4400; }
.countdown { font-family: var(--mono); font-weight: 800; font-size: clamp(1.6rem, 5vw, 2.4rem); letter-spacing: .04em; }

/* Altimeter */
.altimeter { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius); padding: 16px; }
.altimeter .gauge { height: 18px; border-radius: 999px; background: rgba(255,255,255,.18); overflow: hidden; position: relative; }
.altimeter .fill { height: 100%; background: linear-gradient(90deg, var(--amber), #ffd27a); width: 0; transition: width 1.2s ease; }
.altimeter .marks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: .7rem; color: var(--sky); margin-top: 4px; }
.altimeter .big { font-size: 1.8rem; font-weight: 800; }
@media (prefers-reduced-motion: reduce) { .altimeter .fill { transition: none; } }

/* Catalog */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0; }
.toolbar input[type=search] { flex: 1 1 220px; }
.toolbar select { width: auto; flex: 0 1 200px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chip { white-space: nowrap; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--paper); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .9rem; }
.chip[aria-current="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.lots { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); margin: 12px 0 32px; }
.lot { background: var(--paper); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; position: relative; }
.lot a.cover { color: inherit; text-decoration: none; display: flex; flex-direction: column; flex: 1; }
.lot .thumb { aspect-ratio: 4 / 3; background: #e9edf3 center / cover no-repeat; }
.lot .thumb img { width: 100%; height: 100%; object-fit: cover; }
.lot .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.lot .lotno { font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.lot h3 { font-size: 1.05rem; margin: 0; }
.lot .price { font-size: 1.35rem; font-weight: 800; }
.lot .meta { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; color: var(--muted); margin-top: auto; }
.lot .watch { position: absolute; top: 8px; right: 8px; }
.watch-btn { background: rgba(255,255,255,.92); border: 0; border-radius: 999px; width: 44px; height: 44px; font-size: 1.3rem; cursor: pointer; color: var(--navy); }
.watch-btn[aria-pressed="true"] { background: var(--amber); }
.ribbon { position: absolute; left: 0; top: 12px; background: var(--amber); color: #1a1200; font-weight: 800; font-size: .72rem; padding: 3px 10px; border-radius: 0 999px 999px 0; text-transform: uppercase; letter-spacing: .08em; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 28px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }

/* Item page */
.item-grid { display: grid; gap: 22px; margin: 20px 0 40px; }
@media (min-width: 900px) { .item-grid { grid-template-columns: 1.15fr 1fr; align-items: start; } .bidbox { position: sticky; top: 80px; } }
.gallery .main { aspect-ratio: 4 / 3; background: #e9edf3; border-radius: var(--radius); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.gallery .main img { max-height: 100%; width: auto; cursor: zoom-in; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.gallery .thumbs button { border: 3px solid transparent; padding: 0; border-radius: 10px; overflow: hidden; width: 74px; height: 56px; flex: none; cursor: pointer; background: none; }
.gallery .thumbs button[aria-current="true"] { border-color: var(--amber); }
.gallery .thumbs img { width: 100%; height: 100%; object-fit: cover; }
.lightbox { border: 0; padding: 0; background: rgba(0,0,0,.92); max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; height: 100%; }
.lightbox button { position: absolute; top: 12px; right: 12px; }
.bidbox .price { font-size: 2.4rem; font-weight: 900; line-height: 1; }
.bidbox .row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.you { border-radius: 12px; padding: 10px 12px; font-weight: 700; margin: 10px 0; }
.you.winning { background: #d7f5e3; color: #0f5132; }
.you.outbid { background: #ffe0dc; color: #7a1a10; }
.you.won { background: var(--amber); color: #1a1200; }
.quick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 12px 0; }
.quick .btn { min-height: 56px; font-size: 1.05rem; padding: 6px; }
.quick .btn:first-child { grid-column: 1 / -1; min-height: 64px; font-size: 1.25rem; }
.autopilot { margin-top: 10px; }
.autopilot summary { cursor: pointer; font-weight: 800; padding: 10px 0; }
.amount-row { display: flex; gap: 8px; }
.amount-row .prefix { display: flex; align-items: center; font-weight: 800; font-size: 1.2rem; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.history li.superseded .who { text-decoration: line-through; color: var(--muted); }
.history li.void { opacity: .55; }
.prose { overflow-wrap: anywhere; }
.prose blockquote { border-left: 4px solid var(--amber); margin: 0; padding-left: 12px; }
.ctb-navy { color: var(--navy-2); } .ctb-amber { color: var(--amber-ink); } .ctb-red { color: var(--red); } .ctb-green { color: var(--green); } .ctb-big { font-size: 1.25em; }
dialog.confirm { border: 0; border-radius: 18px; padding: 0; max-width: 440px; width: calc(100% - 24px); box-shadow: 0 20px 60px rgba(0,0,0,.35); background: var(--paper); color: var(--ink); }
dialog.confirm::backdrop { background: rgba(11,37,69,.6); }
dialog.confirm .head { background: var(--navy); color: #fff; padding: 14px 18px; font-weight: 800; }
dialog.confirm .content { padding: 18px; }
dialog.confirm .amount { font-size: 2.2rem; font-weight: 900; text-align: center; margin: 6px 0 10px; }
dialog.confirm .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 90; box-shadow: var(--shadow); max-width: calc(100% - 24px); }
.toast.good { background: var(--green); } .toast.bad { background: var(--red); }

/* Flight plan */
.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 2px solid var(--line); margin: 16px 0; }
.tabs a { padding: 10px 14px; text-decoration: none; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs a[aria-current="page"] { color: var(--ink); border-color: var(--amber); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.stat .v { font-size: 1.5rem; font-weight: 800; }
.stat .l { font-size: .82rem; color: var(--muted); }
.list-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list-row img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; flex: none; }
.list-row .grow { flex: 1; min-width: 0; }
.boarding { background: var(--paper); border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); }
.boarding .top { background: var(--navy); color: #fff; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; }
.boarding .tailno { font-family: var(--mono); font-size: 2rem; font-weight: 900; color: var(--amber); }
.boarding .stub { border-top: 2px dashed var(--line); padding: 14px 18px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; background: var(--paper); font-size: .95rem; }
table.data th, table.data td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.data th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
td.r, th.r { text-align: right; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #e5ecf6; color: var(--navy); }
.pill.good { background: #d7f5e3; color: #0f5132; } .pill.warn { background: #ffe2b8; color: #6b3d00; } .pill.bad { background: #ffd9d4; color: #7a1a10; }

/* Tower */
.tower { display: grid; grid-template-columns: 1fr; min-height: calc(100vh - 60px); }
@media (min-width: 980px) { .tower { grid-template-columns: 230px 1fr; } }
.tower-nav { background: var(--navy); padding: 12px; }
.tower-nav a { display: block; color: #dfe7f1; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.tower-nav a[aria-current="page"], .tower-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.tower-nav .label { color: var(--amber); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; padding: 12px 12px 4px; }
@media (max-width: 979px) { .tower-nav { display: flex; overflow-x: auto; gap: 4px; padding: 8px; } .tower-nav .label { display: none; } .tower-nav a { white-space: nowrap; } }
.tower-main { padding: 18px 16px 48px; min-width: 0; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; padding: 6px 0; align-items: center; }
.checklist .ok::before { content: "✔"; color: var(--green); font-weight: 900; }
.checklist .no::before { content: "✖"; color: var(--red); font-weight: 900; }
.checklist .opt::before { content: "○"; color: var(--muted); font-weight: 900; }
.statusstrip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0; }
.photo { border: 2px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); }
.photo.dragging { opacity: .4; }
.photo img { aspect-ratio: 4/3; object-fit: cover; width: 100%; cursor: grab; }
.photo .tools { display: flex; gap: 4px; padding: 6px; flex-wrap: wrap; }
.photo .tools button { min-height: 36px; min-width: 36px; }
.photo input { min-height: 36px; font-size: .85rem; padding: 4px 8px; margin: 0 6px 6px; width: calc(100% - 12px); }
.drop { border: 3px dashed var(--sky); border-radius: 14px; padding: 18px; text-align: center; background: rgba(141,169,196,.12); }
.donor-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.donor-chips span { background: var(--navy); color: #fff; border-radius: 999px; padding: 4px 6px 4px 12px; display: inline-flex; align-items: center; gap: 4px; }
.donor-chips button { background: none; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer; min-width: 28px; min-height: 28px; }
.suggest { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); max-height: 220px; overflow: auto; }
.suggest li button { width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; font: inherit; cursor: pointer; color: var(--ink); }
.suggest li button:hover, .suggest li button:focus { background: #e5ecf6; }
.editor { background: #fff; color: #111; border-radius: 0 0 10px 10px; min-height: 180px; }
.ql-toolbar.ql-snow { border-radius: 10px 10px 0 0; background: #fff; }
.locked-note { background: #fff1b8; color: #5c4400; padding: 10px 12px; border-radius: 10px; }

/* Footer */
.site-footer { border-top: 4px solid var(--amber); background: var(--navy); color: #cdd8e6; padding: 22px 0 30px; margin-top: 40px; font-size: .9rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* Donor wall */
.hangar { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.hangar .card h3 { margin-bottom: 4px; }

@media print { .site-header, .site-footer, .whoami, .no-print { display: none !important; } body { background: #fff; } }
.prose li[data-list="bullet"] { list-style-type: disc; }
.urgent { color: var(--red); }
