/* Asclepio – stile dell'interfaccia (su Bootstrap 5). */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../vendor/inter/inter-latin-wght-normal.260c81a4759b.woff2") format("woff2-variations");
}

:root {
  --a-primary: #0b6e8a;
  --a-primary-dark: #08546a;
  --a-accent: #22b8a0;
  --a-bg: #f3f6fb;
  --a-surface: #ffffff;
  --a-border: #e3e8f0;
  --a-text: #1d2733;
  --a-muted: #66748a;
  --a-radius: 14px;
  --a-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --a-sidebar: 248px;
  --a-hover: #f1f5fa;
  --a-active: #e8f4f6;
  --a-active-text: #08546a;
  --a-topbar: rgba(243, 246, 251, .85);
  --a-thead: #f8fafc;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--a-text);
  --bs-body-bg: var(--a-bg);
  --bs-primary: #0b6e8a;
  --bs-primary-rgb: 11, 110, 138;
  --bs-link-color: #0b6e8a;
  --bs-link-color-rgb: 11, 110, 138;
  --bs-link-hover-color: #08546a;
  --bs-border-radius: 10px;
}

body { background: var(--a-bg); font-feature-settings: "cv11", "ss01"; }

/* --- Tema scuro ------------------------------------------------------------------- */
[data-bs-theme="dark"] {
  --a-bg: #0f1520;
  --a-surface: #171f2c;
  --a-border: #263142;
  --a-text: #e4e9f1;
  --a-muted: #92a0b5;
  --a-hover: #1e2938;
  --a-active: #12343d;
  --a-active-text: #7fe0cf;
  --a-topbar: rgba(15, 21, 32, .85);
  --a-thead: #1a2331;
  --a-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --bs-body-color: var(--a-text);
  --bs-body-bg: var(--a-bg);
  --bs-link-color: #4fc3d9;
  --bs-link-color-rgb: 79, 195, 217;
  --bs-link-hover-color: #7fd7e7;
  --bs-border-color: var(--a-border);
  --bs-secondary-bg: var(--a-surface);
  --bs-tertiary-bg: var(--a-hover);
}
[data-bs-theme="dark"] .c-blue   { background: #1b2b4d; color: #8db1ff; }
[data-bs-theme="dark"] .c-teal   { background: #123a37; color: #5fd9c4; }
[data-bs-theme="dark"] .c-orange { background: #3d2a17; color: #ffaa66; }
[data-bs-theme="dark"] .c-green  { background: #183522; color: #74d68b; }
[data-bs-theme="dark"] .c-purple { background: #2c2350; color: #b9a3ff; }
[data-bs-theme="dark"] .c-pink   { background: #43192d; color: #ff8fbd; }
[data-bs-theme="dark"] .c-red    { background: #451d1d; color: #ff8a8a; }
[data-bs-theme="dark"] .c-yellow { background: #3d3214; color: #f3cf5c; }
[data-bs-theme="dark"] .c-gray   { background: #253042; color: #b3bfd1; }
[data-bs-theme="dark"] .c-cyan   { background: #133847; color: #6fd2f2; }
[data-bs-theme="dark"] .status-draft { background: #3d3214; color: #f3cf5c; }
[data-bs-theme="dark"] .status-signed { background: #183522; color: #74d68b; }
[data-bs-theme="dark"] .status-imported { background: #253042; color: #b3bfd1; }
[data-bs-theme="dark"] .btn-light { --bs-btn-bg: #1e2938; --bs-btn-border-color: #263142; --bs-btn-color: var(--a-text);
  --bs-btn-hover-bg: #263142; --bs-btn-hover-border-color: #2f3c50; --bs-btn-hover-color: var(--a-text); }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background-color: #111925; color: var(--a-text); }
[data-bs-theme="dark"] .list-group-item { background: transparent; color: var(--a-text); border-color: var(--a-border); }
[data-bs-theme="dark"] .list-group-item-action:hover { background: var(--a-hover); }
[data-bs-theme="dark"] .dropdown-menu { background: var(--a-surface); }
[data-bs-theme="dark"] .brand span { color: var(--a-text); }
[data-bs-theme="dark"] .auth-hero .brand span { color: #fff; }

.btn-primary {
  --bs-btn-bg: var(--a-primary); --bs-btn-border-color: var(--a-primary);
  --bs-btn-hover-bg: var(--a-primary-dark); --bs-btn-hover-border-color: var(--a-primary-dark);
  --bs-btn-active-bg: var(--a-primary-dark); --bs-btn-active-border-color: var(--a-primary-dark);
  --bs-btn-disabled-bg: var(--a-primary); --bs-btn-disabled-border-color: var(--a-primary);
}
.btn-outline-primary {
  --bs-btn-color: var(--a-primary); --bs-btn-border-color: var(--a-primary);
  --bs-btn-hover-bg: var(--a-primary); --bs-btn-hover-border-color: var(--a-primary);
  --bs-btn-active-bg: var(--a-primary-dark);
}
.btn { font-weight: 600; border-radius: 10px; }
.form-control, .form-select { border-radius: 10px; border-color: var(--a-border); padding: .6rem .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--a-accent); box-shadow: 0 0 0 .2rem rgba(34, 184, 160, .18); }

/* --- Struttura: menu laterale + contenuto -------------------------------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--a-sidebar); flex-shrink: 0; background: var(--a-surface);
  border-right: 1px solid var(--a-border); padding: 1.25rem .9rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: .65rem; padding: .25rem .5rem 1.25rem; text-decoration: none; }
.brand img { width: 38px; height: 38px; }
.brand span { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; color: var(--a-text); }
.nav-section { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--a-muted); padding: 1rem .6rem .4rem; }
.nav-item-a {
  display: flex; align-items: center; gap: .75rem; padding: .5rem .6rem; border-radius: 12px;
  color: var(--a-text); text-decoration: none; font-weight: 550; margin-bottom: 2px;
}
.nav-item-a:hover { background: var(--a-hover); color: var(--a-text); }
.nav-item-a.active { background: var(--a-active); color: var(--a-active-text); }
.nav-item-a .soon { margin-left: auto; font-size: .65rem; font-weight: 700; color: var(--a-muted);
  background: var(--a-hover); border-radius: 99px; padding: .1rem .45rem; }
.sidebar-footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--a-border); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem; padding: .85rem 2rem; background: var(--a-topbar);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; border-bottom: 1px solid transparent;
}
.topbar .search { flex: 1; max-width: 520px; position: relative; }
.topbar .search i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--a-muted); }
.topbar .search input { padding-left: 2.5rem; background: var(--a-surface); }
.content { padding: 1.25rem 2rem 3rem; }
.page-title { font-weight: 800; letter-spacing: -.02em; font-size: 1.6rem; margin: 0; }
.page-sub { color: var(--a-muted); margin: .15rem 0 0; }

/* --- Riquadri, card ------------------------------------------------------------ */
.card-a { background: var(--a-surface); border: 1px solid var(--a-border); border-radius: var(--a-radius);
  box-shadow: var(--a-shadow); }
.card-a .card-a-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--a-border);
  display: flex; align-items: center; gap: .75rem; }
.card-a .card-a-head h2 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.card-a .card-a-body { padding: 1.25rem; }

.stat { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.25rem; }
.stat .num { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.stat .lbl { color: var(--a-muted); font-size: .9rem; }

/* --- Icone colorate --------------------------------------------------------------- */
.ico { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 1.05rem; flex-shrink: 0; }
.ico-lg { width: 48px; height: 48px; border-radius: 14px; font-size: 1.4rem; }
.ico-sm { width: 26px; height: 26px; border-radius: 8px; font-size: .85rem; }
.c-blue   { background: #e7efff; color: #2f6fed; }
.c-teal   { background: #dff6f2; color: #109583; }
.c-orange { background: #fff0e3; color: #e8701a; }
.c-green  { background: #e5f6e8; color: #2a9442; }
.c-purple { background: #efe9ff; color: #7448e0; }
.c-pink   { background: #ffe6f0; color: #d12f74; }
.c-red    { background: #ffe8e8; color: #d43a3a; }
.c-yellow { background: #fff6d6; color: #b98900; }
.c-gray   { background: #eef1f5; color: #566479; }
.c-cyan   { background: #e0f4fb; color: #0f8bb3; }

.chip { display: inline-flex; align-items: center; gap: .35rem; border-radius: 99px; padding: .2rem .65rem;
  font-size: .78rem; font-weight: 650; }

/* --- Tabelle ------------------------------------------------------------------------ */
.table-a { margin: 0; }
.table-a thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--a-muted);
  font-weight: 700; background: var(--a-thead); border-bottom: 1px solid var(--a-border); padding: .7rem 1rem; }
.table-a td { padding: .8rem 1rem; vertical-align: middle; border-color: var(--a-border); background: transparent; color: var(--a-text); }
.table-a tbody tr { cursor: pointer; }
.table-a tbody tr:hover td { background: var(--a-hover); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.avatar-xl { width: 64px; height: 64px; font-size: 1.3rem; }
.text-muted-a { color: var(--a-muted); }
.excerpt { color: var(--a-muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 1;
  -webkit-box-orient: vertical; overflow: hidden; }

/* --- Editor del referto ------------------------------------------------------------- */
.report-editor textarea { font-size: 1rem; line-height: 1.6; min-height: 360px; resize: vertical; }
.status-draft { background: #fff6d6; color: #8a6700; }
.status-signed { background: #e5f6e8; color: #217a37; }
.status-imported { background: #eef1f5; color: #566479; }
.type-list { max-height: 60vh; overflow-y: auto; }
.type-item { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: 12px;
  text-decoration: none; color: var(--a-text); }
.type-item:hover { background: var(--a-hover); color: var(--a-text); }

/* --- Pagine di accesso ------------------------------------------------------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 3rem; display: flex; flex-direction: column;
  background: radial-gradient(1200px 600px at -10% 110%, #22b8a0 0%, transparent 60%),
              radial-gradient(900px 500px at 110% -10%, #2f6fed 0%, transparent 55%),
              linear-gradient(135deg, #08546a, #0b6e8a);
}
.auth-hero .brand span { color: #fff; }
.auth-hero h1 { font-weight: 800; letter-spacing: -.03em; font-size: 2.6rem; line-height: 1.1; margin-top: auto; }
.auth-hero p { opacity: .85; font-size: 1.1rem; max-width: 30rem; }
.auth-hero .features { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 auto; }
.auth-hero .features span { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 99px; padding: .35rem .8rem; font-size: .88rem; font-weight: 600; }
.auth-hero .features i { margin-right: .35rem; }
.auth-side { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1, .auth-card h2 { font-weight: 800; letter-spacing: -.02em; font-size: 1.75rem; }
/* Moduli generati da allauth (HTML semplice) con l'aspetto di Bootstrap */
.auth-card label { font-weight: 600; font-size: .9rem; margin-bottom: .3rem; display: block; }
.auth-card input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
.auth-card textarea, .auth-card select {
  display: block; width: 100%; padding: .7rem .9rem; border: 1px solid var(--a-border); border-radius: 10px;
  background: var(--a-surface); color: var(--a-text); font-size: 1rem;
}
.auth-card input:focus { outline: none; border-color: var(--a-accent); box-shadow: 0 0 0 .2rem rgba(34, 184, 160, .18); }
.auth-card form p { margin-bottom: 1rem; }
.auth-card form button[type=submit], .auth-card .btn-auth {
  width: 100%; border: 0; border-radius: 10px; padding: .75rem 1rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--a-primary), var(--a-accent));
}
.auth-card .errorlist { list-style: none; padding: .6rem .8rem; margin: 0 0 .75rem; border-radius: 10px;
  background: #ffe8e8; color: #a12828; font-size: .9rem; }
.auth-card .helptext, .auth-card span.helptext { color: var(--a-muted); font-size: .82rem; }
.btn-provider { display: flex; align-items: center; justify-content: center; gap: .6rem; width: 100%;
  border: 1px solid var(--a-border); background: var(--a-surface); border-radius: 10px; padding: .7rem 1rem; font-weight: 650;
  color: var(--a-text); }
.btn-provider:hover { background: var(--a-hover); }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--a-muted); font-size: .85rem; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--a-border); }

/* --- iPad in verticale e tablet: menu a sole icone ---------------------------------------- */
@media (min-width: 768px) and (max-width: 1099.98px) {
  .sidebar { width: 84px; padding: 1rem .6rem; align-items: center; }
  .sidebar .lbl, .sidebar .nav-section, .sidebar .soon, .brand span, .sidebar-footer .who, .sidebar .dropdown-toggle::after { display: none; }
  .brand { padding: .25rem 0 1rem; }
  .nav-item-a { justify-content: center; padding: .55rem; }
  .nav-item-a .ico { width: 42px; height: 42px; font-size: 1.15rem; }
  .sidebar-footer .d-flex { flex-direction: column; gap: .5rem !important; padding: 0 !important; }
  .content, .topbar { padding-left: 1.25rem; padding-right: 1.25rem; }
  .menu-toggle { display: none !important; }
}

/* --- Telefono: menu a scomparsa --------------------------------------------------------- */
@media (max-width: 767.98px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 1045; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 1040; display: none; }
  .sidebar.open + .sidebar-backdrop { display: block; }
  .topbar, .content { padding-left: 1rem; padding-right: 1rem; }
  .page-title { font-size: 1.35rem; }
}
/* Telefono: le tabelle diventano schede (una riga = un riquadro), niente scorrimento laterale */
@media (max-width: 575.98px) {
  .table-stack thead { display: none; }
  .table-stack tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem;
                          padding: .8rem 1rem; border-bottom: 1px solid var(--a-border); }
  .table-stack tbody td { display: block; padding: 0 !important; border: 0; white-space: normal; }
  .table-stack tbody td.d-none { display: none !important; }
  .table-stack tbody td.stack-full { flex-basis: 100%; order: 10; }
  .table-stack tbody td[colspan] { flex-basis: 100%; }
  .table-stack tbody tr:hover td { background: transparent; }
  .table-stack tbody tr:hover { background: var(--a-hover); }
  .topbar .btn { white-space: nowrap; }
}
@media (max-width: 420px) {
  /* pulsanti in alto: solo l'icona, il testo resta come suggerimento */
  .topbar { gap: .4rem; }
  .topbar .ms-auto { gap: .3rem !important; }
  .topbar .ms-auto .btn { font-size: 0; padding-left: .65rem; padding-right: .65rem; }
  .topbar .ms-auto .btn i { font-size: 1.15rem; margin: 0 !important; }
}
@media (min-width: 768px) { .menu-toggle { display: none !important; } }
@media (max-width: 991.98px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 1.5rem; }
  .auth-hero h1 { font-size: 1.8rem; margin-top: 1.5rem; }
  .auth-hero .features { margin-bottom: 0; }
}

/* --- Schermi touch (iPad, telefono): bersagli comodi da toccare, niente zoom di iOS -------- */
@media (pointer: coarse) {
  .btn, .form-control, .form-select, .nav-item-a, .type-item, .list-group-item { min-height: 44px; }
  .form-control, .form-select, .auth-card input { font-size: 16px; }
  .table-a td { padding-top: 1rem; padding-bottom: 1rem; }
}

/* --- Stampa -------------------------------------------------------------------------------- */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
}

/* Icona del pulsante tema */
[data-bs-theme="dark"] .theme-dark-hide, [data-bs-theme="light"] .theme-light-hide { display: none; }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--a-primary); }

/* --- Modelli di stampa -------------------------------------------------------------------- */
.layout-thumb { height: 220px; overflow: hidden; background: var(--a-hover); border-radius: 1rem 1rem 0 0; position: relative; }
.layout-thumb iframe { width: 794px; height: 1123px; border: 0; transform: scale(.42); transform-origin: 0 0;
                       position: absolute; left: 50%; margin-left: -167px; top: 10px; pointer-events: none;
                       box-shadow: 0 4px 20px rgba(0, 0, 0, .12); }
.layout-thumb-fixed { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
                      gap: .5rem; color: var(--a-muted); font-size: .9rem; }
.layout-thumb-fixed i { font-size: 2.5rem; }

/* Editor */
.editor { display: flex; flex-direction: column; gap: 1rem; }
.ed-tools { padding: .5rem; position: sticky; top: .5rem; z-index: 20; }
.ed-tools-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.ed-tool { display: inline-flex; align-items: center; gap: .4rem; border: 0; background: transparent; border-radius: .8rem;
           padding: .35rem .6rem; font-size: .85rem; font-weight: 600; color: var(--a-text); min-height: 40px; cursor: pointer; }
.ed-tool:hover { background: var(--a-hover); }
.ed-check input { margin: 0; }
.ed-sep { width: 1px; align-self: stretch; background: var(--a-border); margin: 0 .25rem; }
.ed-fields { max-height: 60vh; overflow: auto; min-width: 320px; }
.ed-fields code { color: var(--bs-primary); }
.ed-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.ed-stage { background: var(--a-hover); border-radius: 1.25rem; padding: 12px; overflow: auto; min-height: 60vh; }
.ed-scaler { position: relative; margin: 0 auto; }
.ed-sheet { position: absolute; left: 0; top: 0; width: 210mm; height: 297mm; background: #fff; transform-origin: 0 0;
            box-shadow: 0 6px 30px rgba(0, 0, 0, .15); color: #000; overflow: hidden; touch-action: none; user-select: none; }
.ed-sheet .el-body .report-field { white-space: pre-wrap; }
.ed-sheet .el-body .report-label, .ed-sheet .el-body .report-strong { font-weight: 700; }
.ed-sheet .el-body .report-small { font-size: .85em; color: #333; }
.ed-sheet .el-body .report-gap { font-size: .5em; }
.ed-sheet .el-body .report-section { font-weight: 700; text-transform: uppercase; font-size: .92em; margin: .8em 0 .2em; color: var(--section-color); }
.ed-sheet .el-body.labels-plain .report-label { font-weight: inherit; }
.ed-el { cursor: move; outline: 1px dashed rgba(11, 110, 138, .25); }
.ed-el:hover { outline-color: rgba(11, 110, 138, .7); }
.ed-el.selected { outline: 2px solid #0b6e8a; }
.ed-el.every::after { content: ""; position: absolute; right: -1px; top: -1px; width: 6px; height: 6px; background: #c2410c; border-radius: 50%; }
.ed-badge { position: absolute; right: 2mm; top: 1mm; font: 600 8pt Inter, sans-serif; color: #0b6e8a; background: #e0f2f7;
            border-radius: 4px; padding: .3mm 1.5mm; z-index: 2; pointer-events: none; }
.ed-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border: 1px dashed #999;
            font: 600 9pt Inter, sans-serif; color: #777; background: repeating-linear-gradient(45deg, #fafafa, #fafafa 6px, #f0f0f0 6px, #f0f0f0 12px); }
.ed-cont { border: 1px dashed rgba(194, 65, 12, .35); pointer-events: none; }
.ed-h { position: absolute; width: 9px; height: 9px; background: #fff; border: 2px solid #0b6e8a; border-radius: 2px; z-index: 5; }
@media (pointer: coarse) { .ed-h { width: 22px; height: 22px; border-radius: 50%; } }
.ed-h-nw { left: 0; top: 0; transform: translate(-50%, -50%); cursor: nwse-resize; }
.ed-h-n { left: 50%; top: 0; transform: translate(-50%, -50%); cursor: ns-resize; }
.ed-h-ne { right: 0; top: 0; transform: translate(50%, -50%); cursor: nesw-resize; }
.ed-h-e { right: 0; top: 50%; transform: translate(50%, -50%); cursor: ew-resize; }
.ed-h-se { right: 0; bottom: 0; transform: translate(50%, 50%); cursor: nwse-resize; }
.ed-h-s { left: 50%; bottom: 0; transform: translate(-50%, 50%); cursor: ns-resize; }
.ed-h-sw { left: 0; bottom: 0; transform: translate(-50%, 50%); cursor: nesw-resize; }
.ed-h-w { left: 0; top: 50%; transform: translate(-50%, -50%); cursor: ew-resize; }
.ed-guide { position: absolute; background: #e11d48; z-index: 900; pointer-events: none; }
.ed-guide.v { top: 0; bottom: 0; width: 1px; }
.ed-guide.h { left: 0; right: 0; height: 1px; }
.ed-panel { position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow: auto; }
.ed-panel .ed-row { margin-bottom: .6rem; }
.ed-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.ed-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.ed-sec { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--a-muted); font-weight: 700; margin: 1rem 0 .5rem; }
.ed-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: .4rem; }
.ed-thumb { aspect-ratio: 1; border: 2px solid var(--a-border); border-radius: .6rem; background: #fff; padding: 3px; cursor: pointer;
            display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .75rem; color: var(--a-muted); }
.ed-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ed-thumb.active { border-color: #0b6e8a; }
.ed-upload i { font-size: 1.2rem; }
.ed-layers .list-group-item { background: transparent; color: var(--a-text); border-color: var(--a-border); }
.ed-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; transition: all .25s;
            background: #0f766e; color: #fff; padding: .7rem 1.1rem; border-radius: .9rem; font-weight: 600; z-index: 2000;
            box-shadow: 0 10px 30px rgba(0, 0, 0, .2); max-width: 90vw; }
.ed-toast.bad { background: #b91c1c; }
.ed-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 1199.98px) {
  .ed-main { grid-template-columns: minmax(0, 1fr); }
  .ed-panel { position: static; max-height: none; }
  .ed-tool span:not(.ico) { display: none; }
}
