/* Mulyankan AI */
:root {
  --navy: #0C3B35; --navy-2: #11544B; --navy-3: #146B5E; --ridge: #2E8A78;
  --amber: #F2A93B; --orange: #E8722C; --amber-soft: #FFF3E2;
  --ink: #15231F; --ink-2: #3B4B46; --muted: #66766F; --line: #DDE7E3; --line-2: #C6D5CF;
  --bg: #F3F7F5; --card: #FFFFFF; --ok: #1F9D6B; --ok-soft: #E3F6EE; --warn: #B7791F; --warn-soft: #FFF6E3;
  --bad: #C2413A; --bad-soft: #FDECEA; --info-soft: #E6F4F0;
  --r: 12px; --r-sm: 8px; --shadow: 0 1px 2px rgba(12,59,53,.06), 0 4px 16px rgba(12,59,53,.06);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--navy-3); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--navy-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--amber), var(--orange)); border: 0; color: #fff; box-shadow: 0 2px 8px rgba(232,114,44,.28); }
.btn.primary:hover { filter: brightness(1.04); }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: rgba(12,59,53,.06); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--bad); }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: rgba(12,59,53,.07); color: var(--ink); }

/* ---------- forms ---------- */
label.f { display: block; }
label.f > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 4px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; outline: none; min-height: 40px; }
input:focus, select:focus, textarea:focus { border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(20,107,94,.14); }
.grid { display: grid; gap: 12px 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.badge-src { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 6px; background: var(--info-soft); color: var(--navy-3); vertical-align: 1px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field-need input, .field-need select { border-color: var(--amber); background: var(--amber-soft); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; overflow: hidden; background: #fff; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; cursor: pointer; font-size: 13.5px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--navy); color: #fff; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .hero { background: radial-gradient(1200px 600px at 10% 110%, rgba(242,169,59,.22), transparent 60%),
  linear-gradient(160deg, var(--navy-2), var(--navy) 60%); color: #fff; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login .hero::after { content: ""; position: absolute; right: -80px; bottom: -40px; width: 520px; height: 260px;
  background: linear-gradient(180deg, rgba(46,138,120,.55), rgba(46,138,120,0)); clip-path: polygon(0 100%, 30% 25%, 48% 60%, 70% 0, 100% 100%); }
.brand-row { display: flex; align-items: center; gap: 14px; }
.brand-row img { width: 52px; height: 52px; }
.brand-name { font-size: 22px; font-weight: 800; letter-spacing: .3px; }
.brand-name small { display: block; font-size: 11px; letter-spacing: 2.6px; font-weight: 600; color: var(--amber); margin-top: 2px; }
.hero h1 { font-size: 40px; line-height: 1.12; max-width: 520px; margin-top: 64px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--amber), var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero ul { list-style: none; padding: 0; margin: 28px 0 0; max-width: 480px; position: relative; z-index: 1; }
.hero li { display: flex; gap: 12px; margin: 14px 0; color: #D2E7E0; }
.hero li b { color: #fff; }
.hero .num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: rgba(242,169,59,.18); color: var(--amber); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.hero .foot { font-size: 12px; color: #9CC2B6; position: relative; z-index: 1; }
.login .panel { display: grid; place-items: center; padding: 32px; }
.login form { width: 100%; max-width: 380px; }
.login form h2 { font-size: 24px; margin-bottom: 6px; }
.err { color: var(--bad); font-size: 13.5px; min-height: 20px; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login .hero { padding: 28px 22px; } .hero h1 { font-size: 28px; margin-top: 28px; } .hero ul { display: none; } }

/* ---------- shell ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 18px; padding: 10px 22px; border-bottom: 3px solid var(--amber); }
.top .brand-row img { width: 34px; height: 34px; }
.top .brand-name { font-size: 16px; } .top .brand-name small { font-size: 9px; letter-spacing: 2px; }
.top nav { display: flex; gap: 4px; margin-left: 12px; }
.top nav a { white-space: nowrap; color: #C3DCD4; text-decoration: none; padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.top nav a.on, .top nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.top .who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: #C3DCD4; }
.top .who .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.25); }
main { max-width: 1180px; margin: 0 auto; padding: 24px 22px 80px; }
@media (max-width: 760px) { .top { flex-wrap: wrap; padding: 10px 14px; gap: 8px; } .top nav { order: 3; width: 100%; margin: 0; overflow-x: auto; } .top .who span { display: none; } main { padding: 16px 12px 80px; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; }
.card + .card { margin-top: 16px; }
.card h2 + p { margin-top: 4px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }

/* ---------- jobs list ---------- */
.jobs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-top: 16px; }
.job-card { cursor: pointer; transition: transform .08s, box-shadow .08s; }
.job-card:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(12,59,53,.10); }
.job-card .t { font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--info-soft); color: var(--navy-3); }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); } .chip.bad { background: var(--bad-soft); color: var(--bad); }
.empty { text-align: center; padding: 48px 20px; }
.empty img { width: 64px; opacity: .9; }

/* ---------- job workspace ---------- */
.job-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.job-head input.title { font-size: 20px; font-weight: 800; border: 1px solid transparent; background: transparent; padding: 4px 8px; margin-left: -8px; min-width: 240px; flex: 1; }
.job-head input.title:hover, .job-head input.title:focus { border-color: var(--line-2); background: #fff; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.step { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 14px; cursor: pointer; display: flex; gap: 10px; align-items: center; text-align: left; }
.step .n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--bg); color: var(--ink-2); border: 1px solid var(--line-2); }
.step b { display: block; font-size: 14px; } .step small { color: var(--muted); font-size: 12px; }
.step.on { border-color: var(--navy); box-shadow: 0 0 0 2px rgba(12,59,53,.12); }
.step.on .n { background: var(--navy); color: #fff; border-color: var(--navy); }
.step.done .n { background: var(--ok); color: #fff; border-color: var(--ok); }
@media (max-width: 760px) { .steps { grid-template-columns: repeat(4, 1fr); gap: 4px; } .step { padding: 8px; flex-direction: column; gap: 4px; text-align: center; } .step small { display: none; } .step b { font-size: 12px; } }

.drop { border: 2px dashed var(--line-2); border-radius: 14px; padding: 28px; text-align: center; background: linear-gradient(180deg, #fff, #FBFDFC); transition: border-color .1s, background .1s; }
.drop.over { border-color: var(--amber); background: var(--amber-soft); }
.drop h3 { font-size: 17px; margin-bottom: 4px; }
.drop .row { justify-content: center; margin-top: 14px; }
.files { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin-top: 16px; }
.file { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; display: flex; flex-direction: column; }
.file .thumb { height: 120px; background: #EDF4F1 center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-weight: 700; font-size: 13px; position: relative; }
.file .thumb { overflow: hidden; border-bottom: 1px solid var(--line); }
.file .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.file .body { padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.file .name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file select { min-height: 34px; padding: 5px 8px; font-size: 13px; }
.file .status { font-size: 12.5px; color: var(--ink-2); }
.file .status.err { color: var(--bad); }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid rgba(12,59,53,.18); border-top-color: var(--orange); border-radius: 50%; animation: sp .8s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes sp { to { transform: rotate(360deg); } }
.ai-line { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: linear-gradient(90deg, rgba(242,169,59,.14), rgba(20,107,94,.06)); font-weight: 600; font-size: 14px; }
.ai-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(232,114,44,.18); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(232,114,44,.05); } }

.need { border-left: 4px solid var(--amber); }
.need h2 { display: flex; gap: 8px; align-items: center; }
details.sec { border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-top: 12px; }
details.sec > summary { cursor: pointer; padding: 13px 16px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
details.sec[open] > summary::after { transform: rotate(180deg); }
details.sec > .inner { padding: 4px 16px 16px; }
.band { font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; font-weight: 800; color: var(--navy-3); margin: 16px 0 8px; }
.band.j { color: #C55A11; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tabs button { border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 13px; }
.tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 700; padding: 6px 6px; border-bottom: 1px solid var(--line); }
table.t td { padding: 5px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t td input, table.t td select { min-height: 34px; padding: 5px 7px; font-size: 13px; }
.table-wrap { overflow-x: auto; }

/* ---------- map tracer ---------- */
.tracer { display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
@media (max-width: 900px) { .tracer { grid-template-columns: 1fr; } }
.canvas-wrap { position: relative; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #E7EFEC; height: min(68vh, 680px); touch-action: none; }
.canvas-wrap canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.canvas-tools { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.canvas-tools .btn { background: rgba(255,255,255,.95); }
.canvas-hint { position: absolute; bottom: 10px; left: 10px; right: 10px; background: rgba(12,59,53,.86); color: #fff; padding: 8px 12px; border-radius: 9px; font-size: 13px; }
.edge-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.edge-row b { font-family: ui-monospace, Consolas, monospace; }
.result-big { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.kpi b { display: block; font-size: 20px; } .kpi small { color: var(--muted); font-size: 12px; font-weight: 600; }
.kpi.hl { background: linear-gradient(135deg, var(--navy-2), var(--navy)); color: #fff; } .kpi.hl small { color: #C3DCD4; }
.kpi.amber { background: linear-gradient(135deg, var(--amber), var(--orange)); color: #fff; } .kpi.amber small { color: #FFF1DE; }

/* ---------- reports ---------- */
.dl { display: grid; gap: 8px; }
.dl a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); background: #fff; }
.dl a:hover { border-color: var(--navy-3); }
.ext { flex: none; font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 6px; color: #fff; background: var(--navy-3); }
.ext.pdf { background: #C2413A; } .ext.xlsx { background: #1F7A4D; } .ext.docx { background: #2E8A78; } .ext.png, .ext.jpg { background: #7A5AB8; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.pages img { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: zoom-in; }
ul.list { margin: 6px 0 0; padding-left: 18px; } ul.list li { margin: 3px 0; }
.lightbox { position: fixed; inset: 0; background: rgba(8,16,30,.85); display: grid; place-items: center; z-index: 50; padding: 20px; }
.lightbox img { max-width: 100%; max-height: 100%; background: #fff; border-radius: 6px; }

/* ---------- checklists page ---------- */
.dl-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.dl-card { display: flex; gap: 16px; align-items: flex-start; }
.dl-card .ico { flex: none; width: 56px; height: 68px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 800; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 14px; opacity: 0; transition: .2s; z-index: 60; pointer-events: none; max-width: 92vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--bad); }
.modal-bg { position: fixed; inset: 0; background: rgba(8,16,30,.5); display: grid; place-items: center; z-index: 40; padding: 16px; }
.modal { background: #fff; border-radius: 14px; padding: 22px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }

/* ================= v0.9 beta additions ================= */
.beta { display: inline-block; margin-left: 7px; font-size: 9.5px; letter-spacing: 1px; font-weight: 800; padding: 2px 6px; border-radius: 5px;
  background: var(--amber); color: var(--navy); vertical-align: 3px; }
.brand-name small { letter-spacing: 2.6px; }
.btn.big { padding: 12px 22px; font-size: 15.5px; }
button.link { border: 0; background: none; color: var(--navy-3); text-decoration: underline; cursor: pointer; padding: 0; font-size: inherit; }
.credit-chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 99px; background: rgba(242,169,59,.16);
  color: #FFD58A; text-decoration: none; font-size: 13px; font-weight: 600; white-space: nowrap; border: 1px solid rgba(242,169,59,.35); }
.credit-chip b { color: #fff; }
.credit-chip.low { background: var(--bad); color: #fff; border-color: var(--bad); }
.top .who .acct { display: inline-flex; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 99px; }
.av { width: 26px; height: 26px; border-radius: 50%; background: var(--amber); color: var(--navy); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.foot-bar { max-width: 1180px; margin: 0 auto; padding: 0 22px 28px; display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.foot-bar a { color: var(--muted); }
.banner { margin: 0 0 14px; padding: 11px 14px; border-radius: 10px; background: var(--amber-soft); border: 1px solid #F3D79E; font-size: 14px; }
.banner.bad { background: var(--bad-soft); border-color: #F2C3BF; }
.drop.quick { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px; text-align: left; margin-bottom: 4px; }
.drop.quick .row { margin: 0; }
.search { margin-top: 14px; max-width: 420px; }
input[type=search] { width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 10px; min-height: 42px; background: #fff; }

/* AI-read fields */
.tag-ai { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: #EFE7FB; color: #6B3FB0;
  vertical-align: 1px; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
label.f.ai input, label.f.ai select { border-color: #B79BE3; background: #FAF7FF; }
.ai-warn { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: #FFF8EC; border: 1px solid #F1CF8E; margin-bottom: 16px; }
.ai-warn .ico { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--warn); color: #fff; font-weight: 900; }
.ai-warn p { margin: 4px 0 8px; font-size: 13.5px; color: var(--ink-2); }
.ai-warn.ok { background: var(--ok-soft); border-color: #B8E4D0; } .ai-warn.ok .ico { background: var(--ok); }
label.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
label.check input { width: 20px; height: 20px; accent-color: var(--navy); }
.with-btn { display: flex; gap: 6px; } .with-btn input { flex: 1; min-width: 0; } .with-btn .btn { flex: none; }
details.sub { margin-top: 16px; border-top: 1px dashed var(--line-2); padding-top: 10px; }
details.sub > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--navy-3); }
.preview { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--bg); font-weight: 600; }
.modal label.f + label.f { margin-top: 10px; }
.modal { max-height: 92vh; overflow-y: auto; }
.qr { display: grid; place-items: center; margin: 8px 0; } .qr svg { width: 200px; height: 200px; }
textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--r-sm); resize: vertical; }

/* step navigation */
.actionbar { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }

/* credits */
.packs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-top: 12px; }
.pack { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.pack.best { border: 2px solid var(--amber); }
.pack .price { font-size: 22px; font-weight: 800; color: var(--navy); }
.pack .btn { margin-top: 6px; justify-content: center; }
.pack .ribbon { position: absolute; top: -10px; right: 12px; background: var(--amber); color: var(--navy); font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.packs.compact .pack { padding: 12px; } .packs.compact .price { font-size: 18px; }
td.pos { color: var(--ok); font-weight: 700; } b.neg { color: var(--bad); }
td.wrap { white-space: normal; word-break: break-word; max-width: 520px; }

/* ================= phone ================= */
@media (max-width: 760px) {
  html, body { font-size: 15px; }
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea { font-size: 16px; min-height: 46px; }
  .btn { min-height: 44px; } .btn.sm { min-height: 38px; padding: 7px 12px; }
  .icon-btn { min-width: 40px; min-height: 40px; }
  .top { padding: 8px 12px; } .top .brand-row img { width: 30px; height: 30px; }
  .top .who { gap: 6px; } .top .who .nm { display: none; } .top .who .acct { padding: 3px; border: 0; }
  .top nav a { padding: 9px 12px; }
  main { padding: 14px 12px 96px; }
  .section-title { flex-wrap: wrap; }
  .section-title > .btn.primary { width: 100%; justify-content: center; }
  .card { padding: 14px; }
  .grid { grid-template-columns: 1fr; }
  .job-head input.title { min-width: 0; font-size: 18px; }
  .actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(12,59,53,.08); }
  .actionbar .btn { flex: 1; justify-content: center; }
  .foot-bar { padding: 0 12px 90px; }
  .drop { padding: 18px 14px; }
  .drop.quick .row, .drop.quick .row .btn { width: 100%; justify-content: center; } .drop.quick .row label { flex: 1; }
  .files { grid-template-columns: 1fr 1fr; gap: 8px; } .file .thumb { height: 96px; }
  .modal-bg { place-items: end center; padding: 0; } .modal { border-radius: 16px 16px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-width: none; }
  /* data tables become stacked cards */
  table.t[data-table] thead { display: none; }
  table.t[data-table] tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
  table.t[data-table] td { border: 0; padding: 0; }
  table.t[data-table] td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-bottom: 2px; }
  table.t[data-table] td:last-child { grid-column: 1 / -1; text-align: right; }
  .canvas-wrap { height: 62vh; }
  .ai-warn { padding: 12px; }
}
@media (max-width: 380px) { .files { grid-template-columns: 1fr; } .credit-chip { padding: 5px 8px; } }
.ai-warn p .tag-ai { margin: 0 2px; vertical-align: 0; }
@media (max-width: 760px) {
  #toast { top: calc(10px + env(safe-area-inset-top)); bottom: auto; left: 12px; right: 12px; transform: translateY(-20px); max-width: none; text-align: center; }
  #toast.show { transform: none; }
}
.with-unit { display: flex; align-items: center; gap: 6px; } .with-unit input { flex: 1; min-width: 0; } .with-unit span { color: var(--muted); font-weight: 700; }
label.check.owner-same { align-self: end; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--bg); }
table.t td.ai input, table.t td.ai select { border-color: #B79BE3; background: #FAF7FF; }
label.check.roads-draw { padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--bg); width: 100%; }
.picker { position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: crosshair; touch-action: manipulation; }
.picker img { width: 100%; display: block; }
.pick-mark { position: absolute; width: 22px; height: 14px; background: repeating-linear-gradient(45deg, #c00000 0 3px, #ff6b6b 3px 5px); border: 2px solid #000; pointer-events: none; box-shadow: 0 0 0 3px rgba(255,255,255,.8); }
/* location plan editor */
.ped-tabs { display: flex; gap: 6px; align-items: center; margin: 10px 0 8px; }
.ped-tabs button { border: 1px solid var(--line-2); background: #fff; border-radius: 99px; padding: 7px 14px; font-weight: 600; cursor: pointer; min-height: 38px; }
.ped-tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.ped-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 10px; max-height: 70vh; background: #fff; }
.ped-stage { position: relative; min-width: 100%; aspect-ratio: 297 / 210; }
.ped-stage img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.ped-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.ped-stage svg.road { cursor: crosshair; } .ped-stage svg.plot { cursor: pointer; }
.ped-plot { fill: rgba(192,0,0,.75); stroke: #000; stroke-width: .5; cursor: move; }
.ped-road { fill: none; stroke: #000; stroke-linejoin: round; } .ped-road-core { fill: none; stroke: #fff; stroke-linejoin: round; }
.ped-draft { fill: none; stroke: rgba(20,107,94,.55); stroke-linejoin: round; stroke-linecap: round; } .ped-dot { fill: var(--orange); stroke: #fff; stroke-width: .4; }
.ped-tools { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; margin-top: 10px; }
.ped-tools.road { flex-direction: column; gap: 8px; } .ped-tools.road .row input { flex: 1; min-width: 160px; } .ped-tools.road select { width: auto; }
.ped-pad { display: grid; grid-template-columns: repeat(3, 46px); gap: 4px; }
.ped-pad button { height: 46px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 16px; cursor: pointer; }
.ped-pad button.mid { font-size: 11px; font-weight: 700; color: var(--muted); }
.ped-list { list-style: none; padding: 0; margin: 0; } .ped-list li { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
/* site plan editor */
.sed-road .sed-hit { fill: none; stroke: transparent; cursor: pointer; pointer-events: stroke; }
.sed-road .sed-edge { fill: none; stroke: #000; stroke-width: .45; stroke-linejoin: miter; pointer-events: none; }
.sed-road.on .sed-edge { stroke: #146B5E; stroke-width: .6; }
.sed-road.on .sed-hit { stroke: rgba(20,107,94,.12); }
.sed-label { font-size: 2.6px; text-anchor: middle; dominant-baseline: middle; fill: #000; cursor: move; paint-order: stroke; stroke: #fff; stroke-width: .8px; }
.sed-v { fill: #E8722C; stroke: #fff; stroke-width: .5; cursor: grab; } .sed-v.sel { fill: #146B5E; }
.sed-add circle { fill: #fff; stroke: #146B5E; stroke-width: .35; cursor: copy; } .sed-add text { font-size: 2.6px; text-anchor: middle; fill: #146B5E; pointer-events: none; font-weight: 700; }
.sed-tools { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; } .sed-tools select { width: auto; min-width: 160px; }
.sed-val { min-width: 92px; text-align: center; font-weight: 600; font-size: 13.5px; }
.ped-stage svg .sed-road { cursor: pointer; }
