/* ECARBOXES — Dark Tech
   Design tokens per brief: slate-blue surfaces, electric blue / neon violet
   accents, emerald success. Inter for UI, JetBrains Mono for data.
   Desktop-first 3-column dashboard (sidebar / explorer / metadata). */

:root {
  --bg: #0b0f19;
  --surface: #161b26;
  --surface-2: #1f293d;
  --border: #242c3d;
  --text: #f3f4f6;
  --text-2: #9ca3af;
  --accent: #8b5cf6;
  --accent-2: #3b82f6;
  --success: #10b981;
  --danger: #ef4444;
  --teal: #14b8a6;
  --amber: #f59e0b;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo,
    Consolas, monospace;
  --radius: 12px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--text); }

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: rgba(139, 92, 246, 0.35); color: var(--text); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
}
.skip-link:focus { left: 8px; }

/* ============ Layout shell ============ */

.sidebar {
  width: 240px;
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--border);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.meta-panel {
  width: 300px;
  flex: 0 0 300px;
  background: var(--bg);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: none;
}
.meta-panel.open { display: block; }

/* ============ Sidebar ============ */

.sidebar-top {
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}
.brand-sub { color: var(--text-2); font-weight: 500; font-size: 12px; }

.workspace {
  margin-top: 14px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
  cursor: pointer;
}
.workspace:hover { border-color: var(--accent-2); }

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 13.5px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.sidebar-nav a svg { flex: 0 0 auto; }
.sidebar-nav a:hover { background: var(--surface); color: var(--text); }
.sidebar-nav a.active {
  background: rgba(139, 92, 246, 0.14);
  color: var(--text);
}
.sidebar-nav a.active svg { color: var(--accent); }
.sidebar-nav .nav-sep { height: 1px; background: var(--border); margin: 8px 6px; }

.sidebar-bottom {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
}
.storage-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 8px;
}
.storage-label b { color: var(--text); font-weight: 600; }
.storage-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.storage-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}
.upgrade-badge {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  border-radius: 999px;
  padding: 4px 10px;
}
.lang-switch {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-1);
}
.lang-switch button {
  flex: 1;
  padding: 5px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-2);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.lang-switch button:hover { color: var(--text); }
.lang-switch button.active {
  color: #fff;
  background: var(--accent-2);
}
.lang-sep {
  width: 1px;
  align-self: stretch;
  background: var(--border);
}

/* ============ Main header ============ */

.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.breadcrumbs a:hover { color: var(--text); }
.breadcrumbs .crumb-sep { color: var(--border); }
.breadcrumbs .crumb-cur {
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
}

.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap svg {
  position: absolute;
  left: 10px;
  color: var(--text-2);
  pointer-events: none;
}
.search-wrap input {
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 8px 12px 8px 34px;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.search-wrap input::placeholder { color: var(--text-2); }
.search-wrap input:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.search-kbd {
  position: absolute;
  right: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  pointer-events: none;
}

/* ============ Action bar ============ */

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.action-left { display: flex; align-items: center; gap: 10px; }
.action-right { display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.btn svg { color: var(--text-2); }
.btn:hover svg { color: var(--text); }

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #fff;
  font-weight: 600;
}
.btn.primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.45);
}
.btn.primary svg { color: #fff; }

.btn.icon {
  padding: 8px;
}
.btn.icon.active {
  background: var(--surface-2);
  border-color: var(--accent-2);
  color: var(--accent);
}
.btn.icon.active svg { color: var(--accent); }

.btn.danger { color: var(--danger); border-color: var(--border); }
.btn.danger:hover { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }
.btn.danger svg { color: var(--danger); }

.btn.teal { color: var(--teal); border-color: var(--border); }
.btn.teal:hover { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.15); }
.btn.teal svg { color: var(--teal); }

.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }

select.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
  cursor: pointer;
}
select.sort-select:hover { border-color: var(--accent-2); }

/* ============ Explorer content ============ */

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.explorer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.explorer-head h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.explorer-head .count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
}

/* Grid view */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.file-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease),
    transform 0.15s var(--ease);
}
.file-card:hover {
  background: var(--surface-2);
  border-color: var(--accent-2);
  transform: translateY(-1px);
}
.file-card .file-icon { margin-bottom: 12px; }
.file-card .file-name {
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
  line-height: 1.35;
}
.file-card .file-meta {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.file-card .file-plate {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--accent-2);
  font-family: var(--mono);
}

/* List view */
.file-list { display: flex; flex-direction: column; gap: 2px; }
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s var(--ease);
}
.file-row:hover { background: var(--surface-2); }
.file-row .file-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-row .file-plate {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-2);
  min-width: 110px;
}
.file-row .file-meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  min-width: 120px;
  text-align: right;
}

/* File type icon (rounded tile with extension) */
.file-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.file-icon.t-bin { color: #a78bfa; background: rgba(139, 92, 246, 0.12); border-color: rgba(139, 92, 246, 0.3); }
.file-icon.t-hex { color: #60a5fa; background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.3); }
.file-icon.t-json { color: #fbbf24; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); }
.file-icon.t-img { color: #34d399; background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); }
.file-icon.t-zip { color: #f472b6; background: rgba(236, 72, 153, 0.12); border-color: rgba(236, 72, 153, 0.3); }
.file-icon.t-code { color: #38bdf8; background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.3); }
.file-icon.t-other { color: var(--text-2); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
}
.empty-state svg { color: var(--border); margin-bottom: 12px; }
.empty-state h2 { font-size: 15px; color: var(--text); margin: 0 0 6px; }
.empty-state p { font-size: 13px; margin: 0; }

/* ============ Generic content pages ============ */

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.page-head h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.page-head .kicker {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  margin: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}

/* Vehicle rows */
.v-list { display: flex; flex-direction: column; gap: 2px; }
.v-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.v-row:hover { background: var(--surface-2); border-color: var(--border); }
.v-row .v-plate {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  min-width: 130px;
}
.v-row .v-name { flex: 1; font-size: 13.5px; font-weight: 500; }
.v-row .v-count { font-family: var(--mono); font-size: 12px; color: var(--text-2); }

/* Facts grid (metadata) */
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.facts > div { background: var(--surface); padding: 12px 14px; }
.facts dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: 4px;
}
.facts dd { margin: 0; font-size: 13.5px; word-break: break-word; }
.mono-sm { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); word-break: break-all; }

/* Tags */
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.tag {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent-2);
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 6px;
  padding: 2px 8px;
}

/* Forms */
.form { max-width: 640px; }
.form .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px 18px;
}
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  padding: 9px 12px;
  font-family: inherit;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.field input[type="file"] { padding: 7px; }
.field .hint { display: block; font-size: 12px; color: var(--text-2); margin-top: 4px; }
.field .error { display: block; font-size: 12px; color: var(--danger); margin-top: 4px; }
.errors { color: var(--danger); border: 1px solid var(--danger); border-radius: 8px; padding: 10px 14px; }

.form-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Drop zone (upload) */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
  margin-bottom: 16px;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.06);
  color: var(--text);
}
.dropzone svg { margin-bottom: 8px; color: var(--accent); }
.dropzone b { color: var(--text); }

/* ============ Metadata panel ============ */

.meta-panel-inner { padding: 16px; }
.meta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.meta-head h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin: 0;
}
.meta-close {
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}
.meta-close:hover { color: var(--text); background: var(--surface-2); }

.meta-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.meta-preview .file-icon { width: 56px; height: 56px; font-size: 13px; border-radius: 14px; }
.meta-preview .preview-name {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
  word-break: break-all;
  text-align: center;
}
.meta-preview pre {
  width: 100%;
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
  background: var(--bg);
  border-radius: 8px;
  padding: 10px;
  overflow: auto;
  max-height: 180px;
  white-space: pre-wrap;
  word-break: break-all;
}

.meta-list { margin-bottom: 16px; }
.meta-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.meta-item:last-child { border-bottom: none; }
.meta-item dt { color: var(--text-2); }
.meta-item dd {
  margin: 0;
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}
.meta-actions { display: flex; flex-direction: column; gap: 8px; }
.meta-actions .btn { justify-content: center; }

/* ============ Drag & drop overlay ============ */

.dnd-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(11, 15, 25, 0.82);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
}
.dnd-overlay.show { display: flex; }
.dnd-overlay .dnd-box {
  border: 2px dashed var(--accent);
  border-radius: 16px;
  padding: 48px 64px;
  text-align: center;
  color: var(--text);
  background: rgba(139, 92, 246, 0.08);
}
.dnd-overlay .dnd-box svg { color: var(--accent); margin-bottom: 12px; }
.dnd-overlay .dnd-box p { margin: 0; font-size: 16px; font-weight: 600; }
.dnd-overlay .dnd-box small { color: var(--text-2); font-family: var(--mono); }

/* ============ Upload progress bar ============ */

.upload-progress {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 3px;
  background: var(--surface-2);
  display: none;
}
.upload-progress.show { display: block; }
.upload-progress > span {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent), var(--success), var(--accent-2));
  background-size: 300% 100%;
  animation: upload-slide 1.2s linear infinite;
}
@keyframes upload-slide {
  0% { margin-left: -40%; }
  100% { margin-left: 100%; }
}

/* ============ Messages / toast ============ */

.messages { margin-bottom: 16px; }
.msg {
  background: var(--surface);
  border: 1px solid var(--success);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--success);
}
.msg.error { border-color: var(--danger); color: var(--danger); }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  z-index: 99;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ Archives ============ */

.archive-year { margin-bottom: 24px; }
.archive-year h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin: 0 0 10px;
}

/* ============ Responsive ============ */

@media (max-width: 1100px) {
  .sidebar { width: 64px; flex: 0 0 64px; }
  .sidebar-top { padding: 12px 10px; }
  .brand { justify-content: center; }
  .brand-name, .brand-sub, .workspace, .sidebar-nav a span, .storage-label, .storage-bar, .upgrade-badge { display: none; }
  .sidebar-nav a { justify-content: center; padding: 10px; }
  .sidebar-bottom { padding: 12px 10px; }
  .lang-switch { display: flex; flex-direction: column; margin-top: 0; width: 44px; }
  .lang-switch button { padding: 4px 0; }
  .lang-sep { width: auto; height: 1px; align-self: stretch; }
  .meta-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 80;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.4);
    transform: translateX(100%);
    transition: transform 0.2s var(--ease);
  }
  .meta-panel.open { transform: translateX(0); }
}

@media (max-width: 720px) {
  body { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .sidebar-top { border-bottom: none; padding: 8px 12px; }
  .sidebar-nav { flex-direction: row; padding: 4px 8px; gap: 4px; }
  .sidebar-nav a { padding: 8px; }
  .sidebar-bottom { display: none; }
  .lang-switch { display: flex; margin: 0 12px 0 auto; flex: 0 0 auto; width: auto; }
  .main-header { flex-direction: column; align-items: stretch; gap: 10px; }
  .search-wrap input { width: 100%; }
  .search-kbd { display: none; }
  .action-bar { flex-direction: column; align-items: stretch; }
  .main-content { padding: 14px; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
