/* WCPR Photos. Charcoal field-app sidebar, WCPR red accent, light/dark content from the brand tokens. */
:root {
  --red: var(--wcpr-red, #c8102e); --red-h: var(--wcpr-red-hover, #a50d26);
  --side: #16181c; --side-2: #1f2228; --side-ink: #d7dbe0; --side-mute: #8b929b;
  --bg: #f3f4f6; --card: #ffffff; --ink: #16181c; --mute: #5f6670; --line: #dfe2e6; --chip: #eef0f3;
  --r: 10px; --font: var(--wcpr-font, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root { --bg: #0f1114; --card: #181b20; --ink: #e7eaee; --mute: #9aa1aa; --line: #2a2e35; --chip: #22262d; color-scheme: dark; } }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); }
a { color: var(--red); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 1.55rem; margin: 0 0 4px; line-height: 1.2; text-wrap: balance; } h2 { font-size: 1.15rem; margin: 28px 0 12px; } h3 { font-size: .95rem; margin: 18px 0 8px; }
.sr { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.muted { color: var(--mute); } .small { font-size: .84rem; } .mono { font-family: var(--wcpr-font-mono, ui-monospace, Menlo, monospace); }
.grow { flex: 1; min-width: 0; } .center { text-align: center; margin: 16px 0; }
.ic { width: 20px; height: 20px; flex: none; color: currentColor; } .ic.sm { width: 16px; height: 16px; } .ic.xs { width: 13px; height: 13px; } .ic.lg { width: 40px; height: 40px; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* shell */
.shell { display: flex; min-height: 100vh; }
.side { width: 248px; flex: none; background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 14px 10px calc(14px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.brandrow { padding: 2px 6px; } .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.1rem; }
.brand .mark { height: 30px; width: auto; background: var(--red); border-radius: 8px; padding: 5px; }
.nsearch { display: flex; align-items: center; gap: 8px; background: var(--side-2); border: 1px solid #2c3038; border-radius: 9px; padding: 0 10px; color: var(--side-mute); }
.nsearch input { flex: 1; background: none; border: 0; color: #fff; padding: 9px 0; font: inherit; min-width: 0; } .nsearch input:focus { outline: none; }
.org { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; padding: 6px 8px 0; }
#nav a, .navgroup summary { display: flex; align-items: center; gap: 12px; color: var(--side-ink); padding: 8px 10px; border-radius: 8px; font-size: .93rem; text-decoration: none; }
#nav a:hover { background: var(--side-2); } #nav a[aria-current] { background: #2a2e36; color: #fff; box-shadow: inset 3px 0 0 var(--red); }
#nav a .ic { color: var(--side-mute); } #nav a[aria-current] .ic { color: #fff; }
.navmain { display: flex; flex-direction: column; gap: 1px; padding-bottom: 8px; border-bottom: 1px solid #2a2e35; }
.navgroup { border-bottom: 1px solid #2a2e35; padding: 4px 0; } .navgroup summary { cursor: pointer; font-weight: 700; list-style: none; color: #fff; }
.navgroup summary::after { content: "▾"; margin-left: auto; color: var(--side-mute); } .navgroup:not([open]) summary::after { content: "▸"; }
.navgroup a { padding-left: 22px !important; } .starhint { margin: 4px 10px 8px; padding: 10px; border: 1px dashed #3a3f48; border-radius: 8px; font-size: .8rem; color: var(--side-mute); }
.navfoot { margin-top: auto; padding-top: 8px; }
.col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: none; align-items: center; gap: 10px; padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); background: var(--side); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbrand { font-weight: 700; } .who { font-size: .85rem; color: var(--mute); }
.main { padding: 24px max(16px, env(safe-area-inset-right)) 96px max(16px, env(safe-area-inset-left)); max-width: 1320px; width: 100%; margin: 0 auto; }
.col > .who { display: none; }
@media (max-width: 860px) {
  .side { position: fixed; left: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  body.navopen .side { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); } .top { display: flex; } .top .who { color: #c7ccd2; }
  .main { padding-top: 16px; }
}
@media (min-width: 861px) { .col .top { display: flex; background: transparent; color: var(--ink); position: static; padding: 10px 24px 0; } .col .top .menu, .col .top .topbrand { display: none; } }

/* controls */
.btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 .9rem var(--font); cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { text-decoration: none; border-color: var(--mute); } .btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; } .btn.primary:hover { background: var(--red-h); }
.btn.danger { color: var(--red); } .btn.ghost { background: transparent; border-color: transparent; color: var(--mute); }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: .82rem; } .btn.big { min-height: 52px; padding: 0 20px; font-size: 1rem; }
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.input { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; }
.input.sm { width: auto; padding: 8px 10px; } .input.lg { font-size: 1.3rem; font-weight: 700; } .input.color { width: 56px; padding: 2px; height: 42px; }
textarea.input { resize: vertical; }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap, .chips.wrap { flex-wrap: wrap; } .stack { display: flex; flex-direction: column; gap: 10px; }
.filters { flex-wrap: wrap; margin: 4px 0 16px; } .filters .input:not(.sm) { max-width: 420px; }
.chips { display: flex; gap: 6px; } .chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--chip); color: var(--ink); font: 500 .82rem var(--font); cursor: pointer; }
.chip.on { background: var(--red); border-color: var(--red); color: #fff; } .chip.ghost { background: transparent; border-style: dashed; }
.label { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--lc) 16%, transparent); color: var(--lc); }
.label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lc); }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; } .swatch.on { outline: 3px solid var(--ink); outline-offset: 1px; }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; font-size: .78rem; font-weight: 700; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: .68rem; vertical-align: middle; }

/* page parts */
.vhead, .phead { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.vact { display: flex; gap: 8px; flex-wrap: wrap; } .sub { color: var(--mute); margin: 0; }
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; color: var(--mute); margin-bottom: 6px; }
.shead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; } .shead h2, .shead h3 { margin-bottom: 8px; }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--mute); font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; text-decoration: none; } .tabs a.on { color: var(--ink); border-color: var(--red); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.list { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.lrow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; } .lrow:last-child { border-bottom: 0; } a.lrow:hover { background: var(--chip); text-decoration: none; }
.empty { text-align: center; padding: 48px 16px; color: var(--mute); } .empty .ic { color: var(--line); } .empty h3 { color: var(--ink); font-size: 1.05rem; }
.loading { padding: 40px; text-align: center; color: var(--mute); }
.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; } .tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; } .tbl th { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 6px; accent-color: var(--red); }
.code { background: #0f1114; color: #e7eaee; padding: 14px; border-radius: 9px; overflow-x: auto; font: .82rem/1.5 var(--wcpr-font-mono, ui-monospace, Menlo, monospace); margin: 0; }

/* projects */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: var(--ink); text-decoration: none; }
.pcard:hover { text-decoration: none; border-color: var(--mute); }
.pcover { aspect-ratio: 16/10; background: var(--chip); display: grid; place-items: center; color: var(--mute); } .pcover img { width: 100%; height: 100%; object-fit: cover; }
.pbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; } .pbody .row { justify-content: space-between; }

/* media grid */
.day h3 { margin: 22px 0 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; } .grid.lg { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tile { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--chip); cursor: pointer; display: block; width: 100%; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; } .tile-ph { display: grid; place-items: center; height: 100%; color: var(--mute); }
.tile.sel { outline: 3px solid var(--red); outline-offset: -3px; }
.badge { position: absolute; font: 600 .7rem var(--font); color: #fff; background: rgba(0,0,0,.6); border-radius: 6px; padding: 2px 6px; display: inline-flex; align-items: center; }
.badge.vid { left: 6px; bottom: 6px; } .badge.mk { right: 6px; top: 6px; background: var(--red); } .badge.cm { right: 6px; bottom: 6px; }
.check { position: absolute; left: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.35); color: #fff; display: grid; place-items: center; font-weight: 700; }
.tile.sel .check { background: var(--red); border-color: var(--red); }
.ftile { display: flex; flex-direction: column; gap: 2px; min-width: 0; } .ftile .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selbar { position: sticky; top: 8px; z-index: 5; display: flex; gap: 10px; align-items: center; background: var(--side); color: #fff; padding: 8px 12px; border-radius: 10px; margin-bottom: 10px; }
.selbar[hidden] { display: none; }

/* viewer */
.viewer { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.v-stage { position: relative; background: #0b0c0e; border-radius: 12px; overflow: hidden; display: grid; place-items: center; min-height: 300px; }
.v-stage img, .v-stage video { max-width: 100%; max-height: 80vh; display: block; }
.vnav { position: absolute; inset: auto 0 50% 0; display: flex; justify-content: space-between; padding: 0 8px; pointer-events: none; } .vnav a { pointer-events: auto; background: rgba(0,0,0,.5); color: #fff; }
.v-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; } .v-side h3 { margin-bottom: 2px; } .meta { margin: 4px 0; font-size: .88rem; color: var(--mute); } .meta strong { color: var(--ink); }
.ai p { margin: 4px 0; font-size: .9rem; }
.comments, .msgs { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.comments li, .msgs li { display: flex; gap: 10px; align-items: flex-start; } .comments p, .msgs p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.msgs li { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.msgthumb img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.msgform { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 16px; }
@media (max-width: 960px) { .viewer { grid-template-columns: minmax(0, 1fr); } }

/* markup */
.mk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.mk-stage { background: #0b0c0e; border-radius: 12px; padding: 8px; display: grid; place-items: center; }
.mk-canvas { max-width: 100%; max-height: 78vh; touch-action: none; cursor: crosshair; }

/* checklists, reports, customers */
.cl { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.cl li { display: flex; align-items: center; gap: 10px; } .cl input { width: 20px; height: 20px; accent-color: var(--red); flex: none; } .cl label { flex: 1; }
.proof img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; display: block; }
.ritems { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-direction: column; gap: 10px; }
.ritem { display: grid; grid-template-columns: 28px 120px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; }
.rn { font-weight: 700; color: var(--mute); text-align: center; } .rbtns { display: flex; flex-direction: column; }
@media (max-width: 600px) { .ritem { grid-template-columns: 24px 84px minmax(0, 1fr); } .rbtns { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; } }
.custs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.cust { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; } .cust ul { margin: 6px 0 0; padding-left: 18px; font-size: .88rem; }

/* map */
.map { height: min(70vh, 640px); border-radius: 12px; border: 1px solid var(--line); }
.pop { display: flex; flex-direction: column; gap: 3px; min-width: 180px; } .pop img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; }

/* capture + modal */
.modal { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 40px); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.modal::backdrop { background: rgba(10,12,15,.6); }
.mhead { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); } .mhead h2 { margin: 0; font-size: 1.05rem; }
.mbody { padding: 16px; overflow-y: auto; max-height: calc(100vh - 180px); } .mfoot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.capture { display: flex; flex-direction: column; gap: 12px; } .pick-target { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 1rem; min-height: 24px; }
.shoot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .shoot .btn { justify-content: center; }
.pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.pick { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.pick span { font-size: .82rem; color: var(--mute); } .pick:hover { border-color: var(--red); }
.fab { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom)); width: 62px; height: 62px; border-radius: 50%; border: 0; background: var(--red); color: #fff; box-shadow: 0 8px 24px rgba(200,16,46,.45); cursor: pointer; display: grid; place-items: center; z-index: 30; }
.fab svg { width: 28px; height: 28px; }
.qpill { border: 0; border-radius: 999px; padding: 6px 12px; background: #1d6f42; color: #fff; font: 600 .8rem var(--font); cursor: pointer; } .qpill.bad { background: var(--red); }
.queuep { position: fixed; right: 16px; top: 56px; z-index: 35; width: min(360px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.queuep h3 { margin: 0 0 8px; } .qrow { display: flex; gap: 6px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: .85rem; }
#toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #16181c; color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; max-width: calc(100vw - 32px); font-size: .9rem; }
#toast.bad { background: var(--red); }
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
@media (max-width: 600px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; } .main { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); } }
