/* =========================================================================
   Flow — condivisione file
   Palette di brand: inchiostro #161c23 · blu #2061f4 · carta #f8f9fb
   Una sola card in Home guida tutto l'invio (file → opzioni → invio → fatto).
   Nessun build step. Responsive 320px → 1920px.
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- Token ---------- */
:root {
  --ink: #161c23;
  --paper: #f8f9fb;
  --blue: #2061f4;
  --blue-rgb: 32, 97, 244;

  --text: #161c23;
  --text-soft: #566070;
  --text-faint: #8b94a4;

  --card-bg: rgba(255, 255, 255, 0.88);
  --card-solid: #ffffff;
  --card-border: rgba(255, 255, 255, 0.7);
  --line: rgba(22, 28, 35, 0.09);
  --field-bg: rgba(22, 28, 35, 0.05);
  --card-shadow: 0 34px 70px -34px rgba(8, 18, 44, 0.55);

  --accent: var(--blue);
  --accent-rgb: var(--blue-rgb);
  --on-accent: #ffffff;
  --danger: #d1453b;
  --success: #1f9d6c;

  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --font: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --ease: cubic-bezier(.22, .8, .32, 1);
  --spring: cubic-bezier(.34, 1.4, .5, 1);

  --nav-size: 232px;

  /* Colori dei testi sopra la foto: JS li cambia zona per zona in base alla luminosità dello sfondo */
  --shadow-d: 0 1px 3px rgba(8, 18, 44, .35), 0 2px 18px rgba(8, 18, 44, .55);
  --title-fg: #fff;             --title-sh: var(--shadow-d);  --title-haze: radial-gradient(ellipse at center, rgba(8, 18, 44, .3), rgba(8, 18, 44, 0) 68%);
  --rail-fg: #fff;              --rail-sh: 0 1px 3px rgba(8, 18, 44, .4), 0 0 16px rgba(8, 18, 44, .35);
  --rail-logo: drop-shadow(0 1px 2px rgba(8, 18, 44, .4)) drop-shadow(0 2px 14px rgba(8, 18, 44, .4));
  --rail-hover: rgba(255, 255, 255, .09);  --rail-active: rgba(255, 255, 255, .2);  --rail-veil: rgba(255, 255, 255, .07);
  --note-fg: #fff;              --note-bg: rgba(255, 255, 255, .1);  --note-line: rgba(255, 255, 255, .26);  --note-ico: rgba(255, 255, 255, .16);
  --tag-fg: #fff;               --tag-sh: var(--shadow-d);
  --acct-fg: #fff;              --acct-bg: rgba(255, 255, 255, .14);  --acct-bg-hover: rgba(255, 255, 255, .26);  --acct-bg-on: rgba(255, 255, 255, .34);
  --acct-line: rgba(255, 255, 255, .7);  --acct-line-on: #fff;  --acct-orb: rgba(255, 255, 255, .22);
  --idle-h: 340px;
  --card-w: 456px;
}

:root[data-theme="dark"] {
  --text: #f3f4f8;
  --text-soft: #a4abbb;
  --text-faint: #6f778a;
  --card-bg: rgba(22, 27, 37, 0.86);
  --card-solid: #1b1f28;
  --card-border: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.09);
  --field-bg: rgba(255, 255, 255, 0.07);
  --card-shadow: 0 34px 70px -30px rgba(0, 0, 0, 0.8);
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.card {
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
}

.icon { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* =========================================================================
   SFONDO + PARALLAX
   ========================================================================= */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(180deg, #6d8fcb, #34528f); }
.backdrop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); will-change: transform; opacity: 0; transition: opacity 1s var(--ease); }
.backdrop img.is-ready { opacity: 1; }
.backdrop-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 34, 68, var(--scrim-top, .2)) 0%, rgba(20, 34, 68, 0) 34%, rgba(9, 16, 32, var(--scrim-bot, .14)) 100%);
  box-shadow: inset 0 0 0 100vmax rgba(9, 13, 20, var(--scrim-extra, 0));
  transition: box-shadow .5s var(--ease);
}
body:not([data-view="home"]) { --scrim-extra: .05; }
:root[data-theme="dark"] body { --scrim-extra: .34; }
:root[data-theme="dark"] body:not([data-view="home"]) { --scrim-extra: .44; }

/* =========================================================================
   BARRA ALTA: logo + account
   ========================================================================= */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 70; display: flex; align-items: flex-start; justify-content: space-between; padding: 24px 28px 0 30px; pointer-events: none; }
.topbar > * { pointer-events: auto; }

.brand { display: block; width: clamp(112px, 9.5vw, 148px); color: var(--rail-fg); filter: var(--rail-logo); transition: color .5s var(--ease); }
.brand svg { display: block; width: 100%; height: auto; fill: currentColor; overflow: hidden; }
/* onda luminosa che attraversa F → l → o → w */
.logo-sweep { opacity: 0; }
body.is-transferring .logo-sweep { opacity: 1; animation: logoSweep 2.6s cubic-bezier(.45,.05,.3,1) infinite; }
body.logo-done .logo-sweep, .brand:hover .logo-sweep { opacity: 1; animation: logoSweepOnce 1.3s cubic-bezier(.45,.05,.3,1) 1; }
@keyframes logoSweep { 0% { transform: translateX(0); } 55%, 100% { transform: translateX(2200px); } }
@keyframes logoSweepOnce { from { transform: translateX(0); } to { transform: translateX(2200px); } }

.account-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 10px 0 5px; border-radius: var(--radius-pill);
  color: var(--acct-fg); font-size: 13.5px; font-weight: 700;
  border: 1.5px solid var(--acct-line); background: var(--acct-bg);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .5s var(--ease);
}
.account-btn:hover { background: var(--acct-bg-hover); }
.account-btn[aria-pressed="true"] { background: var(--acct-bg-on); border-color: var(--acct-line-on); }
.account-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--acct-orb); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.account-avatar .icon { width: 16px; height: 16px; }
.account-avatar > span[hidden], .account-avatar > svg[hidden] { display: none; }
.account-btn.is-user .account-label { display: none; }
.account-btn.is-user { padding-right: 8px; }
.account-btn.is-user .account-avatar { background: var(--accent); color: #fff; }
.account-chevron { width: 15px; height: 15px; opacity: .85; transition: transform .35s var(--spring); }
.account-btn[aria-pressed="true"] .account-chevron { transform: rotate(180deg); }

/* =========================================================================
   NAVIGAZIONE — quasi invisibile: solo icone e testo, con un velo appena percettibile
   ========================================================================= */
.nav {
  position: fixed; z-index: 60; top: 108px; left: 0; width: 230px;
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 26px 12px 14px;
  background: linear-gradient(90deg, var(--rail-veil), rgba(255,255,255,0));
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  -webkit-mask-image: linear-gradient(90deg, #000 60%, transparent), linear-gradient(180deg, transparent, #000 16%, #000 84%, transparent);
  mask-image: linear-gradient(90deg, #000 60%, transparent), linear-gradient(180deg, transparent, #000 16%, #000 84%, transparent);
  -webkit-mask-composite: source-in; mask-composite: intersect;
}
.nav-item {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 11px 14px; border-radius: 15px;
  color: var(--rail-fg); font-size: 14px; font-weight: 600; text-align: left;
  text-shadow: var(--rail-sh);
  transition: background-color .2s var(--ease), color .5s var(--ease);
}
.nav-item .icon { width: 20px; height: 20px; stroke-width: 1.6; }
.nav-item:hover { background: var(--rail-hover); }
.nav-item { max-width: 196px; }
.nav-item.is-active { background: var(--rail-active); font-weight: 700; }

/* =========================================================================
   VISTE
   ========================================================================= */
.view-area { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
.view { position: absolute; inset: 0; overflow: hidden; }
.view[hidden] { display: none; }
.view:not(#view-home) { padding: 96px 32px 32px calc(var(--nav-size) + 32px); animation: viewIn .4s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } }
.view-scroll { height: 100%; overflow-y: auto; margin: 0 -12px; padding: 0 12px; }

.page { width: min(980px, 100%); margin: 0 auto; padding-bottom: 12px; }
.page-narrow { width: min(560px, 100%); }
.page-title { color: var(--title-fg); font-size: clamp(21px, 2.4vw, 26px); font-weight: 800; margin-bottom: 16px; text-shadow: var(--title-sh); transition: color .5s var(--ease); }

/* =========================================================================
   HOME — la card centrata sullo schermo
   ========================================================================= */
.home { position: relative; height: 100%; }

.home-title {
  position: absolute; left: 50%; bottom: calc(50% + var(--idle-h) / 2 + 34px);
  width: min(780px, calc(100% - 40px)); text-align: center; color: var(--title-fg);
  transform: translateX(-50%);
  transition: opacity .35s var(--ease), transform .5s var(--ease);
}
.home-title::before { content: ""; position: absolute; inset: -36px -90px -30px; z-index: -1; pointer-events: none; background: var(--title-haze); transition: opacity .5s var(--ease); }
.home-title h1 { font-size: clamp(25px, 3.5vw, 42px); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; text-shadow: var(--title-sh); }
.home-title p { margin-top: 12px; font-size: clamp(13.5px, 1.35vw, 16px); font-weight: 600; opacity: 1; text-shadow: var(--title-sh); }
.home:not([data-state="idle"]) .home-title { opacity: 0; transform: translate(-50%, -14px); pointer-events: none; }

.flow-card {
  opacity: 1;
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(var(--card-w), calc(100% - 32px));
  border-radius: var(--radius-xl);
  transition: scale .35s var(--spring), box-shadow .35s var(--ease), border-color .35s var(--ease), opacity .6s var(--ease);
}
body[data-auth="pending"] .flow-card, body[data-auth="pending"] .home-title { opacity: 0; }
#uploadForm { display: contents; }
.home[data-access="guest"] { --idle-h: 372px; }
.flow-card.is-dragover { scale: 1.02; border-color: rgba(var(--accent-rgb), .8); box-shadow: var(--card-shadow), 0 0 0 4px rgba(var(--accent-rgb), .28); }
.flow-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; }
.flow-card.is-catching::after { animation: catchRing .85s var(--ease); }
@keyframes catchRing { 0% { opacity: 1; box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .5); } 100% { opacity: 0; box-shadow: 0 0 0 30px rgba(var(--accent-rgb), 0); } }

/* ---------- Avanzamento a punti ---------- */
.flow-steps { display: flex; flex-direction: column; align-items: center; gap: 7px; max-height: 60px; padding-top: 20px; overflow: hidden; transition: max-height .5s var(--ease), padding .5s var(--ease), opacity .4s var(--ease); }
.home[data-state="idle"] .flow-steps { max-height: 0; padding-top: 0; opacity: 0; }
.fs-row { display: flex; align-items: center; gap: 7px; }
.fs-dot { position: relative; display: block; width: 8px; height: 8px; border-radius: 99px; overflow: hidden; background: rgba(var(--accent-rgb), .18); transition: width .55s var(--spring), background-color .4s var(--ease); }
.fs-fill { position: absolute; inset: 0; width: 0; border-radius: inherit; background: var(--accent); transition: width .45s var(--ease); }
.fs.is-done .fs-fill { width: 100%; }
.fs.is-active .fs-dot { width: 30px; }
.fs.is-active .fs-fill { width: calc(var(--p, 1) * 100%); transition: none; }
.fs.is-active:not(.is-progress) .fs-fill { width: 100%; transition: width .45s var(--ease); }
.fs-label { font-size: 12px; font-weight: 600; color: var(--text-soft); transition: opacity .25s var(--ease); }

/* ---------- Corpo della card ---------- */
.flow-body { position: relative; overflow: hidden; max-height: calc(100dvh - 150px); transition: height .5s var(--ease); }
.pane { display: none; padding: 24px 30px 28px; max-height: calc(100dvh - 150px); overflow-y: auto; scrollbar-width: thin; }
.pane.is-active { display: block; animation: paneIn .45s var(--ease) both; }
.pane.is-leaving { animation: paneOut .13s ease-in both; }
@keyframes paneIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes paneOut { to { opacity: 0; transform: translateY(-6px); } }

.pane-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pane-head h2 { font-size: 18px; font-weight: 800; }
.pane-meta { font-size: 12.5px; color: var(--text-faint); font-weight: 600; }
.pane-actions { display: flex; gap: 10px; margin-top: 20px; }
.pane-actions .btn { flex: 1; }
.pane-actions .btn-ghost { flex: 0 0 auto; padding-inline: 22px; }
.pane-actions-col { flex-direction: column; align-items: stretch; gap: 12px; }

/* ---------- Inizio ---------- */
.pane-idle.is-active { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: var(--idle-h); padding: 34px 34px 30px; text-align: center; cursor: pointer; }
.idle-icon { position: relative; width: 84px; height: 84px; display: grid; place-items: center; margin-bottom: 22px; color: var(--accent); }
.idle-icon::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--accent-rgb), .18), rgba(var(--accent-rgb), 0) 68%); animation: breathe 3.6s ease-in-out infinite; }
.idle-icon svg { position: relative; width: 84px; height: 84px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.idle-icon .arrow { animation: arrowLift 3.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.94); opacity: .7; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes arrowLift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2px); } }
.flow-card.is-dragover .idle-icon .arrow { animation: arrowBounce .7s ease-in-out infinite; }
@keyframes arrowBounce { 0%, 100% { transform: translateY(1px); } 50% { transform: translateY(-2.4px); } }
.pane-idle .btn { width: 100%; }
.idle-or { margin-top: 18px; font-size: 14px; color: var(--text-soft); font-weight: 500; }
.idle-max { margin-top: 22px; font-size: 12px; color: var(--text-faint); }

/* ---------- Accesso (ospiti) ---------- */
.pane-login.is-active { display: flex; flex-direction: column; padding: 30px 30px 26px; text-align: center; animation: paneIn .45s var(--ease) both; }
.login-orb { width: 50px; height: 50px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--accent-rgb), .1); color: var(--accent); }
.login-orb .icon { width: 24px; height: 24px; }
.pane-login h2 { font-size: 20px; font-weight: 800; }
.login-lead { margin: 6px 0 18px; font-size: 13.5px; line-height: 1.5; color: var(--text-soft); }
.pane-login .field { text-align: left; margin-bottom: 12px; }
.pane-login .status { margin-top: 0; margin-bottom: 8px; }
.pane-login .btn { width: 100%; }

/* ---------- Coda file ---------- */
.file-queue { display: grid; gap: 8px; max-height: 250px; overflow-y: auto; scrollbar-width: thin; margin: 0 -4px; padding: 2px 4px; }
.file-queue:empty { display: none; }
.file-queue-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 14px; background: var(--field-bg); animation: fileIn .5s var(--spring) both; }
@keyframes fileIn { 0% { opacity: 0; transform: scale(.92); box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .55); } 60% { box-shadow: 0 0 22px 0 rgba(var(--accent-rgb), .3); } 100% { opacity: 1; transform: none; box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); } }
.file-queue-info { flex: 1; min-width: 0; }
.file-queue-name { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-queue-size { font-size: 12px; color: var(--text-faint); }
.file-queue-remove { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: var(--text-faint); flex-shrink: 0; transition: background-color .2s var(--ease), color .2s var(--ease); }
.file-queue-remove:hover { background: var(--line); color: var(--text); }
.add-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--accent); font-size: 13px; font-weight: 700; }
.add-more:hover { text-decoration: underline; text-underline-offset: 3px; }
.queue-warning { margin-top: 10px; font-size: 12.5px; color: var(--danger); }
.queue-warning:empty { display: none; }

/* tile colorata per tipo di file */
.ftile { position: relative; width: 38px; height: 38px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; color: #fff; background: #6b7a90; }
.ftile[data-kind="pdf"] { background: linear-gradient(140deg, #f0635f, #d63b3b); }
.ftile[data-kind="archive"] { background: linear-gradient(140deg, #f5a24a, #e07a1f); }
.ftile[data-kind="image"] { background: linear-gradient(140deg, #4aa8f5, #2061f4); }
.ftile[data-kind="video"] { background: linear-gradient(140deg, #3a4a68, #161c23); }
.ftile[data-kind="audio"] { background: linear-gradient(140deg, #a07af5, #6d45d6); }
.ftile[data-kind="doc"] { background: linear-gradient(140deg, #5b8def, #2b5cd6); }
.ftile[data-kind="sheet"] { background: linear-gradient(140deg, #3fbf8a, #1f9d6c); }
.ftile[data-kind="slides"] { background: linear-gradient(140deg, #f58a4a, #d9581f); }
.lock-badge { position: absolute; right: -4px; bottom: -4px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: #fff; border: 2px solid var(--card-solid); }
.lock-badge svg { width: 8px; height: 8px; fill: none; stroke: currentColor; stroke-width: 2.6; }

/* ---------- Campi e righe ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-soft); }
.field label em { font-style: normal; font-weight: 500; color: var(--text-faint); }
.field input, .field textarea, .row input[type="text"], .row input[type="number"], .row input[type="password"], .row select, .panel-tools select, .inline-field-row input {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; font-size: 14px; background: var(--field-bg); color: var(--text);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.field textarea { resize: none; min-height: 64px; }
.field input:focus, .field textarea:focus, .row input:focus, .row select:focus, .inline-field-row input:focus { outline: none; border-color: rgba(var(--accent-rgb), .7); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14); }
.char-count { font-size: 11px; color: var(--text-faint); text-align: right; }

.rows { display: grid; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.rows > .row:last-child { border-bottom: 0; }
.row > label:first-child, .row > span:first-child { color: var(--text-soft); }
.row input[type="text"], .row input[type="number"], .row input[type="password"], .row select { width: 172px; padding: 8px 12px; font-size: 13.5px; text-align: right; }
.row select { text-align: left; }
.row input:disabled { opacity: .5; cursor: not-allowed; }
.advanced { margin-top: 4px; }
.advanced summary { cursor: pointer; list-style: none; padding: 8px 0; font-size: 13px; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: ""; width: 6px; height: 6px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .3s var(--ease); }
.advanced[open] summary::after { transform: rotate(225deg) translate(-1px, -1px); }

.switch-row { cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; }
.switch-input { position: absolute; opacity: 0; width: 38px; height: 22px; margin: 0; cursor: pointer; }
.switch-track { width: 38px; height: 22px; border-radius: var(--radius-pill); background: var(--line); display: inline-block; position: relative; transition: background-color .25s var(--ease); }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.28); transition: transform .3s var(--spring); }
.switch-input:checked + .switch-track { background: var(--accent); }
.switch-input:checked + .switch-track .switch-thumb { transform: translateX(16px); }
.switch-input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

.detail-grid { display: grid; gap: 4px; }
.detail-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 8px 0; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.detail-grid > .detail-row:last-child { border-bottom: 0; }
.detail-label { color: var(--text-soft); }
.detail-value { text-align: right; word-break: break-word; font-weight: 600; }
.detail-value.mono { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; }

.status { min-height: 14px; font-size: 12.5px; color: var(--text-soft); text-align: center; margin-top: 10px; }
.status:empty { min-height: 0; margin: 0; }
.status[data-state="error"] { color: var(--danger); }

/* ---------- Bottoni ---------- */
.btn { position: relative; border-radius: var(--radius-pill); padding: 13px 22px; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; transition: transform .2s var(--ease), box-shadow .25s var(--ease), background-color .2s var(--ease), opacity .2s var(--ease); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-accent { background: linear-gradient(180deg, #3673ff, var(--accent)); color: var(--on-accent); box-shadow: 0 10px 22px -10px rgba(var(--accent-rgb), .8), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-accent:hover:not(:disabled) { box-shadow: 0 14px 28px -10px rgba(var(--accent-rgb), .9), inset 0 1px 0 rgba(255,255,255,.25); }
.btn-lg { padding: 17px 26px; font-size: 15.5px; }
.btn-sm { padding: 9px 16px; font-size: 13px; }
.btn-ghost { background: var(--field-bg); border: 1px solid var(--line); color: var(--text); }
.btn-danger { background: rgba(209,69,59,.1); border: 1px solid rgba(209,69,59,.35); color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #fff; box-shadow: 0 10px 22px -10px rgba(209,69,59,.8); }
.btn-text { padding: 6px; font-size: 13.5px; font-weight: 700; color: var(--text-soft); align-self: center; }
.btn-text:hover { color: var(--text); }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius-pill); color: var(--text-soft); transition: background-color .2s var(--ease), color .2s var(--ease); }
.icon-btn:hover { background: var(--field-bg); color: var(--text); }
.icon-btn[data-action="delete"]:hover, .icon-btn[data-action="revoke"]:hover { color: var(--danger); }
.icon-btn-solid { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); transition: transform .2s var(--ease); }
.icon-btn-solid:hover { transform: translateY(-1px); }
.link-btn { color: var(--accent); font-size: 13px; font-weight: 700; }
.inline-field-row { display: flex; gap: 8px; }
.inline-field-row input { flex: 1; min-width: 0; }
.mono-field { font-family: var(--font-mono); font-size: 12.5px !important; }

/* ---------- Caricamenti personalizzati ---------- */
.dots { display: inline-flex; gap: 5px; align-items: center; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: dotWave 1s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .12s; }
.dots i:nth-child(3) { animation-delay: .24s; }
@keyframes dotWave { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.btn > .dots { position: absolute; opacity: 0; pointer-events: none; }
.btn.is-loading { pointer-events: none; }
.btn.is-loading > .btn-label { opacity: 0; }
.btn.is-loading > .dots { opacity: 1; }
.loading-block { display: flex; justify-content: center; padding: 30px 0; color: var(--accent); }
.is-spinning .icon { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius-md); background: var(--field-bg); }
.skel i { display: block; border-radius: 10px; background: linear-gradient(100deg, var(--line) 30%, rgba(255,255,255,.35) 50%, var(--line) 70%); background-size: 260% 100%; animation: shimmer 1.4s linear infinite; }
.skel i:first-child { width: 38px; height: 38px; flex-shrink: 0; }
.skel div { flex: 1; display: grid; gap: 8px; }
.skel div i { height: 10px; width: 60%; }
.skel div i + i { width: 34%; height: 8px; }
@keyframes shimmer { from { background-position: 130% 0; } to { background-position: -130% 0; } }

/* ---------- Trasferimento: anello che si carica ---------- */
.pane-sending { text-align: center; padding: 26px 30px 26px; }
.pane-sending .pane-actions { justify-content: center; }
.ring-wrap { position: relative; width: 204px; height: 204px; margin: 0 auto 10px; }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ring circle { fill: none; }
.ring-orbit { stroke: rgba(var(--accent-rgb), .3); stroke-width: 1.2; stroke-dasharray: .8 6.4; stroke-linecap: round; transform-origin: 80px 80px; animation: orbit 30s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
.ring-track { stroke: rgba(var(--accent-rgb), .13); stroke-width: 9; }
.ring-fill { stroke: url(#ringGrad); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transform: rotate(-90deg); transform-origin: 80px 80px; filter: drop-shadow(0 0 6px rgba(var(--accent-rgb), .5)); }
.dot-core { fill: #fff; filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), .9)); }
.dot-halo { fill: rgba(var(--accent-rgb), .3); animation: haloPulse 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.pane-sending.is-finalizing .dot-halo { animation-duration: .6s; }
@keyframes haloPulse { 0%, 100% { transform: scale(.7); opacity: .9; } 50% { transform: scale(1.2); opacity: .3; } }
.ring-wrap .progress-percent { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; }
.ring-wrap .progress-percent sup { position: static; top: auto; left: auto; transform: none; align-self: center; margin: -14px 0 0 3px; font-size: 20px; }
.progress-percent { font-size: 52px; font-weight: 800; line-height: 1; margin-top: 4px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.progress-percent sup { font-size: 22px; font-weight: 700; color: var(--text-faint); vertical-align: top; margin-left: 2px; position: relative; top: 6px; }
.progress-label { margin-top: 0; color: var(--text-soft); font-size: 13.5px; font-weight: 600; }
.progress-file { margin-top: 3px; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-stats { display: flex; margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); }
.progress-stats > div { flex: 1; }
.progress-stats > div + div { border-left: 1px solid var(--line); }
.progress-stats span { display: block; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.progress-stats small { color: var(--text-faint); font-size: 11.5px; }

/* ---------- Fatto ---------- */
.pane-done { text-align: center; }
.done-mark { width: 92px; height: 92px; margin: 2px auto 6px; display: block; overflow: visible; }
.done-mark circle, .done-mark path { fill: none; }
.dm-glow { fill: rgba(var(--accent-rgb), .12) !important; transform-box: fill-box; transform-origin: center; transform: scale(.6); opacity: 0; }
.dm-ring { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transform: rotate(-90deg); transform-origin: 48px 48px; }
.dm-check { stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.pane-done.is-active .dm-glow { animation: glowIn .9s .45s var(--ease) forwards; }
.pane-done.is-active .dm-ring { animation: draw .75s .05s cubic-bezier(.5,0,.2,1) forwards; }
.pane-done.is-active .dm-check { animation: draw .45s .62s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes glowIn { to { transform: scale(1); opacity: 1; } }
.done-title { font-size: 22px; font-weight: 800; }
.done-sub { margin: 4px 0 16px; font-size: 13.5px; color: var(--text-soft); }
.file-queue-done { text-align: left; max-height: 168px; margin-bottom: 4px; }
.file-queue-done .file-queue-item { animation-delay: .7s; }

/* ---------- Nota in basso a sinistra + slogan ---------- */
.home-note { position: absolute; left: 28px; bottom: 28px; max-width: 330px; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 18px; color: var(--note-fg); background: var(--note-bg); border: 1px solid var(--note-line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: opacity .35s var(--ease); }
.note-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--note-ico); flex-shrink: 0; }
.note-ico .icon { width: 19px; height: 19px; }
.home-note strong { display: block; font-size: 13px; }
.home-note div span { display: block; margin-top: 2px; font-size: 11.5px; line-height: 1.4; opacity: .82; }
.home-tagline { position: absolute; right: 30px; bottom: 56px; white-space: nowrap; text-align: right; color: var(--tag-fg); text-shadow: var(--tag-sh); transition: opacity .35s var(--ease); }
.home-tagline p { font-size: 13px; line-height: 1.4; opacity: .95; }
.home:not([data-state="idle"]) .home-note, .home:not([data-state="idle"]) .home-tagline { opacity: 0; pointer-events: none; }

/* =========================================================================
   I MIEI FILE
   ========================================================================= */
.panel { height: 100%; max-height: 100%; width: min(980px, 100%); margin: 0 auto; display: flex; flex-direction: column; border-radius: var(--radius-xl); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 26px 14px; flex-shrink: 0; }
.panel-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.panel-title h1 { font-size: 22px; font-weight: 800; }
.panel-tools { display: flex; align-items: center; gap: 10px; padding: 0 26px 14px; flex-shrink: 0; }
.search-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 42px; border-radius: var(--radius-pill); background: var(--field-bg); border: 1px solid var(--line); color: var(--text-faint); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.search-field:focus-within { border-color: rgba(var(--accent-rgb), .7); box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .14); }
.search-field input { flex: 1; min-width: 0; background: none; border: 0; font-size: 14px; color: var(--text); }
.search-field input:focus-visible { outline: none; }
.search-field input::placeholder { color: var(--text-faint); }
.panel-tools select { height: 42px; padding: 0 14px; border-radius: var(--radius-pill); font-size: 13px; }

.shares { flex: 1; min-height: 0; overflow-y: auto; padding: 0 16px 16px; scrollbar-width: thin; display: grid; align-content: start; gap: 2px; }
.share-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px;
  padding: 10px 12px; border-radius: 18px; border: 1px solid transparent;
  transition: transform .3s var(--spring), background-color .25s var(--ease), box-shadow .3s var(--ease), border-color .25s var(--ease);
}
.share-main { min-width: 0; display: grid; gap: 2px; }
.share-name { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-meta { font-size: 12.5px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-actions { display: flex; gap: 0; opacity: .55; transition: opacity .25s var(--ease); }
.share-row:hover, .share-row:focus-within { transform: translateY(-2px); background: var(--card-solid); border-color: var(--line); box-shadow: 0 16px 30px -20px rgba(8,18,44,.45); }
.share-row:hover .share-actions, .share-row:focus-within .share-actions { opacity: 1; }
.shares-empty { margin: 8px 10px; padding: 46px 20px; text-align: center; color: var(--text-soft); border-radius: var(--radius-lg); border: 1.5px dashed var(--line); font-size: 14px; line-height: 1.5; }
.shares-empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.shares-empty .btn { margin-top: 16px; }

.badge { display: inline-flex; align-items: center; padding: 4px 11px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; background: var(--field-bg); border: 1px solid var(--line); white-space: nowrap; }
.badge-active { color: var(--success); border-color: rgba(31,157,108,.3); background: rgba(31,157,108,.08); }
.badge-expired { color: var(--text-faint); }
.badge-revoked, .badge-exhausted { color: var(--danger); border-color: rgba(209,69,59,.3); background: rgba(209,69,59,.07); }

/* =========================================================================
   ACCOUNT / RICEVUTI / IMPOSTAZIONI
   ========================================================================= */
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-content: start; }
.account-grid > .stats, .account-grid > .recent-card { grid-column: 1 / -1; }
.account-grid > [hidden] { display: none; }
.profile-card { display: flex; align-items: center; gap: 16px; padding: 22px; border-radius: var(--radius-lg); }
.avatar { width: 58px; height: 58px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(140deg, #3d78ff, var(--accent)); color: #fff; font-size: 20px; font-weight: 800; }
.profile-info { flex: 1; min-width: 0; }
.profile-info strong { display: block; font-size: 16px; }
.profile-info span { display: block; font-size: 12.5px; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; }
.profile-info .badge { display: inline-flex; margin-top: 8px; color: var(--text); }
.profile-info .badge[hidden] { display: none; }
.login-card { padding: 24px 24px 22px; border-radius: var(--radius-lg); }
.login-card h2 { font-size: 18px; font-weight: 800; }
.login-card > p { margin: 4px 0 16px; font-size: 13px; color: var(--text-soft); }
.login-card .btn { width: 100%; margin-top: 4px; }
.login-card .status { margin-top: 0; margin-bottom: 4px; }
.storage-card { padding: 22px 24px 10px; border-radius: var(--radius-lg); }
.storage-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-size: 13px; color: var(--text-soft); }
.storage-head strong { font-size: 20px; font-weight: 800; color: var(--text); }
.meter { height: 9px; border-radius: 99px; background: var(--field-bg); overflow: hidden; }
.meter-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7fa8ff, var(--accent)); transition: width .8s var(--ease); }
.meter-fill.is-warn { background: linear-gradient(90deg, #f0a35f, var(--danger)); }
.storage-sub { margin: 9px 0 6px; font-size: 12px; color: var(--text-faint); }
.storage-card .row { border-bottom: 0; border-top: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-tile { border-radius: var(--radius-md); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat-value { font-weight: 800; font-size: clamp(19px, 2.2vw, 24px); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--text-soft); }
.recent-card { padding: 6px 24px 10px; border-radius: var(--radius-lg); }
.recent-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 10px; }
.recent-head h2 { font-size: 15px; font-weight: 800; }
.recent-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.recent-info { flex: 1; min-width: 0; display: grid; gap: 1px; }
.recent-meta { font-size: 12px; color: var(--text-faint); }
.recent-empty { padding: 16px 0 12px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text-soft); }

.empty-state { border-radius: var(--radius-xl); padding: 46px 34px; text-align: center; max-width: 460px; margin: 6vh auto 0; color: var(--text-soft); }
.empty-orb { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--accent-rgb), .1); color: var(--accent); }
.empty-orb .icon { width: 28px; height: 28px; }
.empty-state h2 { font-size: 19px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.empty-state p { font-size: 14px; line-height: 1.55; }

.settings-panel { border-radius: var(--radius-lg); padding: 6px 24px; }
.settings-panel .row { padding: 16px 0; font-size: 14px; }
.settings-panel > .row:last-child { border-bottom: 0; }
.settings-note { margin-top: 16px; font-size: 12.5px; color: var(--title-fg); line-height: 1.5; text-shadow: var(--title-sh); }
.segmented { display: flex; background: var(--field-bg); border-radius: var(--radius-pill); padding: 3px; }
.segmented-btn { padding: 7px 16px; border-radius: var(--radius-pill); font-size: 13px; font-weight: 700; color: var(--text-soft); transition: background-color .25s var(--ease), color .25s var(--ease); }
.segmented-btn.is-active { background: var(--card-solid); color: var(--text); box-shadow: 0 4px 10px -4px rgba(8,18,44,.3); }

/* =========================================================================
   TOAST + MODALI
   ========================================================================= */
.toast-stack { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 11px 20px; border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 600; box-shadow: 0 16px 34px -16px rgba(0,0,0,.6); opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .3s var(--ease), transform .4s var(--spring); }
.toast.is-visible { opacity: 1; transform: none; }
.toast.toast-error { background: var(--danger); color: #fff; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(9,14,26,.5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fadeIn .25s var(--ease); }
.modal-backdrop[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-panel, .confirm-panel { animation: popIn .35s var(--spring); }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.modal-panel { width: min(560px, 100%); max-height: min(86vh, 740px); overflow-y: auto; border-radius: var(--radius-lg); background: var(--card-solid); }
.modal-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; background: var(--card-solid); border-bottom: 1px solid var(--line); }
.modal-header h2 { font-size: 17px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-close { width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center; border-radius: var(--radius-pill); }
.modal-close:hover { background: var(--field-bg); }
.modal-body { padding: 18px 22px 26px; display: grid; gap: 18px; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.confirm-panel { width: min(400px, 100%); padding: 26px 26px 22px; border-radius: var(--radius-lg); background: var(--card-solid); }
.confirm-panel h2 { font-size: 18px; font-weight: 800; }
.confirm-panel p { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--text-soft); }
.timeline-section h3 { font-size: 13px; color: var(--text-soft); margin-bottom: 12px; font-weight: 700; }
.timeline { display: grid; gap: 14px; border-left: 1.5px solid var(--line); padding-left: 16px; }
.timeline-item { position: relative; display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.timeline-dot { position: absolute; left: -20.5px; top: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline-time { color: var(--text-faint); white-space: nowrap; font-size: 12px; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-height: 760px) {
  :root { --idle-h: 310px; }
  .home[data-access="guest"] { --idle-h: 350px; }
  .ring-wrap { width: 176px; height: 176px; }
  .home-title p { display: none; }
  .home-title h1 { font-size: clamp(22px, 3vw, 32px); }
  .home-title { bottom: calc(50% + var(--idle-h) / 2 + 22px); }
  .idle-icon { width: 68px; height: 68px; margin-bottom: 16px; }
  .idle-icon svg { width: 68px; height: 68px; }
  .home-note { display: none; }
  .home-tagline { bottom: 30px; }
}

@media (max-width: 1060px) { .stats { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 860px) {
  .topbar { padding: 16px 16px 0 18px; }
  .brand { width: 98px; }
  .account-label { display: none; }
  .account-btn { padding: 0 8px 0 5px; }

  .nav {
    top: auto; bottom: 0; left: 0; right: 0; width: 100%;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    flex-direction: row; justify-content: space-around; gap: 0;
    padding: 6px 8px calc(4px + env(safe-area-inset-bottom, 0px));
    border-radius: 0; border: 0; border-top: 1px solid rgba(255,255,255,.14);
    background: rgba(12,20,36,.38);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    -webkit-mask-image: none; mask-image: none;
  }
  .nav-item { max-width: none; flex: 1; flex-direction: column; justify-content: center; gap: 3px; padding: 6px 2px; font-size: 10.5px; color: #fff; text-shadow: none; }
  .nav-item:hover { background: transparent; }
  .nav-item.is-active { background: rgba(255,255,255,.22); }
  .nav { background: rgba(12,20,36,.5); }
  .view-area { height: 100vh; height: 100dvh; padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .view:not(#view-home) { padding: 76px 16px 16px 16px; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  #view-home { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .toast-stack { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .home-note, .home-tagline { display: none; }
  .account-grid { grid-template-columns: 1fr; }
  .panel-head { padding: 18px 18px 12px; }
  .panel-tools { padding: 0 18px 12px; }
  .shares { padding: 0 8px 12px; }
}

@media (max-width: 560px) {
  :root { --idle-h: 320px; }
  .home[data-access="guest"] { --idle-h: 372px; }
  .home-title p { display: none; }
  .home-title h1 { font-size: 23px; }
  .home-title { bottom: calc(50% + var(--idle-h) / 2 + 22px); }
  .pane { padding: 20px 20px 22px; }
  .pane-idle.is-active { padding: 28px 22px 24px; }
  .row input[type="text"], .row input[type="number"], .row input[type="password"], .row select { width: 140px; }
  .panel-tools select { display: none; }
  .panel-title .pane-meta { display: none; }
  .panel-title h1 { white-space: nowrap; font-size: 20px; }
  .share-row { padding: 8px 8px; }
  .share-actions .icon-btn { width: 32px; height: 32px; }
  .share-row { grid-template-columns: auto minmax(0, 1fr); row-gap: 8px; }
  .share-row .badge { display: none; }
  .share-actions { grid-column: 1 / -1; justify-content: flex-end; opacity: 1; margin-top: -4px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .profile-card { flex-wrap: wrap; }
  .progress-percent { font-size: 46px; }
}

@media (max-width: 380px) { .brand { width: 84px; } }

@media (hover: none) { .idle-or { display: none; } .idle-max { margin-top: 16px; } }

/* Animazioni ridotte: preferenza di sistema o interruttore in Impostazioni */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
:root[data-motion="reduced"] .logo-sweep { opacity: 0 !important; }
