:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #5d6980;
  --line: #d9dfec;
  --primary: #175cff;
  --primary-strong: #0e43bd;
  --success: #0f7b49;
  --danger: #b42318;
  --warning: #a15c00;
  --soft: #eef3ff;
  --focus: #ffbf47;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; color: var(--text); background: var(--bg); line-height: 1.5; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; }
button, .button {
  border: 0;
  border-radius: 14px;
  padding: 0.82rem 1rem;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  min-height: 46px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
}
button:hover, .button:hover { background: var(--primary-strong); }
button.secondary, .button.secondary { background: #e8edf7; color: var(--text); }
button.secondary:hover, .button.secondary:hover { background: #d7dfef; }
button.danger { background: var(--danger); }
button.ghost { background: transparent; color: var(--primary); border: 1px solid var(--line); }
button:disabled { opacity: .55; cursor: not-allowed; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 0; background: #111827; color: #fff; padding: .75rem; z-index: 9; }
.skip-link:focus { left: .75rem; }
.app-shell { width: min(1120px, 100%); margin: 0 auto; padding: 16px; }
.mobile-shell { width: min(520px, 100%); margin: 0 auto; padding: 14px; }
.hero { padding: 20px 0 12px; }
.hero h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 6vw, 2.3rem); letter-spacing: -0.04em; }
.hero p { margin: 0; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.admin-grid { grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.5fr); align-items: start; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: 0 10px 25px rgba(20, 33, 61, .06); }
.card h2, .card h3 { margin: 0 0 12px; letter-spacing: -0.03em; }
.form-grid { display: grid; gap: 12px; }
.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label, .field-label { display: block; font-weight: 800; margin-bottom: 5px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  padding: .78rem .85rem;
  min-height: 45px;
}
textarea { resize: vertical; }
.help { color: var(--muted); font-size: .92rem; margin-top: 5px; }
.status, .notice { border-radius: 15px; padding: .85rem; background: var(--soft); color: #17376e; }
.status[hidden], .notice[hidden], [hidden] { display: none !important; }
.status.error, .field-error { color: var(--danger); }
.status.error { background: #fff1f0; border: 1px solid #ffd1cc; }
.status.success { color: var(--success); background: #ecfdf3; border: 1px solid #b7ebc6; }
.status.warn { color: var(--warning); background: #fff7e8; border: 1px solid #ffd899; }
.field-error { font-size: .9rem; min-height: 1.35em; margin-top: 4px; }
.field-invalid { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(180, 35, 24, .12); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stack { display: grid; gap: 12px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .28rem .62rem; font-size: .84rem; font-weight: 800; background: #edf2ff; color: #1744a0; }
.badge.live { background: #e9f9ee; color: var(--success); }
.badge.closed { background: #f1f3f7; color: #586176; }
.list { display: grid; gap: 12px; }
.bidder-card { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: #fff; }
.bidder-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.bidder-title { font-weight: 900; font-size: 1.05rem; }
.meta { color: var(--muted); font-size: .92rem; }
.item-list { margin: 10px 0 0; padding-left: 1.2rem; }
.item-list li { margin: .25rem 0; }
.summary-row, .calc-row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf0f6; padding: .45rem 0; }
.summary-row strong, .calc-row strong { white-space: nowrap; }
.calc-row.total { border: 0; font-size: 1.15rem; font-weight: 900; }
.radio-grid { display: grid; gap: 8px; }
.radio-option { display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 14px; padding: .78rem; cursor: pointer; }
.radio-option input { width: auto; min-height: auto; }
.preview { white-space: pre-wrap; min-height: 180px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: #111827; color: #f9fafb; border-radius: 16px; padding: 14px; overflow-wrap: anywhere; }
.fallback-box textarea { height: 180px; }
.main-action { width: 100%; font-size: 1.08rem; min-height: 56px; }
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.error-page .card { width: min(520px, 100%); text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .admin-grid, .two-col { grid-template-columns: 1fr; }
  .app-shell { padding: 12px; }
  .card { padding: 15px; border-radius: 18px; }
  .toolbar button, .toolbar .button { flex: 1 1 auto; }
}
@media (max-width: 380px) {
  .mobile-shell { padding: 10px; }
  .hero h1 { font-size: 1.45rem; }
  button, .button { padding-left: .75rem; padding-right: .75rem; }
}
