/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
  font-size: var(--fs-md);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  text-align: center;
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}
.btn:disabled {
  opacity: 0.45;
}
.btn.primary {
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: var(--shadow-1);
}
.btn.primary:hover:not(:disabled) {
  background: var(--primary-hover);
}
.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
}
.btn.ghost:hover:not(:disabled) {
  background: var(--surface-2);
}
.btn.danger {
  background: var(--danger);
  color: #fff;
}
.btn.danger-outline {
  background: transparent;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
}
.btn.block {
  width: 100%;
}
.btn.sm {
  min-height: 36px;
  padding: 6px 14px;
  font-size: var(--fs-sm);
}
.btn .icon {
  width: 18px;
  height: 18px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  flex: none;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.link-btn {
  border: 0;
  background: none;
  color: var(--primary);
  font-weight: 600;
  padding: 12px;
  margin-top: 8px;
}
.row-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}
.stack {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

/* ---------- Schermate di accesso ---------- */
.splash {
  min-height: 100dvh;
  display: grid;
  place-items: center;
}
.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(120% 60% at 50% -10%, var(--primary-soft), transparent 70%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 32px 24px 24px;
  box-shadow: var(--shadow-2);
  text-align: center;
  animation: rise 260ms var(--ease);
}
.auth-card h1 {
  margin-top: 4px;
}
.auth-card .lead {
  font-size: var(--fs-lg);
  color: var(--ink-2);
}
.auth-card .feature-list,
.auth-card .choice-list,
.auth-card .privacy-box,
.auth-card .check,
.auth-card .secret-form {
  text-align: left;
}
.brand-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: var(--shadow-1);
}
.brand-mark .icon {
  width: 28px;
  height: 28px;
}
.brand-mark.lg {
  width: 72px;
  height: 72px;
  border-radius: 22px;
}
.brand-mark.lg .icon {
  width: 36px;
  height: 36px;
}
.app-logo {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 16px;
  filter: drop-shadow(0 6px 14px rgb(10 40 120 / 0.35));
}
.app-logo.lg {
  width: 88px;
  height: 88px;
  border-radius: 20px;
}
.app-logo.xs {
  width: 32px;
  height: 32px;
  margin: 0;
  border-radius: 8px;
  filter: none;
}
.brand-mark.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.steps {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 20px;
}
.steps span {
  width: 28px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  transition: background var(--dur);
}
.steps span.on {
  background: var(--primary);
}
.feature-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 24px;
  display: grid;
  gap: 14px;
}
.feature-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.feature-list li > .icon {
  color: var(--primary);
  margin-top: 2px;
}
.feature-list strong {
  display: block;
}
.feature-list span {
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.choice-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 4px;
}
.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: left;
  transition: border-color var(--dur), background var(--dur);
}
.choice.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.choice .radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  flex: none;
  margin-top: 2px;
}
.choice.selected .radio {
  border: 6px solid var(--primary);
}
.choice-text strong {
  display: flex;
  align-items: center;
  gap: 8px;
}
.choice-text span {
  display: block;
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.badge {
  font-style: normal;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ok);
  background: var(--ok-soft);
  padding: 2px 8px;
  border-radius: 999px;
}

/* ---------- Campi ---------- */
.field {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  border: 0;
  padding: 0;
  min-width: 0;
}
.field > span,
.field > legend {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  padding: 0;
}
.field em {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-3);
}
.field input,
.field select,
.setting-row select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field-error,
.form-error {
  color: var(--danger);
  font-size: var(--fs-sm);
  font-weight: 500;
}
.form-error,
.form-warning {
  margin: 12px 0 0;
}
.form-warning {
  color: var(--warn);
  background: var(--warn-soft);
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
}
.input-with-action {
  position: relative;
}
.input-with-action input {
  padding-right: 52px;
}
.input-with-action .icon-btn {
  position: absolute;
  right: 2px;
  top: 2px;
}
.secret-form {
  margin-top: 16px;
}
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 16px 0 20px;
  font-size: var(--fs-sm);
}
.check input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--primary);
  flex: none;
}
.strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -6px 0 12px;
  font-size: var(--fs-xs);
  color: var(--ink-2);
}
.strength .bars {
  display: flex;
  gap: 4px;
  flex: 1;
}
.strength i {
  height: 4px;
  flex: 1;
  border-radius: 4px;
  background: var(--line);
}
.strength.s1 i:nth-child(-n + 1) {
  background: var(--danger);
}
.strength.s2 i:nth-child(-n + 2) {
  background: var(--accent);
}
.strength.s3 i:nth-child(-n + 3) {
  background: var(--ok);
}
.strength.s4 i {
  background: var(--ok);
}

/* ---------- Tastierino PIN ---------- */
.pin {
  margin-top: 12px;
  outline: none;
}
.pin-label {
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.pin-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 14px 0 22px;
  min-height: 14px;
}
.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  transition: background var(--dur), border-color var(--dur), transform var(--dur);
}
.dot.on {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.08);
}
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 300px;
  margin: 0 auto;
}
.key {
  height: 64px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 1.5rem;
  font-weight: 500;
  display: grid;
  place-items: center;
  transition: background var(--dur), transform 90ms;
}
.key:active:not(:disabled) {
  transform: scale(0.95);
  background: var(--primary-soft);
}
.key.aux {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
}
.key.ok:not(:disabled) {
  background: var(--primary);
  color: var(--primary-ink);
}
.key:disabled {
  opacity: 0.35;
}

/* ---------- Stati di attesa ---------- */
.busy {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px 0;
}
.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 4px solid var(--primary-soft);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.privacy-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  font-size: var(--fs-sm);
  max-height: 46dvh;
  overflow: auto;
  color: var(--ink-2);
}
.privacy-box strong {
  color: var(--ink);
}
.privacy-box.inset {
  margin: 0 16px 16px;
  max-height: none;
}

/* ---------- Struttura dell'app ---------- */
.shell {
  min-height: 100dvh;
}
.sidebar {
  display: none;
}
.main-col {
  min-width: 0;
  padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom) + 16px);
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.content {
  padding: 8px 16px 24px;
}
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding: 0 4px env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--line);
}
.tab {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 0 10px;
  color: var(--ink-3);
  font-size: 0.7rem;
  font-weight: 600;
}
.tab.active {
  color: var(--primary);
}
.tab-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 28px;
  border-radius: 999px;
  transition: background var(--dur);
}
.tab.active .tab-icon {
  background: var(--primary-soft);
}
.tab.camera .tab-icon {
  width: 56px;
  height: 56px;
  margin-top: -22px;
  border-radius: 20px;
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: var(--shadow-2);
}
.tab.camera .tab-icon .icon {
  width: 26px;
  height: 26px;
}
.tab.camera.active .tab-icon {
  background: var(--primary-hover);
}

@media (min-width: 900px) {
  .shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
  }
  .sidebar {
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 14px;
    background: var(--surface);
    border-right: 1px solid var(--line);
  }
  .sidebar nav {
    display: grid;
    gap: 2px;
  }
  .sidebar .lock-btn {
    margin-top: auto;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    font-weight: 700;
    font-size: var(--fs-lg);
  }
  .brand .icon {
    color: var(--primary);
  }
  .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: var(--tap);
    padding: 8px 12px;
    border-radius: var(--r-sm);
    color: var(--ink-2);
    font-weight: 600;
    border: 0;
    background: none;
    text-align: left;
    width: 100%;
    transition: background var(--dur), color var(--dur);
  }
  .nav-item:hover {
    background: var(--surface-2);
    color: var(--ink);
  }
  .nav-item.active {
    background: var(--primary-soft);
    color: var(--primary);
  }
  .topbar,
  .bottom-nav {
    display: none;
  }
  .main-col {
    padding-bottom: 32px;
  }
  .content {
    padding: 32px 40px;
  }
}

/* ---------- Selettore figlio ---------- */
.switcher {
  position: relative;
  min-width: 0;
}
.switcher-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  min-height: var(--tap);
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
}
.sidebar .switcher-btn {
  width: 100%;
  border-radius: var(--r-md);
  padding: 8px;
}
.switcher-text {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}
.switcher-text strong,
.switcher-text small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.switcher-text small {
  color: var(--ink-3);
  font-size: var(--fs-xs);
}
.chev .icon {
  width: 16px;
  height: 16px;
  transform: rotate(90deg);
  color: var(--ink-3);
}
.sidebar .chev {
  margin-left: auto;
}
.switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  min-width: 240px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  animation: rise 160ms var(--ease);
}
.switcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: var(--tap);
  padding: 6px 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  text-align: left;
}
.switcher-item span {
  flex: 1;
}
.switcher-item small {
  color: var(--ink-3);
}
.switcher-item:hover,
.switcher-item.active {
  background: var(--surface-2);
}
.switcher-item > .icon {
  color: var(--primary);
}
.switcher-item.add {
  color: var(--primary);
  font-weight: 600;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--r-sm) var(--r-sm);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  flex: none;
  background: var(--ink-3);
}
.avatar.sm {
  width: 28px;
  height: 28px;
  font-size: var(--fs-sm);
}
.avatar.lg {
  width: 56px;
  height: 56px;
  font-size: 1.4rem;
}
.avatar.empty {
  background: var(--surface-2);
  color: var(--ink-3);
  border: 1px dashed var(--line-strong);
}
.avatar.empty .icon {
  width: 18px;
  height: 18px;
}
.c-ocean { background: var(--p-ocean); }
.c-leaf { background: var(--p-leaf); }
.c-sun { background: var(--p-sun); }
.c-coral { background: var(--p-coral); }
.c-plum { background: var(--p-plum); }
.c-sky { background: var(--p-sky); }

/* ---------- Pagine e card ---------- */
.page {
  max-width: 880px;
  margin: 0 auto;
  animation: rise 220ms var(--ease);
}
.page.narrow {
  max-width: 640px;
}
.eyebrow {
  color: var(--ink-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  margin: 8px 0 2px;
}
.page-title {
  font-size: var(--fs-2xl);
  margin: 4px 0 16px;
}
.section-title {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin: 28px 4px 8px;
}
.danger-text {
  color: var(--danger);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-1);
  margin-bottom: 16px;
}
.card.hero,
.card.pending {
  text-align: center;
  padding: 32px 20px;
}
.hero-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: var(--primary-soft);
  color: var(--primary);
}
.hero-icon .icon {
  width: 30px;
  height: 30px;
}
.hero-icon.soft {
  background: var(--accent-soft);
  color: var(--accent);
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
}
.profile-card > div {
  flex: 1;
  min-width: 0;
}
.profile-card h2 {
  margin: 0;
}
.profile-card p {
  margin: 0;
}
.notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface-2);
}
.notice > .icon {
  color: var(--accent);
  margin-top: 2px;
}
.notice p {
  margin: 4px 0 0;
  font-size: var(--fs-sm);
}
.card.list,
.card.settings-group {
  padding: 4px 0;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.list-row + .list-row {
  border-top: 1px solid var(--line);
}
.list-row strong,
.list-row small {
  display: block;
}
.empty {
  padding: 20px;
  text-align: center;
  color: var(--ink-3);
  margin: 0;
}
.pill {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 999px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  margin: 8px 0 0 -4px;
  min-height: var(--tap);
}
.back-link .icon {
  width: 18px;
  height: 18px;
}
.card.form {
  padding: 24px 20px 20px;
}
.swatches {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.swatch {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: inset 0 0 0 3px var(--surface);
  border: 2px solid transparent;
}
.swatch input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.swatch:has(input:checked) {
  border-color: var(--ink);
}
.swatch:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- Impostazioni ---------- */
.setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 10px 16px;
  border: 0;
  background: none;
  text-align: left;
  color: var(--ink);
}
.setting-row + .setting-row,
.settings-group > * + * {
  border-top: 1px solid var(--line);
}
.setting-row > .icon:first-child {
  color: var(--primary);
}
.setting-row > .icon:last-child {
  color: var(--ink-3);
  width: 18px;
  height: 18px;
}
.setting-row .grow strong,
.setting-row .grow small {
  display: block;
}
.setting-row .grow small {
  font-size: var(--fs-xs);
}
.setting-row select {
  width: auto;
  min-height: 40px;
  padding: 6px 10px;
}
button.setting-row:hover,
a.setting-row:hover {
  background: var(--surface-2);
}
.setting-row.danger,
.setting-row.danger > .icon:first-child {
  color: var(--danger);
}
.icon.rot {
  transform: rotate(90deg);
}
.inline-panel {
  padding: 16px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  margin: 12px 0 16px;
}
.segmented button {
  flex: 1;
  border: 0;
  background: none;
  min-height: 36px;
  border-radius: 999px;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  padding: 4px 10px;
}
.segmented button.on {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-1);
}
.segmented.compact {
  margin: 0;
  flex: none;
}
.storage {
  display: grid;
  gap: 10px;
}
.storage-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--fs-sm);
}
.storage-line .ok {
  color: var(--ok);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.storage-line .ok .icon {
  width: 16px;
  height: 16px;
}
.storage .btn {
  justify-self: start;
}
.meter {
  height: 8px;
  border-radius: 8px;
  background: var(--bg-soft);
  overflow: hidden;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 8px;
  width: 1%;
}
.meter i.w-5 { width: 5%; } .meter i.w-10 { width: 10%; } .meter i.w-15 { width: 15%; } .meter i.w-20 { width: 20%; }
.meter i.w-25 { width: 25%; } .meter i.w-30 { width: 30%; } .meter i.w-35 { width: 35%; } .meter i.w-40 { width: 40%; }
.meter i.w-45 { width: 45%; } .meter i.w-50 { width: 50%; } .meter i.w-55 { width: 55%; } .meter i.w-60 { width: 60%; }
.meter i.w-65 { width: 65%; } .meter i.w-70 { width: 70%; } .meter i.w-75 { width: 75%; } .meter i.w-80 { width: 80%; }
.meter i.w-85 { width: 85%; } .meter i.w-90 { width: 90%; } .meter i.w-95 { width: 95%; } .meter i.w-100 { width: 100%; }
.callout {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  margin: 4px 0 0;
}
.callout.warn {
  background: var(--warn-soft);
  color: var(--ink);
}
.callout.warn > .icon {
  color: var(--warn);
}

/* ---------- Banner, finestre, avvisi ---------- */
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 16px 0;
  padding: 10px 12px 10px 16px;
  border-radius: var(--r-md);
  background: var(--primary-soft);
  color: var(--ink);
  font-size: var(--fs-sm);
}
.banner span {
  flex: 1;
}
.banner > .icon {
  color: var(--primary);
}
@media (min-width: 900px) {
  .banner {
    margin: 20px 40px 0;
  }
}
.scrim {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: end center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: var(--scrim);
  animation: fade 160ms var(--ease);
}
@media (min-width: 600px) {
  .scrim {
    place-items: center;
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.dialog {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: 24px 20px 20px;
  box-shadow: var(--shadow-2);
  animation: rise 200ms var(--ease);
}
.dialog-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 12px;
}
.dialog-icon.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.dialog-body {
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}
.dialog-actions .btn {
  flex: 1;
}
.toast {
  position: fixed;
  z-index: 110;
  left: 50%;
  bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom) + 16px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: var(--fs-sm);
  font-weight: 600;
  box-shadow: var(--shadow-2);
  animation: rise 200ms var(--ease);
}
.toast .icon {
  width: 18px;
  height: 18px;
}
.toast.error {
  background: var(--danger);
  color: #fff;
}
@media (min-width: 900px) {
  .toast {
    bottom: 32px;
  }
}
@media (max-width: 380px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}
