/* ══════════════════════════════════
   SEGNALAZIONI — v11 OPTIMIZED
   Layout fisso pulito • Safe area • Progress UI
   ══════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --navH: 76px;
  --topbarH: 76px;
  --bounce: cubic-bezier(.2, .9, .2, 1);
  
  /* Dark theme */
  --bg: #070A12;
  --panel: rgba(255, 255, 255, .05);
  --panel2: rgba(9, 12, 22, .92);
  --stroke: rgba(255, 255, 255, .10);
  --text: #EAF0FF;
  --muted: rgba(234, 240, 255, .55);
  --warn: #FFB830;
  --danger: #E53935;
  --ok: #19f7a7;
  --shadow: rgba(0, 0, 0, .40);
  --backdrop: rgba(0, 0, 0, .72);
  --rad1: rgba(177, 0, 255, .18);
  --rad2: rgba(0, 209, 255, .14);
  --green: #4f9f55;
  --brand-red: #9e1b1b;
  
  /* Colore pulsanti personalizzabile (sovrascrivibile via JS) */
  --primary-color: var(--green);
  --primary-color-dark: #3d7a42;
  --primary-shadow: rgba(79, 159, 85, .25);
  
  /* Accent colors - neon default */
  --accent: #00D1FF;
  --accent2: #B100FF;
  
  /* Safe area insets */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

/* Fallback for older browsers */
@supports (padding-top: constant(safe-area-inset-top)) {
  :root {
    --sat: constant(safe-area-inset-top);
    --sab: constant(safe-area-inset-bottom);
  }
}

/* ── Theme variants ── */
html[data-theme="light"] {
  --bg: #f7f8fb;
  --panel: rgba(0, 0, 0, .03);
  --panel2: rgba(255, 255, 255, .92);
  --stroke: rgba(0, 0, 0, .08);
  --text: #0B1020;
  --muted: rgba(11, 16, 32, .50);
  --danger: #D32F2F;
  --shadow: rgba(12, 20, 50, .12);
  --backdrop: rgba(0, 0, 0, .45);
  --rad1: rgba(138, 0, 255, .08);
  --rad2: rgba(0, 102, 255, .06);
}

/* Accent color schemes */
html[data-accent="neon"] { --accent: #00D1FF; --accent2: #B100FF; }
html[data-accent="ocean"] { --accent: #00B3FF; --accent2: #00FFB2; }
html[data-accent="emerald"] { --accent: #00E676; --accent2: #00B0FF; }
html[data-accent="sunset"] { --accent: #FF2D55; --accent2: #FFB300; }

/* ══════════════════════════════════
   BASE LAYOUT - Fixed topbar/bottomnav, scrollable main
   ══════════════════════════════════ */
* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: radial-gradient(800px 500px at 10% 8%, var(--rad1), transparent 60%),
              radial-gradient(700px 500px at 90% 15%, var(--rad2), transparent 55%),
              var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.4;
}

/* ── Topbar (fixed) ── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  padding-top: calc(10px + var(--sat));
  height: calc(var(--topbarH) + var(--sat));
  backdrop-filter: blur(12px);
  background: color-mix(in oklab, var(--bg) 50%, transparent);
  border-bottom: 1px solid var(--stroke);
}

.brand__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: .6px;
  text-transform: uppercase;
  font-size: 17px;
}

.brand__logo {
  height: 42px;
  width: auto;
  display: inline-block;
  object-fit: contain;
}

.brand__subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-top: 2px;
}

.topbar__actions {
  display: flex;
  gap: 8px;
}

.iconbtn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform .08s;
}

.iconbtn:active {
  transform: scale(.95);
}

/* Exit button */
.iconbtn.exit-btn {
  font-size: 22px;
}

.iconbtn.exit-btn:active {
  transform: scale(0.92);
}

/* ── Main container (scrollable) ── */
main.container {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--topbarH) + var(--sat));
  bottom: calc(var(--navH) + var(--sab));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  max-width: 540px;
  margin: 0 auto;
}

/* ── Bottom navigation (fixed) ── */
.bottomnav {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(8px + var(--sab));
  height: var(--navH);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, var(--panel2) 90%, transparent);
  box-shadow: 0 12px 32px var(--shadow);
  z-index: 1000;
  backdrop-filter: blur(14px);
}

.navbtn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px;
  position: relative;
  transition: all .08s;
}

.navbtn__icon {
  font-size: 22px;
  line-height: 1;
}

.navbtn__label {
  font-size: 13px;
  font-weight: 800;
}

.navbtn.is-active {
  color: var(--text);
  border-color: color-mix(in oklab, var(--accent) 30%, transparent);
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--accent) 15%, transparent),
    color-mix(in oklab, var(--accent2) 12%, transparent)
  );
}

/* Brand red accent for active nav in light theme */
html[data-theme="light"] .navbtn.is-active {
  border-color: color-mix(in oklab, var(--brand-red) 30%, transparent);
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--brand-red) 15%, transparent),
    color-mix(in oklab, var(--brand-red) 8%, transparent)
  );
}

/* UI Refinement: more prominent active state */
.navbtn.is-active .navbtn__icon {
  font-weight: 700;
  transform: scale(1.05);
}

.navbtn.is-active .navbtn__label {
  font-weight: 700;
}

.navbtn__badge {
  position: absolute;
  top: -2px;
  right: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--primary-color);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  display: none;
  align-items: center;
  justify-content: center;
}

.navbtn__badge.has-items {
  display: flex;
}

/* ══════════════════════════════════
   CARDS & COMPONENTS
   ══════════════════════════════════ */
.card {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 12px 32px var(--shadow);
}

/* UI Refinement: softer shadow in light theme */
html[data-theme="light"] .card {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.h1 {
  font-size: 22px;
  font-weight: 900;
}

.sub {
  color: var(--muted);
  font-size: 15px;
}

.badge {
  padding: 5px 10px;
  border-radius: 99px;
  border: 1px solid var(--stroke);
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.badge--ok {
  color: var(--ok);
  border-color: color-mix(in oklab, var(--ok) 20%, transparent);
}

.badge--warn {
  color: var(--warn);
  border-color: color-mix(in oklab, var(--warn) 20%, transparent);
}

.badge--err {
  color: var(--danger);
  border-color: color-mix(in oklab, var(--danger) 20%, transparent);
}

/* ══════════════════════════════════
   FORMS
   ══════════════════════════════════ */
.label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin: 10px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

/* Label highlight for light theme */
html[data-theme="light"] .label {
  color: var(--brand-red);
}

.section__title {
  font-weight: 900;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  margin: 0;
}

/* Section title highlight for light theme */
html[data-theme="light"] .section__title {
  color: var(--brand-red);
}

input, select, textarea {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: color-mix(in oklab, var(--bg) 50%, transparent);
  color: var(--text);
  outline: none;
  font-family: inherit;
  font-size: 17px;
}

/* UI Refinement: input background in light theme */
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #f7f8fb;
  border-color: #d1d5db;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 15%, transparent);
}

textarea {
  min-height: 56px;
  resize: vertical;
}

.row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.row--2 {
  grid-template-columns: 1fr 1fr;
}

/* ══════════════════════════════════
   BUTTONS
   ══════════════════════════════════ */
.btn {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 0;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  background: var(--primary-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 4px 14px var(--primary-shadow);
  transition: transform .08s, box-shadow .08s;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 6px var(--primary-shadow);
}

.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.btn--sm {
  padding: 10px 12px;
  font-size: 15px;
}

.btn--outline {
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  background: transparent;
  box-shadow: none;
}

.btn--outline:active {
  background: color-mix(in oklab, var(--primary-color) 12%, transparent);
}

html[data-theme="dark"] .btn--outline {
  color: var(--primary-color);
  border-color: var(--primary-color);
  filter: brightness(1.25);
}

.btn--danger {
  background: var(--danger);
  box-shadow: 0 4px 14px rgba(229, 57, 53, .2);
}

.btn--iconic {
  padding: 11px 14px;
}

.ico {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
}

/* ── Via search ── */
.viaSearchRow {
  display: flex;
  gap: 6px;
  align-items: center;
  margin: 4px 0 6px;
}

.viaSearch {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--text);
  outline: none;
  font-family: inherit;
  font-size: 17px;
}

.chipbtn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  transition: transform .08s;
}

.chipbtn:active {
  transform: scale(.95);
}

/* ── Note templates (pills) ── */
.note-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.note-pill {
  padding: 6px 12px;
  border-radius: 99px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all .08s;
  font-weight: 600;
}

.note-pill:hover, .note-pill:active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: scale(.98);
}

/* ── App version ── */
.app-version {
  text-align: center;
  padding: 12px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  opacity: 0.7;
}

/* ── App footer ── */
.app-footer {
  text-align: center;
  padding: 24px 16px;
  margin-top: 32px;
  color: var(--muted);
  font-size: 12px;
  opacity: 0.75;
}

/* ── Photo preview ── */
.preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.preview__item {
  position: relative;
}

.preview__item img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--stroke);
}

.preview__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, .7);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: transform .08s;
}

.preview__remove:active {
  transform: scale(.9);
}

/* ══════════════════════════════════
   MODALS
   ══════════════════════════════════ */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(6px);
  padding: 12px;
  padding-top: calc(12px + var(--sat));
  padding-bottom: calc(12px + var(--sab));
  z-index: 2000;
  overflow-y: auto;
}

.modal__sheet {
  max-width: 540px;
  margin: 0 auto;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: var(--bg);
  box-shadow: 0 16px 48px var(--shadow);
  overflow: hidden;
  animation: sheetUp .25s var(--bounce) both;
}

.modal__sheet--sm {
  max-width: 440px;
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--stroke);
}

.modal__title {
  font-weight: 900;
  font-size: 19px;
}

.modal__body {
  padding: 14px 16px 18px;
  max-height: calc(100vh - 200px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.modal__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--stroke);
}

@keyframes sheetUp {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ── Settings tabs ── */
.stabs {
  display: flex;
  border-bottom: 1px solid var(--stroke);
  padding: 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stab {
  flex: 1;
  min-width: fit-content;
  padding: 12px 8px 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 3px solid transparent;
  text-align: center;
  transition: all .08s;
}

.stab.is-active {
  color: var(--text);
  border-bottom-color: var(--primary-color);
}

.stab-page {
  display: none;
}

.stab-page.is-active {
  display: block;
}

/* ── Password row ── */
.pw-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.pw-row input {
  flex: 1;
  font-family: monospace;
  letter-spacing: 1px;
}

.sep {
  height: 1px;
  background: var(--stroke);
  margin: 16px 0;
}

/* ── Help ── */
.help {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--panel);
}

.help b {
  color: var(--text);
  font-weight: 800;
}

/* ── Toggle ── */
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}

.toggle input {
  width: 20px;
  height: 20px;
  cursor: pointer;
}

/* ── Logo preview ── */
.logo-preview-wrap {
  display: flex;
  justify-content: center;
  padding: 20px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--panel);
}

.logo-preview {
  max-width: 200px;
  max-height: 200px;
  object-fit: contain;
}

/* ══════════════════════════════════
   ARCHIVE
   ══════════════════════════════════ */
.archive-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.archive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.archive-card {
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  transition: transform .12s;
}

.archive-card:active {
  transform: scale(.98);
}

.archive-card__thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(255, 255, 255, .04);
  flex: 0 0 64px;
}

.archive-card__meta {
  flex: 1;
  min-width: 0;
}

.archive-card__title {
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.archive-card__sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.3;
}

.archive-empty {
  text-align: center;
  padding: 28px 14px;
  color: var(--muted);
}

.archive-empty__icon {
  font-size: 36px;
  margin-bottom: 8px;
  opacity: .4;
}

.archive-empty__text {
  font-size: 17px;
  line-height: 1.5;
}

.archive-viewer-img {
  width: 100%;
  max-height: 45vh;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: #000;
  margin-bottom: 10px;
}

.archive-viewer-meta {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
}

/* ══════════════════════════════════
   HISTORY
   ══════════════════════════════════ */
.histCard {
  border: 1px solid var(--stroke);
  background: var(--panel);
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
}

.histTop {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.histTitle {
  font-weight: 800;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.histMeta {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.histRow {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.histPill {
  padding: 3px 8px;
  border-radius: 99px;
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-size: 14px;
}

.histActions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 4px;
  margin-top: 8px;
}

.detailGrid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detailRow {
  display: flex;
  gap: 8px;
}

.detailLabel {
  min-width: 56px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.detailValue {
  flex: 1;
  font-size: 16px;
}

.detailBody {
  min-height: 120px;
  width: 100%;
  margin-top: 10px;
  font-size: 16px;
}

/* ══════════════════════════════════
   TOAST
   ══════════════════════════════════ */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

.toast-box {
  position: fixed;
  top: calc(10px + var(--sat));
  right: 10px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  max-width: 320px;
}

@media (max-width: 480px) {
  .toast-box {
    left: 10px;
    right: 10px;
    max-width: none;
  }
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--bg);
  backdrop-filter: blur(16px);
  box-shadow: 0 6px 20px var(--shadow);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  pointer-events: auto;
  animation: toastIn .22s var(--bounce) both;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.toast--exit {
  animation: toastOut .18s ease-in both;
}

.toast__ico {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 900;
}

.toast--ok .toast__ico {
  background: color-mix(in oklab, var(--ok) 14%, transparent);
  color: var(--ok);
}

.toast--warn .toast__ico {
  background: color-mix(in oklab, var(--warn) 14%, transparent);
  color: var(--warn);
}

.toast--err .toast__ico {
  background: color-mix(in oklab, var(--danger) 14%, transparent);
  color: var(--danger);
}

.toast--info .toast__ico {
  background: color-mix(in oklab, var(--accent) 14%, transparent);
  color: var(--accent);
}

.toast__bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 0 0 12px 12px;
  transition: width linear;
}

.toast--ok .toast__bar { background: var(--ok); }
.toast--warn .toast__bar { background: var(--warn); }
.toast--err .toast__bar { background: var(--danger); }
.toast--info .toast__bar { background: var(--accent); }

/* ══════════════════════════════════
   CONFIRM DIALOG
   ══════════════════════════════════ */
@keyframes dlgIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dlg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2500;
  align-items: center;
  justify-content: center;
}

.dlg.is-open {
  display: flex;
}

.dlg__overlay {
  position: fixed;
  inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(4px);
}

.dlg__card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 22px;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 16px 48px var(--shadow);
  animation: dlgIn .2s var(--bounce) both;
}

.dlg__title {
  font-weight: 900;
  font-size: 19px;
  margin-bottom: 6px;
}

.dlg__msg {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 16px;
  white-space: pre-line;
}

.dlg__btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ══════════════════════════════════
   PROGRESS OVERLAY
   ══════════════════════════════════ */
.progress-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: var(--backdrop);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}

.progress-overlay.is-active {
  display: flex;
}

.progress-card {
  background: var(--bg);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 28px;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 16px 48px var(--shadow);
  text-align: center;
  animation: sheetUp .25s var(--bounce) both;
}

.progress-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 4px solid var(--stroke);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.progress-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
}

.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--stroke);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  width: 0%;
  transition: width .3s ease;
}

.progress-text {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

/* ══════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════ */
@media (max-width: 560px) {
  .preview {
    grid-template-columns: repeat(2, 1fr);
  }
  .preview__item img {
    height: 110px;
  }
  .histActions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .row--2 {
    grid-template-columns: 1fr;
  }
}
