[hidden] { display: none !important; }
:root {
  --ink: #17201f; --muted: #5d6b69; --line: #d9e0de; --bg: #f5f6f3; --card: #fff;
  --brand: #0f3d3e; --brand-2: #1f6f6b; --accent: #c8792d;
  --ok: #1d7a46; --warn: #a15c00; --bad: #b3261e; --info: #24588f;
  --ok-bg: #e5f4ea; --warn-bg: #fdf1dc; --bad-bg: #fbe7e5; --info-bg: #e6eef8;
  --r: 12px; --tap: 48px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
a { color: var(--brand-2); }
h1 { font-size: 1.35rem; margin: 0 0 .25rem; }
h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.pad { padding: 16px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 12px 16px 24px; }
.wide { max-width: 1200px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--brand); color: #fff; }
.brand { font-weight: 700; letter-spacing: .02em; flex: 1; }
.brand span { font-weight: 400; opacity: .8; }
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 3px 10px; font-size: .8rem; border: 0; background: #ffffff22; color: #fff; }
.chip.net { background: var(--bad); }
.chip.sync.pending { background: var(--accent); }
.chip.sync.error { background: var(--bad); }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; text-align: center; padding: 6px 0 8px; font-size: .72rem; color: var(--muted); text-decoration: none; }
.tabs a .ic { display: block; font-size: 1.3rem; line-height: 1.5; }
.tabs a.on { color: var(--brand); font-weight: 600; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 10px 0; }
.card.tap { cursor: pointer; }
.card.tap:active { background: #f0f3f2; }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 2px 6px; font-weight: 600; }

label.f { display: block; margin: 10px 0; }
label.f > span { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 4px; }
label.f > span em { font-style: normal; color: var(--bad); }
label.f > small { display: block; color: var(--muted); font-size: .78rem; margin-top: 3px; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid #b9c4c1; border-radius: 10px; background: #fff; color: var(--ink); min-height: var(--tap); }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid #1f6f6b33; border-color: var(--brand-2); }
input[type=checkbox] { width: 22px; height: 22px; min-height: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 10px 16px; border-radius: 10px; border: 1px solid var(--brand); background: #fff; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.big { width: 100%; min-height: 58px; font-size: 1.1rem; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn.ghost { border-color: var(--line); color: var(--ink); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn:disabled { opacity: .5; }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices button { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid #b9c4c1; background: #fff; font: inherit; font-size: .95rem; color: var(--ink); }
.choices button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.choices.decision button { flex: 1 1 30%; border-radius: 10px; min-height: 52px; font-weight: 600; }
.choices.decision button.on[data-v="Pursue"] { background: var(--ok); border-color: var(--ok); }
.choices.decision button.on[data-v="Needs information"] { background: var(--info); border-color: var(--info); }
.choices.decision button.on[data-v="Not suitable"] { background: var(--bad); border-color: var(--bad); }

details.more { background: #fff; border: 1px solid var(--line); border-radius: var(--r); margin: 10px 0; }
details.more > summary { padding: 14px; font-weight: 600; cursor: pointer; list-style: none; min-height: var(--tap); }
details.more > summary::after { content: "＋"; float: right; color: var(--muted); }
details.more[open] > summary::after { content: "－"; }
details.more > .inner { padding: 0 14px 12px; }

.shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.shot { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: #e8ecea; border: 1px solid var(--line); }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot .doc { display: flex; align-items: center; justify-content: center; height: 100%; font-size: .7rem; padding: 4px; text-align: center; word-break: break-all; }
.shot button { position: absolute; top: 2px; right: 2px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: #000a; color: #fff; font-size: 14px; }
.filebtn { position: relative; overflow: hidden; }
.filebtn input[type=file] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

.pill { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: #eef1f0; color: var(--ink); margin: 2px 4px 2px 0; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--info-bg); color: var(--info); }
.banner { border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: .92rem; }
.banner.warn { background: var(--warn-bg); color: #6b3d00; }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.info { background: var(--info-bg); color: var(--info); }

.list-item { display: flex; gap: 12px; align-items: flex-start; }
.thumb { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 10px; object-fit: cover; background: #e8ecea; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gcard { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.gcard .ph { aspect-ratio: 4/3; background: #e8ecea; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .85rem; }
.gcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.gcard .bd { padding: 10px 12px 12px; }
.gcard .t { font-weight: 700; }
.price { font-weight: 700; }
.price.unknown { color: var(--muted); font-weight: 500; }

.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.filters label.f { margin: 0; }
.filters label.f > span { font-size: .75rem; }
.filters select, .filters input { min-height: 40px; padding: 7px 9px; font-size: 15px; }

table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th, table.t td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.scroll-x { overflow-x: auto; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.stat { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat .card { margin: 0; }
.stat .n { font-size: 1.8rem; font-weight: 700; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 50; max-width: 92vw; }
#toast div { background: #1d2726; color: #fff; padding: 10px 14px; border-radius: 10px; margin-top: 6px; box-shadow: 0 4px 16px #0003; font-size: .95rem; }
#toast div.bad { background: var(--bad); }
#toast div.ok { background: var(--ok); }
.sticky-save { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); padding: 14px 0 6px; z-index: 5; }
.qitem { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.lightbox { position: fixed; inset: 0; background: #000e; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.lightbox img { max-width: 100%; max-height: 80vh; }
.lightbox .row { margin-top: 12px; max-width: 420px; }
label.row > input[type=radio], label.row > input[type=checkbox] { flex: 0 0 22px; width: 22px; height: 22px; min-height: 0; margin: 0; }
label.row > span { flex: 1 1 auto; }
@media (max-width: 520px) { .gcard .ph { aspect-ratio: 16/9; } }
.pill.co-tuleen { background: #0f3d3e; color: #fff; }
.pill.co-ajeeb { background: #c8792d; color: #fff; }
.choices.company button.on[data-v="Tuleen"] { background: #0f3d3e; border-color: #0f3d3e; }
.choices.company button.on[data-v="Ajeeb"] { background: #c8792d; border-color: #c8792d; }
.choices.company button { flex: 1 1 45%; font-size: 1.1rem; }
@media (max-width: 520px) { .filters { grid-template-columns: 1fr 1fr; } .filters label.f:first-child { grid-column: 1 / -1; } }
.typeahead { position: relative; z-index: 15; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px #0002; margin: -6px 0 10px; max-height: 60vh; overflow-y: auto; }
.ta-row { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 10px; font: inherit; color: var(--ink); cursor: pointer; }
.ta-row:active, .ta-row:hover { background: #f0f3f2; }
