/* Gigamat Projects – portale rilievi
   Palette: acciaio dell'armadio rack, blu dei cavi di rete, ambra delle prese di corrente. */

:root {
  --paper: #eef1f4;
  --panel: #ffffff;
  --ink: #18212c;
  --muted: #5d6876;
  --line: #d5dbe2;
  --line-soft: #e8ecf0;
  --steel: #1f2833;
  --steel-2: #2d3744;
  --led: #eaf2ff;
  --data: #1d63c7;
  --data-dark: #164f9f;
  --power: #c77a06;
  --custom: #6f7a88;
  --ok: #1f8a4c;
  --danger: #c0392b;
  --mine: #d6f4cc;
  --theirs: #ffffff;
  --chat-bg: #e3e8ed;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --top: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--paper); }
body.noscroll { overflow: hidden; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--data); }
code { background: var(--line-soft); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
:focus-visible { outline: 2px solid var(--data); outline-offset: 2px; }
[hidden] { display: none !important; }

.ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Pulsanti ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--panel); font-weight: 600; text-decoration: none; color: var(--ink);
  white-space: nowrap;
}
.btn:hover { border-color: #b3bdc8; }
.btn.primary { background: var(--data); border-color: var(--data); color: #fff; }
.btn.primary:hover { background: var(--data-dark); border-color: var(--data-dark); }
.btn.ghost { background: transparent; }
.btn.danger-text { color: var(--danger); }
.btn.danger-text:hover { border-color: var(--danger); }
.btn:disabled { opacity: .55; cursor: default; }

.btn-icon {
  width: 38px; height: 38px; border: 0; background: transparent; border-radius: var(--r-sm);
  display: inline-grid; place-items: center; color: var(--muted); flex: none;
}
.btn-icon:hover { background: var(--line-soft); color: var(--ink); }
.btn-icon.danger:hover { background: #fbeae8; color: var(--danger); }
.btn-icon.light { color: #fff; }
.btn-icon.light:hover { background: rgba(255, 255, 255, .14); color: #fff; }

/* ---------- Barra superiore ---------- */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  min-height: var(--top); padding: env(safe-area-inset-top) 20px 0;
  background: var(--steel); color: #fff;
}
.topbar form { margin: 0; }
.brand { display: inline-flex; align-items: baseline; gap: 5px; font-size: 19px; font-weight: 800; letter-spacing: -.03em; color: inherit; text-decoration: none; }
.brand span { font-weight: 400; opacity: .65; letter-spacing: -.01em; }
.top-tag { font-size: 13px; padding: 2px 8px; border-radius: 4px; background: rgba(255, 255, 255, .1); opacity: .9; }
.spacer { flex: 1; }
.btn-top { height: 34px; padding: 0 12px; background: transparent; border: 1px solid rgba(255, 255, 255, .25); color: #fff; border-radius: var(--r-sm); font-size: 14px; }
.btn-top:hover { background: rgba(255, 255, 255, .08); }
.link-top { display: none; color: #fff; font-size: 14px; text-decoration: none; opacity: .9; }

/* ---------- Layout scheda + chat ---------- */

.layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start;
  max-width: 1360px; margin: 0 auto; padding: 28px 24px 48px;
}
.sheet-col, .ws-center { min-width: 0; container: sheet / inline-size; }
.chat-col { position: sticky; top: calc(var(--top) + 24px); height: calc(100vh - var(--top) - 48px); height: calc(100dvh - var(--top) - 48px); min-height: 420px; }

.hello { font-size: clamp(30px, 4.2vw, 44px); line-height: 1.05; font-weight: 750; letter-spacing: -.03em; margin: 0 0 10px; overflow-wrap: anywhere; }
.sheet-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.sub { color: var(--muted); margin: 0; max-width: 60ch; }
.meta { color: var(--muted); margin: 0; font-size: 14px; }
.meta strong { color: var(--ink); font-weight: 600; }

.save-state { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.save-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.save-state[data-s="saving"]::before { background: var(--power); }
.save-state[data-s="error"] { color: var(--danger); }
.save-state[data-s="error"]::before { background: var(--danger); }

.loading { color: var(--muted); padding: 24px 0; }

/* ---------- Righe ---------- */

.rows { display: flex; flex-direction: column; gap: 10px; }

.row {
  display: grid; grid-template-columns: minmax(170px, 1.15fr) auto minmax(150px, 1fr) auto;
  gap: 14px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--custom);
  border-radius: var(--r); padding: 12px 14px 12px 12px;
}
.row.k-data { border-left-color: var(--data); }
.row.k-power { border-left-color: var(--power); }

.row-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kind-ico { display: inline-flex; color: var(--custom); }
.kind-ico .ico { width: 22px; height: 22px; }
.k-data .kind-ico { color: var(--data); }
.k-power .kind-ico { color: var(--power); }
.label-text { font-weight: 600; line-height: 1.3; }
.label-input {
  width: 100%; min-width: 0; height: 42px; padding: 0 10px; font-weight: 600;
  border: 1px dashed #b7c1cc; border-radius: var(--r-sm); background: #f8fafb;
}
.label-input:focus { outline: none; border-style: solid; border-color: var(--data); background: #fff; box-shadow: 0 0 0 3px rgba(29, 99, 199, .15); }

/* Contatore: il “display” dell'armadio */
.stepper { display: inline-flex; align-items: stretch; gap: 2px; padding: 3px; background: var(--steel); border-radius: var(--r-sm); }
.stepper:focus-within { box-shadow: 0 0 0 3px rgba(29, 99, 199, .35); }
.step { width: 38px; border: 0; border-radius: 4px; background: var(--steel-2); color: #c8d2de; display: grid; place-items: center; }
.step:hover { background: #3b4756; color: #fff; }
.step:active { background: #475567; }
.qty {
  width: 70px; padding: 3px 0; border: 0; background: transparent; text-align: center;
  color: var(--led); font-size: 25px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: .02em;
  appearance: textfield; -moz-appearance: textfield;
}
.qty::-webkit-outer-spin-button, .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty:focus { outline: none; background: rgba(255, 255, 255, .07); border-radius: 4px; }

.row-desc { min-width: 0; }
.desc {
  display: block; width: 100%; min-height: 42px; padding: 9px 10px; resize: none; overflow: hidden; line-height: 1.4;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff;
}
.desc:focus { outline: none; border-color: var(--data); box-shadow: 0 0 0 3px rgba(29, 99, 199, .15); }

.row-actions { display: flex; align-items: center; gap: 4px; }
.btn-photo {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font-weight: 600;
}
.btn-photo:hover { border-color: var(--data); color: var(--data); }
.btn-photo .count {
  min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; display: grid; place-items: center;
  background: var(--line-soft); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums;
}
.btn-photo.has .count { background: var(--data); color: #fff; }
.del-spacer { width: 38px; flex: none; }

.btn-add {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; padding: 14px;
  border: 1.5px dashed #a9b4c0; border-radius: var(--r); background: transparent; color: var(--muted); font-weight: 600;
}
.btn-add:hover { border-color: var(--data); color: var(--data); background: rgba(29, 99, 199, .04); }
.btn-add:disabled { opacity: .6; }

@container sheet (max-width: 700px) {
  .row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "head head" "step act" "desc desc";
    gap: 10px; padding: 12px;
  }
  .row-head { grid-area: head; }
  .stepper { grid-area: step; justify-self: start; }
  .row-actions { grid-area: act; }
  .row-desc { grid-area: desc; }
  .step { width: 44px; }
  .del-spacer { display: none; }
}
@container sheet (max-width: 400px) {
  .step { width: 40px; }
  .qty { width: 54px; font-size: 22px; }
  .btn-photo { padding: 0 8px 0 10px; gap: 6px; }
}

/* ---------- Galleria ---------- */

.overlay { position: fixed; inset: 0; z-index: 100; }

.gallery { display: flex; flex-direction: column; background: #10161d; color: #e8edf2; }
.g-head {
  display: flex; align-items: center; gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) 14px 12px 20px; border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.g-title { flex: 1; min-width: 0; }
.g-title h2 { margin: 0; font-size: 18px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-count { font-size: 13px; opacity: .65; }
.g-cam { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .25); }
.g-cam:hover { border-color: rgba(255, 255, 255, .5); }
@media (hover: hover) and (pointer: fine) { .g-cam { display: none; } }

.g-body { flex: 1; overflow: auto; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; max-width: 1400px; margin: 0 auto; }
@media (max-width: 520px) { .g-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } .g-body { padding: 10px; } }

.g-tile { position: relative; aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: #1c242e; }
.g-thumb { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; }
.g-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.g-thumb:hover img { transform: scale(1.03); }
.g-del {
  position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: rgba(10, 14, 19, .7); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .15s;
}
.g-del .ico { width: 18px; height: 18px; }
.g-tile:hover .g-del, .g-del:focus-visible { opacity: 1; }
.g-del:hover { background: var(--danger); }
@media (hover: none) { .g-del { opacity: 1; } }

.g-drop {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px;
  border: 1.5px dashed rgba(255, 255, 255, .3); border-radius: var(--r); background: transparent; color: #cdd6e0; text-align: center;
}
.g-drop .ico { width: 30px; height: 30px; }
.g-drop span { font-size: 12.5px; line-height: 1.35; opacity: .75; }
.g-drop:hover { border-color: #7aa9ec; color: #fff; }

.uploading { display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: 12px; }
.g-pname { font-size: 12px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-prog { height: 4px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, .12); }
.g-prog i { display: block; width: 0; height: 100%; background: #7aa9ec; transition: width .15s; }
.g-loading { grid-column: 1 / -1; padding: 20px 0; opacity: .7; }

.g-veil {
  position: absolute; inset: 12px; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 2px dashed #7aa9ec; border-radius: var(--r-lg); background: rgba(16, 22, 29, .88);
  font-size: 18px; font-weight: 600; pointer-events: none;
}
.g-veil .ico { width: 42px; height: 42px; }
.gallery.dragging .g-veil { display: flex; }

/* ---------- Slideshow ---------- */

.lightbox { z-index: 110; background: #07090c; color: #fff; }
.lb-head {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px 18px;
}
.lb-counter { font-size: 14px; font-variant-numeric: tabular-nums; opacity: .8; }
.lb-tools { display: flex; gap: 4px; }
.lb-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 60px 76px; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; opacity: 0; transition: opacity .2s; user-select: none; -webkit-user-select: none; }
.lb-img.ready { opacity: 1; }
.lb-nav {
  position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
  width: 50px; height: 50px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff;
  display: grid; place-items: center;
}
.lb-nav:hover { background: rgba(255, 255, 255, .22); }
.lb-nav .ico { width: 26px; height: 26px; }
.lb-nav.prev { left: 14px; }
.lb-nav.next { right: 14px; }
@media (max-width: 640px) {
  .lb-stage { padding: 56px 0; }
  .lb-nav { width: 44px; height: 44px; background: rgba(0, 0, 0, .4); }
  .lb-nav.prev { left: 6px; }
  .lb-nav.next { right: 6px; }
}

/* ---------- Finestre ---------- */

.modal-wrap { z-index: 120; display: grid; place-items: center; padding: 16px; background: rgba(16, 22, 29, .5); }
.modal {
  width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  background: var(--panel); border-radius: var(--r-lg); box-shadow: 0 24px 64px rgba(10, 15, 20, .28);
}
.m-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 14px 4px 20px; }
.m-head h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; }
.form { display: flex; flex-direction: column; gap: 14px; padding: 8px 20px 20px; }
.field label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 600; }
.field input {
  width: 100%; height: 42px; padding: 0 12px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--r-sm);
}
.field input:focus { outline: none; border-color: var(--data); box-shadow: 0 0 0 3px rgba(29, 99, 199, .15); }
.field small { display: block; margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.pw-row { display: flex; gap: 8px; }
.pw-row input { flex: 1; min-width: 0; }
.form-err { margin: 0; color: var(--danger); font-size: 14px; }
.form-err:empty { display: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.cred {
  margin: 0; padding: 12px 14px; white-space: pre-wrap; word-break: break-all;
  font: 14px/1.7 ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-sm);
}

/* ---------- Chat ---------- */

.chat { display: flex; flex-direction: column; height: 100%; overflow: hidden; background: var(--chat-bg); border: 1px solid var(--line); border-radius: var(--r-lg); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--panel); border-bottom: 1px solid var(--line); }
.chat-head strong { display: block; line-height: 1.2; }
.chat-head small { color: var(--muted); font-size: 12.5px; }
.avatar {
  width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--steel); color: #fff; font-size: 13px; font-weight: 700;
}
.chat-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 3px; padding: 14px 12px; }
.chat-empty { margin: auto; max-width: 30ch; text-align: center; color: var(--muted); font-size: 14px; }
.day { align-self: center; margin: 10px 0 6px; padding: 3px 10px; border-radius: 8px; background: rgba(255, 255, 255, .88); color: var(--muted); font-size: 12px; }
.day:first-child { margin-top: 0; }

.msg {
  position: relative; max-width: 82%; padding: 7px 10px 5px; border-radius: 12px;
  box-shadow: 0 1px 1px rgba(20, 30, 40, .08); overflow-wrap: anywhere;
}
.msg.theirs { align-self: flex-start; background: var(--theirs); border-top-left-radius: 3px; }
.msg.mine { align-self: flex-end; background: var(--mine); border-top-right-radius: 3px; }
.msg.theirs + .msg.mine, .msg.mine + .msg.theirs { margin-top: 8px; }
.msg.theirs + .msg.theirs { border-top-left-radius: 12px; }
.msg.mine + .msg.mine { border-top-right-radius: 12px; }
.msg-body { white-space: pre-wrap; font-size: 14.5px; line-height: 1.4; }
.msg-meta { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-top: 1px; font-size: 11px; color: #6b7784; }
.ticks { display: inline-flex; width: 17px; height: 12px; color: #8b97a4; }
.ticks svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.msg.read .ticks { color: #2a8be0; }

.chat-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px; background: var(--panel); border-top: 1px solid var(--line); }
.chat-input {
  flex: 1; min-width: 0; max-height: 140px; padding: 9px 14px; resize: none; line-height: 1.4;
  border: 1px solid var(--line); border-radius: 20px; background: #f6f8fa;
}
.chat-input:focus { outline: none; border-color: var(--data); background: #fff; }
.chat-send { width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; }
.chat-send:hover { background: #197340; }
.chat-send:disabled { opacity: .5; }

/* ---------- Pannello admin ---------- */

.admin-shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.sidebar {
  position: sticky; top: var(--top); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top));
  display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line);
}
.side-top { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.search { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--paper); }
.search:focus { outline: none; border-color: var(--data); background: #fff; }
.user-list { flex: 1; overflow: auto; list-style: none; margin: 0; padding: 8px; }
.user-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: var(--r); background: transparent; text-align: left; }
.user-item:hover { background: var(--paper); }
.user-item.active { background: #e2ebf8; }
.ui-text { flex: 1; min-width: 0; }
.ui-text strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-text small { color: var(--muted); font-size: 12.5px; }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; background: var(--ok); color: #fff; font-size: 12px; font-weight: 700; }
.empty-list { padding: 16px 10px; color: var(--muted); font-size: 14px; }

.admin-main { min-width: 0; }
.admin-main .layout { max-width: 1400px; }
.admin-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.admin-head .hello { font-size: clamp(26px, 3.2vw, 36px); margin-bottom: 4px; }
.ah-text { flex: 1; min-width: 0; }
.ah-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-icon.back { display: none; margin-top: 2px; }
.empty-main { display: grid; place-items: center; min-height: 60vh; padding: 24px; text-align: center; color: var(--muted); }
.empty-main h2 { margin: 0 0 6px; color: var(--ink); font-size: 22px; }
.empty-main p { margin: 0 0 16px; max-width: 40ch; }

/* ---------- Accesso ---------- */

.login {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    repeating-linear-gradient(0deg, transparent 0 43px, rgba(255, 255, 255, .035) 43px 44px),
    var(--steel);
}
.login-card { width: min(400px, 100%); padding: 30px 28px; background: var(--panel); border-radius: var(--r-lg); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.login-card .brand { margin-bottom: 26px; font-size: 22px; color: var(--ink); }
.login-card h1 { margin: 0 0 4px; font-size: 25px; letter-spacing: -.02em; }
.login-card > p { margin: 0 0 20px; color: var(--muted); }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .btn.primary, .login-card > .btn { width: 100%; height: 46px; margin-top: 4px; }
.alert { margin-bottom: 14px; padding: 10px 12px; border-radius: var(--r-sm); background: #fbeae8; color: var(--danger); font-size: 14px; }

/* ---------- Notifiche ---------- */

.toasts {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 200; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: max-content; max-width: calc(100vw - 32px); pointer-events: none;
}
.toast { padding: 10px 16px; border-radius: var(--r); background: var(--steel); color: #fff; font-size: 14px; box-shadow: 0 8px 24px rgba(10, 15, 20, .25); transition: opacity .3s, transform .3s; }
.toast.ok { background: var(--ok); }
.toast.error { background: var(--danger); }
.toast.out { opacity: 0; transform: translateY(8px); }


/* ---------- v2: pagina, griglia progetto ---------- */

.page { max-width: 1520px; margin: 0 auto; padding: 24px 24px 48px; }
.hello { margin-bottom: 18px; }
.btn.small { height: 34px; padding: 0 12px; font-size: 14px; }
.btn .ico { width: 18px; height: 18px; }

.ws {
  display: grid; gap: 18px; align-items: start;
  grid-template-columns: 260px minmax(0, 1fr) 360px;
  grid-template-areas: "files center chat";
}
.ws.has-proj { grid-template-rows: auto 1fr; grid-template-areas: "proj center chat" "files center chat"; }
.ws-proj { grid-area: proj; }
.ws-center { grid-area: center; }
.ws-files { grid-area: files; }
.ws-chat { grid-area: chat; position: sticky; top: calc(var(--top) + 18px); height: calc(100vh - var(--top) - 36px); height: calc(100dvh - var(--top) - 36px); min-height: 440px; }
.ws-files:empty, .ws-chat:empty { display: none; }
.ws.is-empty { grid-template-columns: 260px minmax(0, 1fr); grid-template-areas: "proj center"; grid-template-rows: auto; }
.ws.is-empty .ws-files, .ws.is-empty .ws-chat { display: none; }

.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; min-height: 32px; }
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-count { font-size: 12px; color: var(--muted); background: var(--line-soft); border-radius: 10px; padding: 1px 8px; }
.card-count:empty { display: none; }

/* Lista progetti (utente) */
.proj-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 42vh; overflow: auto; }
.proj-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 0; border-radius: var(--r); background: transparent; text-align: left; font-weight: 500; }
.proj-item .ico { width: 18px; height: 18px; color: var(--muted); }
.proj-item:hover { background: var(--paper); }
.proj-item.active { background: #e2ebf8; font-weight: 650; }
.proj-item.active .ico { color: var(--data); }
.pi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.first-project { max-width: 560px; padding: 28px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.first-project h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.01em; }
.first-project p { margin: 0 0 16px; color: var(--muted); }
.first-project input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.first-project input:focus { outline: none; border-color: var(--data); box-shadow: 0 0 0 3px rgba(29, 99, 199, .15); }
.first-project .btn { height: 44px; }

/* Intestazione progetto */
.proj-head { margin-bottom: 14px; }
.ph-title { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.proj-name { margin: 0 4px 0 0; font-size: 23px; font-weight: 700; letter-spacing: -.015em; overflow-wrap: anywhere; }
.ph-title .btn.small { margin-left: auto; }
.ph-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.btn.danger-text.small { height: 32px; }

/* Traduzioni */
.tr-line { display: flex; align-items: flex-start; gap: 6px; margin-top: 5px; font-size: 12.5px; line-height: 1.35; color: #45658c; }
.tr-line .ico { width: 14px; height: 14px; margin-top: 1px; flex: none; }
.label-wrap { flex: 1; min-width: 0; }
.msg-tr { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 4px; font-size: 11.5px; color: #5f7389; }
.msg-tr .ico { width: 13px; height: 13px; }
.tr-toggle { padding: 0; border: 0; background: none; color: var(--data); font-size: inherit; text-decoration: underline; }

/* Allegati */
.files-card > .btn.small { width: 100%; margin-bottom: 10px; }
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
.file { display: flex; align-items: center; gap: 10px; padding: 6px 4px 6px 6px; border-radius: var(--r-sm); }
.file:hover { background: var(--paper); }
.ext { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 6px; background: #e6ebf1; color: #4a5665; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; }
.ext-pdf { background: #fbe4e1; color: #b3261e; }
.ext-dwg, .ext-dxf { background: #e3eefc; color: var(--data); }
.ext-xlsx, .ext-xls, .ext-csv { background: #e1f3e7; color: #1f7a45; }
.ext-docx, .ext-doc { background: #e3ebfb; color: #2b56b0; }
.ext-jpg, .ext-jpeg, .ext-png, .ext-webp, .ext-heic { background: #f1eafa; color: #6f3aa6; }
.ext-zip, .ext-rar, .ext-7z { background: #fdf1dc; color: #a0620a; }
.file-main { flex: 1; min-width: 0; }
.file-name { display: block; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.file-name:hover { color: var(--data); text-decoration: underline; }
.file-main small { font-size: 12px; color: var(--muted); }
.file .btn-icon { width: 32px; height: 32px; }
.file.uploading .g-prog { margin-top: 6px; background: var(--line-soft); }
.files-empty { padding: 6px 2px; font-size: 13.5px; color: var(--muted); }
.card-veil {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  border: 2px dashed var(--data); border-radius: var(--r-lg); background: rgba(234, 242, 255, .95);
  color: var(--data); font-weight: 650; pointer-events: none;
}
.card-veil .ico { width: 30px; height: 30px; }
.files-card.dragging .card-veil { display: flex; }

/* Selettore lingua */
.lang-switch { display: inline-flex; overflow: hidden; border: 1px solid rgba(255, 255, 255, .25); border-radius: var(--r-sm); }
.lang-switch button { padding: 6px 9px; border: 0; background: transparent; color: #cfd8e3; font-size: 13px; font-weight: 600; }
.lang-switch button + button { border-left: 1px solid rgba(255, 255, 255, .15); }
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--steel); }
.lang-switch button:not([aria-pressed="true"]):hover { background: rgba(255, 255, 255, .1); color: #fff; }
.login-langs { display: flex; justify-content: center; gap: 16px; margin-top: 22px; font-size: 13.5px; }
.login-langs a { color: var(--muted); text-decoration: none; }
.login-langs a:hover { color: var(--data); }
.login-langs a[aria-current] { color: var(--ink); font-weight: 650; }

/* Admin: albero utenti → progetti */
.tree { flex: 1; overflow: auto; list-style: none; margin: 0; padding: 8px; }
.t-row { display: flex; align-items: center; border-radius: var(--r); }
.t-row:hover { background: var(--paper); }
.t-row.active { background: #e2ebf8; }
.t-toggle { width: 28px; height: 44px; flex: none; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); }
.t-toggle .ico { width: 16px; height: 16px; transition: transform .15s; }
.t-user.open > .t-row .t-toggle .ico { transform: rotate(90deg); }
.t-user-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 2px; border: 0; background: none; text-align: left; }
.t-user-btn .avatar { width: 34px; height: 34px; font-size: 12px; }
.t-projects { list-style: none; margin: 2px 0 8px 27px; padding: 0 0 0 10px; border-left: 1px solid var(--line); }
.t-proj, .t-add { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 0; border-radius: var(--r-sm); background: none; text-align: left; font-size: 14px; }
.t-proj .ico, .t-add .ico { width: 16px; height: 16px; color: var(--muted); }
.t-proj:hover, .t-add:hover { background: var(--paper); }
.t-proj.active { background: #e2ebf8; font-weight: 650; }
.t-proj.active .ico { color: var(--data); }
.t-add { color: var(--data); font-weight: 600; }
.t-add .ico { color: var(--data); }
.t-empty { padding: 6px 8px; font-size: 13px; color: var(--muted); }

.crumb { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.crumb-link { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 0; border: 0; background: none; color: var(--data); font-size: 15px; font-weight: 650; }
.crumb-link .ico { width: 18px; height: 18px; }
.crumb-note { font-size: 13px; color: var(--muted); }

.section-title { margin: 28px 0 12px; font-size: 17px; }
.proj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.proj-card-btn {
  min-height: 124px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); text-align: left;
}
.proj-card-btn:hover { border-color: var(--data); }
.pc-top { width: 100%; display: flex; justify-content: space-between; color: var(--data); }
.proj-card-btn strong { font-size: 16px; overflow-wrap: anywhere; }
.proj-card-btn small { margin-top: auto; color: var(--muted); }
.pc-tr { display: flex; gap: 5px; font-size: 12.5px; color: #45658c; }
.pc-tr .ico { width: 14px; height: 14px; }
.proj-card-btn.add { align-items: center; justify-content: center; border-style: dashed; color: var(--muted); }
.proj-card-btn.add:hover { color: var(--data); }
.field select { width: 100%; height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }


/* ---------- v3: menu laterale e pagine ---------- */

.app-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.side-nav { position: sticky; top: var(--top); height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); padding: 16px 10px; background: var(--panel); border-right: 1px solid var(--line); }
.side-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: var(--r); background: none; text-align: left; font-weight: 550; color: var(--muted); }
.nav-item .ico { width: 20px; height: 20px; }
.nav-item span:not(.ico):not(.badge) { flex: 1; }
.nav-item:hover { background: var(--paper); color: var(--ink); }
.nav-item.active { background: #e2ebf8; color: var(--data); font-weight: 700; }
.app-main { min-width: 0; }
.page.narrow { max-width: 860px; }
.page.wide { max-width: 1680px; }
.page-title { margin: 0 0 18px; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.025em; }
.card + .card { margin-top: 18px; }
.card-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.card-head { flex-wrap: wrap; }
.card-head .seg { margin-right: auto; margin-left: 12px; }
.empty-note { color: var(--muted); padding: 10px 2px; margin: 0; }
.empty-note p { margin: 0 0 12px; }
.muted { color: var(--muted); }

/* Filtro a segmenti */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--paper); border-radius: var(--r); }
.seg button { padding: 5px 11px; border: 0; border-radius: 7px; background: none; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 30, 40, .12); }

/* Stato progetto */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.s-open { background: #fff3dc; color: #9a5b00; }
.status.s-closed { background: #e2f3e8; color: #1f7a45; }
.status-select { height: 32px; padding: 0 10px; border-radius: 999px; font-weight: 650; font-size: 13.5px; border: 1px solid transparent; cursor: pointer; }
.status-select.s-open { background: #fff3dc; color: #9a5b00; border-color: #f1d9a8; }
.status-select.s-closed { background: #e2f3e8; color: #1f7a45; border-color: #b9e0c7; }

/* Tabelle */
.tbl-wrap { overflow-x: auto; margin: 0 -14px -14px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; padding: 8px 14px; font-size: 12.5px; font-weight: 650; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: #f6f9fd; }
.tbl tr.clickable:focus-visible { outline: 2px solid var(--data); outline-offset: -2px; }
.tbl small { display: block; font-size: 12px; margin-top: 2px; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .nowrap { white-space: nowrap; }
.tbl .raw { color: var(--muted); font-weight: 400; }
.tbl .p-name { font-size: 15px; }
.tbl .td-badge { width: 40px; text-align: right; }
.tbl .actions { white-space: nowrap; text-align: right; }
.tbl .actions .btn + .btn { margin-left: 6px; }
.desc-cell { max-width: 420px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tr-mini { display: inline-flex !important; align-items: center; gap: 4px; color: #45658c; }
.tr-mini .ico { width: 12px; height: 12px; }
.u-cell { display: inline-flex; align-items: center; gap: 8px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 14px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.filters select, .filters input { height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font-size: 14px; color: var(--ink); min-width: 200px; }
.iv-summary { margin-left: auto; display: flex; gap: 14px; align-items: baseline; font-size: 14px; color: var(--muted); }
.iv-summary strong { color: var(--ink); font-size: 16px; }

/* ---------- Pagina progetto ---------- */

.crumb-link { margin-bottom: 8px; }
.pj-head { margin-bottom: 16px; }
.pj-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.pj-title .proj-name { margin: 0; font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -.02em; }
.proj-owner { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.proj-owner .ico { width: 16px; height: 16px; }
.pj-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin-top: 12px; }
.pj-tools .btn.danger-text { margin-left: auto; }
.btn-photo.wide { padding: 0 12px; }

.pj-grid { display: grid; gap: 16px; align-items: start; grid-template-columns: 300px minmax(0, 1fr) 252px; }
.pj-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pj-left .card + .card { margin-top: 0; }
.pj-center { min-width: 0; }
.pj-chat { position: sticky; top: calc(var(--top) + 16px); }

/* Righe compatte */
.pj-left .rows { gap: 6px; }
.pj-left .row { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 8px 10px 9px; border-left-width: 3px; border-radius: var(--r-sm); }
.pj-left .row-head { align-items: flex-start; gap: 8px; }
.pj-left .kind-ico .ico { width: 18px; height: 18px; }
.pj-left .label-text { flex: 1; font-size: 13.5px; line-height: 1.3; }
.pj-left .label-input { height: 32px; font-size: 13.5px; }
.pj-left .btn-icon.sm { width: 28px; height: 28px; margin: -2px -4px 0 0; }
.pj-left .btn-icon.sm .ico { width: 17px; height: 17px; }
.row-ctrl { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pj-left .stepper { padding: 2px; }
.pj-left .step { width: 30px; }
.pj-left .step .ico { width: 16px; height: 16px; }
.pj-left .qty { width: 48px; font-size: 18px; padding: 2px 0; }
.pj-left .btn-photo { height: 32px; padding: 0 8px 0 10px; gap: 6px; }
.pj-left .btn-photo .ico { width: 18px; height: 18px; }
.pj-left .desc { min-height: 32px; padding: 6px 8px; font-size: 13.5px; }
.pj-left .btn-add { margin-top: 8px; padding: 9px; font-size: 14px; }

/* Interventi */
.iv-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 12px; }
.iv-head h2 { margin: 0; font-size: 17px; }
.iv-total { color: var(--muted); font-size: 13.5px; margin-right: auto; }
.iv-list { display: flex; flex-direction: column; gap: 10px; }
.iv-empty { margin: 0; padding: 18px 4px; color: var(--muted); }
.iv-card { position: relative; border: 1px solid var(--line); border-left: 3px solid var(--data); border-radius: var(--r); padding: 10px 12px; background: #fbfcfd; }
.iv-times { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding-right: 30px; }
.iv-f input[type=date] { width: 142px; }
.iv-f input[type=time] { width: 100px; }
.iv-f { display: flex; flex-direction: column; gap: 3px; }
.iv-f > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.iv-f input { height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font-variant-numeric: tabular-nums; }
.iv-f input:focus { outline: none; border-color: var(--data); box-shadow: 0 0 0 3px rgba(29, 99, 199, .15); }
.iv-hours { min-height: 36px; display: flex; flex-direction: column; justify-content: center; }
.iv-hours strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.iv-hours small { font-size: 11.5px; color: var(--muted); }
.iv-del { position: absolute; top: 6px; right: 6px; }
.iv-desc { margin-top: 8px; }
.iv-desc .desc { min-height: 56px; }
.iv-foot { margin-top: 8px; }
.iv-foot .btn.has { border-color: var(--data); color: var(--data); }

/* Chat compatta che si allunga con i messaggi */
.pj-chat .chat { height: auto; min-height: 300px; max-height: calc(100vh - var(--top) - 32px); max-height: calc(100dvh - var(--top) - 32px); }
.pj-chat .chat-list { flex: 1 1 auto; min-height: 140px; overflow-y: auto; }
.pj-chat .chat-head { padding: 10px; gap: 8px; }
.pj-chat .avatar { width: 32px; height: 32px; font-size: 12px; }
.pj-chat .msg { max-width: 92%; }
.chat-who { flex: 1; min-width: 0; }
.chat-who small { display: block; line-height: 1.3; }
.chat-head .btn-icon.on { background: #e2ebf8; color: var(--data); }
.chat-search { display: flex; align-items: center; gap: 2px; padding: 6px 6px 6px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.chat-search-input { flex: 1; min-width: 0; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13.5px; }
.chat-search-input:focus { outline: none; border-color: var(--data); }
.chat-search-info { font-size: 11.5px; color: var(--muted); white-space: nowrap; padding: 0 4px; }
.chat-search .btn-icon { width: 30px; height: 30px; }
.chat-search .btn-icon .ico { width: 17px; height: 17px; }
.msg.hit { box-shadow: 0 0 0 2px #f3d27a; }
.msg.hit.current { box-shadow: 0 0 0 2px #e0a100, 0 2px 10px rgba(224, 161, 0, .35); }
.msg mark { background: #ffe38a; color: inherit; border-radius: 2px; padding: 0 1px; }

/* Impostazioni */
.settings-form { padding: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--data); }
.check small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.form-actions.left { justify-content: flex-start; }
.test-row { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.test-row input { flex: 1; min-width: 220px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.test-result { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--paper); font-size: 14px; }
.test-result.ok { background: #e2f3e8; color: #1a5f37; }
.test-result.err { background: #fbeae8; color: #9c2a1f; }
.test-result pre { margin: 8px 0 0; padding: 8px; max-height: 240px; overflow: auto; background: rgba(255, 255, 255, .6); border-radius: 6px; font: 12px/1.45 ui-monospace, Consolas, monospace; color: var(--ink); white-space: pre-wrap; }
.test-result summary { cursor: pointer; margin-top: 6px; font-size: 13px; }
.field [hidden] { display: none !important; }

/* ---------- Responsive v3 ---------- */

@media (max-width: 1400px) {
  .pj-grid { grid-template-columns: 320px minmax(0, 1fr); }
  .pj-chat { grid-column: 1 / -1; position: static; }
  .pj-chat .chat { max-height: 70vh; }
}
@media (max-width: 1000px) {
  .pj-grid { grid-template-columns: minmax(0, 1fr); }
  .pj-center { order: -1; }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .side-nav { min-width: 0; }
  .side-nav { position: sticky; top: var(--top); z-index: 15; height: auto; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-nav ul { flex-direction: row; overflow-x: auto; }
  .nav-item { width: auto; white-space: nowrap; padding: 8px 12px; }
  .page { padding: 18px 14px 40px; }
  .grid2 { grid-template-columns: 1fr; }
  .tbl-wrap { margin: 0; overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; width: 100%; }
  .tbl tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .tbl tbody tr:last-child { border-bottom: 0; }
  .tbl td { display: flex; gap: 10px; padding: 3px 0; border: 0; }
  .tbl td[data-label]::before { content: attr(data-label); flex: 0 0 110px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
  .tbl td > * { min-width: 0; }
  .tbl td:not([data-label]) { justify-content: flex-end; }
  .desc-cell { max-width: none; }
  .iv-summary { margin-left: 0; width: 100%; }
  .filters select, .filters input { min-width: 0; width: 100%; }
  .filters label { flex: 1 1 160px; }
  .pj-tools .btn.danger-text { margin-left: 0; }
}
@media (max-width: 520px) {
  .topbar { padding-left: 14px; padding-right: 14px; gap: 8px; }
  .brand { font-size: 17px; }
  .brand span { display: none; }
  .btn-top { padding: 0 9px; font-size: 13px; }
  .lang-switch button { padding: 6px 7px; font-size: 12px; }
  .top-tag { display: none; }
  .iv-times { gap: 8px; }
  .iv-f input[type=date] { width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
