:root {
  --bg: #efeadb;          /* the Access form ground */
  --panel: #fbfaf5;
  --line: #cfc8b4;
  --ink: #23201a;
  --muted: #736d5f;
  --label: #7f7f7f;       /* grey field headers from the original forms */
  --title: #0b4fd6;       /* Access title bar blue */
  --band: #7a0c0c;        /* stats section bands */
  --accent: #6d9b1f;      /* the logo's green */
  --danger: #b3261e;
  --radius: 6px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 "Segoe UI", Tahoma, Arial, sans-serif; color: var(--ink); background: var(--bg); }
main { max-width: 1400px; margin: 0 auto; padding: 12px 16px 32px; }
a { color: var(--title); }
h1 { font-size: 1.6rem; font-weight: 500; margin: 0 0 .25rem; }
h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
h3 { font-size: .95rem; margin: 1rem 0 .5rem; }
.muted { color: var(--muted); font-weight: normal; }
.small { font-size: .85rem; }
code { background: #eee8d6; padding: 0 4px; border-radius: 3px; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 8px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: .08em; color: #333; text-decoration: none; }
.eye { width: 26px; height: 16px; border-radius: 50%; border: 3px solid #555; position: relative; }
.eye::after { content: ""; position: absolute; inset: 1px 6px; border-radius: 50%; background: var(--accent); }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.topbar nav a, .menu summary { padding: 6px 10px; border-radius: var(--radius); color: var(--ink); text-decoration: none; cursor: pointer; }
.topbar nav a:hover, .menu summary:hover { background: var(--bg); }
.menu { position: relative; }
.menu summary { list-style: none; }
.menu summary::after { content: " ▾"; }
.menu > div { position: absolute; right: 0; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-width: 200px; box-shadow: 0 6px 20px rgb(0 0 0 / .12); }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 16px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.panel.narrow { max-width: 720px; }
.titlebar { background: var(--title); color: #fff; font-weight: 700; margin: -12px -14px 12px; padding: 6px 14px; border-radius: var(--radius) var(--radius) 0 0; }
.badge { background: #fff; color: var(--title); border-radius: 3px; padding: 0 6px; margin-left: 8px; font-size: .85em; }
.band { display: inline-block; background: var(--band); color: #fff; padding: 3px 10px; font-size: .9rem; }

.flash { padding: 8px 12px; border-radius: var(--radius); margin-bottom: 10px; border: 1px solid; }
.flash.ok { background: #eef6e2; border-color: #b9d38f; }
.flash.error { background: #fbeaea; border-color: #e3a5a1; }
.flash.info { background: #e9f0fd; border-color: #a9c1f2; }

label { display: flex; flex-direction: column; gap: 2px; }
label.inline { flex-direction: row; align-items: center; gap: 6px; }
.lbl { background: var(--label); color: #fff; font-weight: 600; padding: 2px 6px; font-size: .82rem; }
.lbl a { color: #fff; text-decoration: none; }
.lbl-plain { font-size: .85rem; color: var(--muted); }
input, select, textarea { font: inherit; padding: 5px 7px; border: 1px solid #9c9582; border-radius: 3px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--title); outline-offset: -1px; }
input[readonly] { background: #f1eee6; }
.invalid { border-color: var(--danger); background: #fff4f3; }
.err { color: var(--danger); font-size: .78rem; }
.warn { color: var(--danger); font-weight: 600; }
.hint { color: var(--muted); font-size: .8rem; margin: 4px 0 8px; }

.btn { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border: 1px solid #9c9582; border-radius: var(--radius); background: #f4f1e8; color: var(--ink); text-decoration: none; cursor: pointer; font: inherit; white-space: nowrap; }
.btn:hover { background: #e9e4d4; }
.btn.primary { background: var(--title); border-color: var(--title); color: #fff; }
.btn.primary:hover { background: #0a44b8; }
.btn.danger { color: var(--danger); border-color: #d9a29e; }
.btn.small { padding: 2px 8px; font-size: .85rem; }
.btn.disabled { opacity: .35; cursor: default; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
form.inline { display: inline; }
.span4 { grid-column: 1 / -1; }

.grid4 { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 8px 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(160px, 1fr)); gap: 8px 10px; }
.cust-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.cust-head > form { flex: 1 1 640px; }
.cust-actions { display: flex; flex-direction: column; gap: 8px; }
.navbtns { display: flex; align-items: center; gap: 2px; }
.navbtns .btn { border-radius: 0; padding: 4px 10px; }
.counter { margin-left: 8px; color: var(--band); font-weight: 700; font-size: .85rem; }
.dupes { background: #fff8e0; border: 1px solid #e6cf7a; padding: 8px 12px; border-radius: var(--radius); }
.dupes ul { margin: 4px 0 8px; }

.section-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.section-head h2 { margin: 0; }
.diag-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.chip { flex: none; border: 1px solid var(--line); border-radius: 14px; padding: 2px 10px; text-decoration: none; color: var(--ink); background: #fff; font-size: .85rem; }
.chip small { color: var(--muted); }
.chip.active { background: var(--title); color: #fff; border-color: var(--title); }
.chip.active small { color: #dfe8ff; }

.diag-top { display: flex; gap: 16px; flex-wrap: wrap; }
.diag-top .grow { flex: 1 1 400px; }
.eyes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-weight: 700; padding: 0 4px; }
.lens-row { display: flex; gap: 6px; align-items: flex-end; flex-wrap: wrap; }
.lens-row > b { width: 72px; font-size: .85rem; }
.lens-cell { width: 108px; }
.lens-cell span { font-size: .72rem; color: var(--muted); }
.lens-cell input { text-align: right; font-variant-numeric: tabular-nums; }
.diag-bottom { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-top: 12px; }
.frame-opts { display: grid; grid-template-columns: 1fr 1fr; }
.frame-opts legend { grid-column: 1 / -1; }
.money { flex-direction: row; }
.money input { width: 110px; text-align: right; }
.diag-bottom .row.end { flex: 1; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: -4px 0 10px; }
.tabs a { padding: 6px 12px; text-decoration: none; color: var(--ink); border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
.tabs a.active { background: #fff; border-color: var(--line); margin-bottom: -1px; font-weight: 600; }
.photos { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.photos figure { margin: 0; width: 180px; }
.photos img { width: 180px; height: 135px; object-fit: cover; border: 1px solid var(--line); background: #eee; }
.photos figcaption { font-size: .8rem; color: var(--muted); }

.itemform { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 10px; align-items: end; }
.itemform .wide { grid-column: span 2; }
.itemform .options, .itemform .row.end, .itemform .warn { grid-column: 1 / -1; }
.options { flex-direction: row; gap: 18px; flex-wrap: wrap; }

.tablewrap { overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: .88rem; }
.grid th, .grid td { border-bottom: 1px solid #e3ddcc; padding: 4px 6px; text-align: left; vertical-align: middle; }
.grid thead th { background: var(--label); color: #fff; font-weight: 600; position: sticky; top: 0; white-space: nowrap; }
.grid tfoot th { background: #ece7d8; }
.grid tbody tr:hover { background: #f5f1e4; }
.grid.clickable tbody tr { cursor: pointer; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.center { text-align: center !important; }
.nowrap { white-space: nowrap; }
.tick { width: 26px; height: 22px; border: 1px solid #9c9582; background: #fff; border-radius: 3px; cursor: pointer; color: var(--accent); font-weight: 700; }
.tick.on { background: #eef6e2; }
.params input { width: 90px; text-align: right; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stats-grid .panel { margin-bottom: 0; }
.stats-grid + .panel { margin-top: 12px; }
.stats td, .stats th { padding: 3px 8px; }
.stats { margin-top: 6px; }

.splash { text-align: center; padding: 32px 16px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 24px auto; max-width: 900px; }
.tile { display: flex; flex-direction: column; gap: 4px; padding: 18px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--title); }
.tile b { font-size: 1.6rem; color: var(--title); }

.labels { display: grid; grid-template-columns: repeat(auto-fill, 62mm); gap: 2mm; }
.label { border: 1px dashed #aaa; padding: 2mm 3mm; height: 28mm; background: #fff; font-size: 11px; overflow: hidden; }
.label .price { font-size: 16px; font-weight: 700; }

@media (max-width: 900px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .grid3, .eyes, .stats-grid { grid-template-columns: 1fr; }
}
@media print {
  .no-print, .topbar, footer { display: none !important; }
  body, main { background: #fff; padding: 0; }
  .panel { border: 0; padding: 0; }
  .label { border: 0; }
}
