/* SafeBlob — modern tactile skeuomorphic stylesheet (no build step, no external assets) */
:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-top: #ffffff;
  --surface-bottom: #f5f8fc;
  --surface-2: #f4f7fb;
  --surface-3: #e7edf5;
  --text: #182230;
  --text-2: #445368;
  --muted: #66768a;
  --border: #d5dfeb;
  --border-strong: #bfcddd;
  --accent: #0f6cbd;
  --accent-top: #1a7fd8;
  --accent-bottom: #0b5aa3;
  --accent-hover: #0c62b0;
  --accent-soft: #e4f0fe;
  --danger: #c42b1c;
  --danger-top: #d93829;
  --danger-bottom: #a82215;
  --danger-soft: #fdecea;
  --success: #0f7b4f;
  --warning: #b45309;
  --highlight: rgba(255, 255, 255, 0.85);
  --highlight-strong: rgba(255, 255, 255, 0.98);
  --inset-shadow: inset 0 1.5px 3px rgba(15, 29, 48, 0.08), inset 0 0 0 1px rgba(15, 29, 48, 0.025);
  --shadow-xs: 0 1px 2px rgba(16, 34, 56, 0.06), inset 0 1px 0 var(--highlight-strong);
  --shadow-sm: 0 1px 2px rgba(16, 34, 56, 0.06), 0 3px 8px rgba(16, 34, 56, 0.05), inset 0 1px 0 var(--highlight-strong);
  --shadow-md: 0 4px 12px rgba(16, 34, 56, 0.09), 0 8px 20px rgba(16, 34, 56, 0.06), inset 0 1px 0 var(--highlight-strong);
  --shadow-lg: 0 16px 40px rgba(16, 34, 56, 0.18), 0 2px 6px rgba(16, 34, 56, 0.07), inset 0 1px 0 var(--highlight-strong);
  --folder-top: #b87443;
  --folder-base: #8e5227;
  --folder-edge: #6b3b19;
  --folder-stitch: rgba(255, 232, 196, 0.58);
  --radius: 12px;
  --sidebar-w: 258px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b111b;
    --surface: #151f2e;
    --surface-top: #192536;
    --surface-bottom: #121b28;
    --surface-2: #121a27;
    --surface-3: #1e2b3e;
    --text: #eef4fb;
    --text-2: #c2cede;
    --muted: #8fa1b8;
    --border: #27364b;
    --border-strong: #354963;
    --accent: #4c9cf0;
    --accent-top: #5ba6f5;
    --accent-bottom: #3682d6;
    --accent-hover: #6bb0f7;
    --accent-soft: #173352;
    --danger: #f26b5b;
    --danger-top: #f57b6c;
    --danger-bottom: #d95242;
    --danger-soft: #3a1f20;
    --success: #4ade80;
    --warning: #fbbf24;
    --highlight: rgba(255, 255, 255, 0.07);
    --highlight-strong: rgba(255, 255, 255, 0.12);
    --inset-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(0, 0, 0, 0.18);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.32), inset 0 1px 0 var(--highlight);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.32), 0 5px 14px rgba(0, 0, 0, 0.22), inset 0 1px 0 var(--highlight);
    --shadow-md: 0 6px 14px rgba(0, 0, 0, 0.38), 0 10px 24px rgba(0, 0, 0, 0.26), inset 0 1px 0 var(--highlight);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.58), 0 2px 8px rgba(0, 0, 0, 0.36), inset 0 1px 0 var(--highlight);
    --folder-top: #9d6136;
    --folder-base: #764420;
    --folder-edge: #4e2b12;
    --folder-stitch: rgba(255, 224, 178, 0.42);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b111b;
  --surface: #151f2e;
  --surface-top: #192536;
  --surface-bottom: #121b28;
  --surface-2: #121a27;
  --surface-3: #1e2b3e;
  --text: #eef4fb;
  --text-2: #c2cede;
  --muted: #8fa1b8;
  --border: #27364b;
  --border-strong: #354963;
  --accent: #4c9cf0;
  --accent-top: #5ba6f5;
  --accent-bottom: #3682d6;
  --accent-hover: #6bb0f7;
  --accent-soft: #173352;
  --danger: #f26b5b;
  --danger-top: #f57b6c;
  --danger-bottom: #d95242;
  --danger-soft: #3a1f20;
  --success: #4ade80;
  --warning: #fbbf24;
  --highlight: rgba(255, 255, 255, 0.07);
  --highlight-strong: rgba(255, 255, 255, 0.12);
  --inset-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.32), inset 0 1px 0 var(--highlight);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.32), 0 5px 14px rgba(0, 0, 0, 0.22), inset 0 1px 0 var(--highlight);
  --shadow-md: 0 6px 14px rgba(0, 0, 0, 0.38), 0 10px 24px rgba(0, 0, 0, 0.26), inset 0 1px 0 var(--highlight);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.58), 0 2px 8px rgba(0, 0, 0, 0.36), inset 0 1px 0 var(--highlight);
  --folder-top: #9d6136;
  --folder-base: #764420;
  --folder-edge: #4e2b12;
  --folder-stitch: rgba(255, 224, 178, 0.42);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(circle at 50% 0%, var(--surface-2) 0%, var(--bg) 72%);
  background-color: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; align-items: center; }
.gap8 { gap: 8px; }
.hidden, [hidden] { display: none !important; }

/* ---------- tactile buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border: 1px solid var(--border); border-bottom-color: var(--border-strong);
  border-radius: 9px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  color: var(--text); font-weight: 600; font-size: 13.5px;
  box-shadow: var(--shadow-xs);
  transition: background .15s, border-color .15s, transform .08s, box-shadow .12s;
  white-space: nowrap;
}
.btn:hover {
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-3) 100%);
  border-color: var(--border-strong);
}
.btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(15, 29, 48, 0.16);
}
.btn.primary {
  background: linear-gradient(180deg, var(--accent-top) 0%, var(--accent-bottom) 100%);
  border-color: var(--accent-bottom);
  color: #fff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.22);
  box-shadow: 0 2px 6px rgba(15, 108, 189, 0.28), 0 1px 2px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}
.btn.primary:hover {
  background: linear-gradient(180deg, #228be6 0%, var(--accent) 100%);
  border-color: var(--accent-bottom);
}
.btn.primary:active {
  background: var(--accent-bottom);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.32);
}
.btn.subtle {
  background: var(--surface-2);
  box-shadow: inset 0 1px 0 var(--highlight);
}
.btn.subtle:hover { background: var(--surface-3); }
.btn.tiny { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn.danger-ghost {
  color: var(--danger); border-color: var(--danger);
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--danger-soft) 100%);
  box-shadow: var(--shadow-xs);
}
.btn.danger-ghost:hover { background: var(--danger-soft); }
.btn.danger {
  background: linear-gradient(180deg, var(--danger-top) 0%, var(--danger-bottom) 100%);
  border-color: var(--danger-bottom);
  color: #fff;
  text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.22);
  box-shadow: 0 2px 6px rgba(196, 43, 28, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn.danger:active { box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.32); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text-2);
  transition: background .12s, border-color .12s, box-shadow .12s, transform .08s;
}
.icon-btn:hover {
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-3) 100%);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
  color: var(--text);
}
.icon-btn:active {
  transform: translateY(1px);
  box-shadow: var(--inset-shadow);
}
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; font-size: 12.5px; }
.link-btn:hover { text-decoration: underline; }

/* ---------- shell ---------- */
.app-shell { display: flex; height: 100dvh; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-2) 100%);
  border-right: 1px solid var(--border);
  box-shadow: 2px 0 12px rgba(15, 29, 48, 0.04), inset -1px 0 0 var(--highlight);
  display: flex; flex-direction: column;
  padding: 18px 14px 14px; gap: 4px; z-index: 30; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 16px; font-size: 18px; font-weight: 750; letter-spacing: -.3px; }
.brand img { border-radius: 9px; box-shadow: 0 2px 6px rgba(15, 29, 48, 0.16); }
.sidebar-close { display: none; margin-left: auto; }
.new-btn { width: 100%; margin-bottom: 14px; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px;
  border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text-2);
  font-weight: 550; font-size: 13.5px; text-align: left;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active {
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--accent-soft) 100%);
  border-color: var(--border);
  box-shadow: var(--shadow-xs);
  color: var(--accent); font-weight: 700;
}
.nav-item.danger { color: var(--danger); }
.nav-item.danger:hover { background: var(--danger-soft); color: var(--danger); }
.mobile-nav-logout {
  display: none; margin: 8px 0 0; padding-top: 8px;
  border-top: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--highlight);
}
.nav-ico { display: grid; place-items: center; width: 20px; height: 20px; }
.nav-ico svg { width: 19px; height: 19px; }
.pill {
  margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 20px;
  background: var(--surface-3); border: 1px solid var(--border);
  box-shadow: inset 0 1px 2px rgba(15, 29, 48, 0.08);
  color: var(--muted); font-size: 11px; font-weight: 650; text-align: center;
}
.nav-item.active .pill {
  background: var(--surface); border-color: var(--border-strong); color: var(--accent);
}
.sidebar-divider {
  height: 1px; background: var(--border);
  box-shadow: 0 1px 0 var(--highlight-strong);
  margin: 16px 4px 12px;
}
.sidebar-section-title { padding: 0 8px 8px; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .7px; }
.quota { padding: 0 8px; }
.progress-track {
  height: 8px; border-radius: 10px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  box-shadow: var(--inset-shadow);
  overflow: hidden; padding: 1px;
}
.progress-bar {
  height: 100%; width: 0; border-radius: 8px;
  background: linear-gradient(180deg, #38bdf8 0%, var(--accent) 55%, var(--accent-bottom) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: width .35s ease;
}
.progress-bar.warn { background: linear-gradient(180deg, #fbbf24 0%, var(--warning) 100%); }
.progress-bar.full { background: linear-gradient(180deg, var(--danger-top) 0%, var(--danger-bottom) 100%); }
.quota-text { display: flex; justify-content: space-between; margin: 8px 0 12px; color: var(--muted); font-size: 12px; }
.sidebar-foot { margin-top: auto; }
.install-card {
  padding: 12px; border: 1px solid var(--border); border-radius: 11px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  box-shadow: var(--shadow-sm); margin-bottom: 10px;
}
.install-card strong { font-size: 13px; }
.install-card p { margin: 5px 0 11px; color: var(--muted); font-size: 12px; }
.sidebar-legal { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 6px 8px 2px; color: var(--muted); font-size: 11.5px; }
.sidebar-legal a { color: inherit; }
.sidebar-legal a:hover { color: var(--accent); text-decoration: underline; }
.sidebar-version { padding: 6px 8px; color: var(--muted); font-size: 11px; }
.sidebar-scrim { display: none; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.topbar {
  height: 64px; flex: 0 0 64px; display: flex; align-items: center; gap: 14px;
  padding: 0 22px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(16, 34, 56, 0.05), inset 0 1px 0 var(--highlight-strong);
  z-index: 20;
}
.menu-toggle { display: none; }
.search {
  display: flex; align-items: center; gap: 9px; flex: 1; max-width: 480px;
  padding: 0 10px 0 13px; height: 38px;
  border: 1px solid var(--border); border-top-color: var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  box-shadow: var(--inset-shadow), 0 1px 0 var(--highlight-strong);
  color: var(--muted);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search:focus-within {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: var(--inset-shadow), 0 0 0 3px var(--accent-soft);
}
.search input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.user-menu-wrap { position: relative; }
.avatar-btn { border: 0; background: none; padding: 2px; border-radius: 50%; }
.avatar {
  display: inline-grid; place-items: center; width: 35px; height: 35px; border-radius: 50%;
  color: #fff; font-size: 12px; font-weight: 750; letter-spacing: .3px;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 6px rgba(15, 29, 48, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.45);
}
.dropdown {
  position: absolute; right: 0; top: 46px; width: 228px; padding: 6px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-lg); z-index: 60;
}
.dropdown-head {
  padding: 10px 11px 12px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--highlight);
  margin-bottom: 5px; display: flex; flex-direction: column;
}
.dropdown-head span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.dropdown-item { display: block; width: 100%; padding: 9px 11px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 13px; }
.dropdown-item:hover { background: var(--surface-3); }
.dropdown-item.danger { color: var(--danger); }

.offline-banner {
  display: flex; align-items: center; gap: 9px; padding: 9px 22px;
  background: linear-gradient(180deg, #fff7df 0%, #ffefc2 100%);
  border-bottom: 1px solid #f3d78a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  color: #7c4a03; font-size: 13px;
}
:root[data-theme="dark"] .offline-banner { background: linear-gradient(180deg, #423114 0%, #33250e 100%); border-color: #5c441c; color: #fcd34d; }
.offline-banner .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.offline-banner .link-btn { margin-left: auto; color: inherit; }

.content { flex: 1; overflow: auto; padding: 22px 26px 60px; }
.content-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; min-height: 20px; }
.crumbs button, .crumbs a { border: 0; background: none; padding: 2px 3px; color: var(--muted); font-size: 12.5px; }
.crumbs button:hover, .crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs .current { color: var(--text); font-weight: 700; }
.crumbs .sep { opacity: .5; }
h1#view-title { margin: 4px 0 0; font-size: 25px; font-weight: 750; letter-spacing: -.5px; }
.toolbar { display: flex; align-items: center; gap: 8px; }
.sort-wrap {
  display: flex; align-items: center; gap: 2px;
  border: 1px solid var(--border); border-bottom-color: var(--border-strong);
  border-radius: 9px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  box-shadow: var(--shadow-xs);
}
.select { border: 0; background: transparent; padding: 8px 10px; outline: 0; font-size: 13px; }
#sort-direction.desc svg { transform: scaleY(-1); }
.selection-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 14px; margin-bottom: 14px; border: 1px solid var(--accent);
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--accent-soft) 100%);
  box-shadow: var(--shadow-sm);
  border-radius: 10px; font-weight: 600; font-size: 13px;
}

/* ---------- tactile item cards ---------- */
.items.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 13px; }
.item-card {
  position: relative; display: grid; grid-template-columns: 1fr auto;
  grid-template-areas: "preview more" "name name" "sub sub" "badges badges";
  align-content: start; gap: 2px; padding: 10px;
  border: 1px solid var(--border); border-bottom-color: var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s, transform .12s; min-height: 176px;
  user-select: none;
}
.item-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.item-card:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}
.item-card.selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--accent-soft) 100%);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-sm);
}
.item-card .item-preview {
  grid-area: preview; height: 96px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--inset-shadow);
  overflow: hidden; margin-bottom: 7px;
}
.item-preview img.thumb { width: 100%; height: 100%; object-fit: cover; }
.file-icon { display: grid; place-items: center; color: var(--accent); filter: drop-shadow(0 1px 2px rgba(15, 29, 48, 0.12)); }
.file-icon svg { width: 40px; height: 40px; }
.file-icon.pdf { color: #d13438; }
.file-icon.word, .file-icon.text { color: #2b579a; }
.file-icon.excel { color: #217346; }
.file-icon.powerpoint { color: #d24726; }
.file-icon.archive { color: #7c3aed; }
.file-icon.video { color: #b4236f; }
.file-icon.audio { color: #0f766e; }
.file-icon.code { color: #475569; }
.file-icon.image { color: #0f6cbd; }

/* ---------- flatter stitched leather folder (modern UI + skeuomorphic warmth) ---------- */
.file-icon.folder {
  position: relative;
  display: inline-block;
  width: 66px;
  height: 46px;
  filter: drop-shadow(0 2px 4px rgba(24, 12, 4, 0.16));
  transition: transform .14s ease, filter .14s ease;
}
.file-icon.folder svg { display: none; }
.file-icon.folder::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 10px;
  border-radius: 5px 6px 0 0;
  border: 1px solid var(--folder-edge);
  border-bottom: 0;
  background: linear-gradient(180deg, var(--folder-top) 0%, var(--folder-base) 100%);
  box-shadow: inset 0 1px 0 var(--folder-stitch);
}
.file-icon.folder::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 7px;
  bottom: 0;
  border-radius: 7px;
  border: 1px solid var(--folder-edge);
  background-color: var(--folder-base);
  background-image:
    repeating-linear-gradient(90deg, var(--folder-stitch) 0 3px, transparent 3px 6px),
    linear-gradient(180deg, var(--folder-top) 0%, var(--folder-base) 100%);
  background-size: calc(100% - 12px) 1px, 100% 100%;
  background-position: 6px calc(100% - 3px), 0 0;
  background-repeat: no-repeat, no-repeat;
  box-shadow:
    inset 0 1px 0 var(--folder-stitch),
    0 1px 2px rgba(15, 29, 48, 0.12);
}
.item-card:hover .file-icon.folder {
  transform: translateY(-1px);
  filter: drop-shadow(0 4px 8px rgba(24, 12, 4, 0.2));
}
.item-card.selected .file-icon.folder {
  filter: drop-shadow(0 0 5px rgba(15, 108, 189, 0.28)) drop-shadow(0 3px 6px rgba(24, 12, 4, 0.18));
}

.item-name { grid-area: name; font-weight: 650; font-size: 13.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-sub { grid-area: sub; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-badges { grid-area: badges; display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.badge {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 6px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-3) 100%);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 var(--highlight);
  color: var(--text-2);
}
.badge.shared { background: linear-gradient(180deg, var(--surface-top) 0%, var(--accent-soft) 100%); border-color: rgba(15, 108, 189, 0.25); color: var(--accent); }
.badge.star { background: linear-gradient(180deg, #fffbe8 0%, #ffefb8 100%); border-color: #eed07a; color: #9a5500; }
.item-more {
  grid-area: more; position: absolute; right: 7px; top: 7px; width: 28px; height: 28px;
  border: 1px solid var(--border); border-radius: 7px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  box-shadow: var(--shadow-xs);
  color: var(--text-2); opacity: 0; display: grid; place-items: center; z-index: 2;
}
.item-card:hover .item-more, .item-card.selected .item-more, .item-more:focus-visible { opacity: 1; }
.item-more:hover { background: var(--surface-3); }
.item-check { position: absolute; left: 10px; top: 10px; z-index: 2; opacity: 0; }
.item-card:hover .item-check, .item-card.selected .item-check, .item-check:focus-within { opacity: 1; }
.item-check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.items.list { display: flex; flex-direction: column; gap: 4px; }
.items.list .item-card {
  grid-template-columns: 32px 36px 1fr 130px 150px 90px 30px;
  grid-template-areas: "check preview name sub badges more";
  align-items: center; min-height: 50px; padding: 6px 12px; gap: 10px; border-radius: 10px;
}
.items.list .item-card:hover { transform: none; }
.items.list .item-preview { height: 32px; width: 32px; margin: 0; background: var(--surface-2); }
.items.list .file-icon svg { width: 22px; height: 22px; }
.items.list .file-icon.folder,
.share-row .file-icon.folder {
  width: 26px;
  height: 19px;
  filter: drop-shadow(0 1px 2px rgba(24, 12, 4, 0.18));
}
.items.list .file-icon.folder::before,
.share-row .file-icon.folder::before {
  left: 0;
  top: 0;
  width: 11px;
  height: 5px;
  border-radius: 3px 3px 0 0;
}
.items.list .file-icon.folder::after,
.share-row .file-icon.folder::after {
  top: 3.5px;
  bottom: 0;
  border-radius: 4px;
  background-size: calc(100% - 6px) 1px, 100% 100%;
  background-position: 3px calc(100% - 2px), 0 0;
}
.items.list .item-check { position: static; opacity: 1; }
.items.list .item-more { position: static; opacity: 0; }
.items.list .item-card:hover .item-more { opacity: 1; }
.items.list .item-name { font-size: 13.5px; }
.items.list .item-sub { text-align: left; }
.items.list .item-badges { justify-content: flex-start; margin: 0; }
.items.list .item-badges .badge { display: none; }
.items.list .item-badges .badge.shared, .items.list .item-badges .badge.star { display: inline-block; }

.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-art {
  margin: 0 auto 16px; width: 88px; height: 88px; border-radius: 24px; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--accent-soft) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  color: var(--accent);
}
.empty-art svg { width: 46px; height: 46px; filter: drop-shadow(0 2px 4px rgba(15, 108, 189, 0.2)); }
.empty h2 { margin: 0 0 6px; color: var(--text); font-size: 19px; }
.empty p { margin: 0 auto 18px; max-width: 380px; font-size: 13.5px; }

/* ---------- details drawer ---------- */
.details {
  width: 300px; flex: 0 0 300px;
  border-left: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-2) 100%);
  box-shadow: -2px 0 12px rgba(15, 29, 48, 0.04), inset 1px 0 0 var(--highlight);
  overflow: auto; padding: 18px;
}
.details-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.big-icon {
  display: grid; place-items: center; height: 140px;
  background: var(--surface-2); border: 1px solid var(--border);
  box-shadow: var(--inset-shadow);
  border-radius: 11px; margin-bottom: 14px; color: var(--accent);
}
.big-icon svg { width: 62px; height: 62px; filter: drop-shadow(0 2px 4px rgba(15, 29, 48, 0.14)); }
.big-icon .file-icon.folder {
  width: 78px;
  height: 54px;
}
.big-icon .file-icon.folder::before {
  width: 31px;
  height: 12px;
}
.big-icon .file-icon.folder::after {
  top: 8px;
}
.details h3 { margin: 0 0 4px; font-size: 15px; word-break: break-all; }
.details .detail-row {
  display: flex; justify-content: space-between; gap: 10px; padding: 9px 0;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--highlight);
  font-size: 12.5px;
}
.details .detail-row span:first-child { color: var(--muted); }
.details .detail-row span:last-child { text-align: right; word-break: break-all; }
.details-activity { margin-top: 24px; }
.activity-list { display: flex; flex-direction: column; gap: 10px; }
.activity-item { font-size: 12px; color: var(--text-2); }
.activity-item span { display: block; color: var(--muted); font-size: 11px; }

/* ---------- overlays & modals ---------- */
.dropzone { position: fixed; inset: 0; z-index: 90; background: rgba(15, 42, 75, .58); backdrop-filter: blur(3px); display: grid; place-items: center; }
.dropzone-inner {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 70px;
  border: 2px dashed #fff; border-radius: 20px; color: #fff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 2px 12px rgba(0, 0, 0, 0.25), 0 16px 40px rgba(0, 0, 0, 0.3);
}
.drop-glyph { font-size: 36px; }
.dropzone-inner span:last-child { opacity: .85; font-size: 13px; }
.upload-panel {
  position: fixed; right: 18px; bottom: 18px; width: 340px; max-height: 340px; overflow: auto;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-lg); z-index: 80;
}
.upload-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.upload-row { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.upload-row:last-child { border: 0; }
.upload-row .upload-name { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.upload-row .upload-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row .upload-state { color: var(--muted); }
.upload-row .upload-state.error { color: var(--danger); }
.upload-row .upload-state.done { color: var(--success); }

.modal-root { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(11, 22, 38, .5); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 18px; pointer-events: auto; }
.modal {
  width: min(460px, 100%); max-height: 88dvh; overflow: auto;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  border: 1px solid var(--border); border-radius: 15px;
  box-shadow: var(--shadow-lg); animation: pop .16s ease-out;
}
.modal.wide { width: min(620px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 6px 18px 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 12px 18px 18px; }
.modal p.hint { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 12.5px; font-weight: 650; }
.field input, .field select, .field textarea, .auth-form label input, .share-form input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border); border-top-color: var(--border-strong);
  border-radius: 9px;
  background: var(--surface-2);
  box-shadow: var(--inset-shadow), 0 1px 0 var(--highlight-strong);
  outline: 0;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus, .field select:focus, .auth-form label input:focus, .share-form input:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: var(--inset-shadow), 0 0 0 3px var(--accent-soft);
}
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 12.5px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.alert {
  padding: 10px 12px; border-radius: 9px; font-size: 12.5px; margin-bottom: 14px;
  border: 1px solid transparent; box-shadow: inset 0 1px 0 var(--highlight);
}
.alert.error { background: var(--danger-soft); border-color: rgba(196, 43, 28, 0.25); color: var(--danger); }
.alert.info { background: var(--accent-soft); border-color: rgba(15, 108, 189, 0.25); color: var(--accent); }

.share-link-box { display: flex; gap: 8px; margin-bottom: 14px; }
.share-link-box input {
  flex: 1; padding: 9px 11px;
  border: 1px solid var(--border); border-top-color: var(--border-strong);
  border-radius: 9px; background: var(--surface-2);
  box-shadow: var(--inset-shadow);
  font-size: 12px; min-width: 0;
}
.share-section { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); box-shadow: inset 0 1px 0 var(--highlight); }
.share-section h3 { margin: 0 0 10px; font-size: 13px; }
.share-list-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.share-list-item:last-child { border: 0; }
.share-list-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.move-tree {
  max-height: 260px; overflow: auto;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); box-shadow: var(--inset-shadow);
  padding: 6px;
}
.move-node { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 7px; background: none; font-size: 13px; }
.move-node:hover { background: var(--surface-3); }
.move-node.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; box-shadow: var(--shadow-xs); }
.preview-body {
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  box-shadow: var(--inset-shadow);
  border-radius: 11px; min-height: 220px; max-height: 66dvh; overflow: auto; padding: 12px;
}
.preview-body img { max-width: 100%; max-height: 62dvh; object-fit: contain; border-radius: 6px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16); }
.preview-body iframe { width: 100%; height: 58dvh; border: 0; border-radius: 6px; background: #fff; }
.preview-body pre { width: 100%; white-space: pre-wrap; word-break: break-word; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0; }
.preview-fallback { text-align: center; color: var(--muted); }

.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 130; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 9px; padding: 11px 15px; border-radius: 11px;
  background: linear-gradient(180deg, #2b3748 0%, #18202c 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff; box-shadow: var(--shadow-lg); font-size: 13px; max-width: 90vw; animation: pop .16s;
}
.toast.error { background: linear-gradient(180deg, var(--danger-top) 0%, var(--danger-bottom) 100%); }
.toast.success { background: linear-gradient(180deg, #159963 0%, var(--success) 100%); }
.context-menu {
  position: fixed; min-width: 190px; padding: 6px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-lg); z-index: 120;
}
.context-menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; text-align: left; font-size: 13px; }
.context-menu button:hover { background: var(--surface-3); }
.context-menu button.danger { color: var(--danger); }
.context-menu hr { border: 0; border-top: 1px solid var(--border); box-shadow: 0 1px 0 var(--highlight); margin: 5px 0; }

/* ---------- auth ---------- */
.auth-body { background: var(--bg); }
.auth-wrap { min-height: 100dvh; display: grid; grid-template-columns: minmax(320px, 460px) 1fr; }
.auth-card {
  align-self: center; width: min(410px, calc(100% - 40px)); margin: 40px auto; padding: 32px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  border: 1px solid var(--border); border-bottom-color: var(--border-strong);
  border-radius: 17px; box-shadow: var(--shadow-md);
}
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.auth-brand img { border-radius: 10px; box-shadow: 0 2px 6px rgba(15, 29, 48, 0.16); }
.auth-brand strong { display: block; font-size: 16px; }
.auth-brand span { color: var(--muted); font-size: 12px; }
.auth-card h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.4px; }
.auth-sub { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 650; }
.auth-form label.check { flex-direction: row; align-items: center; font-weight: 500; }
.auth-form .btn.block { margin-top: 4px; padding: 11px; }
.auth-foot { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.demo-hint { margin-top: 22px; padding: 11px 12px; border: 1px dashed var(--border); border-radius: 9px; background: var(--surface-2); font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.demo-hint span { font-weight: 750; color: var(--text-2); }
.demo-hint code { font-size: 11px; }
.demo-hint .btn { margin-left: auto; }
.auth-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 8vw; background: linear-gradient(140deg, #0f6cbd, #1e3a8a 55%, #4f46e5); color: #fff; box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.18); }
.auth-aside h2 { font-size: clamp(26px, 3vw, 40px); max-width: 480px; margin: 0 0 20px; letter-spacing: -.8px; line-height: 1.15; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); }
.auth-aside ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; opacity: .94; }
.auth-aside li::before { content: "✓"; margin-right: 10px; font-weight: 800; }
.auth-orb { position: absolute; right: -120px; top: -120px; width: 430px; height: 430px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.28), rgba(255,255,255,0) 65%); }
.offline-glyph {
  display: grid; place-items: center; width: 78px; height: 78px; border-radius: 50%;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--accent-soft) 100%);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  color: var(--accent); margin-bottom: 18px;
}

/* ---------- public share ---------- */
.share-body { background: var(--bg); }
.share-header {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 26px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(16, 34, 56, 0.05), inset 0 1px 0 var(--highlight-strong);
}
.share-logo { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 750; font-size: 17px; }
.share-logo:hover { text-decoration: none; }
.share-actions { display: flex; gap: 8px; }
.share-main { max-width: 900px; margin: 34px auto; padding: 0 18px; }
.share-card {
  padding: 28px; border-radius: 17px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  border: 1px solid var(--border); border-bottom-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.share-owner { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.share-owner strong { color: var(--text); }
.share-card h1 { margin: 0 0 5px; font-size: 26px; word-break: break-all; }
.share-crumbs { margin: 18px 0; }
.share-list { margin-top: 20px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; }
.share-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.share-row:last-child { border: 0; }
.share-row .file-icon svg { width: 24px; height: 24px; }
.share-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--text); }
.empty-inline { padding: 30px; text-align: center; color: var(--muted); }
.share-file { margin-top: 22px; }
.share-file-preview { border-radius: 11px; border: 1px solid var(--border); box-shadow: var(--inset-shadow); overflow: hidden; margin-bottom: 18px; }
.share-file-preview img { display: block; max-width: 100%; max-height: 60dvh; margin: 0 auto; }
.share-file-preview iframe { width: 100%; height: 60dvh; border: 0; background: #fff; }
.share-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 22px 0; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .details { position: absolute; right: 0; top: 64px; bottom: 0; z-index: 40; box-shadow: var(--shadow-lg); }
}
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .sidebar { position: fixed; inset: 0 auto 0 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .app-shell.menu-open .sidebar { transform: translateX(0); }
  .app-shell.menu-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(1px); z-index: 25; }
  .sidebar-close { display: inline-grid; }
  .menu-toggle { display: inline-grid; }
  .mobile-nav-logout { display: block; }
  .topbar { padding: 0 12px; gap: 8px; }
  .content { padding: 16px 14px 60px; }
  .upload-btn span { display: none; }
  .items.grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .details { width: min(320px, 88vw); }
  .share-card { padding: 18px; }
}
@media (max-width: 560px) {
  .items.list .item-card { grid-template-columns: 22px 30px 1fr 30px; grid-template-areas: "check preview name more" ". . sub sub" ". . badges badges"; gap: 4px 8px; }
  .items.list .item-sub { font-size: 11px; }
  .content-head { align-items: flex-start; }
  h1#view-title { font-size: 21px; }
  .toolbar { width: 100%; justify-content: flex-end; }
  .search { max-width: none; }
  .share-header { padding: 10px 14px; }
  .upload-panel { right: 8px; left: 8px; width: auto; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Google sign-in ---------- */
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; white-space: nowrap; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); box-shadow: 0 1px 0 var(--highlight); }
.google-btn {
  width: 100%; border-color: var(--border); border-bottom-color: var(--border-strong);
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  box-shadow: var(--shadow-xs); font-weight: 650;
}
.google-btn:hover { background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-3) 100%); border-color: var(--border-strong); }
.demo-note { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: 11px; }
.google-demo-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.google-demo-head h1 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.auth-card .alert code { font-size: 11px; }
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-initials { display: grid; place-items: center; width: 100%; height: 100%; }

/* ---------- Admin dashboard ---------- */
.admin-body { background: var(--bg); }
.admin-topbar {
  display: flex; align-items: center; gap: 18px; padding: 12px 26px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(16, 34, 56, 0.05), inset 0 1px 0 var(--highlight-strong);
}
.admin-badge {
  margin-left: 4px; padding: 3px 8px; border-radius: 6px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--accent-soft) 100%);
  border: 1px solid rgba(15, 108, 189, 0.25);
  box-shadow: var(--shadow-xs);
  color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .8px;
}
.admin-nav { display: flex; gap: 4px; margin-left: 18px; }
.admin-nav a { padding: 8px 13px; border-radius: 8px; border: 1px solid transparent; color: var(--text-2); font-weight: 600; font-size: 13px; }
.admin-nav a:hover { background: var(--surface-3); text-decoration: none; }
.admin-nav a.active {
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--accent-soft) 100%);
  border-color: var(--border); box-shadow: var(--shadow-xs); color: var(--accent);
}
.admin-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.admin-wrap { max-width: 1200px; margin: 28px auto 70px; padding: 0 20px; }
.admin-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-page-head h1 { margin: 0 0 3px; font-size: 26px; letter-spacing: -.5px; }
.admin-page-head p { margin: 0; font-size: 13.5px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
  display: flex; flex-direction: column; gap: 5px; padding: 16px 18px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  border: 1px solid var(--border); border-bottom-color: var(--border-strong);
  border-radius: 13px; box-shadow: var(--shadow-sm);
}
.stat-label { color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .6px; }
.stat-value { font-size: 27px; font-weight: 750; letter-spacing: -.6px; }
.stat-value.backend-value { font-size: 17px; line-height: 1.35; }
.admin-columns { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; margin-bottom: 16px; }
.admin-columns.storage-columns { grid-template-columns: 1.6fr 1fr; }
.admin-side { display: flex; flex-direction: column; gap: 16px; }
.admin-card {
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-bottom) 100%);
  border: 1px solid var(--border); border-bottom-color: var(--border-strong);
  border-radius: 13px; padding: 18px 20px; box-shadow: var(--shadow-sm);
}
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.admin-card h2 { margin: 0; font-size: 16px; }
.admin-card h3.admin-subhead { margin: 16px 0 5px; font-size: 13px; }
.admin-card h3.admin-subhead:first-of-type { margin-top: 0; }
.backend-line { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.status-pill {
  display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 10.5px; font-weight: 800; letter-spacing: .5px;
  background: var(--surface-3); border: 1px solid var(--border); box-shadow: inset 0 1px 0 var(--highlight); color: var(--text-2);
}
.status-pill.cloud { background: var(--accent-soft); color: var(--accent); }
.status-pill.local { background: #e6f6ec; color: #0f7b4f; }
.status-pill.ok { background: #e6f6ec; color: #0f7b4f; }
.status-pill.bad { background: var(--danger-soft); color: var(--danger); }
.kv { margin: 0; display: flex; flex-direction: column; }
.kv > div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.kv > div:last-child { border: 0; }
.kv dt { color: var(--muted); flex: 0 0 auto; }
.kv dd { margin: 0; text-align: right; word-break: break-all; }
.admin-tip { margin-top: 14px; padding: 11px 13px; border-radius: 9px; background: var(--accent-soft); border: 1px solid rgba(15, 108, 189, 0.2); box-shadow: inset 0 1px 0 var(--highlight); color: var(--text-2); font-size: 12px; line-height: 1.55; }
.admin-hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.admin-hint code, .admin-tip code { font-size: 11px; padding: 1px 4px; border-radius: 4px; background: var(--surface-3); }
.admin-section-title { margin: 20px 0 12px; padding-top: 14px; border-top: 1px solid var(--border); box-shadow: inset 0 1px 0 var(--highlight); color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .7px; }
.provider-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.provider-card {
  display: flex; flex-direction: column; gap: 4px; padding: 13px;
  border: 1px solid var(--border); border-bottom-color: var(--border-strong); border-radius: 11px;
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--surface-2) 100%);
  box-shadow: var(--shadow-xs);
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.provider-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.provider-card.selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--surface-top) 0%, var(--accent-soft) 100%);
  box-shadow: 0 0 0 2px var(--accent-soft), var(--shadow-xs);
}
.provider-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.provider-glyph { font-size: 22px; color: var(--accent); line-height: 1; margin-bottom: 4px; }
.provider-card strong { font-size: 13px; }
.provider-card small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.form-grid .field { min-width: 0; }
.form-grid .field input { width: 100%; }
.admin-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); box-shadow: inset 0 1px 0 var(--highlight); }
.result-box { margin-top: 12px; padding: 11px 13px; border-radius: 9px; font-size: 12.5px; line-height: 1.5; }
.result-box.ok { background: #e6f6ec; color: #0f7b4f; }
.result-box.bad { background: var(--danger-soft); color: var(--danger); }
:root[data-theme="dark"] .result-box.ok { background: #123524; color: #4ade80; }
:root[data-theme="dark"] .status-pill.local, :root[data-theme="dark"] .status-pill.ok { background: #123524; color: #4ade80; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.admin-table th { text-align: left; padding: 9px 8px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); }
.admin-table tr:last-child td { border: 0; }
.admin-table .badge { font-size: 10px; }
@media (max-width: 960px) {
  .admin-columns, .admin-columns.storage-columns { grid-template-columns: 1fr; }
  .admin-nav { margin-left: 0; }
  .admin-name { display: none; }
}
@media (max-width: 620px) {
  .admin-topbar { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }
  .admin-nav { order: 3; width: 100%; }
  .provider-grid, .form-grid { grid-template-columns: 1fr; }
  .admin-wrap { padding: 0 12px; }
}