/* PXM Approvals. Delmar brand: light first, ink accent, gold only in the logo, no pills, status = icon + word. */
html, body { background: var(--dm-bg); color: var(--dm-text); }
body { margin: 0; font-family: var(--dm-font-ui); font-size: var(--dm-text-body); line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: inherit; }
img { display: block; }
.num, td.is-num { font-variant-numeric: tabular-nums; text-align: right; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 10px 32px; border-bottom: 1px solid var(--dm-border); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.topnav { display: flex; gap: 4px; }
.topnav a { height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: var(--dm-radius-md); text-decoration: none; color: var(--dm-text-secondary); font-weight: 500; font-size: 14px; }
.topnav a:hover { background: var(--dm-surface-hover); color: var(--dm-text); }
.topnav a[aria-current="page"] { color: var(--dm-text); font-weight: 600; background: var(--dm-surface); box-shadow: 0 0 0 1px var(--dm-border); }
.who { margin-left: auto; text-align: right; font-size: 13px; line-height: 1.3; color: var(--dm-text-secondary); }
.who b { color: var(--dm-text); font-weight: 600; display: block; }
.devflag { background: var(--dm-surface-sunken); border-bottom: 1px solid var(--dm-border); padding: 6px 32px; font-size: 13px; color: var(--dm-text-secondary); }
.devflag::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dm-warning); margin-right: 8px; vertical-align: 1px; }

.view { max-width: 1200px; margin: 0 auto; padding: 24px 32px 120px; outline: none; }
.head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.head h1 { margin: 4px 0 0; font-size: var(--dm-text-title-1); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.head .sub { color: var(--dm-text-secondary); margin: 4px 0 0; max-width: 70ch; }
.head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.back { font-size: 13px; color: var(--dm-text-secondary); text-decoration: none; }
.back:hover { color: var(--dm-text); }
h2.sec { font-size: var(--dm-text-title-3); font-weight: 600; letter-spacing: -.01em; margin: 32px 0 12px; }
.muted { color: var(--dm-text-secondary); }
.tert { color: var(--dm-text-tertiary); }
.small { font-size: 13px; }
.hair { border: 0; border-top: 1px solid var(--dm-border); margin: 24px 0; }
.kbd { display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid var(--dm-border-strong); border-bottom-width: 2px; border-radius: 5px; font-size: 11px; font-weight: 600; line-height: 16px; text-align: center; color: var(--dm-text-secondary); background: var(--dm-surface); }
.hint { font-size: 12px; color: var(--dm-text-tertiary); }

/* stats strip: plain numbers separated by hairlines (no cards) */
.stats { display: flex; flex-wrap: wrap; border-top: 1px solid var(--dm-border); border-bottom: 1px solid var(--dm-border); }
.stat { padding: 14px 24px 14px 0; margin-right: 24px; }
.stat + .stat { padding-left: 24px; border-left: 1px solid var(--dm-border); }
.stat .v { font-size: var(--dm-text-title-2); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .k { font-size: 12px; color: var(--dm-text-secondary); }

/* tables: rows are links */
.dm-table tr.go { cursor: pointer; }
.dm-table tr.go:hover td { background: var(--dm-surface-hover); }
.dm-table tr.mine td:first-child { font-weight: 600; }
.dm-table td .line2 { display: block; font-size: 13px; color: var(--dm-text-secondary); }

/* segmented tabs: rounded rectangles */
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--dm-surface-sunken); border-radius: var(--dm-radius-lg); width: max-content; max-width: 100%; overflow-x: auto; margin-bottom: 20px; }
.tabs a { height: 32px; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; border-radius: var(--dm-radius-sm); text-decoration: none; font-size: 14px; font-weight: 500; color: var(--dm-text-secondary); white-space: nowrap; }
.tabs a[aria-current="page"] { background: var(--dm-surface); color: var(--dm-text); font-weight: 600; box-shadow: 0 0 0 1px var(--dm-border), 0 1px 2px rgba(31,29,26,.06); }
.tabs .n { font-variant-numeric: tabular-nums; color: var(--dm-text-tertiary); font-weight: 500; }

/* photo + product */
.ph { background: var(--dm-surface-sunken); border-radius: var(--dm-radius-md); overflow: hidden; aspect-ratio: 1; box-shadow: inset 0 0 0 1px var(--dm-border); }
.ph img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.ph.none { display: grid; place-items: center; }
.ph.none::after { content: ""; width: 30%; height: 30%; background: url(delmar-mark.svg) center/contain no-repeat; filter: grayscale(1); opacity: .25; }

/* photo grid (groups, samples, rule examples) */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px 16px; }
.tile { position: relative; display: grid; gap: 6px; padding: 8px; border-radius: var(--dm-radius-lg); outline: none; cursor: default; }
.tile.toggle { cursor: pointer; }
.tile:focus-visible { box-shadow: 0 0 0 2px var(--dm-focus); }
.tile .nm { font-size: 13px; line-height: 1.35; max-height: 2.7em; color: var(--dm-text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .val { font-size: 14px; font-weight: 600; }
.tile .ev { font-size: 12px; line-height: 1.4; max-height: 4.2em; color: var(--dm-text-tertiary); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile .chk { position: absolute; top: 14px; right: 14px; width: 24px; height: 24px; border-radius: var(--dm-radius-xs); background: var(--dm-primary); display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.tile .chk svg { width: 14px; height: 14px; color: #fff; }
.tile.off .chk { background: #fff; box-shadow: 0 0 0 1.5px var(--dm-border-strong); }
.tile.off .chk svg { display: none; }
.tile.off .ph { opacity: .45; }
.tile.off .exc { display: block; }
.tile .exc { display: none; font-size: 12px; font-weight: 600; }
.tile.wrong .chk { background: var(--dm-surface); box-shadow: 0 0 0 1.5px var(--dm-danger); }

/* one-by-one card */
.card1 { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 32px; align-items: start; }
.card1 .thumbs { display: flex; gap: 8px; margin-top: 8px; }
.card1 .thumbs button { width: 56px; padding: 0; border: 0; background: none; border-radius: var(--dm-radius-sm); cursor: pointer; }
.card1 .thumbs button[aria-pressed="true"] .ph { box-shadow: inset 0 0 0 2px var(--dm-ink); }
.attr { margin: 16px 0 4px; }
.proposal { font-size: var(--dm-text-title-1); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; word-break: break-word; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 20px 0 0; font-size: 14px; }
dl.facts dt { color: var(--dm-text-secondary); }
dl.facts dd { margin: 0; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--dm-border); border-bottom: 1px solid var(--dm-border); margin: 16px 0; font-size: 14px; }
.editrow { display: flex; gap: 8px; margin-top: 12px; }
.editrow .dm-input { flex: 1; }

/* sticky action bar (bottom on phones) */
.actionbar { position: sticky; bottom: 0; z-index: 15; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 0; margin-top: 24px; background: linear-gradient(180deg, rgba(252,251,248,0) 0, var(--dm-bg) 16px); }
.actionbar .grow { flex: 1; }
.actionbar .meta { font-size: 13px; color: var(--dm-text-secondary); }

/* distribution list (rule values) */
.dist { display: grid; gap: 6px; max-width: 520px; }
.dist .r { display: grid; grid-template-columns: minmax(0, 1fr) 72px 120px; gap: 12px; align-items: center; font-size: 14px; }
.dist .meter { display: block; height: 6px; border-radius: 3px; background: var(--dm-surface-sunken); overflow: hidden; }
.dist .meter i { display: block; height: 100%; background: var(--dm-stone-600); }

/* toast + sheet (floating: shadow allowed) */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: flex; gap: 12px; align-items: center; padding: 10px 12px 10px 16px; border-radius: var(--dm-radius-lg);
  background: var(--dm-ink); color: #fff; font-size: 14px; box-shadow: 0 12px 32px rgba(31,29,26,.24); max-width: calc(100vw - 32px); }
.toast button { background: rgba(255,255,255,.14); color: #fff; border: 0; height: 32px; padding: 0 12px; border-radius: var(--dm-radius-sm); font-weight: 600; cursor: pointer; }
.toast.err { background: var(--dm-surface); color: var(--dm-text); box-shadow: 0 0 0 1px var(--dm-border), 0 12px 32px rgba(31,29,26,.16); }
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: var(--dm-scrim); display: grid; place-items: center; padding: 16px; }
.sheet { background: var(--dm-surface); border-radius: var(--dm-radius-xl); box-shadow: 0 24px 64px rgba(31,29,26,.24); padding: 24px; width: min(480px, 100%); }
.sheet h3 { margin: 0 0 8px; font-size: var(--dm-text-title-3); font-weight: 600; }
.sheet .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* intro + wins + rule question */
.intro { padding: 4px 0 24px; border-bottom: 1px solid var(--dm-border); margin-bottom: 24px; max-width: 76ch; }
.intro h2 { font-size: var(--dm-text-title-2); font-weight: 600; letter-spacing: -.01em; margin: 0 0 8px; }
.intro p { margin: 8px 0; }
.intro ol.how { margin: 12px 0; padding-left: 20px; display: grid; gap: 6px; }
.wins { margin-bottom: 8px; }
.wins-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.wins-big { font-size: var(--dm-text-title-3); font-weight: 600; margin-top: 4px; }
.wins-big .num { font-size: var(--dm-text-title-1); letter-spacing: -.02em; margin-right: 4px; }
.ask { padding: 16px 0 20px; border-top: 1px solid var(--dm-border); margin-bottom: 8px; max-width: 80ch; }
.ask .q { font-size: 18px; font-weight: 600; line-height: 1.4; letter-spacing: -.01em; margin: 6px 0 4px; }
.ask dl.facts { margin-top: 12px; }

/* progress bars (ink only) */
.rw-bar { position: relative; height: 8px; border-radius: 4px; background: var(--dm-surface-sunken); overflow: hidden; box-shadow: inset 0 0 0 1px var(--dm-border); }
.rw-bar.big { height: 12px; border-radius: 6px; }
.rw-bar.thin { height: 5px; }
.rw-bar i { position: absolute; top: 0; bottom: 0; left: 0; display: block; }
.rw-bar .rw-old { background: var(--dm-stone-600); }
.rw-bar .rw-new { background: var(--dm-ink); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.rw-line { display: flex; justify-content: space-between; font-size: 12px; color: var(--dm-text-secondary); margin: 10px 0 4px; }

/* reward card: floats, so shadow allowed */
.reward { position: fixed; left: 50%; bottom: 84px; z-index: 55; width: min(380px, calc(100vw - 32px)); padding: 16px; border-radius: var(--dm-radius-xl);
  background: var(--dm-surface); box-shadow: 0 0 0 1px var(--dm-border), 0 18px 48px rgba(31,29,26,.2); cursor: pointer;
  transform: translate(-50%, 24px); opacity: 0; transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .25s; }
.reward.in { transform: translate(-50%, 0); opacity: 1; }
.rw-top { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.rw-check { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--dm-success); display: grid; place-items: center; animation: rw-pop .45s cubic-bezier(.3,1.6,.5,1) both; }
.rw-check svg { width: 18px; height: 18px; color: #fff; }
.rw-big { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rw-sub { font-size: 13px; color: var(--dm-text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
@keyframes rw-pop { from { transform: scale(.4); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .reward, .rw-bar .rw-new { transition: none; } .rw-check { animation: none; } }

.empty { padding: 48px 0; text-align: center; color: var(--dm-text-secondary); }
.empty::before { content: ""; display: block; width: 48px; height: 48px; margin: 0 auto 12px; background: url(delmar-mark.svg) center/contain no-repeat; filter: grayscale(1); opacity: .25; }
.loading { padding: 48px 0; color: var(--dm-text-tertiary); }

/* phones */
@media (max-width: 760px) {
  .bar { padding: 8px 16px; gap: 12px; }
  .brand span { display: none; }
  .who { font-size: 12px; }
  .who .role { display: none; }
  .devflag { padding: 6px 16px; }
  .view { padding: 16px 16px 140px; }
  .head h1 { font-size: var(--dm-text-title-2); }
  .head .actions { margin-left: 0; width: 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tile { padding: 4px; }
  .tile .chk { top: 10px; right: 10px; }
  .card1 { grid-template-columns: 1fr; gap: 12px; }
  .card1 .ph.main { aspect-ratio: auto; height: 32vh; }
  .proposal { font-size: var(--dm-text-title-2); }
  .actionbar { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--dm-material);
    -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); border-top: 1px solid var(--dm-border); }
  .actionbar .dm-btn { flex: 1; height: var(--dm-control-lg); }
  .actionbar .nav-btn { flex: 0 0 auto; min-width: 48px; }
  .actionbar .meta:empty { display: none; }
  .actionbar .meta, .hint, .kbd { display: none; }
  .hide-sm { display: none; }
  .stats .stat { padding-right: 16px; margin-right: 16px; }
  .stat + .stat { padding-left: 16px; }
  .dist .r { grid-template-columns: minmax(0, 1fr) 56px 64px; }
  .toast { bottom: 88px; }
}
