/* ============================================================
   KIIK — Katalog Induk Imej Kebangsaan
   Heritage / national-archive design system (hand-authored)
   Palette: archival paper · deep ink · oxblood + teal · brass rule
   ============================================================ */

:root {
  --paper:   #f5efe3;
  --paper-2: #efe7d6;
  --paper-3: #e7dcc6;
  --card:    #fbf7ee;
  --ink:     #221c15;
  --ink-2:   #574d40;
  --ink-3:   #8a7d6b;
  --line:    #dccfb4;
  --line-2:  #cbbb95;
  --accent:  #8a2b22;   /* oxblood */
  --accent-d:#6f2119;
  --teal:    #1f4e56;
  --brass:   #a8802e;
  --good:    #2f6b41;
  --danger:  #a3341f;
  --r: 3px;
  --shadow: 0 1px 0 rgba(60,45,20,.05), 0 18px 40px -26px rgba(60,42,15,.45);
  --shadow-sm: 0 1px 2px rgba(60,45,20,.10);
  --maxw: 1200px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% -10%, rgba(168,128,46,.06), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(31,78,86,.05), transparent 35%);
  line-height: 1.55;
  font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { font-family: var(--serif); font-weight: 600; line-height: 1.12; color: var(--ink); margin: 0 0 .4em; letter-spacing: -.01em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.muted { color: var(--ink-2); }
.small { font-size: .85rem; }
.center { text-align: center; }

/* ---- kicker / mono labels (card-catalogue voice) ---- */
.kicker {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.mono { font-family: var(--mono); }
.acc { font-family: var(--mono); font-size: .78rem; letter-spacing: .04em; color: var(--ink-3); }

/* ---- rule ---- */
.rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
.rule-2 { border: 0; border-top: 3px double var(--line-2); margin: 0; }

/* ============================ Masthead ============================ */
.masthead {
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--brass);
}
.masthead .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: flex; align-items: baseline; gap: 12px; color: var(--paper); }
.brand:hover { text-decoration: none; }
.brand .mark {
  font-family: var(--serif); font-weight: 700; font-size: 1.5rem; letter-spacing: .02em;
  color: #fff;
}
.brand .mark b { color: var(--brass); }
.brand .full { font-family: var(--mono); font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; color: #c9bfa9; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a {
  color: #e7ddca; padding: 8px 12px; border-radius: var(--r); font-size: .9rem; font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.nav a.cta {
  background: var(--accent); color: #fff; border: 1px solid var(--accent-d);
}
.nav a.cta:hover { background: var(--accent-d); }
.nav .cartcount {
  display:inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 20px;
  background: var(--brass); color: #221c15; font-family: var(--mono); font-size: .72rem; font-weight: 600; text-align:center;
}
.menu-toggle { display: none; }

/* ============================ Hero ============================ */
.hero { border-bottom: 1px solid var(--line); background:
  linear-gradient(180deg, var(--paper-2), var(--paper)); }
.hero .grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding: 60px 0 54px; }
.hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.5rem); margin-bottom: .3em; }
.hero .lede { font-size: 1.12rem; color: var(--ink-2); max-width: 46ch; margin-bottom: 26px; }
.hero .searchbar { display: flex; gap: 0; box-shadow: var(--shadow); border: 1.5px solid var(--ink); border-radius: var(--r); overflow: hidden; background: #fff; max-width: 520px; }
.hero .searchbar input { flex: 1; border: 0; padding: 15px 16px; font-size: 1rem; font-family: var(--sans); background: transparent; }
.hero .searchbar input:focus { outline: none; }
.hero .searchbar button { border: 0; background: var(--ink); color: #fff; padding: 0 22px; font-weight: 600; font-family: var(--sans); cursor: pointer; }
.hero .searchbar button:hover { background: var(--accent); }
.hero .quicklinks { margin-top: 14px; font-size: .88rem; color: var(--ink-2); }
.hero .quicklinks a { font-family: var(--mono); font-size: .8rem; margin-right: 14px; }

/* hero collage */
.collage { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 128px; gap: 12px; }
.collage a { position: relative; overflow: hidden; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow-sm); }
.collage a:nth-child(1) { grid-row: span 2; }
.collage a:nth-child(4) { grid-column: span 2; }
.collage img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.92) contrast(1.02); transition: transform .5s ease; }
.collage a:hover img { transform: scale(1.05); }

/* ============================ Stat strip ============================ */
.stripe { background: var(--ink); color: var(--paper); }
.stripe .wrap { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 26px 22px; }
.stat { text-align: center; padding: 4px; border-right: 1px solid rgba(255,255,255,.10); }
.stat:last-child { border-right: 0; }
.stat .n { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: #fff; }
.stat .n b { color: var(--brass); }
.stat .l { font-family: var(--mono); font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: #c4b99f; }

/* ============================ Sections ============================ */
.section { padding: 54px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; margin-bottom: 26px; gap: 16px; border-bottom: 3px double var(--line-2); padding-bottom: 14px; }
.section-head h2 { font-size: 1.9rem; margin: 0; }
.section-head .link { font-family: var(--mono); font-size: .8rem; letter-spacing: .04em; white-space: nowrap; }

/* ============================ Card grid ============================ */
.grid-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--brass); }
.card a.frame { display: block; background: #201a13; position: relative; aspect-ratio: 4/3; overflow: hidden; }
.card a.frame img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.94) contrast(1.02); }
.card .tag-rights {
  position: absolute; top: 10px; left: 10px; font-family: var(--mono); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 2px; background: rgba(33,28,21,.86); color: #f0e7d4; backdrop-filter: blur(2px);
}
.card .tag-rights.ref { background: rgba(163,52,31,.9); color:#fff; }
.card .body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card .body .acc { display: block; }
.card .body h3 { font-size: 1.06rem; line-height: 1.2; margin: 0; }
.card .body h3 a { color: var(--ink); }
.card .body h3 a:hover { color: var(--accent); text-decoration: none; }
.card .meta { font-size: .82rem; color: var(--ink-2); margin-top: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inst-chip { display:inline-flex; align-items:center; gap:6px; font-family: var(--mono); font-size:.72rem; color: var(--ink-2); }
.inst-chip .dot { width: 9px; height: 9px; border-radius: 50%; display:inline-block; }

/* ============================ Buttons ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: .92rem; cursor: pointer;
  padding: 11px 20px; border-radius: var(--r); border: 1.5px solid var(--ink); background: var(--ink); color: #fff;
  transition: background .2s, color .2s, border-color .2s; line-height: 1;
}
.btn:hover { background: #000; text-decoration: none; color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent-d); }
.btn-accent:hover { background: var(--accent-d); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--paper-3); color: var(--ink); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .84rem; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; }

/* ============================ Layout: browse ============================ */
.browse-layout { display: grid; grid-template-columns: 260px 1fr; gap: 34px; padding: 34px 0 60px; align-items: start; }
.facets { position: sticky; top: 18px; }
.facet { border-top: 1px solid var(--line); padding: 16px 0; }
.facet:first-child { border-top: 0; padding-top: 0; }
.facet h4 { font-family: var(--mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
.facet ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.facet li a { display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px; border-radius: var(--r); color: var(--ink-2); font-size: .9rem; }
.facet li a:hover { background: var(--paper-3); text-decoration: none; color: var(--ink); }
.facet li a.on { background: var(--ink); color: #fff; }
.facet li a.on .c { color: #cbbf9f; }
.facet li a .c { font-family: var(--mono); font-size: .76rem; color: var(--ink-3); }
.facet-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tagchip { font-family: var(--mono); font-size: .74rem; padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 20px; color: var(--ink-2); }
.tagchip:hover { background: var(--ink); color: #fff; border-color: var(--ink); text-decoration: none; }
.tagchip.on { background: var(--accent); color: #fff; border-color: var(--accent-d); }

.results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.results-head .count { font-family: var(--mono); font-size: .82rem; color: var(--ink-2); }
.results-head select { font-family: var(--sans); padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; color: var(--ink); }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.active-filters .f { font-family: var(--mono); font-size: .76rem; background: var(--paper-3); border: 1px solid var(--line-2); padding: 4px 10px; border-radius: 20px; color: var(--ink-2); }
.active-filters .f a { color: var(--accent); margin-left: 6px; font-weight: 700; }

/* ============================ Item detail ============================ */
.item-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; padding: 30px 0 60px; align-items: start; }
.viewer-wrap { border: 1px solid var(--line-2); border-radius: var(--r); background: #1c1710; box-shadow: var(--shadow); overflow: hidden; }
#osd { width: 100%; height: 540px; background: #1c1710; }
.viewer-wrap img.fallback { width: 100%; height: auto; }
.viewer-note { font-family: var(--mono); font-size: .72rem; color: var(--ink-3); padding: 9px 12px; border-top: 1px solid var(--line); background: var(--paper-2); display: flex; justify-content: space-between; gap: 8px; }

.detail .kicker { margin-bottom: 8px; display:block; }
.detail h1 { font-size: 2rem; margin-bottom: 12px; }
.detail .lead-desc { color: var(--ink-2); margin-bottom: 20px; }

.meta-table { width: 100%; border-collapse: collapse; margin: 6px 0 22px; border-top: 3px double var(--line-2); }
.meta-table tr { border-bottom: 1px solid var(--line); }
.meta-table th { text-align: left; font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; padding: 10px 14px 10px 0; width: 38%; vertical-align: top; }
.meta-table td { padding: 10px 0; color: var(--ink); vertical-align: top; }

.badge { display: inline-block; font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; padding: 3px 9px; border-radius: 2px; }
.badge.pd { background: #e7efe7; color: var(--good); border: 1px solid #bcd6c1; }
.badge.ref { background: #f6e3dd; color: var(--danger); border: 1px solid #e2b6a9; }

.subjects { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 8px; }

/* licence calculator */
.calc { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 20px; margin-top: 8px; }
.calc h3 { font-size: 1.15rem; margin-bottom: 4px; }
.calc .fld { margin: 13px 0; }
.calc label.lbl { display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.calc select { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; color: var(--ink); font-family: var(--sans); font-size: .92rem; }
.calc .check { display: flex; align-items: center; gap: 9px; font-size: .9rem; color: var(--ink-2); }
.pricebox { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 0 12px; padding: 14px 16px; background: var(--ink); color: #fff; border-radius: var(--r); }
.pricebox .lbl2 { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: #c4b99f; }
.pricebox .amt { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; }
.pricebox .amt small { font-size: .9rem; color: #cdbf9f; font-family: var(--mono); font-weight: 400; }
.notforsale { background: #f6e3dd; border: 1px solid #e2b6a9; color: var(--danger); padding: 14px 16px; border-radius: var(--r); font-size: .9rem; }

.related { padding: 20px 0 0; }

/* ============================ Tables / cart / checkout ============================ */
.panel { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.panel-pad { padding: 22px 24px; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); padding: 12px; border-bottom: 2px solid var(--line-2); }
.cart-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cart-table .thumb { width: 74px; }
.cart-table .thumb img { width: 74px; height: 56px; object-fit: cover; border-radius: 2px; border: 1px solid var(--line-2); }
.cart-line-opts { font-family: var(--mono); font-size: .74rem; color: var(--ink-3); margin-top: 4px; }
.checkout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 30px; align-items: start; padding: 20px 0 60px; }
.summary-row { display: flex; justify-content: space-between; padding: 7px 0; color: var(--ink-2); }
.summary-row.total { border-top: 3px double var(--line-2); margin-top: 8px; padding-top: 14px; font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: var(--ink); }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: var(--mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: var(--r); background: #fff; font-family: var(--sans); font-size: .95rem; color: var(--ink); }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.pay-note { font-family: var(--mono); font-size: .74rem; color: var(--ink-3); margin-top: 10px; display:flex; gap:8px; align-items:center; }

/* ============================ Flash / alerts ============================ */
.flash { padding: 12px 18px; border-radius: var(--r); margin: 18px 0; font-size: .92rem; border: 1px solid; }
.flash.ok { background: #e7efe7; border-color: #bcd6c1; color: var(--good); }
.flash.err { background: #f6e3dd; border-color: #e2b6a9; color: var(--danger); }

/* ============================ Institution cards ============================ */
.inst-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.inst-card { background: var(--card); border: 1px solid var(--line-2); border-left: 5px solid var(--accent); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow-sm); display:flex; flex-direction:column; gap:8px; }
.inst-card:hover { box-shadow: var(--shadow); }
.inst-card .badge-inst { width: 52px; height: 52px; border-radius: var(--r); display:flex; align-items:center; justify-content:center; font-family: var(--serif); font-weight: 700; font-size: 1rem; color: #fff; }
.inst-card h3 { font-size: 1.2rem; margin: 4px 0 0; }
.inst-card .type { font-family: var(--mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.inst-card .cnt { font-family: var(--mono); font-size: .8rem; color: var(--ink-2); margin-top: auto; }

/* ============================ Admin ============================ */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin: 8px 0 30px; }
.kpi { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); padding: 16px; text-align: center; box-shadow: var(--shadow-sm); }
.kpi .n { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; }
.kpi .l { font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.data-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.data-table th { text-align: left; font-family: var(--mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 11px 14px; border-bottom: 2px solid var(--line-2); background: var(--paper-2); }
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.data-table tr:last-child td { border-bottom: 0; }
.text-right { text-align: right; }

/* ============================ Licence agreement (print) ============================ */
.doc { max-width: 800px; margin: 30px auto; background: #fff; border: 1px solid var(--line-2); box-shadow: var(--shadow); padding: 48px 54px; }
.doc h1 { font-size: 1.6rem; }
.doc .doc-head { display: flex; justify-content: space-between; align-items: start; border-bottom: 3px double var(--ink); padding-bottom: 16px; margin-bottom: 22px; }
.doc dl { display: grid; grid-template-columns: 200px 1fr; gap: 8px 16px; margin: 20px 0; }
.doc dt { font-family: var(--mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.doc dd { margin: 0; }
.doc .terms { font-size: .88rem; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; }
.doc .stamp { margin-top: 26px; font-family: var(--mono); font-size: .78rem; color: var(--good); border: 2px solid var(--good); display: inline-block; padding: 6px 14px; border-radius: 2px; transform: rotate(-3deg); }

/* ============================ Prose pages ============================ */
.prose { max-width: 760px; }
.prose h2 { font-size: 1.6rem; margin-top: 1.4em; }
.prose h3 { font-size: 1.2rem; margin-top: 1.2em; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 1.2em; }
.prose .std-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 20px 0; }
.prose .std { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); padding: 16px; }
.prose .std b { font-family: var(--mono); font-size: .84rem; color: var(--accent); }

/* ============================ Steps ============================ */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r); padding: 20px; position: relative; }
.step .num { font-family: var(--serif); font-size: 2.2rem; font-weight: 700; color: var(--brass); line-height: 1; }
.step h4 { font-size: 1.05rem; margin: 8px 0 6px; }
.step p { font-size: .88rem; color: var(--ink-2); margin: 0; }

/* ============================ Footer ============================ */
.pagehead { padding: 40px 0 10px; }
.pagehead h1 { font-size: 2.4rem; }
.breadcrumb { font-family: var(--mono); font-size: .76rem; color: var(--ink-3); margin-bottom: 10px; }
.breadcrumb a { color: var(--ink-2); }

footer.site { background: var(--ink); color: #cbbf9f; margin-top: 40px; border-top: 3px solid var(--brass); }
footer.site .wrap { padding: 44px 22px 28px; }
footer.site .cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
footer.site .mark { font-family: var(--serif); color: #fff; font-size: 1.4rem; font-weight: 700; }
footer.site .mark b { color: var(--brass); }
footer.site h5 { font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: #9c917a; margin: 0 0 12px; }
footer.site a { color: #cbbf9f; display: block; padding: 3px 0; font-size: .9rem; }
footer.site a:hover { color: #fff; }
footer.site .demo-note { margin-top: 30px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: .8rem; color: #968b74; }
.pagination { display:flex; gap:6px; margin-top: 26px; flex-wrap: wrap; font-family: var(--mono); font-size:.85rem; }
.pagination a, .pagination span { padding: 7px 12px; border: 1px solid var(--line-2); border-radius: var(--r); color: var(--ink-2); background: var(--card); }
.pagination a:hover { background: var(--ink); color:#fff; text-decoration:none; }
.pagination .active span, .pagination span[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }

.empty { text-align: center; padding: 70px 20px; color: var(--ink-2); }
.empty .big { font-family: var(--serif); font-size: 1.4rem; color: var(--ink); }

/* ---- copyright protection: no-drag media, capture shield, toast ---- */
img, .frame, #osd, .viewer-wrap, .collage a, canvas {
  -webkit-user-drag: none; -khtml-user-drag: none; -moz-user-drag: none; user-drag: none;
  -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.capm-shield { position: fixed; inset: 0; background: var(--ink); color: var(--paper); display: none; align-items: center; justify-content: center; text-align: center; z-index: 9998; padding: 24px; }
:root.capm-hidden .capm-shield { display: flex; }
.capm-inner { display: flex; flex-direction: column; gap: 10px; }
.capm-inner strong { font-family: var(--serif); font-size: 1.8rem; }
.capm-inner span { font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; color: #c9bfa9; }
#capm-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: var(--accent); color: #fff; padding: 12px 20px; border-radius: var(--r); font-size: .9rem; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; z-index: 9999; font-family: var(--sans); max-width: 90vw; }
#capm-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.shield-badge { display:inline-flex; align-items:center; gap:6px; font-family: var(--mono); font-size:.66rem; letter-spacing:.06em; color: var(--good); }

/* ============================ Responsive ============================ */
@media (max-width: 980px) {
  .hero .grid { grid-template-columns: 1fr; gap: 30px; }
  .collage { grid-auto-rows: 110px; }
  .item-layout, .checkout-grid { grid-template-columns: 1fr; }
  .browse-layout { grid-template-columns: 1fr; }
  .facets { position: static; border: 1px solid var(--line-2); border-radius: var(--r); padding: 16px; background: var(--card); }
  .grid-cards, .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .inst-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  footer.site .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: var(--ink); padding: 10px; z-index: 40; align-items: stretch; gap: 2px; border-bottom: 3px solid var(--brass); }
  .nav.open { display: flex; }
  .menu-toggle { display: inline-flex; margin-left: auto; background: transparent; border: 1px solid rgba(255,255,255,.3); color: #fff; border-radius: var(--r); padding: 8px 12px; cursor: pointer; font-family: var(--mono); }
  .stripe .wrap { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .stat { border-right: 0; }
  .grid-cards, .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .inst-grid, .steps, .prose .std-grid { grid-template-columns: 1fr; }
  .section-head h2, .pagehead h1 { font-size: 1.6rem; }
  .doc { padding: 28px 22px; }
  .doc dl { grid-template-columns: 1fr; gap: 2px 0; }
  .doc dd { margin-bottom: 8px; }
}
@media (max-width: 420px) {
  .grid-cards, .grid-3 { grid-template-columns: 1fr 1fr; }
}
