/* ============================================================
   A176 LAB · Sopralluoghi — paper on top, ink tool belt below
   ============================================================ */
@font-face {
  font-family: "Space Grotesk";
  src: url("/static/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter.woff2") format("woff2");
  font-weight: 100 900; font-display: swap;
}

:root {
  --paper: #f4f2ee;
  --paper-2: #ebe8e2;
  --sheet: #f9f8f5;
  --ink: #101112;
  --ink-2: #1c1d1f;
  --ink-3: #2a2b2d;
  --ink-soft: #4a4a48;
  --muted: #66645f;
  --on-ink: #f4f2ee;
  --on-ink-muted: #a9a59d;
  --line: #d8d4cc;
  --line-ink: #34352f;
  --tan: #d2b48c;
  --tan-deep: #7a5c38;
  --tan-soft: #efe4d3;
  --ok: #2f6a3f;    --ok-bg: #dfeadf;
  --warn: #85560a;  --warn-bg: #f3e5c6;
  --danger: #a1382a; --danger-bg: #f4dcd6;
  --r: 4px;
  --r-lg: 8px;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --dock-full: 196px;
  --dock-tabs: 76px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 15px; line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--tan-deep); text-underline-offset: 3px; }
b, strong { font-weight: 600; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.02em; text-wrap: balance; }
::selection { background: var(--tan); color: var(--ink); }
:focus-visible { outline: 2px solid var(--tan-deep); outline-offset: 2px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }
svg { flex: 0 0 auto; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- splash */
.splash {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: var(--paper); transition: opacity .4s var(--ease), visibility .4s;
}
.splash.out { opacity: 0; visibility: hidden; }
.splash img { width: 170px; height: auto; }

/* ---------------------------------------------------------------- login */
.login-screen {
  min-height: 100dvh; display: grid; grid-template-rows: 1fr auto;
  padding: calc(28px + var(--safe-top)) 22px calc(20px + var(--safe-bottom));
}
.login-inner { width: min(420px, 100%); margin: auto; display: flex; flex-direction: column; gap: 32px; }
.login-logo { width: 190px; height: auto; display: block; }
.login-intro h1 { margin: 0; font-size: 26px; }
.login-intro p { margin: 6px 0 0; color: var(--muted); }
.login-card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px 18px 20px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); margin: 0 -18px; }
.seg-btn {
  border: 0; background: transparent; color: var(--muted); padding: 14px 10px 12px;
  font-family: var(--display); font-weight: 600; font-size: 14px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.seg-btn.active { color: var(--ink); border-bottom-color: var(--ink); }
.login-form { display: flex; flex-direction: column; gap: 16px; padding-top: 20px; }
.hint { margin: -8px 0 0; color: var(--muted); font-size: 13px; }
.warning { margin: 0; padding: 10px 12px; border-radius: var(--r); background: var(--warn-bg); color: var(--warn); font-size: 13px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12.5px; margin: 24px 0 0; }

/* ---------------------------------------------------------------- fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea, .input {
  width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: var(--r); padding: 12px 13px; outline: none; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
.field input::placeholder, .field textarea::placeholder, .input::placeholder { color: #6f6c66; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--tan-soft); }
.field input[readonly] { background: var(--paper-2); color: var(--ink-soft); }
.field select { appearance: none; padding-right: 36px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23101112' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; }
.otp-input { text-align: center; font-family: var(--display) !important; font-size: 30px !important; letter-spacing: .3em; font-weight: 600; font-variant-numeric: tabular-nums; }
.check-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.check-row input { width: 20px; height: 20px; accent-color: var(--ink); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 11px 16px; border-radius: var(--r);
  border: 1px solid var(--ink); background: transparent; color: var(--ink);
  font-family: var(--display); font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background .15s, color .15s, transform .1s;
}
.btn .ic { width: 18px; height: 18px; }
.btn:hover { background: var(--paper-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { background: var(--ink-3); }
.btn-ghost { border-color: var(--line); }
.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #275a35; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 7px 12px; font-size: 13.5px; }
.link { border: 0; background: none; padding: 6px 0; color: var(--tan-deep); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

.icon-btn {
  position: relative; display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: var(--r); border: 1px solid transparent; background: transparent; color: var(--ink);
}
.icon-btn:hover { background: var(--paper-2); }
.badge {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--paper);
}

/* ---------------------------------------------------------------- shell */
.app { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + var(--safe-top)) 14px 8px;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; color: var(--ink); }
.brand img { width: 34px; height: 34px; border-radius: var(--r); display: block; }
.brand span { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand small { font-family: var(--body); font-weight: 500; font-size: 13px; color: var(--muted); margin-left: 4px; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.avatar-btn {
  width: 38px; height: 38px; margin-left: 4px; border-radius: 50%; border: 0;
  background: var(--ink); color: var(--on-ink); font-family: var(--display); font-weight: 600; font-size: 13px;
}
.views { width: 100%; max-width: 760px; margin: 0 auto; padding: 18px 16px calc(var(--dock-tabs) + 28px + var(--safe-bottom)); }
body.dock-open .views { padding-bottom: calc(var(--dock-full) + 28px + var(--safe-bottom)); }
.view { display: none; }
.view.active { display: block; animation: enter .28s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }

/* ---------------------------------------------------------------- dock (tool belt) */
.dock {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  background: var(--ink); color: var(--on-ink);
  padding: 12px 12px calc(4px + var(--safe-bottom));
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -10px 30px rgba(16, 17, 18, .14);
}
.dock-inner { max-width: 760px; margin: 0 auto; }
.dock-actions { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 8px; margin-bottom: 10px; }
body:not(.dock-open) .dock-actions { display: none; }
.voice-btn {
  display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 10px 14px;
  border: 0; border-radius: var(--r-lg); background: var(--tan); color: var(--ink); text-align: left;
}
.voice-btn .mic {
  width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--tan);
  display: grid; place-items: center;
}
.voice-btn .mic .ic { width: 22px; height: 22px; stroke-width: 2; }
.voice-btn b { display: block; font-family: var(--display); font-size: 18px; line-height: 1.1; }
.voice-btn small { display: block; font-size: 12.5px; color: #3d3121; }
.voice-btn:active { background: #c7a77c; }
.dock-act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 76px; border: 1px solid var(--line-ink); border-radius: var(--r-lg);
  background: var(--ink-2); color: var(--on-ink); font-family: var(--display); font-weight: 600; font-size: 13px;
}
.dock-act .ic { width: 23px; height: 23px; }
.dock-act:hover { background: var(--ink-3); }
.dock-act:active, .voice-btn:active { transform: translateY(1px); }

.tabbar { display: flex; border-top: 1px solid var(--line-ink); }
body:not(.dock-open) .tabbar { border-top: 0; }
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 2px 7px; border: 0; background: transparent; color: var(--on-ink-muted);
  font-family: var(--display); font-size: 11.5px; font-weight: 600; position: relative;
}
.tab .ic { width: 22px; height: 22px; }
.tab.active { color: var(--on-ink); }
.tab.active::before { content: ""; position: absolute; top: -1px; left: 28%; right: 28%; height: 2px; background: var(--tan); }
body:not(.dock-open) .tab.active::before { top: -6px; }

/* ---------------------------------------------------------------- generic */
.card { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.card + .card { margin-top: 12px; }
.card-tight { padding: 4px 16px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 32px 0 10px; }
.section-title h2 { margin: 0; font-size: 18px; }
.muted { color: var(--muted); }
.tiny { font-size: 13px; color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.empty { text-align: center; padding: 30px 18px; color: var(--muted); }
.empty .ic { width: 34px; height: 34px; color: var(--muted); margin-bottom: 8px; }
.empty h3 { margin: 0 0 4px; color: var(--ink); font-size: 17px; }
.empty p { margin: 0; font-size: 14px; }
.skel { background: linear-gradient(90deg, var(--paper-2), #f1eee8, var(--paper-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: var(--r-lg); }
@keyframes shimmer { to { background-position: -200% 0; } }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: var(--sheet); color: var(--ink-soft);
}
button.pill { min-height: 34px; }
.pill .ic { width: 14px; height: 14px; }
.pill-accent { background: var(--tan-soft); border-color: transparent; color: var(--tan-deep); }
.pill-warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.pill-ok { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.pill-danger { background: var(--danger-bg); border-color: transparent; color: var(--danger); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-lg); font-size: 14px; margin-top: 12px; }
.notice .ic { width: 18px; height: 18px; margin-top: 2px; }
.notice-warn { background: var(--warn-bg); color: var(--warn); }
.notice-danger { background: var(--danger-bg); color: var(--danger); }

/* ---------------------------------------------------------------- site (top visual zone) */
.site { padding: 4px 0 2px; }
.site-kind { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.site-kind .ic { width: 16px; height: 16px; color: var(--tan-deep); }
.site h1 { margin: 6px 0 0; font-size: clamp(28px, 7.5vw, 40px); line-height: 1.05; }
.site-meta { margin: 8px 0 0; color: var(--ink-soft); font-size: 14.5px; }
.site-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-facts b { font-family: var(--display); font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; margin-right: 4px; }
.site-facts .pill { margin-left: auto; }
.site-empty h1 { font-size: clamp(26px, 7vw, 34px); }
.site-empty p { margin: 8px 0 18px; color: var(--ink-soft); max-width: 46ch; }

/* cronoprogramma: the signature visual */
.crono { margin-top: 26px; }
.crono-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.crono-head h2 { margin: 0; font-size: 18px; }
.crono-head span { font-family: var(--display); font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.crono-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.crono-row:last-child { border-bottom: 0; }
.crono-row.pinned .crono-name::after { content: "fissata"; margin-left: 8px; font-family: var(--body); font-size: 11.5px; font-weight: 600; color: var(--tan-deep); background: var(--tan-soft); padding: 2px 7px; border-radius: 99px; vertical-align: 2px; }
.crono-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.crono-name { font-size: 15px; font-weight: 500; }
.crono-perc { font-family: var(--display); font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; }
.rule { height: 10px; margin-top: 8px; background: var(--paper-2); border-radius: 2px; overflow: hidden; position: relative; }
.rule::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(25% - 1px), rgba(16,17,18,.12) calc(25% - 1px) 25%); }
.rule span { display: block; height: 100%; background: var(--ink); width: 0; transition: width .7s var(--ease); }
.rule span.done { background: var(--ok); }
.crono-more { margin-top: 6px; }

/* ---------------------------------------------------------------- lists */
.list { display: flex; flex-direction: column; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.list:empty { display: none; }
.list-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 14px 14px; color: var(--ink);
}
.list-row:last-child { border-bottom: 0; }
button.list-row:hover { background: var(--paper); }
.lr-icon { width: 38px; height: 38px; border-radius: var(--r); background: var(--paper-2); display: grid; place-items: center; color: var(--ink); }
.lr-icon .ic { width: 19px; height: 19px; }
.lr-main { flex: 1; min-width: 0; }
.lr-main strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-main small { display: block; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chev { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; }

.timeline { display: flex; flex-direction: column; }
.tl-item { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: 4px; top: 14px; bottom: 0; width: 1px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink); margin-top: 6px; }
.tl-body { flex: 1; min-width: 0; }
.tl-body strong { display: block; font-size: 14px; font-weight: 500; }
.tl-body small { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- verbale */
.verbale-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.verbale-head h1 { margin: 0; font-size: clamp(24px, 6.4vw, 32px); line-height: 1.1; }
.verbale-head p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.actions { display: flex; gap: 10px; margin-top: 18px; }
.actions .btn { flex: 1; }
.att-group { margin-top: 14px; }
.att-group-title { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--ink-soft); font-size: 13.5px; font-weight: 600; }
.att-group-title .ic { width: 16px; height: 16px; color: var(--tan-deep); }
.att-note { margin: 8px 0 0; color: var(--ink-soft); font-size: 14px; white-space: pre-wrap; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.photo-cell { position: relative; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--paper-2); }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 11px; border-radius: 99px; background: var(--sheet); border: 1px solid var(--line); color: var(--ink); font-size: 13.5px; }
.chip .ic { width: 15px; height: 15px; }
button.chip { cursor: pointer; }
.chip-warn { background: var(--warn-bg); border-color: transparent; color: var(--warn); }
.chip button { border: 0; background: transparent; color: var(--muted); padding: 2px; display: grid; place-items: center; }
.chip button .ic { width: 14px; height: 14px; }
.info-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.info-row:last-of-type { border-bottom: 0; }
.info-row span { color: var(--muted); }
.info-row b { text-align: right; }

/* ---------------------------------------------------------------- sheet */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(16, 17, 18, .45); opacity: 0; transition: opacity .2s; }
.overlay.show { opacity: 1; }
.sheet {
  position: fixed; z-index: 95; left: 50%; bottom: 0; transform: translate(-50%, 102%);
  width: min(640px, 100%); max-height: 92dvh; overflow: auto;
  background: var(--paper); border-radius: 14px 14px 0 0;
  padding: 8px 18px calc(20px + var(--safe-bottom));
  box-shadow: 0 -16px 40px rgba(16, 17, 18, .2);
  transition: transform .32s var(--ease);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-grip { width: 40px; height: 4px; border-radius: 99px; background: var(--line); margin: 4px auto 16px; }
.sheet h2 { margin: 0 0 4px; font-size: 22px; }
.sheet .sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; position: sticky; bottom: calc(-20px - var(--safe-bottom)); background: var(--paper); padding: 10px 0 0; }
.sheet-actions .btn { flex: 1; }
.done-mark { width: 48px; height: 48px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin-bottom: 14px; animation: pop .4s var(--ease) both; }
.done-mark .ic { width: 26px; height: 26px; stroke-width: 2.4; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } }

/* ---------------------------------------------------------------- composer */
.composer-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.composer-actions .btn-primary { flex: 1; min-height: 52px; }
.mic-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--tan); color: var(--ink); display: grid; place-items: center; }
.mic-btn .ic { width: 22px; height: 22px; stroke-width: 2; }
.mic-btn.recording { background: var(--danger); color: #fff; }
.rec-bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--ink); color: var(--on-ink); margin-top: 12px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef6b55; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.rec-time { font-family: var(--display); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 17px; }
.wave { flex: 1; height: 24px; display: flex; align-items: center; gap: 3px; }
.wave i { flex: 1; background: var(--tan); border-radius: 99px; height: 30%; animation: wave .9s ease-in-out infinite; }
.wave i:nth-child(2n) { animation-delay: .12s; }
.wave i:nth-child(3n) { animation-delay: .24s; }
@keyframes wave { 50% { height: 95%; } }
.rec-bar .btn { border-color: var(--on-ink); color: var(--on-ink); }
.rec-bar .btn:hover { background: var(--ink-3); }

/* ---------------------------------------------------------------- proposal */
.prop-activity { padding: 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--sheet); }
.prop-activity + .prop-activity { margin-top: 8px; }
.prop-activity.needs { border-color: var(--warn); background: #fbf4e6; }
.prop-head { display: flex; align-items: flex-start; gap: 10px; }
.prop-head .num { width: 24px; height: 24px; border-radius: var(--r); background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-family: var(--display); font-size: 12.5px; font-weight: 600; }
.prop-head strong { flex: 1; font-size: 15px; }
.perc-chip { font-family: var(--display); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.prop-text { margin: 8px 0 0; padding-left: 10px; border-left: 1px solid var(--tan); color: var(--ink-soft); font-size: 14px; white-space: pre-wrap; }
.prop-mini { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.att-picker { display: flex; flex-direction: column; max-height: 52dvh; overflow: auto; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--sheet); }
.att-choice { display: flex; align-items: center; gap: 10px; min-height: 52px; text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); }
.att-choice:last-child { border-bottom: 0; }
.att-choice:hover { background: var(--paper); }
.att-choice strong { flex: 1; font-size: 14.5px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.att-choice strong .ic { width: 17px; height: 17px; color: var(--ink-soft); }
.att-choice small { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.att-choice.sel { background: var(--ink); color: var(--on-ink); }
.att-choice.sel small, .att-choice.sel strong .ic { color: var(--tan); }

/* ---------------------------------------------------------------- chat */
.chat-wrap { display: flex; flex-direction: column; min-height: calc(100dvh - 190px); }
.chat-scroll { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 12px 12px 12px 4px; background: var(--sheet); border: 1px solid var(--line); align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--ink); color: var(--on-ink); border-color: var(--ink); border-radius: 12px 12px 4px 12px; }
.msg .who { display: block; margin-bottom: 2px; color: var(--tan-deep); font-size: 12.5px; font-weight: 600; }
.msg.mine .who { color: var(--tan); }
.msg .what { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.msg .when { display: block; margin-top: 3px; color: var(--muted); font-size: 11.5px; text-align: right; font-variant-numeric: tabular-nums; }
.msg.mine .when { color: var(--on-ink-muted); }
.chat-input {
  position: sticky; bottom: calc(var(--dock-tabs) + 10px + var(--safe-bottom));
  display: flex; gap: 8px; padding: 6px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line);
  box-shadow: 0 6px 20px rgba(16, 17, 18, .08);
}
.chat-input input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; padding: 8px 10px; font-size: 16px; }
.chat-input button { width: 44px; height: 44px; border-radius: var(--r); border: 0; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; }

/* ---------------------------------------------------------------- admin */
.admin-tabs { display: flex; gap: 0; overflow-x: auto; border-bottom: 1px solid var(--line); margin: -4px 0 18px; scrollbar-width: none; }
.admin-tabs::-webkit-scrollbar { display: none; }
.admin-tabs button { border: 0; background: transparent; color: var(--muted); padding: 12px 14px 10px; font-family: var(--display); font-size: 14.5px; font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-tabs button.active { color: var(--ink); border-bottom-color: var(--ink); }
.figures { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--sheet); }
.figure { padding: 14px 14px 12px; }
.figure + .figure { border-left: 1px solid var(--line); }
.figure b { display: block; font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.figure span { color: var(--muted); font-size: 13px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.panel-head { margin: 0 0 4px; font-size: 19px; }
.verify-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.verify-row:last-child { border-bottom: 0; }
.check { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); color: var(--muted); font-family: var(--display); font-weight: 700; }
.check .ic { width: 17px; height: 17px; stroke-width: 2.4; }
.check.good { background: var(--ok); color: #fff; }
.check.bad { background: var(--danger); color: #fff; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.user-row:last-child { border-bottom: 0; }
.user-av { width: 40px; height: 40px; border-radius: 50%; background: var(--paper-2); display: grid; place-items: center; font-family: var(--display); font-weight: 600; }
.user-row .lr-main small { white-space: nowrap; }

/* ---------------------------------------------------------------- profile */
.profile-head { display: flex; align-items: center; gap: 16px; padding: 6px 0 22px; }
.profile-av { width: 68px; height: 68px; border-radius: 50%; background: var(--ink); color: var(--on-ink); display: grid; place-items: center; font-family: var(--display); font-size: 24px; font-weight: 600; }
.profile-head h1 { margin: 0; font-size: 26px; }
.profile-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.colophon { text-align: center; margin: 34px 0 0; }
.colophon img { width: 120px; opacity: .9; }

/* ---------------------------------------------------------------- toast / loading */
.toast {
  position: fixed; z-index: 120; left: 50%; top: calc(64px + var(--safe-top)); transform: translate(-50%, -12px);
  width: min(440px, calc(100% - 28px)); display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-lg); font-size: 14px; font-weight: 500;
  background: var(--ink); color: var(--on-ink); box-shadow: 0 12px 30px rgba(16, 17, 18, .25);
  opacity: 0; transition: opacity .2s, transform .25s var(--ease); pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast::before { content: ""; width: 4px; align-self: stretch; border-radius: 2px; background: var(--on-ink-muted); flex: 0 0 auto; }
.toast.ok::before { background: #7fbf8c; }
.toast.err::before { background: #ef6b55; }
.toast.warn::before { background: var(--tan); }
.loading { position: fixed; inset: 0; z-index: 110; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(244, 242, 238, .78); font-size: 14px; color: var(--ink-soft); }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
.btn-primary .spinner { border-color: rgba(244, 242, 238, .3); border-top-color: var(--on-ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.offline-banner { position: fixed; z-index: 130; top: 0; left: 0; right: 0; padding: calc(7px + var(--safe-top)) 12px 7px; text-align: center; background: var(--danger); color: #fff; font-size: 13px; font-weight: 500; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 380px) {
  .dock-actions { grid-template-columns: 1fr 1fr 1fr; }
  .voice-btn { grid-column: 1 / -1; min-height: 64px; }
  :root { --dock-full: 260px; }
  .figure b { font-size: 22px; }
}
@media (max-width: 520px) {
  .form-grid.two { grid-template-columns: 1fr; }
  .sheet { padding-left: 16px; padding-right: 16px; }
}
@media (min-width: 900px) {
  .views { padding-top: 28px; }
  .dock { left: 50%; right: auto; width: 760px; transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------------------------------------------------------------- review round 1 */
.notice .link { padding: 0; font-size: inherit; color: inherit; }
.admin-tabs button { flex: 1 0 auto; padding: 12px 8px 10px; font-size: 14px; }
@media (max-width: 440px) {
  .voice-btn { gap: 10px; padding: 10px 12px; }
  .voice-btn .mic { width: 42px; height: 42px; }
  .voice-btn small { display: none; }
}
@media (max-width: 520px) {
  .list-row .chev { display: none; }
  .list-row { padding: 13px 12px; gap: 10px; }
  .list-row .pill { padding: 3px 8px; font-size: 12px; }
}
.hint .link { padding: 0; font-size: inherit; }

/* ---------------------------------------------------------------- telegram one-tap login */
.btn-tg { min-height: 54px; font-size: 16px; }
.btn-tg[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.tg-attesa { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r); background: var(--tan-soft); color: var(--tan-deep); font-size: 14px; font-weight: 500; }
.tg-attesa .spinner { width: 18px; height: 18px; border-width: 2px; border-color: rgba(122, 92, 56, .25); border-top-color: var(--tan-deep); }
.oppure { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: var(--muted); font-size: 13px; }
.oppure::before, .oppure::after { content: ""; flex: 1; height: 1px; background: var(--line); }
