/* Fiche Podologique PRO — prototype */
:root {
  --cream: #f7f2eb;
  --paper: #fbf8f3;
  --sand: #eadfd1;
  --sand-2: #f1e9de;
  --line: #e4dacb;
  --forest: #2f4a43;
  --forest-2: #3f564f;
  --ink: #22302c;
  --muted: #6b7a75;
  --sage: #7e9c8e;
  --sage-l: #dce6e0;
  --sage-xl: #eef3f0;
  --terra: #b86f52;
  --terra-d: #a35a3f;
  --blush: #f2c9b7;
  --blush-l: #f8e7e0;
  --ochre: #c49a4a;
  --ochre-l: #f5ead2;
  --red: #b0463a;
  --red-l: #f6dfdb;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", cursive;
  --r: 14px;
  --shadow: 0 1px 2px rgba(47, 74, 67, 0.06), 0 8px 24px -12px rgba(47, 74, 67, 0.18);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
.serif { font-family: var(--serif); }
.hand { font-family: var(--hand); }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

#app { min-height: 100%; display: flex; flex-direction: column; }

/* ---------- Lock ---------- */
.lock {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 20px; text-align: center;
  background:
    radial-gradient(600px 300px at 50% -10%, var(--sage-xl), transparent 70%),
    var(--cream);
}
.brandmark { display: flex; align-items: center; gap: 10px; justify-content: center; }
.brandmark .word { font-family: var(--serif); font-size: 20px; color: var(--forest); letter-spacing: -0.01em; }
.brandmark .word em { color: var(--terra); font-style: italic; }
.brandmark .pro { font-size: 10px; letter-spacing: 0.18em; font-weight: 700; color: var(--terra); border: 1px solid var(--blush); border-radius: 99px; padding: 2px 8px; }
.lock h1 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 28px 0 4px; color: var(--forest); }
.lock p { margin: 0; color: var(--muted); }
.pin-dots { display: flex; gap: 14px; margin: 26px 0 8px; height: 16px; }
.pin-dots span { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--forest); transition: background 0.15s, transform 0.15s; }
.pin-dots span.on { background: var(--forest); transform: scale(1.1); }
.pin-dots.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pin-msg { min-height: 22px; font-size: 13px; color: var(--red); }
.pinpad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; margin-top: 10px; }
.pinpad button {
  height: 72px; border-radius: 50%; font-family: var(--serif); font-size: 26px; color: var(--forest);
  background: var(--paper); border: 1px solid var(--line); transition: background 0.15s, transform 0.1s;
}
.pinpad button:active { transform: scale(0.94); background: var(--sand-2); }
.pinpad button.ghost { background: none; border: 0; font-family: var(--sans); font-size: 13px; color: var(--muted); }
.lock .hint { margin-top: 22px; font-family: var(--hand); font-size: 20px; color: var(--terra); }
.lock .secure { margin-top: 18px; display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }

/* ---------- Shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; background: rgba(247, 242, 235, 0.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .grow { flex: 1; min-width: 0; }
.topbar .title { font-family: var(--serif); font-size: 19px; color: var(--forest); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--forest); }
.iconbtn:hover { background: var(--sand-2); }
.main { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: 18px 18px 110px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 14px; border-radius: 10px; position: relative; }
.tabbar button.on { color: var(--forest); }
.tabbar button.on::after { content: ""; position: absolute; top: -9px; left: 30%; right: 30%; height: 2px; background: var(--terra); border-radius: 2px; }
.tabbar .count { position: absolute; top: 0; right: 8px; background: var(--terra); color: #fff; font-size: 10px; border-radius: 99px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }

/* ---------- Home ---------- */
.hello { margin: 4px 0 16px; }
.hello h1 { font-family: var(--serif); font-weight: 400; font-size: 28px; margin: 0; color: var(--forest); letter-spacing: -0.01em; }
.hello h1 em { color: var(--terra); }
.hello p { margin: 4px 0 0; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.search { display: flex; align-items: center; gap: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; height: 48px; color: var(--muted); }
.search input { border: 0; outline: 0; background: none; flex: 1; height: 100%; color: var(--ink); }
.list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.pcard {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px;
  transition: transform 0.15s, box-shadow 0.15s; animation: rise 0.35s both;
}
.pcard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-size: 17px; color: var(--forest); background: var(--sage-l); flex: none; }
.pcard .who { flex: 1; min-width: 0; }
.pcard .name { font-weight: 700; color: var(--ink); }
.pcard .meta { font-size: 12.5px; color: var(--muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; border-radius: 99px; padding: 3px 9px; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.g0 { color: #4f7465; background: var(--sage-l); }
.g1 { color: #8a6a24; background: var(--ochre-l); }
.g2 { color: var(--terra-d); background: var(--blush-l); }
.g3 { color: var(--red); background: var(--red-l); }
.gn { color: var(--muted); background: var(--sand-2); }
.fab {
  position: fixed; right: 18px; bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 25;
  display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px; border-radius: 99px;
  background: var(--forest); color: #fff; font-weight: 700; box-shadow: 0 10px 30px -8px rgba(47, 74, 67, 0.55);
  transition: transform 0.15s;
}
.fab:hover { transform: translateY(-2px); }
.empty { padding: 40px 10px; text-align: center; color: var(--muted); }
.storage-note { margin-top: 22px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; justify-content: center; }

/* ---------- Wizard ---------- */
.wz-head { position: sticky; top: 61px; z-index: 15; background: var(--cream); padding: 10px 18px 12px; border-bottom: 1px solid var(--line); }
.wz-head .inner { max-width: 820px; margin: 0 auto; }
.steps { display: flex; gap: 4px; }
.steps button { flex: 1; height: 4px; border-radius: 4px; background: var(--sand); transition: background 0.3s; }
.steps button.done { background: var(--sage); }
.steps button.on { background: var(--terra); }
.wz-meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; gap: 10px; }
.wz-meta .stepname { font-family: var(--serif); font-size: 22px; color: var(--forest); }
.wz-meta .stepname small { font-family: var(--sans); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--terra); font-weight: 700; display: block; }
.saved { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.saved .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sage); }
.saved.busy .dot { background: var(--ochre); animation: pulse 0.8s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.intro { color: var(--muted); margin: 2px 0 18px; font-size: 14px; }
.step { animation: slidein 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.step.back { animation-name: slideback; }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } }
@keyframes slideback { from { opacity: 0; transform: translateX(-24px); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.wz-foot {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: var(--paper); border-top: 1px solid var(--line);
}
.wz-foot .inner { max-width: 820px; margin: 0 auto; display: flex; gap: 10px; }
.btn { height: 48px; padding: 0 20px; border-radius: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform 0.1s, background 0.15s; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--forest); color: #fff; flex: 1; }
.btn.primary:hover { background: var(--forest-2); }
.btn.terra { background: var(--terra); color: #fff; }
.btn.line { border: 1px solid var(--line); background: var(--paper); color: var(--forest); }
.btn.small { height: 38px; padding: 0 14px; font-size: 13px; border-radius: 10px; }

/* Fields */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 14px; }
.card h3 { font-family: var(--serif); font-weight: 500; font-size: 17px; margin: 0 0 12px; color: var(--forest); display: flex; align-items: center; gap: 8px; }
.card h3 .tag { font-family: var(--sans); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--terra); font-weight: 700; margin-left: auto; }
.card.cond { border-color: var(--blush); background: linear-gradient(var(--paper), var(--paper)) padding-box; animation: rise 0.35s both; position: relative; }
.card.cond::before { content: ""; position: absolute; left: -1px; top: 14px; bottom: 14px; width: 3px; background: var(--terra); border-radius: 3px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.grid2 .field { margin-bottom: 0; }
.field > label, .flabel { font-size: 12.5px; font-weight: 700; color: var(--forest-2); }
.field input, .field textarea, .field select {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 11px 12px; outline: 0; width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field textarea { min-height: 76px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-xl); }
.field .err { font-size: 12px; color: var(--red); }
.field.invalid input { border-color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 8px 13px; font-size: 13.5px; color: var(--ink);
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.chip:active { transform: scale(0.96); }
.chip.on { background: var(--forest); border-color: var(--forest); color: #fff; }
.chip.on.warn { background: var(--terra); border-color: var(--terra); }
.seg { display: inline-flex; background: var(--sand-2); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { padding: 8px 14px; border-radius: 9px; font-size: 13.5px; color: var(--forest-2); font-weight: 600; transition: background 0.15s, color 0.15s; }
.seg button.on { background: #fff; color: var(--forest); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); flex-wrap: wrap; }
.row:first-of-type { border-top: 0; }
.row .flabel { flex: 1; min-width: 140px; }
.pain { margin-top: 6px; }
.pain-scale { display: grid; grid-template-columns: repeat(11, 1fr); gap: 4px; }
.pain-scale button { height: 40px; border-radius: 8px; font-weight: 700; font-size: 13px; background: var(--sand-2); color: var(--forest-2); transition: transform 0.1s, background 0.15s; }
.pain-scale button.on { color: #fff; transform: translateY(-2px); }
.pain-ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* Neuro */
.neuro { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.neuro .side { text-align: center; }
.neuro .side .flabel { margin-bottom: 4px; display: block; }
.mono-foot { width: 100%; max-width: 150px; height: auto; margin: 0 auto; display: block; }
.mono-site { cursor: pointer; }
.mono-site circle { transition: fill 0.2s, r 0.2s; }
.mono-site text { font: 700 13px var(--sans); pointer-events: none; }
.table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 13.5px; }
.table th { text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 6px 4px; }
.table td { padding: 8px 4px; border-top: 1px dashed var(--line); vertical-align: middle; }
.table td:first-child { font-weight: 700; color: var(--forest-2); font-size: 13px; }
.table .seg button { padding: 6px 9px; font-size: 12.5px; }

/* Map */
.map-wrap { display: grid; grid-template-columns: 1fr; gap: 14px; }
.viewtabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.viewtabs button { white-space: nowrap; padding: 8px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; background: var(--sand-2); color: var(--forest-2); position: relative; }
.viewtabs button.on { background: var(--forest); color: #fff; }
.viewtabs .n { margin-left: 6px; font-size: 11px; background: var(--terra); color: #fff; border-radius: 99px; padding: 0 6px; }
.foot-stage { position: relative; background: radial-gradient(circle at 50% 45%, #fff 0, #fff 35%, var(--sand-2) 36%, var(--sand-2) 58%, transparent 59%), var(--paper); border-radius: var(--r); border: 1px solid var(--line); display: grid; place-items: center; padding: 10px; }
.foot-svg { width: 100%; max-width: 260px; height: auto; touch-action: manipulation; cursor: crosshair; }
.foot-svg .outline, .mono-foot .outline { fill: #fffdf9; stroke: var(--forest); stroke-width: 2.4; }
.foot-svg .detail, .mono-foot .detail { fill: none; stroke: var(--sage); stroke-width: 1.3; }
.foot-svg .nail, .mono-foot .nail { fill: var(--sand-2); stroke: var(--sage); stroke-width: 1.2; }
.marker { cursor: pointer; animation: pop 0.3s cubic-bezier(0.3, 1.6, 0.5, 1) both; transform-box: fill-box; transform-origin: center; }
.marker text { font: 800 11px var(--sans); fill: #fff; pointer-events: none; }
@keyframes pop { from { transform: scale(0); } }
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.legend button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px 6px 6px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-size: 13px; }
.legend button .k { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 11px; }
.legend button.on { border-color: var(--forest); box-shadow: 0 0 0 2px var(--forest) inset; }
.maphint { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 10px; }
.photo { aspect-ratio: 1; border-radius: 10px; overflow: hidden; position: relative; background: var(--sand-2); animation: pop 0.3s both; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(34, 48, 44, 0.7); color: #fff; display: grid; place-items: center; }
.photo button svg.i { width: 14px; height: 14px; }
.addphoto { aspect-ratio: 1; border-radius: 10px; border: 1.5px dashed var(--sage); color: var(--forest); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 600; background: var(--sage-xl); }

/* Risk */
.risk { border-radius: var(--r); padding: 18px; background: var(--forest); color: #fff; margin-bottom: 14px; position: relative; overflow: hidden; }
.risk::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.12); box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.03); }
.risk .lbl { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blush); font-weight: 700; }
.risk .big { font-family: var(--serif); font-size: 26px; margin: 4px 0 2px; }
.gauge { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 14px 0 12px; }
.gauge span { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.15); transition: background 0.5s; }
.gauge span.on:nth-child(1) { background: #9bc0ae; }
.gauge span.on:nth-child(2) { background: #e2bd6e; }
.gauge span.on:nth-child(3) { background: #e39a7b; }
.gauge span.on:nth-child(4) { background: #e36a5a; }
.risk ul { margin: 6px 0 0; padding-left: 18px; font-size: 13.5px; color: rgba(255, 255, 255, 0.86); }
.risk .cov { margin-top: 10px; font-size: 13px; color: #fff; background: rgba(255, 255, 255, 0.08); border-radius: 10px; padding: 9px 12px; }
.risk .val { margin-top: 10px; font-size: 11.5px; color: rgba(255, 255, 255, 0.6); }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 11px 13px; font-size: 13.5px; animation: rise 0.3s both; }
.alert .d { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.alert.red { background: var(--red-l); color: #7d2a20; }
.alert.red .d { background: var(--red); box-shadow: 0 0 0 4px rgba(176, 70, 58, 0.15); }
.alert.orange { background: var(--ochre-l); color: #6e531a; }
.alert.orange .d { background: var(--ochre); }
.alert.green { background: var(--sage-xl); color: #355b4e; }
.alert.green .d { background: var(--sage); }

/* Signature */
.consent p { font-size: 13.5px; color: var(--forest-2); margin: 0 0 10px; }
.radio { display: flex; flex-direction: column; gap: 8px; }
.radio button { text-align: left; display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13.5px; }
.radio button .o { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--sage); flex: none; margin-top: 1px; display: grid; place-items: center; }
.radio button.on { border-color: var(--forest); }
.radio button.on .o::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--forest); }
.sigpad { position: relative; border: 1.5px dashed var(--sage); border-radius: 12px; background: #fff; height: 190px; overflow: hidden; }
.sigpad canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.sigpad .ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--hand); font-size: 24px; color: var(--sage); pointer-events: none; transition: opacity 0.2s; }
.sigpad .base { position: absolute; left: 20px; right: 20px; bottom: 40px; border-bottom: 1px solid var(--line); pointer-events: none; }
.sigtools { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.prac-sign { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--sage-xl); border-radius: 12px; font-size: 13px; }
.prac-sign .hand { font-size: 26px; color: var(--forest); line-height: 1; }

/* Patient */
.phead { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.phead .avatar { width: 58px; height: 58px; font-size: 22px; }
.phead h1 { font-family: var(--serif); font-weight: 400; font-size: 26px; margin: 0; color: var(--forest); line-height: 1.15; }
.phead .meta { color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1.5px; background: var(--line); }
.tl { position: relative; margin-bottom: 14px; animation: rise 0.35s both; }
.tl::before { content: ""; position: absolute; left: -21px; top: 18px; width: 11px; height: 11px; border-radius: 50%; background: var(--paper); border: 2px solid var(--sage); }
.tl.first::before { border-color: var(--terra); background: var(--terra); }
.tl .card { margin: 0; }
.tl .when { font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--terra); font-weight: 700; }
.tl .what { font-family: var(--serif); font-size: 18px; color: var(--forest); margin: 2px 0 8px; }
.tl .summary { font-size: 13.5px; color: var(--forest-2); }
.tl .tlfoot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 8px; flex-wrap: wrap; }
.lockline { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.lockline svg.i { width: 14px; height: 14px; }
.compare { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--sand-2); user-select: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .after { clip-path: inset(0 0 0 50%); }
.compare .bar { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; box-shadow: 0 0 8px rgba(0, 0, 0, 0.3); }
.compare .bar::after { content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--forest); font-weight: 700; }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; }
.compare .tagl, .compare .tagr { position: absolute; bottom: 10px; font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, 0.85); border-radius: 99px; padding: 3px 9px; color: var(--forest); }
.compare .tagl { left: 10px; }
.compare .tagr { right: 10px; }

/* PDF */
.pdf-tools { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.themes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); transition: transform 0.15s; position: relative; }
.swatch.on { box-shadow: 0 0 0 2px var(--forest); transform: scale(1.08); }
.swatch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.swatch.custom { background: conic-gradient(#e36a5a, #e2bd6e, #9bc0ae, #5a8fb0, #8b6bb0, #e36a5a); }
.pdf-doc {
  --acc: #2f4a43;
  background: #fff; color: #1d2724; border-radius: 4px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04), 0 18px 40px -18px rgba(0, 0, 0, 0.25);
  padding: 34px 30px; font-size: 11.5px; line-height: 1.5; position: relative; overflow: hidden; animation: rise 0.4s both;
}
.pdf-doc::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--acc); }
.pdf-doc header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 1.5px solid var(--acc); padding-bottom: 14px; margin-bottom: 16px; }
.pdf-doc .logo { width: 110px; height: 56px; border: 1px dashed #c9bfae; border-radius: 6px; display: grid; place-items: center; font-size: 10px; color: #a3957f; letter-spacing: 0.1em; overflow: hidden; }
.pdf-doc .logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pdf-doc h1 { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 0; color: var(--acc); line-height: 1.1; }
.pdf-doc .sub { font-size: 10.5px; color: #6b7a75; }
.pdf-doc h2 { font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--acc); margin: 16px 0 6px; font-weight: 800; }
.pdf-doc .kv { display: grid; grid-template-columns: 130px 1fr; gap: 3px 12px; }
.pdf-doc .kv b { color: #556460; font-weight: 600; }
.pdf-doc .pill { display: inline-block; border: 1px solid var(--acc); color: var(--acc); border-radius: 99px; padding: 1px 8px; margin: 0 4px 4px 0; font-size: 10.5px; }
.pdf-doc .riskbox { border: 1.5px solid var(--acc); border-radius: 8px; padding: 10px 12px; display: flex; gap: 14px; align-items: center; }
.pdf-doc .riskbox .n { font-family: var(--serif); font-size: 30px; color: var(--acc); line-height: 1; }
.pdf-doc .maps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; font-size: 9.5px; color: #6b7a75; }
.pdf-doc .maps svg { width: 100%; height: auto; }
.pdf-doc .sigs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pdf-doc .sigs > div { border-top: 1px solid #d8d0c2; padding-top: 6px; min-height: 70px; }
.pdf-doc .sigs img { max-height: 60px; }
.pdf-doc footer { margin-top: 20px; border-top: 1px solid #eee; padding-top: 8px; font-size: 9px; color: #9aa59f; display: flex; justify-content: space-between; }
.pdf-doc .pphotos { display: flex; gap: 6px; flex-wrap: wrap; }
.pdf-doc .pphotos img { width: 80px; height: 80px; object-fit: cover; border-radius: 4px; }

/* Settings */
.set-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.toggle { width: 44px; height: 26px; border-radius: 99px; background: var(--sand); position: relative; transition: background 0.2s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.toggle.on { background: var(--sage); }
.toggle.on::after { transform: translateX(18px); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); opacity: 0; z-index: 60; background: var(--forest); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; display: flex; gap: 8px; align-items: center; transition: opacity 0.25s, transform 0.25s; pointer-events: none; box-shadow: var(--shadow); white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Wide screens: tablet / desktop */
@media (min-width: 960px) {
  .main { padding-top: 26px; }
  .neuro { grid-template-columns: 1fr 1fr; }
  .map-wrap { grid-template-columns: 1.1fr 1fr; align-items: start; }
}
@media (max-width: 420px) {
  .grid2 { grid-template-columns: 1fr; }
  .pinpad { grid-template-columns: repeat(3, 66px); }
  .pinpad button { height: 66px; }
  .pdf-doc { padding: 24px 18px; }
  .pdf-doc .kv { grid-template-columns: 100px 1fr; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; }
  body > *:not(#app), .topbar, .tabbar, .wz-foot, .pdf-tools, .no-print { display: none !important; }
  .main { padding: 0; max-width: none; }
  .pdf-doc { box-shadow: none; padding: 0 0 0 18px; animation: none; }
  .pdf-doc::before { width: 5px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
