:root {
  --ink: #0f2233;
  --ink-soft: #1c3a55;
  --text: #1d2730;
  --muted: #5b6875;
  --bg: #ffffff;
  --bg-alt: #f3f5f7;
  --line: #dde2e7;
  --accent: #f39a2b;
  --accent-dark: #b9650a;
  --danger: #b3261e;
  --ok: #1b6e3c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 34, 51, .08), 0 4px 14px rgba(15, 34, 51, .06);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink-soft); }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 3.2vw, 1.6rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[id] { scroll-margin-top: 84px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.measure { max-width: 720px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 20; }

/* Header */
.site-header { background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { color: #fff; text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
.brand-accent { color: var(--accent); margin-left: .25em; }
.brand-sub { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav a, .link-button { color: #fff; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 600; font-size: .95rem; }
.nav a:hover, .link-button:hover { background: rgba(255, 255, 255, .12); }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; font-family: inherit; cursor: pointer; }

/* Sections */
.section { padding: 44px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.section-head h1, .section-head h2 { margin: 0; }
.more { font-weight: 600; }

.hero { background: linear-gradient(160deg, var(--ink) 0%, var(--ink-soft) 100%); color: #e8eef3; padding: 56px 0 60px; }
.hero h1 { color: #fff; max-width: 20ch; font-size: clamp(1.9rem, 6vw, 3rem); }
.hero-text { max-width: 62ch; font-size: 1.08rem; }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; margin-bottom: .8em; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 1.4em; }

.services { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.service { border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); padding: 20px; }
.service h2 { font-size: 1.15rem; }
.service p { margin: 0; color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px; border-radius: 8px; border: 2px solid transparent; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; }
.btn-primary { background: var(--accent); color: var(--ink); }
.btn-primary:hover { background: #ffad47; }
.btn-ghost { border-color: rgba(255, 255, 255, .6); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.btn-outline { border-color: var(--ink); color: var(--ink); background: #fff; }
.btn-outline:hover { background: var(--bg-alt); }
.btn-danger { border-color: var(--danger); color: var(--danger); background: #fff; }
.btn-danger:hover { background: #fdeceb; }
.btn-small { min-height: 40px; padding: 6px 12px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* Stock cards */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.card:hover h3 { text-decoration: underline; }
.card-img { position: relative; aspect-ratio: 4 / 3; background: var(--bg-alt); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-sold .card-img img { opacity: .55; }
.card-body { padding: 14px 16px 16px; }
.card-body h3 { margin: 0 0 4px; }
.price { margin: 0; font-weight: 700; color: var(--accent-dark); }
.price-large { font-size: 1.4rem; margin-bottom: .8em; }
.no-photo { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font-size: .9rem; background: var(--bg-alt); }
.no-photo-large { aspect-ratio: 4 / 3; border-radius: var(--radius); }
.badge { position: absolute; top: 10px; left: 10px; background: var(--ink); color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.badge-inline { position: static; display: inline-block; }
.badge-sold { background: var(--danger); }
.badge-available { background: var(--ok); }
.badge-hidden { background: var(--muted); }

/* Stock detail */
.crumb { margin-bottom: 14px; font-weight: 600; }
.detail { display: grid; gap: 28px; }
@media (min-width: 860px) { .detail { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); background: var(--bg-alt); scrollbar-width: thin; }
.gallery-slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 3; scroll-margin-top: 90px; }
.gallery-slide img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 8px; margin-top: 10px; }
.gallery-thumbs img { aspect-ratio: 1; object-fit: cover; border-radius: 6px; width: 100%; }
.detail-info h1 { margin-top: .2em; }
.description { overflow-wrap: anywhere; }
.enquire { margin-top: 24px; padding: 20px; background: var(--bg-alt); border-radius: var(--radius); }
.enquire h2 { font-size: 1.15rem; margin: 0; }
.enquire .actions { margin-top: 12px; }

/* Contact */
.contact-list { list-style: none; padding: 0; margin: 20px 0 0; border-top: 1px solid var(--line); }
.contact-list li { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-label { flex: 0 0 84px; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; padding-top: .25em; }
.contact-value { font-size: 1.1rem; font-weight: 600; overflow-wrap: anywhere; }

/* Footer */
.site-footer { background: var(--ink); color: #c5d0da; font-size: .9rem; padding: 22px 0; }
.site-footer a { color: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }

/* Messages */
.messages { padding-top: 16px; }
.message { padding: 12px 16px; border-radius: 8px; background: #e8f4ec; border-left: 4px solid var(--ok); margin: 0 0 10px; }
.message-error { background: #fdeceb; border-left-color: var(--danger); }
.message-warning { background: #fff4e2; border-left-color: var(--accent); }

/* Manage area */
.manage { background: var(--bg-alt); }
.form-wrap { max-width: 460px; }
.form-wrap-wide { max-width: 680px; }
.form { background: #fff; padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow); }
.field { margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.field > label, .field > legend { display: block; font-weight: 700; margin-bottom: 6px; color: var(--ink); padding: 0; }
.optional { font-weight: 400; color: var(--muted); font-size: .85rem; }
.field input[type=text], .field input[type=password], .field input[type=email], .field input[type=number], .field textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px stops iOS zooming in on focus */
  padding: 12px; border: 1px solid #b8c1ca; border-radius: 8px; background: #fff; color: var(--text);
}
.field textarea { resize: vertical; }
.field input[type=file] { width: 100%; font: inherit; font-size: 16px; padding: 14px; border: 2px dashed #b8c1ca; border-radius: 8px; background: var(--bg-alt); }
.field-error input, .field-error textarea { border-color: var(--danger); }
.help { color: var(--muted); font-size: .88rem; margin: 6px 0 0; }
.help ul { margin: 0; padding-left: 1.2em; }
.error { color: var(--danger); font-weight: 600; font-size: .92rem; margin: 6px 0 0; }
.radio { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-weight: 400; min-height: 44px; }
.radio input { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 10px; }
.previews img { aspect-ratio: 1; object-fit: cover; border-radius: 6px; width: 100%; background: var(--bg-alt); }
.sub { margin-top: 32px; }

.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.row { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-main { display: flex; gap: 12px; align-items: center; flex: 1 1 260px; min-width: 0; text-decoration: none; color: inherit; }
.row-thumb { width: 72px; height: 72px; flex: none; border-radius: 8px; object-fit: cover; background: var(--bg-alt); }
.row-thumb-empty { display: grid; place-items: center; font-size: .7rem; color: var(--muted); text-align: center; }
.row-text { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.row-text strong { overflow-wrap: anywhere; color: var(--ink); }
.row-meta { color: var(--muted); font-size: .88rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-actions { display: flex; gap: 8px; margin-left: auto; }
.row-actions form, .photo-actions form { margin: 0; }
.manage-foot { margin-top: 28px; }

.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.photo { position: relative; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.photo img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.photo-actions { display: flex; gap: 6px; padding: 8px; flex-wrap: wrap; }
.danger-zone { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .section { padding: 32px 0; }
  .hero { padding: 40px 0 44px; }
  .wrap { padding: 0 16px; }
  .nav a, .link-button { padding: 10px 8px; font-size: .9rem; }
  .brand-sub { display: none; }
  .header-inner { min-height: 56px; }
  .hero .btn, .enquire .btn { width: 100%; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card-body { padding: 10px 12px 12px; }
  .card-body h3 { font-size: .95rem; }
  .card .price { font-size: .9rem; }
  .row-actions { width: 100%; }
  .row-actions > * { flex: 1; }
  .row-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Customer portal and service requests */
.nav-login { border: 1px solid rgba(255, 255, 255, .45); margin-left: 6px; }
.count { display: inline-block; min-width: 1.5em; padding: 0 .4em; border-radius: 999px; background: var(--accent); color: var(--ink); font-size: .78rem; text-align: center; }
.welcome { margin-bottom: 4px; font-weight: 600; }
.form-note { margin-top: 16px; font-size: .92rem; }
.field select { width: 100%; font: inherit; font-size: 16px; padding: 12px; border: 1px solid #b8c1ca; border-radius: 8px; background: #fff; color: var(--text); }
.field input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--ink); flex: none; }
.row-unread { border-left: 5px solid var(--accent); }
.new-flag { color: var(--accent-dark); font-weight: 700; }
.ticket-meta { margin-bottom: 18px; }
.badge-st-new { background: #0e7490; }
.badge-st-in_progress { background: var(--ink-soft); }
.badge-st-awaiting_parts { background: #6b4fa0; }
.badge-st-done { background: var(--ok); }
.badge-urg-1 { background: var(--danger); }
.badge-urg-2 { background: var(--accent-dark); }
.badge-urg-3 { background: var(--muted); }
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 18px; }
.panel p { margin: 0 0 4px; overflow-wrap: anywhere; }
.thread { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.msg { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; max-width: 92%; justify-self: start; border-left: 4px solid var(--line); }
.msg-me { justify-self: end; border-left-color: var(--accent); }
.msg-meta { font-size: .85rem; color: var(--muted); margin: 0 0 6px; }
.msg-body { overflow-wrap: anywhere; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; min-width: min(260px, 60vw); }
.msg-photos img { aspect-ratio: 1; object-fit: cover; border-radius: 6px; width: 100%; }
.credentials dl { margin: 0 0 14px; }
.credentials dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.credentials dd { margin: 0 0 12px; font-weight: 600; overflow-wrap: anywhere; }
.password, .generated code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.25rem; letter-spacing: .04em; background: var(--bg-alt); padding: 6px 10px; border-radius: 6px; display: inline-block; user-select: all; }
.generator { margin-bottom: 18px; }
.generated { margin: 12px 0 0; }
.generated .help { display: block; }
@media (max-width: 520px) {
  .nav-about, .nav-wide { display: none; }
}

[hidden] { display: none !important; }
.stacked-form { margin-top: 10px; }
