/* CeniDev Foto — design derivato da cenidev.com e dal design system Freccia.
   Chalet per i titoli, DM Sans per testo e controlli, scuro predefinito. */
@font-face { font-family: Chalet; src: url('assets/Chalet-NewYorkSixty.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'DM Sans'; src: url('assets/DMSans-Variable.ttf') format('truetype'); font-weight: 100 1000; font-display: swap; }

:root {
  color-scheme: light;
  --font-sans: 'DM Sans', Arial, sans-serif;
  --font-display: Chalet, Arial, sans-serif;
  --color-bg: #fafafa;
  --color-card: #fff;
  --color-surface-muted: #f0f0f0;
  --color-text: #171717;
  --color-subtext: #5c5c5c;
  --color-border: #d4d4d4;
  --color-control-border: #808080;
  --color-primary: #005f91;
  --color-secondary: #005f91;
  --color-hover: #ebebeb;
  --color-action: #171717;
  --color-on-action: #fafafa;
  --color-danger: #a32138;
  --color-danger-soft: #ffe9ed;
  --color-danger-border: #bb6979;
  --color-success: #17623f;
  --color-overlay: rgb(0 0 0 / 40%);
  --color-focus: var(--color-primary);
  --radius-button: 999px; --radius-control: 16px; --radius-card: 25px; --radius-tile: 14px;
  --control-height: 44px;
  --content-width: 1360px;
  --gutter: 36px;
  --topbar-height: 72px;
  --motion-fast: 140ms;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #101010;
  --color-card: #181818;
  --color-surface-muted: #242424;
  --color-text: #f5f5f5;
  --color-subtext: #b8b8b8;
  --color-border: #404040;
  --color-control-border: #707070;
  --color-primary: #79bfff;
  --color-secondary: #afd8ff;
  --color-hover: #2a2a2a;
  --color-action: #f5f5f5;
  --color-on-action: #101010;
  --color-danger: #ffabb7;
  --color-danger-soft: #2a1d20;
  --color-danger-border: #a66b74;
  --color-success: #94e3b4;
  --color-overlay: rgb(0 0 0 / 60%);
  --color-focus: #90caff;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--color-bg); color: var(--color-text);
  font: 15px/1.55 var(--font-sans);
  animation: fadeIn .6s ease;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; margin: 0; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
button, a, input { -webkit-tap-highlight-color: transparent; }
svg { width: 19px; height: 19px; display: block; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
button svg, a svg { pointer-events: none; }
:focus-visible { outline: 1.5px solid var(--color-focus); outline-offset: 2px; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; background: var(--color-action); color: var(--color-on-action); padding: 12px 16px; border-radius: var(--radius-control); }
.skip-link:focus { top: 12px; }
#main { flex: 1; width: 100%; max-width: var(--content-width); margin: 0 auto; padding: calc(var(--topbar-height) + 40px) var(--gutter) 64px; outline: none; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- Controlli ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: var(--control-height); padding: 10px 20px;
  border: 1px solid var(--color-control-border); border-radius: var(--radius-button);
  background: var(--color-card); font-weight: 500; font-size: 14px; line-height: 1.4; white-space: nowrap;
  transition: background var(--motion-fast), border-color var(--motion-fast), opacity var(--motion-fast);
}
.btn:hover { background: var(--color-hover); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--color-action); color: var(--color-on-action); border-color: var(--color-action); }
.btn-primary:hover { background: var(--color-action); opacity: .86; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { background: var(--color-danger-soft); color: var(--color-danger); border-color: var(--color-danger-border); }
.btn-danger:hover { background: var(--color-danger-soft); opacity: .85; }
.btn-small { min-height: 38px; padding: 7px 14px; font-size: 13px; }
.icon-button {
  display: grid; place-items: center; width: 42px; height: 42px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius-button);
  background: transparent; color: var(--color-subtext);
  transition: background var(--motion-fast), color var(--motion-fast);
}
.icon-button:hover { background: var(--color-hover); color: var(--color-text); }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--color-subtext); font-size: 14px; background: none; border: 0; padding: 6px 0; }
.text-link:hover { color: var(--color-text); }
.text-link svg { width: 16px; height: 16px; }

input, textarea {
  width: 100%; min-height: 46px; padding: 11px 15px;
  background: var(--color-card); color: var(--color-text);
  border: 1px solid var(--color-control-border); border-radius: var(--radius-control); font-size: 15px;
}
textarea { resize: vertical; min-height: 90px; }
input::placeholder, textarea::placeholder { color: var(--color-subtext); }
label.field { display: grid; gap: 8px; font-size: 14px; font-weight: 500; margin-bottom: 18px; }
label.field small { font-weight: 400; color: var(--color-subtext); font-size: 12px; }
.field-error { color: var(--color-danger); font-size: 13px; min-height: 0; margin: 0; }
.field-error:empty { display: none; }
.field-error:not(:empty) { margin-bottom: 12px; }

.photographers-field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.photographers-field legend { padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 500; }
.photographers-field legend small { font-weight: 400; color: var(--color-subtext); font-size: 12px; margin-left: 4px; }
.check-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.check-chip { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 16px 8px 12px; border: 1px solid var(--color-control-border); border-radius: var(--radius-button); cursor: pointer; font-size: 14px; transition: background var(--motion-fast), border-color var(--motion-fast); }
.check-chip:hover { background: var(--color-hover); }
.check-chip input { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--color-action); }
.check-chip span { display: grid; line-height: 1.25; }
.check-chip small { color: var(--color-subtext); font-size: 12px; }
.check-chip:has(input:checked) { border-color: var(--color-text); }
.switch-field { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; margin: 4px 0 20px; }
.switch-field span { display: grid; gap: 3px; font-size: 14px; }
.switch-field strong { font-weight: 500; }
.switch-field small { color: var(--color-subtext); font-size: 12px; }
.switch-field input {
  appearance: none; flex-shrink: 0; width: 44px; height: 26px; min-height: 0; padding: 0; margin: 1px 0 0;
  border-radius: 99px; border: 1px solid var(--color-control-border); background: var(--color-surface-muted);
  position: relative; cursor: pointer; transition: background var(--motion-fast);
}
.switch-field input::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--color-subtext); transition: transform var(--motion-fast), background var(--motion-fast);
}
.switch-field input:checked { background: var(--color-action); border-color: var(--color-action); }
.switch-field input:checked::after { transform: translateX(18px); background: var(--color-on-action); }

.progress { height: 5px; background: var(--color-surface-muted); border-radius: 9px; overflow: hidden; margin: 12px 0 10px; }
.progress span { display: block; height: 100%; width: 0; background: var(--color-primary); border-radius: 9px; transition: width .2s ease; }
.caption { font-size: 12px; color: var(--color-subtext); }
.spinner { width: 26px; height: 26px; border: 2px solid rgb(255 255 255 / 20%); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--color-surface-muted); color: var(--color-subtext); white-space: nowrap; }
.badge svg { width: 13px; height: 13px; }

/* ---------- Topbar & footer ---------- */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 30; height: var(--topbar-height);
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.topbar-wrap { max-width: var(--content-width); height: 100%; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { height: 30px; width: auto; display: block; }
:root[data-theme="dark"] .logo-light, :root:not([data-theme="dark"]) .logo-dark { display: none; }
.brand-text { font-family: var(--font-sans); font-size: 1.3rem; white-space: nowrap; color: var(--color-subtext); line-height: 1; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.topbar-actions .btn { margin-right: 6px; }

.footer { background: var(--color-card); border-top: 1px solid var(--color-border); }
.footer-wrap { max-width: var(--content-width); margin: 0 auto; padding: 22px var(--gutter) calc(22px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; align-items: center; font-size: .9rem; color: var(--color-text); }
.footer a { font-family: var(--font-display); font-weight: 500; color: var(--color-secondary); }
.footer a:hover { text-decoration: underline; }

/* ---------- Home ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 36px; animation: fadeInUp .5s ease; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--color-subtext); margin-bottom: 12px; }
.page-head h1 { font-size: 2.8rem; }
.page-head p.lead { color: var(--color-subtext); max-width: 680px; margin-top: 1.2rem; font-size: 1.05rem; line-height: 1.85; }

.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 32px 24px; }
.album-card { display: block; animation: fadeInUp .5s ease both; transition: transform .2s; }
.album-card:hover { transform: translateY(-5px); }
.album-cover {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius-card); overflow: hidden;
  background: var(--color-surface-muted); border: 1px solid var(--color-border);
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease, opacity .4s ease; }
.album-cover .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--color-subtext); }
.album-cover .placeholder svg { width: 34px; height: 34px; stroke-width: 1.2; }
.album-cover .badge { position: absolute; top: 14px; left: 14px; background: rgb(16 16 16 / 72%); color: #f5f5f5; backdrop-filter: blur(6px); }
.album-card h2 { font-size: 22px; margin: 16px 4px 6px; }
.album-card .meta { font-size: 13px; color: var(--color-subtext); margin: 0 4px; }

.empty-state { text-align: center; padding: 80px 20px; border: 1px dashed var(--color-border); border-radius: var(--radius-card); animation: fadeIn .4s ease; }
.empty-state > svg { width: 38px; height: 38px; margin: 0 auto 16px; color: var(--color-subtext); stroke-width: 1.2; }
.empty-state h2 { font-size: 24px; margin-bottom: 10px; }
.empty-state p { color: var(--color-subtext); max-width: 400px; margin: 0 auto 22px; font-size: 14px; line-height: 1.75; }

/* ---------- Album ---------- */
.album-head { margin-bottom: 26px; animation: fadeInUp .5s ease; }
.album-head .text-link { margin-bottom: 18px; }
.album-head h1 { font-size: 2.8rem; overflow-wrap: anywhere; }
.album-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 12px; color: var(--color-subtext); font-size: 14px; }
.album-meta .sep { opacity: .6; }
.album-by { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 12px; color: var(--color-subtext); font-size: 15px; }
.album-by a { display: inline-flex; white-space: nowrap; align-items: center; gap: 6px; color: var(--color-text); transition: color var(--motion-fast); }
.album-by a:hover { color: var(--color-secondary); }
.album-by a svg { width: 16px; height: 16px; }
.album-by strong { font-weight: 500; }
.album-by a span { color: var(--color-subtext); font-size: 13px; }
.album-desc { color: var(--color-subtext); max-width: 680px; margin-top: 16px; font-size: 1.05rem; line-height: 1.85; white-space: pre-line; }

.toolbar {
  position: sticky; top: var(--topbar-height); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 12px 0; margin-bottom: 18px;
  background: var(--color-bg); border-bottom: 1px solid var(--color-border);
}
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .selection-count { font-size: 14px; color: var(--color-subtext); padding: 0 6px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.tile {
  position: relative; aspect-ratio: 1; border-radius: var(--radius-tile); overflow: hidden;
  background: var(--color-surface-muted); cursor: zoom-in; animation: fadeIn .4s ease both;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .35s ease, transform .35s ease; }
.tile img.loaded { opacity: 1; }
.tile:not(.ready) { animation: fadeIn .4s ease both, pulse 1.6s ease-in-out infinite; }
.tile, .tile img { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.tile-shade {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity var(--motion-fast);
  background: linear-gradient(to bottom, rgb(0 0 0 / 45%), transparent 32%, transparent 62%, rgb(0 0 0 / 60%));
}
.tile-name {
  position: absolute; left: 12px; right: 56px; bottom: 11px; color: #fff; font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0; transition: opacity var(--motion-fast); pointer-events: none;
}
.tile-actions { position: absolute; right: 8px; bottom: 6px; display: flex; gap: 2px; opacity: 0; transition: opacity var(--motion-fast); }
.tile-actions .icon-button, .tile-check { color: #fff; width: 38px; height: 38px; }
.tile-actions .icon-button:hover { background: rgb(255 255 255 / 18%); color: #fff; }
.tile-actions svg { width: 18px; height: 18px; }
.tile-check {
  position: absolute; top: 8px; left: 8px; display: grid; place-items: center;
  background: none; border: 0; padding: 0; opacity: 0; transition: opacity var(--motion-fast);
}
.tile-check span {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; display: grid; place-items: center;
  background: rgb(0 0 0 / 20%); transition: background var(--motion-fast);
}
.tile-check svg { width: 14px; height: 14px; stroke-width: 2.6; opacity: 0; color: #101010; }
.tile-cover-badge { position: absolute; top: 10px; right: 10px; background: rgb(16 16 16 / 72%); color: #f5f5f5; }
@media (hover: hover) {
  .tile:hover .tile-shade, .tile:hover .tile-name, .tile:hover .tile-actions, .tile:hover .tile-check { opacity: 1; }
}
.selecting .tile { cursor: pointer; }
.selecting .tile-check, .selecting .tile-shade { opacity: 1; }
.selecting .tile-shade { background: linear-gradient(to bottom, rgb(0 0 0 / 35%), transparent 30%); }
.selecting .tile-actions, .selecting .tile-name { display: none; }
.tile.selected img { transform: scale(.9); border-radius: 10px; }
.tile.selected { background: color-mix(in srgb, var(--color-primary) 22%, var(--color-surface-muted)); }
.tile.selected .tile-check span { background: #fff; }
.tile.selected .tile-check svg { opacity: 1; }

/* Menu della foto (admin) */
.menu {
  position: fixed; z-index: 45; min-width: 220px; padding: 6px;
  background: var(--color-card); border: 1px solid var(--color-border); border-radius: 18px;
  box-shadow: 0 18px 40px rgb(0 0 0 / 28%); animation: fadeIn .12s ease;
}
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 14px; border: 0; border-radius: 12px; background: none; text-align: left; font-size: 14px; }
.menu button:hover { background: var(--color-hover); }
.menu button.danger { color: var(--color-danger); }
.menu svg { width: 17px; height: 17px; }

/* ---------- Login ---------- */
.login { max-width: 420px; margin: 4vh auto 0; animation: fadeInUp .5s ease; }
.login h1 { font-size: 38px; margin-bottom: 12px; }
.login .lead { color: var(--color-subtext); margin-bottom: 32px; line-height: 1.75; }
.login .btn { width: 100%; margin-top: 6px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 80; background: #0a0a0a; color: #f5f5f5;
  display: flex; flex-direction: column; animation: fadeIn .18s ease; touch-action: none;
}
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px 22px; position: relative; z-index: 2; }
.lb-info { min-width: 0; display: flex; flex-direction: column; }
.lb-info strong { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-info span { font-size: 12px; color: #a3a3a3; }
.lb-actions { display: flex; gap: 4px; }
.lightbox .icon-button { color: #e5e5e5; }
.lightbox .icon-button:hover { background: rgb(255 255 255 / 12%); color: #fff; }
.lb-stage { flex: 1; position: relative; display: grid; place-items: center; overflow: hidden; padding: 0 72px 24px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; transition: opacity .2s ease; will-change: transform; }
.lb-stage img.swiping { transition: none; }
.lb-stage .spinner { position: absolute; }
.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgb(255 255 255 / 8%); color: #fff; transition: background var(--motion-fast);
}
.lb-nav:hover { background: rgb(255 255 255 / 18%); }
.lb-nav:disabled { opacity: 0; pointer-events: none; }
.lb-prev { left: 12px; } .lb-next { right: 12px; }
.lb-nav svg { width: 24px; height: 24px; }

/* ---------- Dialog ---------- */
dialog {
  background: var(--color-card); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius-card);
  padding: 26px; width: min(520px, calc(100% - 32px)); max-height: 88dvh; overflow: auto;
}
dialog::backdrop { background: var(--color-overlay); }
dialog[open] { animation: fadeInUp .2s ease; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.dialog-heading h2 { font-size: 26px; }
.dialog-description { color: var(--color-subtext); font-size: 14px; line-height: 1.75; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 24px; }
.dialog-actions .btn-left { margin-right: auto; }

/* ---------- Upload, drop, toast ---------- */
.upload-panel {
  position: fixed; right: 24px; bottom: 24px; z-index: 70; width: min(360px, calc(100% - 32px));
  background: var(--color-card); border: 1px solid var(--color-control-border); border-radius: 20px; padding: 16px 18px;
  box-shadow: 0 18px 40px rgb(0 0 0 / 25%); animation: fadeInUp .2s ease;
}
.upload-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 30px; }
.upload-head strong { font-weight: 500; font-size: 14px; }
.upload-head .icon-button { width: 32px; height: 32px; margin: -6px -8px -6px 0; }
.upload-errors { margin: 8px 0 0; padding: 0; list-style: none; max-height: 110px; overflow: auto; font-size: 12px; color: var(--color-danger); }
.upload-errors li + li { margin-top: 4px; }
.drop-overlay {
  position: fixed; inset: 0; z-index: 75; display: grid; place-items: center; pointer-events: none;
  background: var(--color-overlay); padding: 24px;
}
.drop-overlay > div {
  width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 14px;
  border: 2px dashed #f5f5f5; border-radius: var(--radius-card); color: #f5f5f5; font-family: var(--font-display); font-size: 24px;
}
.drop-overlay svg { width: 44px; height: 44px; stroke-width: 1.3; }
.toast {
  position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 85;
  background: var(--color-card); color: var(--color-text); border: 1px solid var(--color-control-border);
  padding: 12px 20px; border-radius: var(--radius-control); font-size: 14px; max-width: calc(100% - 32px); text-align: center;
  animation: fadeInUp .2s ease;
}

.notice { padding: 40px 0; color: var(--color-subtext); }
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px; }
.skeleton-grid div { aspect-ratio: 4 / 3; border-radius: var(--radius-card); background: var(--color-surface-muted); animation: pulse 1.5s ease-in-out infinite; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  :root { --gutter: 20px; --topbar-height: 64px; }
  #main { padding-top: calc(var(--topbar-height) + 28px); }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 28px 18px; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .lb-stage { padding: 0 0 12px; }
  .lb-nav { display: none; }
}
@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .brand-text { font-size: 1rem; }
  .topbar:has(#new-album:not([hidden])) .brand-text { display: none; }
  .page-head h1, .album-head h1 { font-size: 1.8rem; }
  .page-head p.lead, .album-desc { font-size: .95rem; }
  .brand-logo { height: 24px; }
  #new-album span { display: none; }
  #new-album { width: 42px; padding: 0; margin-right: 0; }
  .page-head { flex-direction: column; align-items: flex-start; margin-bottom: 26px; }
  .album-grid { grid-template-columns: 1fr; }
  .album-card h2 { font-size: 20px; }
  .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .tile { border-radius: 6px; }
  .tile-check { top: 2px; left: 2px; }
  .tile-check span { width: 22px; height: 22px; }
  .toolbar { gap: 8px; }
  .toolbar .btn { padding: 7px 13px; }
  .toolbar .btn .hide-sm { display: none; }
  .upload-panel { right: 16px; bottom: 16px; }
  dialog { padding: 22px 20px; }
  .dialog-actions .btn { flex: 1; }
  .dialog-actions .btn-left { flex-basis: 100%; order: 3; margin: 0; }
  .footer-wrap { flex-direction: column; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
