/* VCTCrypt web edition — Material Design 3 shell.
   Palette is derived from a single accent seed with color-mix(). */

:root {
  --seed: #4a148c;
  --radius-xs: 4px;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --ease-emph: cubic-bezier(.2, 0, 0, 1.2);
  --rail-w: 88px;
  --topbar-h: 72px;
  --bottom-nav-h: 80px;
}

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --md-primary: var(--seed);
  --md-on-primary: #fff;
  --md-primary-container: color-mix(in srgb, var(--seed) 16%, #fff);
  --md-on-primary-container: color-mix(in srgb, var(--seed) 72%, #000);
  --md-secondary-container: color-mix(in srgb, var(--seed) 22%, #fff);
  --md-on-secondary-container: color-mix(in srgb, var(--seed) 74%, #000);
  --md-surface: color-mix(in srgb, var(--seed) 3%, #fef7ff);
  --md-surface-container-low: color-mix(in srgb, var(--seed) 5%, #f8f2fa);
  --md-surface-container: color-mix(in srgb, var(--seed) 7%, #f3edf7);
  --md-surface-container-high: color-mix(in srgb, var(--seed) 9%, #ece6f0);
  --md-surface-container-highest: color-mix(in srgb, var(--seed) 11%, #e6e0e9);
  --md-on-surface: #1d1b20;
  --md-on-surface-variant: #49454f;
  --md-outline: #79747e;
  --md-outline-variant: color-mix(in srgb, var(--seed) 14%, #cac4d0);
  --md-error: #b3261e;
  --md-error-container: #f9dedc;
  --md-on-error-container: #410e0b;
  --md-success: #2e6b3e;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .16), 0 1px 3px 1px rgba(0, 0, 0, .08);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, .16), 0 2px 6px 2px rgba(0, 0, 0, .1);
  --shadow-3: 0 4px 8px 3px rgba(0, 0, 0, .1), 0 1px 3px rgba(0, 0, 0, .16);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --md-primary: color-mix(in srgb, var(--seed) 48%, #fff);
  --md-on-primary: color-mix(in srgb, var(--seed) 66%, #000);
  --md-primary-container: color-mix(in srgb, var(--seed) 55%, #000);
  --md-on-primary-container: color-mix(in srgb, var(--seed) 22%, #fff);
  --md-secondary-container: color-mix(in srgb, var(--seed) 34%, #1d1b20);
  --md-on-secondary-container: color-mix(in srgb, var(--seed) 20%, #fff);
  --md-surface: color-mix(in srgb, var(--seed) 5%, #141218);
  --md-surface-container-low: color-mix(in srgb, var(--seed) 8%, #1d1b20);
  --md-surface-container: color-mix(in srgb, var(--seed) 11%, #211f26);
  --md-surface-container-high: color-mix(in srgb, var(--seed) 14%, #2b2930);
  --md-surface-container-highest: color-mix(in srgb, var(--seed) 17%, #36343b);
  --md-on-surface: #e6e0e9;
  --md-on-surface-variant: #cac4d0;
  --md-outline: #938f99;
  --md-outline-variant: color-mix(in srgb, var(--seed) 16%, #49454f);
  --md-error: #f2b8b5;
  --md-error-container: #8c1d18;
  --md-on-error-container: #f9dedc;
  --md-success: #8ad69c;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .55);
  --shadow-3: 0 6px 14px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--md-surface);
  color: var(--md-on-surface);
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: currentColor; flex: 0 0 auto; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100dvh; }

.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail-w); z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 12px 0 10px;
  background: var(--md-surface-container-low);
  border-right: 1px solid var(--md-outline-variant);
}
.rail-brand { width: 48px; height: 48px; display: grid; place-items: center; margin: 4px 0 10px; }
.rail-brand img { width: 34px; height: 34px; }
.rail-nav { display: flex; flex-direction: column; gap: 4px; width: 100%; align-items: center; }
.rail-item {
  width: 100%; padding: 0; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--md-on-surface-variant); font-size: 11px; font-weight: 600;
}
.rail-icon {
  width: 64px; height: 32px; display: grid; place-items: center; border-radius: var(--radius-full);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.rail-item:hover .rail-icon { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
.rail-item:active .rail-icon { background: color-mix(in srgb, var(--md-on-surface) 12%, transparent); }
.rail-item.active { color: var(--md-on-surface); }
.rail-item.active .rail-icon { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.rail-label { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-foot { margin-top: auto; padding-bottom: 6px; }
.version-chip {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-full);
  background: var(--md-surface-container-high); color: var(--md-on-surface-variant);
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
}

.main { flex: 1; min-width: 0; margin-left: var(--rail-w); display: flex; flex-direction: column; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 clamp(16px, 3vw, 32px);
  background: var(--md-surface);
  border-bottom: 1px solid transparent;
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease), background-color .25s var(--ease);
}
.topbar.scrolled { background: var(--md-surface-container-low); border-color: var(--md-outline-variant); box-shadow: var(--shadow-1); }
.topbar-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-logo { width: 32px; height: 32px; }
.topbar-title h1 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.topbar-title p { font-size: 12px; color: var(--md-on-surface-variant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.local-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: var(--radius-full); background: var(--md-primary-container); color: var(--md-on-primary-container);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.local-badge svg { width: 14px; height: 14px; }
.icon-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--md-on-surface-variant); cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .3s var(--ease);
}
.icon-btn:hover { background: color-mix(in srgb, var(--md-on-surface) 8%, transparent); }
.icon-btn:active { transform: scale(.94); }
.lang-select {
  height: 36px; padding: 0 30px 0 12px; border-radius: var(--radius-s);
  border: 1px solid var(--md-outline); background: transparent; color: var(--md-on-surface);
  font-size: 13px; font-weight: 600; cursor: pointer; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}

/* ---------- content ---------- */
.content {
  flex: 1; width: 100%; max-width: 920px; margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 32px) 48px;
}
.page { display: none; animation: pageIn .35s var(--ease) both; }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.page-head { margin-bottom: 20px; }
.page-head h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 700; letter-spacing: -.02em; }
.page-head p { margin-top: 6px; color: var(--md-on-surface-variant); font-size: 13.5px; line-height: 1.65; max-width: 70ch; }

/* ---------- cards ---------- */
.card {
  padding: 20px; margin-bottom: 16px;
  border-radius: var(--radius-l);
  background: var(--md-surface-container-low);
  border: 1px solid var(--md-outline-variant);
}
.card + .card { margin-top: 0; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-gap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- dropzone ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 28px 20px; border-radius: var(--radius-m);
  border: 1.5px dashed var(--md-outline);
  background: color-mix(in srgb, var(--md-primary) 4%, transparent);
  text-align: center; cursor: pointer; outline: none;
  transition: border-color .2s var(--ease), background-color .2s var(--ease), transform .2s var(--ease);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--md-primary); background: color-mix(in srgb, var(--md-primary) 9%, transparent); }
.dropzone.dragover { border-color: var(--md-primary); background: color-mix(in srgb, var(--md-primary) 16%, transparent); transform: scale(1.005); }
.dropzone.dragover .dz-icon { transform: translateY(-4px); }
.dz-icon { width: 36px; height: 36px; color: var(--md-primary); transition: transform .3s var(--ease); }
.dz-icon.small { width: 24px; height: 24px; }
.dz-title { font-size: 15px; font-weight: 600; margin-top: 4px; }
.dz-hint { font-size: 12px; color: var(--md-on-surface-variant); }
.dropzone .btn { margin-top: 10px; }
.dz-compact { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; cursor: pointer; border-radius: var(--radius-m); transition: background-color .2s var(--ease); }
.dz-compact.dragover { background: color-mix(in srgb, var(--md-primary) 12%, transparent); }
.dz-compact-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.dz-compact-main p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- file / result lists ---------- */
.file-list, .results { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.file-row, .result-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: var(--radius-s); background: var(--md-surface-container);
  animation: rowIn .3s var(--ease) both;
}
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.file-row .meta, .result-row .meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-row .name, .result-row .name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .size, .result-row .sub { font-size: 11.5px; color: var(--md-on-surface-variant); overflow: hidden; text-overflow: ellipsis; }
.result-row.error .name { color: var(--md-error); }
.result-row.error { background: color-mix(in srgb, var(--md-error) 10%, var(--md-surface-container)); }
.results .all-download { align-self: flex-start; }

/* ---------- fields ---------- */
.field { position: relative; display: block; flex: 1; min-width: 0; }
.field.grow { flex: 1 1 240px; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--md-on-surface-variant); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-s);
  border: 1px solid var(--md-outline); background: var(--md-surface-container-lowest, var(--md-surface));
  color: var(--md-on-surface); font-size: 14px; outline: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.field input:focus, .field textarea:focus {
  border-color: var(--md-primary);
  box-shadow: inset 0 0 0 1px var(--md-primary);
}
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--md-on-surface-variant) 75%, transparent); }
.field input[type="password"] { padding-right: 62px; }
.field textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.field-trail {
  position: absolute; right: 6px; bottom: 6px; height: 30px; padding: 0 10px;
  border: 0; border-radius: var(--radius-s); background: transparent;
  color: var(--md-primary); font-size: 12px; font-weight: 700; cursor: pointer;
}
.field-trail:hover { background: color-mix(in srgb, var(--md-primary) 10%, transparent); }
.field-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.helper { margin-top: 10px; font-size: 12px; line-height: 1.6; color: var(--md-on-surface-variant); }
.helper.error { color: var(--md-error); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 20px; border: 1px solid transparent; border-radius: var(--radius-full);
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease), transform .12s var(--ease);
}
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(.97); }
.btn.filled { background: var(--md-primary); color: var(--md-on-primary); }
.btn.filled:hover:not(:disabled) { box-shadow: var(--shadow-2); background: color-mix(in srgb, var(--md-primary) 90%, var(--md-on-surface)); }
.btn.tonal { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.btn.tonal:hover:not(:disabled) { box-shadow: var(--shadow-1); }
.btn.outlined { border-color: var(--md-outline); color: var(--md-primary); background: transparent; }
.btn.outlined:hover:not(:disabled) { background: color-mix(in srgb, var(--md-primary) 8%, transparent); }
.btn.text { padding: 0 14px; color: var(--md-primary); background: transparent; }
.btn.text:hover:not(:disabled) { background: color-mix(in srgb, var(--md-primary) 8%, transparent); }
.btn.danger { border-color: var(--md-error); color: var(--md-error); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--md-error) 8%, transparent); }
.actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.actions .btn.filled { min-height: 48px; padding: 0 26px; font-size: 15px; }

/* ---------- chips / segmented / swatches ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
  height: 34px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--md-outline); border-radius: var(--radius-s);
  background: transparent; color: var(--md-on-surface-variant);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.chip:hover { background: color-mix(in srgb, var(--md-on-surface) 6%, transparent); }
.chip.selected {
  background: var(--md-secondary-container); border-color: transparent; color: var(--md-on-secondary-container);
  padding-left: 10px;
}
.chip.selected::before { content: "✓"; font-size: 13px; }

.segmented {
  display: inline-flex; padding: 3px; margin-bottom: 16px;
  border: 1px solid var(--md-outline); border-radius: var(--radius-full); background: transparent;
}
.seg {
  min-height: 36px; padding: 0 18px; border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--md-on-surface-variant); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.seg:hover { background: color-mix(in srgb, var(--md-on-surface) 6%, transparent); }
.seg.active { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.segmented.algo { margin: 10px 0 0; width: 100%; justify-content: space-between; }
.segmented.algo .seg { flex: 1; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.swatch {
  width: 44px; height: 44px; border-radius: var(--radius-full); border: 2px solid var(--md-outline-variant);
  cursor: pointer; display: grid; place-items: center; color: #fff; padding: 0;
  transition: transform .2s var(--ease), border-color .2s var(--ease);
}
.swatch:hover { transform: scale(1.06); }
.swatch.selected { border-color: var(--md-on-surface); }
.swatch svg { width: 18px; height: 18px; }

/* ---------- strength ---------- */
.strength { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.strength-track { flex: 1; height: 6px; border-radius: var(--radius-full); background: var(--md-surface-container-highest); overflow: hidden; }
.strength-track i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--md-error); transition: width .3s var(--ease), background-color .3s var(--ease); }
.strength span { font-size: 12px; font-weight: 700; color: var(--md-on-surface-variant); min-width: 3em; text-align: right; }
.strength.s1 i { width: 25%; background: var(--md-error); }
.strength.s2 i { width: 50%; background: #b26a00; }
.strength.s3 i { width: 75%; background: #3d6b00; }
.strength.s4 i { width: 100%; background: var(--md-success); }

/* ---------- progress / status ---------- */
.progress { margin: 8px 0 4px; }
.progress-track { height: 4px; border-radius: var(--radius-full); background: var(--md-surface-container-highest); overflow: hidden; position: relative; }
.progress-track i { position: absolute; inset: 0 auto 0 0; width: 40%; border-radius: inherit; background: var(--md-primary); animation: indeterminate 1.4s var(--ease) infinite; }
@keyframes indeterminate { 0% { left: -40%; width: 40%; } 60% { left: 100%; width: 60%; } 100% { left: 100%; width: 40%; } }
.status { font-size: 13px; color: var(--md-on-surface-variant); margin: 4px 0 12px; }
.status.error { color: var(--md-error); }

/* ---------- hash ---------- */
.hash-value {
  margin-top: 8px; padding: 12px 14px; border-radius: var(--radius-s);
  background: var(--md-surface-container); color: var(--md-on-surface);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12.5px; line-height: 1.7; word-break: break-all;
}
.compare-note { margin-top: 10px; font-size: 12.5px; font-weight: 600; }
.compare-note.ok { color: var(--md-success); }
.compare-note.bad { color: var(--md-error); }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.stat { padding: 14px; border-radius: var(--radius-m); background: var(--md-surface-container); }
.stat b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.stat span { font-size: 11.5px; color: var(--md-on-surface-variant); }
.about-text { margin-top: 8px; font-size: 13px; line-height: 1.75; color: var(--md-on-surface-variant); }
.links { margin-top: 12px; }
.footer-note { margin-top: 8px; text-align: center; font-size: 11.5px; color: var(--md-on-surface-variant); display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }

/* ---------- note result ---------- */
.note-result textarea { margin-top: 10px; min-height: 220px; }
.note-result .row-between { flex-wrap: wrap; }

/* ---------- dialog ---------- */
.dialog-scrim {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, .42);
  animation: fadeIn .2s var(--ease) both;
}
.dialog {
  width: min(440px, 100%); padding: 24px; border-radius: var(--radius-xl);
  background: var(--md-surface-container-high); color: var(--md-on-surface);
  box-shadow: var(--shadow-3); animation: dialogIn .28s var(--ease) both;
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes dialogIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-head h3 { font-size: 18px; font-weight: 700; }
.gen-preview { margin: 14px 0 18px; padding: 14px; border-radius: var(--radius-m); background: var(--md-surface-container); }
.gen-value { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; word-break: break-all; color: var(--md-primary); min-height: 1.6em; }
.gen-preview .helper { margin-top: 4px; }
.slider-row { display: flex; align-items: center; justify-content: space-between; }
.slider-row .field-label { margin: 0; }
.range-value { font-size: 13px; font-weight: 700; }
input[type="range"] { width: 100%; margin: 10px 0 4px; accent-color: var(--md-primary); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bottom-nav-h) + 16px); z-index: 100;
  transform: translate(-50%, 12px); max-width: min(420px, calc(100vw - 32px));
  padding: 12px 18px; border-radius: var(--radius-s);
  background: var(--md-surface-container-highest); color: var(--md-on-surface);
  box-shadow: var(--shadow-2); font-size: 13px; opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; inset: auto 0 0 0; z-index: 40; display: none;
  height: var(--bottom-nav-h); padding: 10px 6px max(8px, env(safe-area-inset-bottom));
  background: var(--md-surface-container);
  border-top: 1px solid var(--md-outline-variant);
}
.bn-item {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--md-on-surface-variant); font-size: 11px; font-weight: 600;
}
.bn-icon {
  width: 56px; height: 30px; display: grid; place-items: center; border-radius: var(--radius-full);
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.bn-item.active { color: var(--md-on-surface); }
.bn-item.active .bn-icon { background: var(--md-secondary-container); color: var(--md-on-secondary-container); }
.bn-item:active .bn-icon { background: color-mix(in srgb, var(--md-on-surface) 12%, transparent); }

/* ---------- responsive ---------- */
@media (max-width: 899px) {
  .rail { display: none; }
  .main { margin-left: 0; padding-bottom: var(--bottom-nav-h); }
  .bottom-nav { display: flex; }
  .local-badge { display: none; }
  .topbar { height: 64px; }
  .content { padding: 18px 16px 32px; }
  .card { padding: 16px; }
  .actions .btn.filled { flex: 1; }
  .dialog-actions .btn { flex: 1; }
}
@media (max-width: 520px) {
  .topbar-title p { display: none; }
  .lang-select { width: 92px; }
  .field-row .btn.outlined { flex: 1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
