/* =========================================================================
   S3 VAULT — World-class internal file manager + cost optimizer
   Design system: Linear / Vercel / Stripe-grade. Light + dark.
   All color via custom properties; theme switched on <html data-theme>.
   ========================================================================= */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

/* =========================================================================
   TOKENS — LIGHT (default)
   ========================================================================= */
:root {
  /* Neutral surfaces */
  --bg:          #fafafa;
  --bg-2:        #f4f4f5;
  --surface:     #ffffff;
  --surface-2:   #f7f7f8;
  --surface-3:   #efeff1;
  --overlay:     rgba(15, 16, 22, 0.42);

  /* Borders */
  --border:      #ececee;
  --border-2:    #dddde1;
  --border-3:    #c9c9cf;
  --ring:        rgba(91, 91, 214, 0.35);

  /* Text */
  --text:        #0d0d12;
  --text-2:      #4b4d57;
  --text-3:      #6b7280;
  --text-4:      #9ca3af;
  --text-on-accent: #ffffff;

  /* Accent (indigo/violet) */
  --accent:      #5b5bd6;
  --accent-2:    #4a4ac4;
  --accent-3:    #3f3fb0;
  --accent-soft: #ededfc;
  --accent-soft-2:#e0e0fa;
  --accent-text: #4a4ac4;

  /* Danger */
  --danger:      #dc2626;
  --danger-2:    #b91c1c;
  --danger-soft: #fef2f2;
  --danger-border:#fecaca;
  --danger-text: #b42318;

  /* Status */
  --success:     #16a34a;
  --success-soft:#ecfdf3;
  --warning:     #d97706;
  --warning-soft:#fffbeb;
  --warning-border:#fde68a;

  /* Storage-tier badge colors (bg / text / border) */
  --t-std-bg:#eff6ff; --t-std-fg:#2563eb; --t-std-bd:#bfdbfe;
  --t-int-bg:#eef2ff; --t-int-fg:#4f46e5; --t-int-bd:#c7d2fe;
  --t-ia-bg:#effdf8;  --t-ia-fg:#0d9488;  --t-ia-bd:#99f6e4;
  --t-1z-bg:#ecfeff;  --t-1z-fg:#0891b2;  --t-1z-bd:#a5f3fc;
  --t-gir-bg:#eef2ff; --t-gir-fg:#4338ca; --t-gir-bd:#c7d2fe;
  --t-gla-bg:#f5f3ff; --t-gla-fg:#7c3aed; --t-gla-bd:#ddd6fe;
  --t-deep-bg:#faf5ff;--t-deep-fg:#9333ea; --t-deep-bd:#e9d5ff;
  --t-rrs-bg:#fffbeb; --t-rrs-fg:#d97706;  --t-rrs-bd:#fde68a;

  /* Shadows */
  --sh-1: 0 1px 2px rgba(16, 18, 27, 0.05);
  --sh-2: 0 4px 12px rgba(16, 18, 27, 0.08), 0 1px 3px rgba(16, 18, 27, 0.06);
  --sh-3: 0 8px 24px rgba(16, 18, 27, 0.10), 0 2px 6px rgba(16, 18, 27, 0.06);
  --sh-4: 0 20px 48px rgba(16, 18, 27, 0.16), 0 6px 16px rgba(16, 18, 27, 0.08);
  --sh-pop: 0 12px 32px rgba(16, 18, 27, 0.14), 0 2px 8px rgba(16, 18, 27, 0.08);

  /* Geometry */
  --r-1: 6px;
  --r-2: 8px;
  --r-3: 10px;
  --r-4: 14px;
  --r-pill: 999px;

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Code', Menlo, monospace;

  /* Layout */
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 60px;
  --topbar-h: 56px;
  --dur: 150ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================================
   TOKENS — DARK (mission-control inspired neutral + indigo)
   ========================================================================= */
:root[data-theme="dark"] {
  --bg:          #0c0d10;
  --bg-2:        #121317;
  --surface:     #16171c;
  --surface-2:   #1c1e24;
  --surface-3:   #23252c;
  --overlay:     rgba(0, 0, 0, 0.66);

  --border:      #25272e;
  --border-2:    #313440;
  --border-3:    #3e4250;
  --ring:        rgba(124, 124, 240, 0.45);

  --text:        #f0f1f4;
  --text-2:      #b6b9c4;
  --text-3:      #888c99;
  --text-4:      #5f636f;
  --text-on-accent: #0c0d10;

  --accent:      #7c7cf0;
  --accent-2:    #9292f5;
  --accent-3:    #a6a6f8;
  --accent-soft: #1e1e35;
  --accent-soft-2:#262648;
  --accent-text: #a6a6f8;

  --danger:      #f0616d;
  --danger-2:    #f87481;
  --danger-soft: #2a1417;
  --danger-border:#5a242b;
  --danger-text: #f0808c;

  --success:     #3ecf76;
  --success-soft:#10231a;
  --warning:     #f0a93c;
  --warning-soft:#241a0c;
  --warning-border:#4a3a1a;

  --t-std-bg:#16243d; --t-std-fg:#7eacff; --t-std-bd:#27406b;
  --t-int-bg:#1c1f44; --t-int-fg:#9aa0ff; --t-int-bd:#2f3470;
  --t-ia-bg:#0e2b27;  --t-ia-fg:#4fd6c4;  --t-ia-bd:#1d4a44;
  --t-1z-bg:#0c2a30;  --t-1z-fg:#43cfe0;  --t-1z-bd:#184750;
  --t-gir-bg:#1b1d44; --t-gir-fg:#9b9bff; --t-gir-bd:#2e3170;
  --t-gla-bg:#24163d; --t-gla-fg:#b794f6; --t-gla-bd:#3d2768;
  --t-deep-bg:#2a153d;--t-deep-fg:#c99af6; --t-deep-bd:#46266b;
  --t-rrs-bg:#241a0c; --t-rrs-fg:#f0b85c;  --t-rrs-bd:#4a3a1a;

  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-2: 0 4px 12px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
  --sh-3: 0 8px 24px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
  --sh-4: 0 24px 56px rgba(0, 0, 0, 0.7), 0 8px 18px rgba(0, 0, 0, 0.5);
  --sh-pop: 0 16px 40px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* =========================================================================
   BASE
   ========================================================================= */
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-soft-2); color: var(--text); }

/* Scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--border-3); background-clip: padding-box; }

/* Focus visibility */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }

kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  color: var(--text-3);
  white-space: nowrap;
}

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--r-2);
  background: transparent;
  color: var(--text);
  font-size: 12.5px; font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform 80ms var(--ease);
  user-select: none;
}
.btn:active { transform: translateY(0.5px); }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; gap: 5px; }
.btn-lg { height: 38px; padding: 0 18px; font-size: 13.5px; }
.btn-icon { width: 32px; padding: 0; flex-shrink: 0; }
.btn-icon.btn-sm { width: 28px; }

.btn-default {
  background: var(--surface); border-color: var(--border-2); color: var(--text);
  box-shadow: var(--sh-1);
}
.btn-default:hover { background: var(--surface-2); border-color: var(--border-3); }

.btn-primary {
  background: var(--accent); border-color: var(--accent); color: var(--text-on-accent);
  font-weight: 600; box-shadow: var(--sh-1);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.btn-danger:hover { background: var(--danger-2); border-color: var(--danger-2); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger-text); border-color: transparent; }
.btn-danger-soft:hover { background: var(--danger-soft); border-color: var(--danger-border); }

.btn-subtle { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
.btn-subtle:hover { background: var(--surface-3); color: var(--text); }

.btn-accent-soft { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.btn-accent-soft:hover { background: var(--accent-soft-2); }

/* =========================================================================
   APP SHELL
   ========================================================================= */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 100vh;
  height: 100vh;
  transition: grid-template-columns 180ms var(--ease);
}
.app.sidebar-collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

/* =========================================================================
   SIDEBAR
   ========================================================================= */
.sidebar {
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  min-width: 0;
  overflow: hidden;
}
.sb-top {
  display: flex; align-items: center; gap: 9px;
  height: var(--topbar-h); padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sb-logo { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.sb-logo-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--accent);
  display: grid; place-items: center; flex-shrink: 0;
  box-shadow: var(--sh-1);
}
.sb-logo-mark svg { width: 16px; height: 16px; color: #fff; }
.sb-logo-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.sb-logo-name { font-size: 14px; font-weight: 600; letter-spacing: -0.2px; color: var(--text); }
.sb-logo-hint { font-size: 10.5px; color: var(--text-4); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-collapse {
  width: 26px; height: 26px; flex-shrink: 0;
  display: grid; place-items: center;
  border: none; background: transparent; color: var(--text-4); cursor: pointer;
  border-radius: var(--r-1);
}
.sb-collapse:hover { background: var(--surface-2); color: var(--text-2); }
.sb-collapse svg { width: 16px; height: 16px; transition: transform 180ms var(--ease); }

.sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 10px; }

.sb-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--text-4); padding: 0 8px; margin: 14px 0 6px;
}
.sb-section-label:first-child { margin-top: 0; }

/* Bucket switcher combobox */
.bucket-switcher { position: relative; }
.bucket-current {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 10px; border: 1px solid var(--border-2); border-radius: var(--r-2);
  background: var(--surface); cursor: pointer; box-shadow: var(--sh-1);
  text-align: left;
}
.bucket-current:hover { border-color: var(--border-3); }
.bucket-current .bc-icon { width: 22px; height: 22px; border-radius: 5px; background: var(--accent-soft); display: grid; place-items: center; flex-shrink: 0; }
.bucket-current .bc-icon svg { width: 13px; height: 13px; color: var(--accent); }
.bucket-current .bc-body { min-width: 0; flex: 1; }
.bucket-current .bc-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bucket-current .bc-meta { font-size: 10.5px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bucket-current .bc-caret { color: var(--text-4); flex-shrink: 0; }
.bucket-current .bc-caret svg { width: 14px; height: 14px; }

.bucket-pop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 60;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-3);
  box-shadow: var(--sh-pop); overflow: hidden;
  display: flex; flex-direction: column; max-height: 60vh;
  animation: popIn 140ms var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.bucket-pop-search { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.bucket-pop-search svg { width: 14px; height: 14px; color: var(--text-4); flex-shrink: 0; }
.bucket-pop-search input { flex: 1; border: none; background: transparent; outline: none; font-size: 12.5px; color: var(--text); }
.bucket-pop-list { overflow-y: auto; padding: 4px; flex: 1; }
.bucket-pop-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--r-1);
  cursor: pointer; width: 100%; text-align: left; border: none; background: transparent;
}
.bucket-pop-item:hover, .bucket-pop-item.kbd-active { background: var(--surface-2); }
.bucket-pop-item.current { background: var(--accent-soft); }
.bucket-pop-item svg.bp-bk { width: 14px; height: 14px; color: var(--text-4); flex-shrink: 0; }
.bucket-pop-item.current svg.bp-bk { color: var(--accent); }
.bucket-pop-item .bp-name { flex: 1; font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bucket-pop-item.current .bp-name { color: var(--text); font-weight: 600; }
.bucket-pop-item .bp-check { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; }
.bucket-pop-empty { padding: 16px; text-align: center; color: var(--text-4); font-size: 12px; }
.bucket-pop-foot { border-top: 1px solid var(--border); padding: 4px; }
.bucket-pop-foot button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px;
  border: none; background: transparent; border-radius: var(--r-1); cursor: pointer;
  font-size: 12.5px; color: var(--accent-text); font-weight: 500;
}
.bucket-pop-foot button:hover { background: var(--accent-soft); }
.bucket-pop-foot button svg { width: 14px; height: 14px; }

/* Nav */
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px;
  border-radius: var(--r-2); border: none; background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-2); width: 100%; text-align: left;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.sb-nav-item:hover { background: var(--surface-2); color: var(--text); }
.sb-nav-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.sb-nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.sb-nav-item .sb-nav-badge {
  margin-left: auto; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: var(--r-pill);
  background: var(--success-soft); color: var(--success);
}

/* Storage breakdown panel */
.sb-breakdown { margin-top: 6px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); }
.sb-bd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sb-bd-title { font-size: 11px; font-weight: 600; color: var(--text-3); }
.sb-bd-refresh { width: 22px; height: 22px; display: grid; place-items: center; border: none; background: transparent; color: var(--text-4); cursor: pointer; border-radius: var(--r-1); }
.sb-bd-refresh:hover { background: var(--surface-2); color: var(--text-2); }
.sb-bd-refresh svg { width: 13px; height: 13px; }
.sb-bd-refresh.spinning svg { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sb-bd-stack { display: flex; height: 8px; border-radius: var(--r-pill); overflow: hidden; background: var(--surface-3); margin-bottom: 12px; }
.sb-bd-seg { height: 100%; min-width: 2px; transition: width 400ms var(--ease); }
.sb-bd-rows { display: flex; flex-direction: column; gap: 7px; }
.sb-bd-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.sb-bd-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.sb-bd-name { color: var(--text-2); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-bd-val { color: var(--text-4); font-family: var(--mono); font-size: 10.5px; }
.sb-bd-total { display: flex; justify-content: space-between; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 11.5px; }
.sb-bd-total .l { color: var(--text-3); }
.sb-bd-total .v { color: var(--text); font-weight: 600; font-family: var(--mono); }
.sb-bd-skel { display: flex; flex-direction: column; gap: 8px; }
.sb-bd-empty { font-size: 11.5px; color: var(--text-4); text-align: center; padding: 8px 0; }
.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: var(--r-1); }
@keyframes skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* Sidebar footer */
.sb-foot { flex-shrink: 0; border-top: 1px solid var(--border); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.sb-foot-user { display: flex; align-items: center; gap: 9px; padding: 6px 8px; min-width: 0; }
.sb-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.sb-foot-email { font-size: 11.5px; color: var(--text-3); min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-foot-actions { display: flex; gap: 6px; }
.sb-foot-actions .btn { flex: 1; }

/* Collapsed sidebar */
.sidebar-collapsed .sb-logo-text,
.sidebar-collapsed .sb-section-label,
.sidebar-collapsed .bucket-current .bc-body,
.sidebar-collapsed .bucket-current .bc-caret,
.sidebar-collapsed .sb-nav-item span,
.sidebar-collapsed .sb-nav-item .sb-nav-badge,
.sidebar-collapsed .sb-breakdown,
.sidebar-collapsed .sb-foot-email,
.sidebar-collapsed .sb-foot-actions span { display: none; }
.sidebar-collapsed .sb-top { padding: 0; justify-content: center; }
.sidebar-collapsed .sb-collapse { display: none; }
.sidebar-collapsed .sb-logo { justify-content: center; }
.sidebar-collapsed .bucket-current { justify-content: center; padding: 8px; }
.sidebar-collapsed .sb-nav-item { justify-content: center; padding: 9px; }
.sidebar-collapsed .sb-foot-user { justify-content: center; padding: 6px 0; }
.sidebar-collapsed .sb-foot-actions { flex-direction: column; }
.sidebar-collapsed .sb-scroll { padding: 12px 8px; }

/* =========================================================================
   WORKSPACE (topbar + main)
   ========================================================================= */
.workspace { display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 12px;
  height: var(--topbar-h); padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.tb-breadcrumb { display: flex; align-items: center; gap: 3px; min-width: 0; flex-shrink: 1; font-size: 13px; overflow: hidden; }
.tb-breadcrumb .crumb {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none; cursor: pointer; color: var(--text-2);
  padding: 4px 7px; border-radius: var(--r-1); font: inherit; max-width: 240px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tb-breadcrumb .crumb:hover { background: var(--surface-2); color: var(--text); }
.tb-breadcrumb .crumb.current { color: var(--text); font-weight: 600; cursor: default; }
.tb-breadcrumb .crumb.current:hover { background: transparent; }
.tb-breadcrumb .crumb svg { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; }
.tb-breadcrumb .crumb-sep { color: var(--text-4); flex-shrink: 0; }

.tb-spacer { flex: 1; }

/* Global search */
.tb-search { position: relative; width: 300px; max-width: 34vw; flex-shrink: 0; }
.tb-search .s-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-4); pointer-events: none; }
.tb-search .s-icon svg { width: 14px; height: 14px; display: block; }
.tb-search input {
  width: 100%; height: 34px;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-2);
  padding: 0 58px 0 32px; font-size: 12.5px; color: var(--text); outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
.tb-search input::placeholder { color: var(--text-4); }
.tb-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); background: var(--surface); }
.tb-search input[type="search"]::-webkit-search-cancel-button { display: none; }
.tb-search .s-hint { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.tb-search .s-clear { position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; border-radius: var(--r-1); border: none; background: var(--surface-3); color: var(--text-3); cursor: pointer; display: grid; place-items: center; }
.tb-search .s-clear:hover { color: var(--text); }
.tb-search .s-clear svg { width: 11px; height: 11px; }

.tb-cmdk {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border-2); border-radius: var(--r-2); background: var(--surface-2);
  color: var(--text-3); cursor: pointer; font-size: 12px; flex-shrink: 0;
}
.tb-cmdk:hover { background: var(--surface-3); color: var(--text-2); }
.tb-cmdk kbd { border: none; background: var(--surface); padding: 2px 5px; }

/* View toggle */
.view-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-2); padding: 2px; flex-shrink: 0; }
.view-toggle button { width: 28px; height: 26px; display: grid; place-items: center; border: none; background: transparent; color: var(--text-4); cursor: pointer; border-radius: var(--r-1); }
.view-toggle button:hover { color: var(--text-2); }
.view-toggle button.active { background: var(--surface); color: var(--accent-text); box-shadow: var(--sh-1); }
.view-toggle button svg { width: 15px; height: 15px; }

.tb-divider { width: 1px; height: 22px; background: var(--border-2); flex-shrink: 0; }

/* Main */
.main { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; }
.view { display: none; }
.view.active { display: block; }
.view-pad { padding: 20px 24px 80px; }
.view-narrow { max-width: 1180px; margin: 0 auto; }

/* =========================================================================
   PAGE HEADERS / TOOLBARS
   ========================================================================= */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title-group { min-width: 0; }
.page-title { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; display: flex; align-items: center; gap: 9px; }
.page-title svg { width: 19px; height: 19px; color: var(--accent); }
.page-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; }

.files-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ft-count { font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ft-spacer { flex: 1; }

/* Upload-as inline control */
.upload-as {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 4px 0 10px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-2); box-shadow: var(--sh-1);
}
.upload-as label { font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-4); white-space: nowrap; }
.select-wrap { position: relative; display: inline-flex; align-items: center; }
.select-wrap select {
  appearance: none; -webkit-appearance: none;
  background: transparent; border: none; outline: none; cursor: pointer;
  font-size: 12px; color: var(--text-2); padding: 0 24px 0 4px; height: 30px;
}
.select-wrap select:focus { color: var(--text); }
.select-wrap .sel-caret { position: absolute; right: 6px; pointer-events: none; color: var(--text-4); }
.select-wrap .sel-caret svg { width: 12px; height: 12px; display: block; }
.select-standalone { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-2); box-shadow: var(--sh-1); padding-left: 6px; }
.select-standalone select { height: 32px; padding-left: 8px; color: var(--text); }

/* Segmented control */
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-2); padding: 2px; }
.segmented button { height: 26px; padding: 0 12px; border: none; background: transparent; color: var(--text-3); cursor: pointer; border-radius: var(--r-1); font-size: 12px; font-weight: 500; }
.segmented button:hover { color: var(--text-2); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-1); }

/* =========================================================================
   COST BANNER (Files view hero)
   ========================================================================= */
.cost-banner {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-4);
  padding: 14px 18px; margin-bottom: 16px; box-shadow: var(--sh-1);
}
.cost-banner-icon { width: 38px; height: 38px; border-radius: var(--r-2); background: var(--warning-soft); border: 1px solid var(--warning-border); display: grid; place-items: center; flex-shrink: 0; }
.cost-banner-icon svg { width: 19px; height: 19px; color: var(--warning); }
.cost-banner-stats { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cb-stat { display: flex; flex-direction: column; gap: 1px; }
.cb-stat .v { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; font-variant-numeric: tabular-nums; }
.cb-stat .l { font-size: 10px; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.05em; }
.cb-vdiv { width: 1px; height: 28px; background: var(--border-2); }
.cost-banner-msg { flex: 1; min-width: 200px; font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.cost-banner-msg svg { width: 15px; height: 15px; color: var(--success); flex-shrink: 0; }
.cost-banner-msg .save { color: var(--success); font-weight: 600; }
.cost-banner.loading { color: var(--text-4); }

/* =========================================================================
   DATA TABLE (Files list)
   ========================================================================= */
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-4); overflow: hidden; box-shadow: var(--sh-1); }
.dt { width: 100%; border-collapse: collapse; table-layout: fixed; }
.dt col.c-check { width: 40px; }
.dt col.c-size { width: 110px; }
.dt col.c-mod { width: 150px; }
.dt col.c-class { width: 150px; }
.dt col.c-act { width: 48px; }

.dt thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
  text-align: left; padding: 9px 12px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-3);
  white-space: nowrap; user-select: none;
}
.dt thead th.sortable { cursor: pointer; }
.dt thead th.sortable:hover { color: var(--text); }
.dt thead th .th-inner { display: inline-flex; align-items: center; gap: 4px; }
.dt thead th.num .th-inner { justify-content: flex-end; }
.dt thead th.sorted { color: var(--accent-text); }
.sort-arrow { width: 12px; height: 12px; opacity: 0.9; }
.sort-arrow.hidden { opacity: 0; }

.dt td { padding: 0 12px; height: 46px; border-bottom: 1px solid var(--border); vertical-align: middle; overflow: hidden; }
.dt tbody tr:last-child td { border-bottom: none; }
.dt tbody tr { cursor: pointer; transition: background 80ms var(--ease); }
.dt tbody tr:hover { background: var(--surface-2); }
.dt tbody tr.selected { background: var(--accent-soft); }
.dt tbody tr.selected:hover { background: var(--accent-soft-2); }
.dt tbody tr.drag-target { background: var(--accent-soft-2); box-shadow: inset 0 0 0 2px var(--accent); }

.dt-section-row td { height: auto; padding: 0; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.dt-section-label { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-4); padding: 7px 12px; }

.cell-check { text-align: center; }
.cell-name { min-width: 0; }
.cell-size, .cell-mod { font-family: var(--mono); font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cell-mod { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-act { text-align: right; }

.name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.file-icon { width: 30px; height: 30px; border-radius: var(--r-1); display: grid; place-items: center; flex-shrink: 0; }
.file-icon svg { width: 16px; height: 16px; }
.name-text { min-width: 0; }
.name-primary { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
tr.is-folder .name-primary { font-weight: 600; }
.name-secondary { font-size: 11px; color: var(--text-4); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

/* File-type icon palettes */
.fi-folder { background: var(--accent-soft); color: var(--accent); }
.fi-image  { background: var(--success-soft); color: var(--success); }
.fi-video  { background: var(--t-gla-bg); color: var(--t-gla-fg); }
.fi-audio  { background: var(--t-rrs-bg); color: var(--t-rrs-fg); }
.fi-pdf    { background: var(--danger-soft); color: var(--danger); }
.fi-text   { background: var(--surface-3); color: var(--text-3); }
.fi-code   { background: var(--t-std-bg); color: var(--t-std-fg); }
.fi-sheet  { background: var(--success-soft); color: var(--success); }
.fi-archive{ background: var(--warning-soft); color: var(--warning); }
.fi-file   { background: var(--surface-3); color: var(--text-3); }

/* Checkbox */
.cbx { position: relative; display: inline-grid; place-items: center; width: 16px; height: 16px; cursor: pointer; vertical-align: middle; }
.cbx input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.cbx .box { width: 16px; height: 16px; border: 1.5px solid var(--border-3); border-radius: 4px; background: var(--surface); display: grid; place-items: center; transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.cbx .box svg { width: 11px; height: 11px; color: #fff; opacity: 0; transform: scale(0.6); transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
.cbx input:checked ~ .box, .cbx.indeterminate .box { background: var(--accent); border-color: var(--accent); }
.cbx input:checked ~ .box svg, .cbx.indeterminate .box svg { opacity: 1; transform: none; }
.cbx input:focus-visible ~ .box { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Storage badge */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--r-1);
  font-size: 11px; font-weight: 500; white-space: nowrap; border: 1px solid transparent;
  font-variant-numeric: tabular-nums;
}
.badge svg { width: 10px; height: 10px; }
.badge-STANDARD { background: var(--t-std-bg); color: var(--t-std-fg); border-color: var(--t-std-bd); }
.badge-INTELLIGENT_TIERING { background: var(--t-int-bg); color: var(--t-int-fg); border-color: var(--t-int-bd); }
.badge-STANDARD_IA { background: var(--t-ia-bg); color: var(--t-ia-fg); border-color: var(--t-ia-bd); }
.badge-ONEZONE_IA { background: var(--t-1z-bg); color: var(--t-1z-fg); border-color: var(--t-1z-bd); }
.badge-GLACIER_IR { background: var(--t-gir-bg); color: var(--t-gir-fg); border-color: var(--t-gir-bd); }
.badge-GLACIER { background: var(--t-gla-bg); color: var(--t-gla-fg); border-color: var(--t-gla-bd); }
.badge-DEEP_ARCHIVE { background: var(--t-deep-bg); color: var(--t-deep-fg); border-color: var(--t-deep-bd); }
.badge-REDUCED_REDUNDANCY { background: var(--t-rrs-bg); color: var(--t-rrs-fg); border-color: var(--t-rrs-bd); }

/* Row action button */
.row-menu-btn { width: 28px; height: 28px; display: inline-grid; place-items: center; border: 1px solid transparent; background: transparent; color: var(--text-4); cursor: pointer; border-radius: var(--r-1); opacity: 0; transition: opacity var(--dur) var(--ease); }
.dt tbody tr:hover .row-menu-btn, .row-menu-btn.open { opacity: 1; }
.row-menu-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }
.row-menu-btn svg { width: 15px; height: 15px; }

/* =========================================================================
   GRID VIEW
   ========================================================================= */
.grid-section-label { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-4); margin: 4px 0 10px; }
.grid-section-label.mt { margin-top: 22px; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 14px; }
.grid-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); overflow: hidden;
  cursor: pointer; position: relative; box-shadow: var(--sh-1);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.grid-card:hover { border-color: var(--border-3); box-shadow: var(--sh-2); }
.grid-card.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--ring), var(--sh-2); }
.grid-card-check { position: absolute; top: 9px; left: 9px; z-index: 2; background: var(--surface); border-radius: 5px; box-shadow: var(--sh-1); opacity: 0; transition: opacity var(--dur) var(--ease); }
.grid-card:hover .grid-card-check, .grid-card.selected .grid-card-check { opacity: 1; }
.grid-card-menu { position: absolute; top: 7px; right: 7px; z-index: 2; opacity: 0; }
.grid-card:hover .grid-card-menu, .grid-card-menu.open { opacity: 1; }
.grid-card-menu .row-menu-btn { opacity: 1; background: var(--surface); box-shadow: var(--sh-1); }
.grid-thumb { height: 120px; display: grid; place-items: center; background: var(--surface-2); position: relative; overflow: hidden; }
.grid-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid-thumb .big-icon { width: 44px; height: 44px; }
.grid-thumb .big-icon svg { width: 100%; height: 100%; }
.grid-thumb.is-folder { background: var(--accent-soft); }
.grid-thumb-badge { position: absolute; bottom: 8px; right: 8px; font-size: 9.5px; font-weight: 600; padding: 2px 6px; border-radius: var(--r-1); background: rgba(0,0,0,0.6); color: #fff; }
.grid-play { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.85); display: grid; place-items: center; position: absolute; }
.grid-play svg { width: 14px; height: 14px; color: #111; margin-left: 2px; }
.grid-body { padding: 10px 11px 11px; }
.grid-name { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; min-width: 0; }
.grid-name svg { width: 13px; height: 13px; flex-shrink: 0; }
.grid-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--text-4); }
.grid-meta .g-size { font-family: var(--mono); }

/* =========================================================================
   STATES (skeleton, empty, error)
   ========================================================================= */
.skel-row td { height: 46px; }
.skel-line { height: 12px; border-radius: var(--r-1); }

.empty-state, .error-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 64px 24px; gap: 6px;
}
.empty-icon { width: 48px; height: 48px; border-radius: var(--r-3); background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; margin-bottom: 10px; }
.empty-icon svg { width: 24px; height: 24px; color: var(--text-4); }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text); }
.empty-sub { font-size: 12.5px; color: var(--text-3); max-width: 320px; }
.error-state .empty-icon { background: var(--danger-soft); border-color: var(--danger-border); }
.error-state .empty-icon svg { color: var(--danger); }

.load-more-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px; }
.trunc-note { font-size: 11.5px; color: var(--text-4); text-align: center; padding: 10px; }

/* Inline loader bar */
.loader-bar { height: 2px; background: var(--border); overflow: hidden; position: relative; }
.loader-bar::after { content: ''; position: absolute; inset: 0; width: 40%; background: var(--accent); animation: indet 1.1s ease-in-out infinite; border-radius: 2px; }
@keyframes indet { 0% { left: -40%; } 100% { left: 100%; } }

/* =========================================================================
   SELECTION ACTION BAR
   ========================================================================= */
.selection-bar {
  position: sticky; bottom: 16px; z-index: 25;
  display: flex; align-items: center; gap: 8px; margin: 16px auto 0; width: fit-content; max-width: 100%;
  padding: 8px 8px 8px 14px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-pill);
  box-shadow: var(--sh-3);
  animation: barUp 180ms var(--ease);
}
@keyframes barUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.sel-count { font-size: 12.5px; font-weight: 600; color: var(--accent-text); white-space: nowrap; margin-right: 2px; display: flex; align-items: center; gap: 6px; }
.sel-count .x { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 11px; font-variant-numeric: tabular-nums; }
.sel-vdiv { width: 1px; height: 20px; background: var(--border-2); }
.selection-bar .btn { box-shadow: none; }

/* =========================================================================
   DROPDOWN MENU (popover)
   ========================================================================= */
.menu {
  position: fixed; z-index: 200; min-width: 200px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-3);
  box-shadow: var(--sh-pop); padding: 5px; animation: popIn 120ms var(--ease);
}
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 9px;
  border: none; background: transparent; border-radius: var(--r-1); cursor: pointer;
  font-size: 12.5px; color: var(--text-2); text-align: left; white-space: nowrap;
}
.menu-item:hover, .menu-item.kbd-active { background: var(--surface-2); color: var(--text); }
.menu-item svg { width: 15px; height: 15px; color: var(--text-4); flex-shrink: 0; }
.menu-item:hover svg { color: var(--text-2); }
.menu-item.danger { color: var(--danger-text); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-item.danger svg { color: var(--danger); }
.menu-item .item-caret { margin-left: auto; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }
.menu-label { font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-4); padding: 6px 9px 4px; }
.menu-item .check-slot { width: 14px; margin-left: auto; }
.menu-item .check-slot svg { width: 14px; height: 14px; color: var(--accent); }

/* =========================================================================
   MODALS
   ========================================================================= */
.modal-layer { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade 160ms var(--ease); }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-4);
  box-shadow: var(--sh-4); width: 100%; max-width: 440px; max-height: 88vh; display: flex; flex-direction: column;
  overflow: hidden; animation: modalIn 180ms var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-lg { max-width: 1080px; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; }
.modal-head.with-border { border-bottom: 1px solid var(--border); padding-bottom: 16px; }
.modal-head-icon { width: 36px; height: 36px; border-radius: var(--r-2); display: grid; place-items: center; flex-shrink: 0; }
.modal-head-icon.danger { background: var(--danger-soft); border: 1px solid var(--danger-border); }
.modal-head-icon.danger svg { width: 19px; height: 19px; color: var(--danger); }
.modal-head-icon.accent { background: var(--accent-soft); }
.modal-head-icon.accent svg { width: 19px; height: 19px; color: var(--accent); }
.modal-head-text { min-width: 0; flex: 1; }
.modal-title { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; color: var(--text); }
.modal-subtitle { font-size: 12.5px; color: var(--text-3); margin-top: 3px; line-height: 1.5; }
.modal-close { width: 28px; height: 28px; display: grid; place-items: center; border: none; background: transparent; color: var(--text-4); cursor: pointer; border-radius: var(--r-1); flex-shrink: 0; }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 0 20px 16px; overflow-y: auto; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); flex-shrink: 0; }
.modal-foot .left { margin-right: auto; }

.field-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-3); margin-bottom: 7px; }
.text-input {
  width: 100%; height: 36px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-2);
  padding: 0 12px; font-size: 13px; color: var(--text); outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); background: var(--surface); }
.text-input.mono { font-family: var(--mono); font-size: 12.5px; }
.text-input.danger-input { border-color: var(--danger-border); }
.text-input.danger-input:focus { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,0.18); }

.warn-box { background: var(--warning-soft); border: 1px solid var(--warning-border); border-radius: var(--r-2); padding: 10px 12px; font-size: 12px; color: var(--text-2); line-height: 1.5; margin-bottom: 14px; }
.warn-box strong { color: var(--warning); }
.danger-box { background: var(--danger-soft); border: 1px solid var(--danger-border); border-radius: var(--r-2); padding: 10px 12px; font-size: 12px; color: var(--danger-text); line-height: 1.5; margin-bottom: 14px; }
.danger-box strong { font-weight: 700; }

.delete-list { margin: 10px 0 4px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-2); max-height: 180px; overflow-y: auto; }
.delete-list-item { font-family: var(--mono); font-size: 11.5px; color: var(--text-3); padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; }
.delete-list-item span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delete-list-item .sz { flex-shrink: 0; }

.check-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; cursor: pointer; }
.check-row .check-row-body { font-size: 12.5px; color: var(--text-2); line-height: 1.45; }
.check-row .check-row-body strong { color: var(--text); }

/* Preview modal */
.preview-modal { max-width: 1080px; width: 100%; height: 88vh; max-height: 88vh; }
.preview-stage { flex: 1; min-height: 0; display: grid; place-items: center; background: var(--bg-2); overflow: auto; padding: 0; }
.preview-stage img, .preview-stage video { max-width: 100%; max-height: 100%; display: block; }
.preview-stage audio { width: min(90%, 560px); }
.preview-stage iframe { width: 100%; height: 100%; border: none; background: #fff; }
.preview-stage pre { width: 100%; height: 100%; margin: 0; padding: 20px 24px; overflow: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; color: var(--text-2); white-space: pre-wrap; word-break: break-word; background: var(--surface); }
.preview-archived { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 48px; }
.preview-archived .pa-icon { width: 56px; height: 56px; border-radius: var(--r-3); background: var(--t-gla-bg); display: grid; place-items: center; }
.preview-archived .pa-icon svg { width: 28px; height: 28px; color: var(--t-gla-fg); }
.preview-archived .pa-title { font-size: 16px; font-weight: 600; }
.preview-archived .pa-sub { font-size: 13px; color: var(--text-3); max-width: 360px; }
.preview-loading { display: grid; place-items: center; padding: 60px; color: var(--text-4); }

/* =========================================================================
   DETAIL DRAWER
   ========================================================================= */
.drawer-layer { position: fixed; inset: 0; z-index: 280; }
.drawer-backdrop { position: absolute; inset: 0; background: var(--overlay); animation: fade 160ms var(--ease); }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 380px; max-width: 92vw; background: var(--surface); border-left: 1px solid var(--border-2); box-shadow: var(--sh-4); display: flex; flex-direction: column; animation: drawerIn 200ms var(--ease); }
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: none; } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.drawer-head .dh-icon { width: 38px; height: 38px; border-radius: var(--r-2); display: grid; place-items: center; flex-shrink: 0; }
.drawer-head .dh-icon svg { width: 19px; height: 19px; }
.drawer-head .dh-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; word-break: break-word; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.drawer-preview { height: 160px; border-radius: var(--r-3); background: var(--bg-2); display: grid; place-items: center; overflow: hidden; margin-bottom: 18px; border: 1px solid var(--border); }
.drawer-preview img { width: 100%; height: 100%; object-fit: cover; }
.drawer-preview .big-icon { width: 48px; height: 48px; }
.drawer-meta { display: flex; flex-direction: column; gap: 0; }
.drawer-meta-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.drawer-meta-row .k { color: var(--text-4); flex-shrink: 0; }
.drawer-meta-row .v { color: var(--text); text-align: right; word-break: break-word; font-variant-numeric: tabular-nums; }
.drawer-meta-row .v.mono { font-family: var(--mono); font-size: 11.5px; }
.drawer-actions { padding: 14px 18px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drawer-actions .btn { width: 100%; }
.drawer-actions .full { grid-column: 1 / -1; }

/* =========================================================================
   UPLOAD TRAY
   ========================================================================= */
.upload-tray {
  position: fixed; right: 20px; bottom: 20px; z-index: 250; width: 376px; max-width: calc(100vw - 40px);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-4);
  box-shadow: var(--sh-4); display: flex; flex-direction: column; overflow: hidden;
  animation: barUp 200ms var(--ease);
}
.tray-head { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.tray-head .th-title { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.tray-head .th-title svg { width: 15px; height: 15px; color: var(--accent); }
.tray-head .th-pill { font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); }
.tray-head .th-actions { margin-left: auto; display: flex; gap: 4px; }
.tray-head .th-actions button { width: 26px; height: 26px; display: grid; place-items: center; border: none; background: transparent; color: var(--text-4); cursor: pointer; border-radius: var(--r-1); }
.tray-head .th-actions button:hover { background: var(--surface-2); color: var(--text); }
.tray-head .th-actions button svg { width: 15px; height: 15px; }
.tray-overall { padding: 8px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.tray-overall .o-track { flex: 1; height: 4px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.tray-overall .o-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width 200ms var(--ease); }
.tray-overall .o-label { font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tray-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.tray-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-2); }
.tray-item:hover { background: var(--surface-2); }
.tray-item-icon { width: 30px; height: 30px; border-radius: var(--r-1); display: grid; place-items: center; flex-shrink: 0; }
.tray-item-icon svg { width: 15px; height: 15px; }
.tray-item-body { flex: 1; min-width: 0; }
.tray-item-name { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tray-item-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tray-item-track { flex: 1; height: 4px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.tray-item-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); width: 0%; transition: width 180ms var(--ease); }
.tray-item-pct { font-size: 10.5px; color: var(--text-4); font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }
.tray-item-detail { font-size: 10.5px; color: var(--text-4); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tray-item.done .tray-item-fill { background: var(--success); }
.tray-item.error .tray-item-fill { background: var(--danger); }
.tray-item.classing .tray-item-fill { background: var(--warning); }
.tray-item-action { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid transparent; background: transparent; color: var(--text-4); cursor: pointer; border-radius: var(--r-1); flex-shrink: 0; }
.tray-item-action:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-2); }
.tray-item-action svg { width: 13px; height: 13px; }
.tray-item-status { font-size: 10.5px; flex-shrink: 0; display: flex; align-items: center; gap: 4px; }
.tray-item.done .tray-item-status { color: var(--success); }
.tray-item.error .tray-item-status { color: var(--danger); }

/* =========================================================================
   DRAG-DROP OVERLAY
   ========================================================================= */
.drop-overlay { position: fixed; inset: 0; z-index: 260; display: none; place-items: center; background: var(--overlay); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); padding: 40px; }
.drop-overlay.active { display: grid; }
.drop-inner { border: 2px dashed var(--accent); border-radius: var(--r-4); background: var(--surface); padding: 44px 64px; text-align: center; box-shadow: var(--sh-4); }
.drop-inner .di-icon { width: 56px; height: 56px; border-radius: var(--r-3); background: var(--accent-soft); display: grid; place-items: center; margin: 0 auto 16px; }
.drop-inner .di-icon svg { width: 28px; height: 28px; color: var(--accent); }
.drop-inner .di-title { font-size: 18px; font-weight: 600; }
.drop-inner .di-sub { font-size: 13px; color: var(--text-3); margin-top: 4px; font-family: var(--mono); }

/* =========================================================================
   TOASTS
   ========================================================================= */
.toasts { position: fixed; top: 16px; right: 16px; z-index: 400; display: flex; flex-direction: column; gap: 8px; pointer-events: none; max-width: 360px; }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px;
  background: var(--surface); border: 1px solid var(--border-2); border-left: 3px solid var(--accent);
  border-radius: var(--r-2); box-shadow: var(--sh-3); font-size: 12.5px; color: var(--text);
  pointer-events: auto; animation: toastIn 200ms var(--ease);
}
@keyframes toastIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.leaving { animation: toastOut 200ms var(--ease) forwards; }
@keyframes toastOut { to { transform: translateX(24px); opacity: 0; } }
.toast .t-icon { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.toast .t-body { flex: 1; min-width: 0; line-height: 1.45; word-break: break-word; }
.toast .t-close { width: 18px; height: 18px; display: grid; place-items: center; border: none; background: transparent; color: var(--text-4); cursor: pointer; border-radius: 4px; flex-shrink: 0; }
.toast .t-close:hover { color: var(--text); }
.toast .t-close svg { width: 13px; height: 13px; }
.toast.ok { border-left-color: var(--success); } .toast.ok .t-icon { color: var(--success); }
.toast.err { border-left-color: var(--danger); } .toast.err .t-icon { color: var(--danger); }
.toast.info { border-left-color: var(--accent); } .toast.info .t-icon { color: var(--accent); }

/* =========================================================================
   COMMAND PALETTE
   ========================================================================= */
.cmdk-layer { position: fixed; inset: 0; z-index: 350; display: grid; place-items: start center; padding: 12vh 16px 16px; }
.cmdk-backdrop { position: absolute; inset: 0; background: var(--overlay); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade 140ms var(--ease); }
.cmdk { position: relative; width: 100%; max-width: 580px; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-4); box-shadow: var(--sh-4); overflow: hidden; animation: modalIn 160ms var(--ease); }
.cmdk-input-wrap { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cmdk-input-wrap svg { width: 17px; height: 17px; color: var(--text-4); flex-shrink: 0; }
.cmdk-input-wrap input { flex: 1; border: none; background: transparent; outline: none; font-size: 14.5px; color: var(--text); }
.cmdk-input-wrap input::placeholder { color: var(--text-4); }
.cmdk-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.cmdk-group-label { font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-4); padding: 8px 9px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r-2); cursor: pointer; }
.cmdk-item.active { background: var(--accent-soft); }
.cmdk-item .ci-icon { width: 28px; height: 28px; border-radius: var(--r-1); background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; }
.cmdk-item.active .ci-icon { background: var(--surface); }
.cmdk-item .ci-icon svg { width: 15px; height: 15px; color: var(--text-3); }
.cmdk-item.active .ci-icon svg { color: var(--accent); }
.cmdk-item .ci-text { flex: 1; min-width: 0; }
.cmdk-item .ci-title { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item .ci-sub { font-size: 11px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item .ci-kbd { margin-left: auto; }
.cmdk-empty { padding: 28px; text-align: center; color: var(--text-4); font-size: 12.5px; }
.cmdk-foot { display: flex; align-items: center; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 11px; color: var(--text-4); }
.cmdk-foot .cf-item { display: flex; align-items: center; gap: 5px; }

/* =========================================================================
   ECONOMY SCOUT & COST INSIGHTS
   ========================================================================= */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); padding: 16px 16px; box-shadow: var(--sh-1); }
.stat-card.highlight { background: var(--success-soft); border-color: transparent; box-shadow: inset 0 0 0 1px var(--success); }
.stat-card .sc-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-4); }
.stat-card .sc-value { font-size: 26px; font-weight: 600; letter-spacing: -0.6px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat-card .sc-value .unit { font-size: 14px; color: var(--text-3); font-weight: 500; margin-left: 1px; }
.stat-card.highlight .sc-value { color: var(--success); }
.stat-card .sc-sub { font-size: 11.5px; color: var(--text-3); margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-card.highlight .sc-sub { color: var(--success); }

.scout-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.scout-controls .sc-label { font-size: 12px; color: var(--text-3); }

.section-title { font-size: 13px; font-weight: 600; margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title .st-count { font-weight: 400; color: var(--text-3); }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 12px; flex-wrap: wrap; }
.section-title-row .section-title { margin: 0; }

/* Insights breakdown bars */
.breakdown { display: flex; flex-direction: column; gap: 9px; }
.bd-item2 { display: grid; grid-template-columns: 190px 1fr 220px; gap: 14px; align-items: center; }
.bd-label2 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bd-label2 .bd-name2 { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bd-track { height: 10px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.bd-fill { height: 100%; border-radius: var(--r-pill); min-width: 3px; transition: width 400ms var(--ease); }
.bd-meta2 { font-family: var(--mono); font-size: 11px; color: var(--text-3); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Recommendations / scout table reuses .dt */
.scout-table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-4); overflow: hidden; box-shadow: var(--sh-1); }
.dt col.c-folder { width: 220px; }
.dt col.c-arrow { width: 150px; }
.dt col.c-save { width: 110px; }
.cell-folder { font-family: var(--mono); font-size: 11px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell-save { font-family: var(--mono); font-size: 12px; color: var(--success); text-align: right; font-variant-numeric: tabular-nums; }
.class-move { display: flex; align-items: center; gap: 6px; }
.class-move .mv-arrow { color: var(--text-4); }
.class-move .mv-arrow svg { width: 13px; height: 13px; }
tr.row-done { opacity: 0.55; }
tr.row-done .cell-save { color: var(--success); font-weight: 600; }
tr.row-failed .cell-save { color: var(--danger); }

/* Progress overlay row inside scout */
.apply-progress { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--accent-soft); border: 1px solid var(--accent-soft-2); border-radius: var(--r-3); margin-bottom: 14px; }
.apply-progress .ap-track { flex: 1; height: 6px; background: var(--surface); border-radius: var(--r-pill); overflow: hidden; }
.apply-progress .ap-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width 200ms var(--ease); }
.apply-progress .ap-label { font-size: 12px; color: var(--accent-text); font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* All Buckets portfolio */
.portfolio-progress { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-3); margin-bottom: 16px; box-shadow: var(--sh-1); }
.portfolio-progress .pp-spinner { width: 16px; height: 16px; flex-shrink: 0; }
.portfolio-progress .pp-spinner svg { width: 100%; height: 100%; color: var(--accent); animation: spin 0.8s linear infinite; }
.portfolio-progress .pp-track { flex: 1; height: 6px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.portfolio-progress .pp-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width 300ms var(--ease); }
.portfolio-progress .pp-label { font-size: 12px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

.mini-bar { display: flex; height: 6px; width: 100px; border-radius: var(--r-pill); overflow: hidden; background: var(--surface-3); }
.mini-bar span { height: 100%; min-width: 1px; }

.note-line { font-size: 11.5px; color: var(--text-4); margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }
.note-line svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Class-fill colors for bars & stacks */
.fill-STANDARD { background: var(--t-std-fg); }
.fill-INTELLIGENT_TIERING { background: var(--t-int-fg); }
.fill-STANDARD_IA { background: var(--t-ia-fg); }
.fill-ONEZONE_IA { background: var(--t-1z-fg); }
.fill-GLACIER_IR { background: var(--t-gir-fg); }
.fill-GLACIER { background: var(--t-gla-fg); }
.fill-DEEP_ARCHIVE { background: var(--t-deep-fg); }
.fill-REDUCED_REDUNDANCY { background: var(--t-rrs-fg); }

/* =========================================================================
   HELP OVERLAY
   ========================================================================= */
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 32px; }
.help-col h4 { font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-4); margin-bottom: 10px; }
.help-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 12.5px; color: var(--text-2); }
.help-row .keys { display: flex; gap: 4px; flex-shrink: 0; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .bd-item2 { grid-template-columns: 150px 1fr; }
  .bd-meta2 { grid-column: 1 / -1; text-align: left; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 100; transform: translateX(-100%); transition: transform 200ms var(--ease); box-shadow: var(--sh-4); }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-collapsed { grid-template-columns: 1fr; }
  .tb-search { width: 180px; }
  .tb-cmdk, .tb-divider { display: none; }
  .dt col.c-mod, .dt col.c-folder { width: 0; }
  .dt .cell-mod, .dt thead .col-mod, .cell-folder, thead .col-folder { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .cost-banner { flex-wrap: wrap; }
  .menu-toggle { display: grid !important; }
}
.menu-toggle { display: none; width: 32px; height: 32px; place-items: center; border: 1px solid var(--border-2); background: var(--surface); border-radius: var(--r-2); cursor: pointer; color: var(--text-2); flex-shrink: 0; }
.menu-toggle svg { width: 17px; height: 17px; }

/* =========================================================================
   MOTION PREFERENCE
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Global cross-bucket search results */
.name-secondary svg{width:12px;height:12px;vertical-align:-2px;margin-right:5px;opacity:.6}
tr.is-result{cursor:pointer}
tr.is-result .go-arrow{display:inline-flex;color:var(--text-4);transition:color .12s ease,transform .12s ease}
tr.is-result .go-arrow svg{width:16px;height:16px}
tr.is-result:hover .go-arrow{color:var(--accent);transform:translateX(2px)}

/* All Buckets — optimize affordance */
.save-pill{display:inline-flex;align-items:center;gap:8px;font-variant-numeric:tabular-nums}
.save-go{display:inline-flex;align-items:center;gap:3px;font-size:11.5px;font-weight:600;color:var(--accent);opacity:0;transform:translateX(-4px);transition:opacity .12s ease,transform .12s ease}
.save-go svg{width:13px;height:13px}
tr[data-bucket]{cursor:pointer}
tr[data-bucket]:hover .save-go{opacity:1;transform:none}
/* Drawer archived preview state */
.dp-archived{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px;padding:24px 18px}
.dp-snow{width:42px;height:42px;display:flex;align-items:center;justify-content:center;border-radius:12px;background:var(--surface-2,#eef0f4);color:var(--accent)}
.dp-snow svg{width:22px;height:22px}
.dp-arch-title{font-weight:650;font-size:14px}
.dp-arch-sub{font-size:12.5px;color:var(--text-3,#6b7280);line-height:1.5;max-width:290px;margin-bottom:6px}

/* Upload-as storage-class chooser pop-up */
.uc-modal .modal-body{padding-top:6px}
.uc-chooser{display:flex;flex-direction:column;gap:8px}
.uc-opt{display:flex;align-items:center;gap:14px;width:100%;text-align:left;padding:11px 14px;border:1px solid var(--border);border-radius:11px;background:var(--surface);cursor:pointer;transition:border-color .12s ease,background .12s ease,box-shadow .12s ease,transform .06s ease}
.uc-opt:hover{border-color:var(--accent);background:var(--surface-2)}
.uc-opt:active{transform:translateY(1px)}
.uc-opt:focus-visible{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft,rgba(91,91,214,.28))}
.uc-opt.is-default{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}
.uc-badge{flex:0 0 auto;min-width:58px;justify-content:center}
.uc-text{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}
.uc-name{font-weight:600;font-size:14px;display:flex;align-items:center;gap:8px;color:var(--text)}
.uc-deftag{font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.5px;color:var(--accent);background:var(--accent-soft,rgba(91,91,214,.14));padding:2px 7px;border-radius:999px}
.uc-desc{font-size:12.5px;color:var(--text-3,#6b7280)}
.uc-rate{flex:0 0 auto;font-size:13px;font-weight:600;color:var(--text-2,#374151);font-variant-numeric:tabular-nums;white-space:nowrap}
.uc-unit{font-size:11px;font-weight:400;color:var(--text-4,#9ca3af);margin-left:1px}

/* Preview modal: make body a flex column so the stage fills the modal (was collapsing video/images to 150px) */
.preview-modal .modal-body { flex: 1 1 auto; min-height: 0; display: flex; padding: 0; }

/* Gallery video posters + drawer inline play */
.grid-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.grid-thumb.has-thumb{background:#000}
.dp-poster{position:relative;width:100%;height:100%;min-height:180px;display:flex;align-items:center;justify-content:center;cursor:pointer;background:#000;border-radius:inherit;overflow:hidden}
.dp-poster img{max-width:100%;max-height:100%;display:block}
.dp-play{position:absolute;inset:0;margin:auto;width:54px;height:54px;border-radius:50%;border:none;background:rgba(0,0,0,.55);color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:background .12s}
.dp-play svg{width:24px;height:24px}
.dp-poster:hover .dp-play{background:rgba(0,0,0,.78)}
.dp-inline{min-height:200px;background:#000}