:root {
  --bg: #050b16;
  --bg-2: #0c1424;
  --panel: #0f1c31;
  --panel-2: #12233c;
  --panel-3: #142a47;
  --text: #eaf0ff;
  --muted: #8fa6c4;
  --accent: #5ce1ce;
  --accent-2: #f9b572;
  --danger: #ef4e5d;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 10px 26px rgba(5, 12, 24, 0.35);
  --radius-lg: 20px;
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  --chip: rgba(255, 255, 255, 0.05);
  --focus: rgba(92, 225, 206, 0.25);
  --grid: rgba(255, 255, 255, 0.04);
  --file-dir-bg: rgba(45, 212, 191, 0.18);
  --file-dir-fg: #7fe3d5;
  --file-image-bg: rgba(56, 189, 248, 0.18);
  --file-image-fg: #8fd6ff;
  --file-video-bg: rgba(139, 92, 246, 0.18);
  --file-video-fg: #c6b3ff;
  --file-audio-bg: rgba(217, 70, 239, 0.18);
  --file-audio-fg: #efb1ff;
  --file-pdf-bg: rgba(244, 63, 94, 0.18);
  --file-pdf-fg: #ff9cab;
  --file-archive-bg: rgba(245, 158, 11, 0.18);
  --file-archive-fg: #ffd08f;
  --file-code-bg: rgba(34, 211, 238, 0.18);
  --file-code-fg: #9fe9f7;
  --file-doc-bg: rgba(99, 102, 241, 0.18);
  --file-doc-fg: #c5c9ff;
  --file-sheet-bg: rgba(16, 185, 129, 0.18);
  --file-sheet-fg: #7fe6c5;
  --file-slide-bg: rgba(249, 115, 22, 0.18);
  --file-slide-fg: #ffc39d;
  --file-font-bg: rgba(163, 230, 53, 0.18);
  --file-font-fg: #d5f59b;
  --file-design-bg: rgba(236, 72, 153, 0.18);
  --file-design-fg: #f6a7d1;
  --file-binary-bg: rgba(148, 163, 184, 0.18);
  --file-binary-fg: #d2dbe6;
  --file-config-bg: rgba(6, 182, 212, 0.18);
  --file-config-fg: #8fd9f7;
  --file-data-bg: rgba(34, 197, 94, 0.18);
  --file-data-fg: #9fe7bf;
  --file-model-bg: rgba(59, 130, 246, 0.18);
  --file-model-fg: #a7c7ff;
  --file-exec-bg: rgba(234, 179, 8, 0.18);
  --file-exec-fg: #ffe08b;
  --file-text-bg: rgba(129, 140, 248, 0.16);
  --file-text-fg: #d0d6ff;
  --file-default-bg: rgba(148, 163, 184, 0.16);
  --file-default-fg: #cbd5e1;
  --font-body: "Space Grotesk", "Segoe UI", sans-serif;
}

body[data-theme="light"] {
  --bg: #f6f8fc;
  --bg-2: #e8edfa;
  --panel: #ffffff;
  --panel-2: #f3f6ff;
  --panel-3: #e6edff;
  --text: #0c1626;
  --muted: #5d6c88;
  --accent: #2bb0a5;
  --accent-2: #f59e0b;
  --danger: #e11d48;
  --border: rgba(12, 22, 38, 0.12);
  --border-strong: rgba(12, 22, 38, 0.18);
  --shadow: 0 18px 48px rgba(10, 19, 40, 0.15);
  --shadow-soft: 0 8px 20px rgba(10, 19, 40, 0.14);
  --chip: rgba(12, 22, 38, 0.05);
  --focus: rgba(43, 176, 165, 0.2);
  --grid: rgba(12, 22, 38, 0.06);
  --file-dir-bg: rgba(45, 212, 191, 0.2);
  --file-dir-fg: #0f766e;
  --file-image-bg: rgba(37, 99, 235, 0.18);
  --file-image-fg: #1d4ed8;
  --file-video-bg: rgba(139, 92, 246, 0.2);
  --file-video-fg: #6d28d9;
  --file-audio-bg: rgba(217, 70, 239, 0.18);
  --file-audio-fg: #a21caf;
  --file-pdf-bg: rgba(244, 63, 94, 0.2);
  --file-pdf-fg: #be123c;
  --file-archive-bg: rgba(245, 158, 11, 0.2);
  --file-archive-fg: #b45309;
  --file-code-bg: rgba(14, 165, 233, 0.2);
  --file-code-fg: #0369a1;
  --file-doc-bg: rgba(99, 102, 241, 0.2);
  --file-doc-fg: #3730a3;
  --file-sheet-bg: rgba(16, 185, 129, 0.2);
  --file-sheet-fg: #15803d;
  --file-slide-bg: rgba(249, 115, 22, 0.2);
  --file-slide-fg: #c2410c;
  --file-font-bg: rgba(163, 230, 53, 0.2);
  --file-font-fg: #3f6212;
  --file-design-bg: rgba(236, 72, 153, 0.2);
  --file-design-fg: #be185d;
  --file-binary-bg: rgba(148, 163, 184, 0.18);
  --file-binary-fg: #475569;
  --file-config-bg: rgba(6, 182, 212, 0.2);
  --file-config-fg: #0e7490;
  --file-data-bg: rgba(34, 197, 94, 0.2);
  --file-data-fg: #047857;
  --file-model-bg: rgba(59, 130, 246, 0.2);
  --file-model-fg: #1e40af;
  --file-exec-bg: rgba(234, 179, 8, 0.2);
  --file-exec-fg: #a16207;
  --file-text-bg: rgba(129, 140, 248, 0.16);
  --file-text-fg: #4338ca;
  --file-default-bg: rgba(148, 163, 184, 0.16);
  --file-default-fg: #475569;
  background: #f6f8fc;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("/static/fonts/SpaceGrotesk-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("/static/fonts/SpaceGrotesk-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("/static/fonts/JetBrainsMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg-2) 40%, #0d1b2f 100%);
  min-height: 100vh;
  overflow: hidden;
}

body.legal-page {
  overflow: auto;
}

.bg-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 420px at 12% 22%, rgba(92, 225, 206, 0.14), transparent 60%),
    radial-gradient(540px 540px at 78% 18%, rgba(249, 181, 114, 0.16), transparent 58%),
    radial-gradient(680px 520px at 60% 78%, rgba(48, 108, 232, 0.18), transparent 65%);
  filter: saturate(140%);
  opacity: 0.7;
  z-index: 0;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(0deg, var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 30% 30%, rgba(0, 0, 0, 1), transparent 60%);
  opacity: 0.7;
  z-index: 0;
}

.hidden {
  display: none !important;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app {
  position: relative;
  z-index: 1;
  height: 100vh;
}

.view {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark.compact .logo {
  width: 46px;
  height: 46px;
}

.logo {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1c9ee6, #5ce1ce);
  color: #06101f;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 18px 36px rgba(92, 225, 206, 0.3);
}

.logo.glow {
  background: linear-gradient(140deg, #5ce1ce, #1e88e5);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 6px;
}

.auth-shell {
  width: min(1080px, 96vw);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  align-items: stretch;
}

.auth-hero {
  background: linear-gradient(160deg, rgba(92, 225, 206, 0.14), rgba(30, 136, 229, 0.12));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(160%);
  display: grid;
  gap: 18px;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.hero-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  box-shadow: var(--shadow-soft);
}

.hero-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.hero-card p {
  margin: 0;
  color: var(--muted);
}

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
  backdrop-filter: blur(14px) saturate(150%);
}

.auth-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 6px;
  font-size: 0.95rem;
  color: var(--muted);
}

.input-field {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input,
select {
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input-field input {
  border: none;
  background: transparent;
  padding: 0;
}

.password-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
}

.password-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.password-toggle .icon {
  width: 18px;
  height: 18px;
}

.password-toggle.active {
  color: var(--text);
  border-color: var(--accent);
}

.input-field .password-toggle {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  padding: 0;
}

.legal-links {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.legal-links.center {
  justify-content: center;
}

.legal-links a {
  color: inherit;
  text-decoration: none;
}

.legal-links a:hover {
  color: var(--text);
}

.legal-links .dot {
  opacity: 0.5;
}

.auth-legal {
  margin-top: 14px;
}

.legal-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 40px 18px;
}

.legal-card {
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.legal-lang {
  display: inline-flex;
  gap: 6px;
}

.legal-lang .btn {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.legal-back {
  width: fit-content;
}

.legal-card h1 {
  margin: 0;
  font-size: 2rem;
}

.legal-card h2 {
  margin: 8px 0 0;
  font-size: 1.15rem;
}

.legal-card p,
.legal-card li {
  color: var(--muted);
  line-height: 1.6;
}

.legal-card ul {
  padding-left: 20px;
  margin: 0;
}

select option {
  background: var(--panel-2);
  color: var(--text);
}

body[data-theme="light"] select option {
  background: #ffffff;
  color: #0c1626;
}

input::placeholder {
  color: var(--muted);
}

.btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: var(--panel-2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn.large {
  padding: 12px 20px;
  font-size: 1rem;
}

.btn .icon {
  width: 16px;
  height: 16px;
}

.btn-label {
  line-height: 1;
}

.btn.icon-only {
  padding: 10px;
  width: 42px;
  justify-content: center;
}

.btn.icon-only .btn-label {
  display: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), #38bdf8);
  color: #06101f;
  font-weight: 600;
  border: none;
  box-shadow: 0 12px 28px rgba(56, 189, 248, 0.25);
}

.btn.ghost {
  background: var(--panel-2);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn.danger {
  color: var(--danger);
  border-color: rgba(239, 78, 93, 0.6);
}

.icon-btn,
.chip {
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.chip.ghost {
  background: var(--panel-2);
}

.chip.success {
  border-color: rgba(92, 225, 206, 0.4);
  color: #1f9f8b;
  background: rgba(92, 225, 206, 0.15);
}

.icon-btn {
  width: 38px;
  justify-content: center;
}

.icon-btn:hover,
.chip:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.link {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.92rem;
}

.error {
  color: var(--danger);
  font-size: 0.92rem;
}

.auth-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

#shell {
  height: 100%;
  width: 100%;
  display: flex;
  padding: 12px;
  align-items: stretch;
  justify-content: stretch;
}

.workspace {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
}

.workspace-chrome {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow-soft);
}

.chrome-left {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.chrome-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.chrome-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.chrome-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.usage-meter {
  min-width: 220px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  display: grid;
  gap: 6px;
}

.usage-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}

.usage-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.usage-values {
  color: var(--text);
  font-weight: 600;
}

.usage-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--panel-3);
  overflow: hidden;
}

.usage-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-2);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--accent), #1e88e5);
  color: #06101f;
  font-weight: 700;
}

.user-name {
  font-weight: 600;
}

.user-role {
  color: var(--muted);
  font-size: 0.85rem;
}

.user-role[data-role="admin"] {
  color: #f97316;
}

.user-role[data-role="unlimited"] {
  color: #fbbf24;
}

.user-role[data-role="pro"] {
  color: #38bdf8;
}

.user-role[data-role="plus"] {
  color: #34d399;
}

.user-role[data-role="standard"] {
  color: var(--muted);
}

.user-role[data-role="viewer"] {
  color: #94a3b8;
}

.workspace-main {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
}

.sidebar {
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  box-shadow: var(--shadow);
  position: relative;
}

.sidebar-block {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.subtle {
  margin: 6px 0 10px;
}

.muted {
  color: var(--muted);
}

.place-list {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  max-height: calc(100vh - 260px);
  padding-right: 4px;
}

.place-item {
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-3);
  cursor: pointer;
  display: grid;
  gap: 4px;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  color: var(--text);
}

.place-item:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.place-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.place-item small {
  color: var(--muted);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.content {
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.toolbar-primary {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.breadcrumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.crumb {
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--border-strong);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.crumb:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.crumb.drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus);
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
}

.toolbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border-radius: var(--radius);
  background: var(--panel-3);
  border: 1px solid var(--border);
  min-width: 240px;
  flex: 1 1 260px;
}

.toolbar-search input {
  background: transparent;
  border: none;
  padding: 0;
  height: 100%;
  line-height: 1;
  min-height: 0;
  appearance: none;
  -webkit-appearance: none;
}

.toolbar-group {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.toolbar-group.primary {
  margin-left: auto;
}

.toolbar-group select {
  height: 42px;
  border-radius: var(--radius);
}

.selection-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  flex-wrap: nowrap;
}

.selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.selection-block {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1 1 0;
  min-width: 0;
}

.selection-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

.primary-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  flex: 0 1 auto;
  justify-content: flex-end;
}

.action-menu-trigger {
  display: none;
  margin-left: auto;
}

.primary-action-btn {
  width: 84px;
  height: 68px;
  border-radius: 10px;
  padding: 8px 10px;
  justify-content: center;
}

.primary-action-btn .icon {
  width: 26px;
  height: 26px;
}

.action-menu-trigger .icon {
  width: 20px;
  height: 20px;
}

.selection-divider {
  width: 1px;
  height: 32px;
  background: var(--border);
}

.btn.icon-stack {
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  width: 84px;
  height: 68px;
  text-align: center;
  border-radius: 10px;
  border: none;
  background: var(--panel-3);
  box-shadow: none;
  align-items: center;
  justify-content: space-between;
}

.btn.icon-stack .icon {
  width: 26px;
  height: 26px;
}

.btn.icon-stack .action-label {
  font-size: 0.7rem;
  line-height: 1.1;
  color: var(--muted);
  margin-top: auto;
}

.btn.icon-stack:focus-visible {
  outline: none;
  box-shadow: none;
}

.btn.icon-stack:disabled {
  opacity: 0.35;
  filter: grayscale(0.35);
}

.selection-info {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
  margin-right: auto;
  text-align: left;
}

@media (max-width: 780px) {
  .selection-bar {
    justify-content: flex-end;
  }
  .selection-bar .selection-block,
  .selection-bar .selection-divider,
  .selection-bar .primary-actions {
    display: none;
  }
  .action-menu-trigger {
    display: inline-flex;
  }
}

.list-shell {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
}

.list-header {
  display: grid;
  grid-template-columns: 1fr 120px 170px;
  gap: 12px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--panel-3);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex: 0 0 auto;
}

.list-shell.show-creator .list-header,
.list-shell.show-creator .file-row {
  grid-template-columns: 1fr 160px 120px 170px;
}

.list-shell:not(.show-creator) .list-header > :nth-child(2) {
  display: none;
}

.file-list {
  overflow-y: auto;
  padding-right: 4px;
  min-height: 0;
  flex: 1 1 auto;
}

.file-list.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  align-content: start;
}

.file-list.no-anim .file-row,
.file-list.no-anim .file-card {
  animation: none;
}

.file-list.motion-forward .file-row,
.file-list.motion-forward .file-card {
  animation: slideForward 0.32s ease;
}

.file-list.motion-back .file-row,
.file-list.motion-back .file-card {
  animation: slideBack 0.32s ease;
}

.file-list.motion-refresh .file-row,
.file-list.motion-refresh .file-card,
.file-list.motion-place .file-row,
.file-list.motion-place .file-card,
.file-list.motion-view .file-row,
.file-list.motion-view .file-card,
.file-list.motion-sort .file-row,
.file-list.motion-sort .file-card {
  animation: fadeUp 0.28s ease;
}

.list-header.motion-forward,
.list-header.motion-back,
.list-header.motion-refresh,
.list-header.motion-place,
.list-header.motion-view,
.list-header.motion-sort {
  animation: fadeUp 0.2s ease;
}

.file-card,
.file-row {
  background: var(--panel);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  position: relative;
}

.file-card:hover,
.file-row:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.file-card.selected,
.file-row.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--focus);
}

.file-card img {
  width: 100%;
  border-radius: var(--radius-md);
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.file-card .file-card-name {
  font-size: 0.95rem;
  word-break: break-word;
  margin-top: 10px;
}

.file-row {
  display: grid;
  grid-template-columns: 1fr 120px 170px;
  gap: 12px;
  align-items: center;
}

.file-name {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.file-creator {
  color: var(--muted);
  font-size: 0.85rem;
}

.file-card-creator {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.file-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--icon-bg, var(--file-default-bg));
  color: var(--icon-color, var(--file-default-fg));
  border: 1px solid var(--border);
  box-shadow: none;
  flex-shrink: 0;
}

.file-size,
.file-mod {
  color: var(--muted);
  font-size: 0.9rem;
}

.file-icon.file-icon-dir {
  --icon-bg: var(--file-dir-bg);
  --icon-color: var(--file-dir-fg);
}

.file-icon.file-icon-image {
  --icon-bg: var(--file-image-bg);
  --icon-color: var(--file-image-fg);
}

.file-icon.file-icon-video {
  --icon-bg: var(--file-video-bg);
  --icon-color: var(--file-video-fg);
}

.file-icon.file-icon-audio {
  --icon-bg: var(--file-audio-bg);
  --icon-color: var(--file-audio-fg);
}

.file-icon.file-icon-pdf {
  --icon-bg: var(--file-pdf-bg);
  --icon-color: var(--file-pdf-fg);
}

.file-icon.file-icon-archive {
  --icon-bg: var(--file-archive-bg);
  --icon-color: var(--file-archive-fg);
}

.file-icon.file-icon-code {
  --icon-bg: var(--file-code-bg);
  --icon-color: var(--file-code-fg);
}

.file-icon.file-icon-doc {
  --icon-bg: var(--file-doc-bg);
  --icon-color: var(--file-doc-fg);
}

.file-icon.file-icon-sheet {
  --icon-bg: var(--file-sheet-bg);
  --icon-color: var(--file-sheet-fg);
}

.file-icon.file-icon-slide {
  --icon-bg: var(--file-slide-bg);
  --icon-color: var(--file-slide-fg);
}

.file-icon.file-icon-font {
  --icon-bg: var(--file-font-bg);
  --icon-color: var(--file-font-fg);
}

.file-icon.file-icon-design {
  --icon-bg: var(--file-design-bg);
  --icon-color: var(--file-design-fg);
}

.file-icon.file-icon-binary {
  --icon-bg: var(--file-binary-bg);
  --icon-color: var(--file-binary-fg);
}

.file-icon.file-icon-config {
  --icon-bg: var(--file-config-bg);
  --icon-color: var(--file-config-fg);
}

.file-icon.file-icon-data {
  --icon-bg: var(--file-data-bg);
  --icon-color: var(--file-data-fg);
}

.file-icon.file-icon-model {
  --icon-bg: var(--file-model-bg);
  --icon-color: var(--file-model-fg);
}

.file-icon.file-icon-exec {
  --icon-bg: var(--file-exec-bg);
  --icon-color: var(--file-exec-fg);
}

.file-icon.file-icon-text {
  --icon-bg: var(--file-text-bg);
  --icon-color: var(--file-text-fg);
}

.file-icon.file-icon-file {
  --icon-bg: var(--file-default-bg);
  --icon-color: var(--file-default-fg);
}

.lock-pill {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--accent-2);
  border: 1px solid rgba(249, 181, 114, 0.5);
  background: rgba(249, 181, 114, 0.15);
  padding: 3px 8px;
  border-radius: 999px;
}

.empty {
  margin-top: 30px;
  text-align: center;
  color: var(--muted);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.6);
  z-index: 8;
  backdrop-filter: blur(8px);
}

.drop-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 18, 0.7);
  display: grid;
  place-items: center;
  z-index: 5;
  backdrop-filter: blur(6px);
}

.drop-box {
  padding: 32px 42px;
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(92, 225, 206, 0.6);
  background: linear-gradient(135deg, rgba(92, 225, 206, 0.12), rgba(30, 136, 229, 0.14));
  color: var(--text);
  font-size: 1.05rem;
  box-shadow: var(--shadow);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.6);
  display: grid;
  place-items: center;
  z-index: 6;
  backdrop-filter: blur(8px);
}

.modal-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  padding: 24px;
  min-width: min(520px, 92vw);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.modal-card.wide {
  min-width: min(760px, 92vw);
}

.modal-title {
  font-weight: 700;
  margin-bottom: 12px;
}

.modal-body {
  max-height: 70vh;
  overflow: auto;
}

.settings-section {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.settings-section-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.account-grid {
  display: grid;
  gap: 10px;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(0, 2fr) auto;
  gap: 10px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.account-label {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.account-value {
  font-weight: 600;
  word-break: break-word;
}

.account-value.muted {
  font-weight: 500;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--muted);
  margin-left: 8px;
}

.status-pill.ok {
  border-color: rgba(92, 225, 206, 0.5);
  color: #1f9f8b;
  background: rgba(92, 225, 206, 0.15);
}

.status-pill.warn {
  border-color: rgba(249, 181, 114, 0.5);
  color: #d97706;
  background: rgba(249, 181, 114, 0.15);
}

.icon-btn.small {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
}

.icon-btn.small .icon {
  width: 16px;
  height: 16px;
}

.account-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.preview-media {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-md);
}

.preview-media.video {
  background: #000;
}

.context-menu {
  position: fixed;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  display: grid;
  gap: 6px;
  z-index: 7;
  min-width: 190px;
  box-shadow: var(--shadow);
}

.context-menu button {
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.context-menu button:hover {
  background: var(--panel-2);
}

.context-menu button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.context-menu button.danger {
  color: var(--danger);
}

.menu-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.menu-separator {
  height: 1px;
  background: var(--border);
  margin: 2px 4px;
}

.download-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

body.download-page {
  overflow: auto;
}

.download-card {
  width: min(760px, 92vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.download-hero {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: center;
  z-index: 1;
}

.download-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
}

.download-title {
  font-size: 1.6rem;
  margin: 0;
}

.download-path {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
  word-break: break-all;
}

.download-meta {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 22px;
  z-index: 1;
}

.download-meta-item {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.download-meta-label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.download-meta-value {
  margin-top: 6px;
  font-size: 0.95rem;
  word-break: break-word;
}

.download-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  z-index: 1;
}

.download-note {
  position: relative;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 16px;
  z-index: 1;
}

.download-error {
  color: var(--danger);
  margin-top: 16px;
}

.transfer-progress {
  position: fixed;
  right: 22px;
  bottom: 84px;
  width: min(360px, 92vw);
  padding: 10px 12px 12px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  z-index: 6;
}

.transfer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.transfer-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.transfer-bar {
  height: 100%;
  width: 0%;
  transition: width 0.2s ease;
  background: linear-gradient(90deg, var(--accent), #1e88e5, var(--accent-2));
}

.transfer-progress[data-state="download"] .transfer-bar {
  background: linear-gradient(90deg, #22c55e, #38bdf8, var(--accent));
}

@media (max-width: 640px) {
  .transfer-progress {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 74px;
  }
}

.loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(5, 7, 12, 0.55);
  z-index: 7;
  backdrop-filter: blur(8px);
  pointer-events: none;
}

.spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

.loading-text {
  color: var(--text);
  font-weight: 600;
}

.toast-stack {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: grid;
  gap: 10px;
  z-index: 9;
}

.toast {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  box-shadow: var(--shadow-soft);
  min-width: 220px;
}

.toast.success {
  border-color: rgba(92, 225, 206, 0.45);
}

.toast.error {
  border-color: rgba(239, 78, 93, 0.4);
  color: var(--danger);
}

.editor {
  position: fixed;
  inset: 40px;
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  z-index: 8;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.editor-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-body {
  flex: 1;
}

.mobile-only {
  display: none;
}

@media (max-width: 1100px) {
  .workspace-main {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}

@media (max-width: 920px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }
  .workspace-chrome {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 820px) {
  #shell {
    padding: 10px;
  }
  .workspace-main {
    grid-template-columns: 1fr;
    height: auto;
  }
  .sidebar {
    position: fixed;
    top: 16px;
    bottom: 16px;
    left: 16px;
    width: min(86vw, 320px);
    transform: translateX(-120%);
    transition: transform 0.2s ease;
    z-index: 9;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.hidden {
    display: none;
  }
  .mobile-only {
    display: inline-flex;
  }
  body {
    overflow: auto;
  }
  .content {
    height: auto;
  }
  .toolbar-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar-search {
    flex: 0 0 42px !important;
    width: 100%;
    height: 42px !important;
    min-height: 42px;
    max-height: 42px;
  }
  .toolbar-group.primary {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 980px) and (orientation: portrait) {
  .toolbar-actions .toolbar-search {
    flex: 0 0 42px !important;
    height: 42px !important;
    min-height: 42px;
    max-height: 42px;
  }
}

@media (max-width: 640px) {
  .list-header {
    display: none;
  }
  .file-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .account-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }
  .account-actions {
    justify-content: flex-start;
  }
  .file-size,
  .file-mod {
    font-size: 0.85rem;
  }
  .modal-card,
  .modal-card.wide {
    min-width: 94vw;
    padding: 16px;
  }
  .editor {
    inset: 0;
    border-radius: 0;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideForward {
  from {
    opacity: 0;
    transform: translateX(16px) translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes slideBack {
  from {
    opacity: 0;
    transform: translateX(-16px) translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
