/* ==========================================================================
   Image.360 console
   ========================================================================== */
:root {
  --navy-950: #070e2b;
  --navy-900: #0c1640;
  --navy-800: #15225a;
  --navy-700: #1f2f73;
  --navy-text: #a8b2d8;

  --primary: #3448c5;
  --primary-600: #2a3bac;
  --primary-700: #22308f;
  --primary-100: #e3e7fb;
  --primary-50: #f1f3fd;

  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --border: #e3e7f0;
  --border-strong: #cfd6e4;

  --text: #172042;
  --text-2: #475072;
  --muted: #7c84a3;

  --success: #13925f;
  --success-50: #e6f6ef;
  --danger: #d2334a;
  --danger-50: #fdecee;
  --warning: #c77c12;
  --warning-50: #fdf3e2;

  --radius-lg: 14px;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 64, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 64, 0.08), 0 1px 2px rgba(16, 24, 64, 0.04);
  --shadow: 0 8px 24px rgba(16, 24, 64, 0.08);
  --shadow-lg: 0 30px 80px rgba(7, 14, 43, 0.35);

  --font: "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Cascadia Code", ui-monospace, Menlo, Consolas, monospace;

  --sidebar-w: 252px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 14px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-700); }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0 0 0.75em; }
code, pre, .mono { font-family: var(--mono); }
code { font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 5px; color: var(--text-2); word-break: break-all; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Checkerboard behind images, like transparency in editors */
.checker {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #eef1f7 25%, transparent 25%),
    linear-gradient(-45deg, #eef1f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef1f7 75%),
    linear-gradient(-45deg, transparent 75%, #eef1f7 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  color: var(--navy-text);
  padding: 18px 12px 14px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }
.brand:hover { color: #fff; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #5b6ff0 0%, #3448c5 55%, #2336a8 100%); box-shadow: 0 6px 16px rgba(52, 72, 197, 0.45); }
.brand-mark svg { width: 20px; height: 20px; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--navy-text); letter-spacing: 0; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 8px;
  color: var(--navy-text); font-weight: 500; font-size: 14px;
  background: none; border: 0; width: 100%; text-align: left; cursor: pointer; font-family: inherit;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item[aria-current="page"] { background: rgba(91, 111, 240, 0.22); color: #fff; box-shadow: inset 3px 0 0 #7d8ef7; }
.nav-heading { font-size: 12px; font-weight: 600; color: #6f7aa8; padding: 22px 12px 8px; display: flex; justify-content: space-between; align-items: center; }
.nav-heading a { color: #8b96c6; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; }
.nav-heading a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-heading .icon { width: 15px; height: 15px; }
.nav-app { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px; color: var(--navy-text); font-size: 13.5px; }
.nav-app:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-app[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav-app .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-app .dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.15); }
.nav-app .dot.off { background: #f87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15); }
.nav-empty { padding: 4px 12px; font-size: 13px; color: #6f7aa8; }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.account { display: flex; align-items: center; gap: 10px; padding: 8px 12px 10px; }
.account-email { font-size: 13px; color: #dfe4f7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-role { font-size: 12px; color: #6f7aa8; }

.avatar {
  --h: 230;
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: hsl(var(--h) 70% 30%);
  background: hsl(var(--h) 85% 90%);
}
.avatar.sm { width: 22px; height: 22px; border-radius: 6px; font-size: 10px; color: #fff; background: hsl(var(--h) 55% 45%); }
.avatar.lg { width: 48px; height: 48px; border-radius: 12px; font-size: 17px; }
.avatar.round { border-radius: 50%; background: var(--navy-700); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  height: 60px; padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); min-width: 0; flex: 1; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--primary); }
.crumbs .icon { width: 14px; height: 14px; color: #b3bad0; }
.crumbs span:last-child { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search {
  display: flex; align-items: center; gap: 8px;
  width: min(380px, 34vw); height: 38px; padding: 0 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; color: var(--muted);
}
.search:focus-within { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-100); }
.search input { border: 0; background: none; outline: none; flex: 1; font: inherit; color: var(--text); min-width: 0; }
.search .icon { width: 16px; height: 16px; }
.topbar .menu-btn { display: none; }
.content { padding: 28px; width: 100%; max-width: 1480px; margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px;
  font: 600 13.5px/1 var(--font);
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: background-color 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
}
.btn:hover { background: var(--surface-2); border-color: #bcc5d8; color: var(--text); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(52, 72, 197, 0.35); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.btn-danger { color: var(--danger); border-color: #efc1c8; }
.btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--primary-50); border-color: transparent; color: var(--primary); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.icon-btn .icon { width: 17px; height: 17px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.panel-pad { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.panel-body { padding: 20px; }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.stack { display: grid; gap: 20px; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

.grid-2-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 20px; }
.grid-1-1 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-2); font-weight: 500; }
.stat-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.stat-icon.green { background: var(--success-50); color: var(--success); }
.stat-icon.amber { background: var(--warning-50); color: var(--warning); }
.stat-icon.violet { background: #f1ebfd; color: #7247d6; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.meter { height: 6px; border-radius: 99px; background: var(--primary-50); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #5b6ff0, var(--primary)); }
.meter.green > span { background: linear-gradient(90deg, #34c38f, var(--success)); }

/* ---------- Chart ---------- */
.chart { width: 100%; height: 220px; display: block; }
.chart .bar { fill: #c9d0f5; transition: fill 0.12s; }
.chart .bar.has { fill: var(--primary); }
.chart g:hover .bar { fill: var(--primary-700); }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .gridline { stroke: var(--border); stroke-dasharray: 3 4; }

.usage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.usage-row { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 12px; align-items: center; }
.usage-row .meter { grid-column: 2 / 4; }
.usage-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-row .size { color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ---------- Pills and badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--success-50); color: var(--success); white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.off { background: var(--danger-50); color: var(--danger); }
.pill.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; background: var(--primary-50); color: var(--primary); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); }
.chip strong { color: var(--text); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Alerts and toasts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); border: 1px solid; font-size: 13.5px; }
.alert .icon { margin-top: 1px; }
.alert-info { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary-700); }
.alert-success { background: var(--success-50); border-color: #bfe8d6; color: #0c6a45; }
.alert-danger { background: var(--danger-50); border-color: #f5c7ce; color: #9c1f33; }
.alert-warning { background: var(--warning-50); border-color: #f3dcb2; color: #8a5409; }
.alert strong { display: block; margin-bottom: 2px; }

.toast {
  position: fixed; right: 24px; top: 76px; z-index: 60;
  display: flex; align-items: center; gap: 12px;
  min-width: 300px; max-width: 460px; padding: 12px 12px 12px 16px;
  background: var(--navy-900); color: #fff; border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.25s ease-out;
}
.toast .icon { color: #34d399; }
.toast.error .icon { color: #fb7185; }
.toast p { margin: 0; flex: 1; }
.toast .icon-btn { color: #aab4d8; width: 28px; height: 28px; }
.toast .icon-btn:hover { background: rgba(255,255,255,.08); border-color: transparent; color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Forms ---------- */
label, .label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; height: 38px; padding: 0 12px;
  font: inherit; color: var(--text);
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color 0.12s, box-shadow 0.12s;
}
textarea { height: auto; padding: 10px 12px; }
select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237c84a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.fields-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.input-group { display: flex; }
.input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); font-family: var(--mono); font-size: 13px; background: var(--surface-2); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin-left: -1px; box-shadow: none; }
.input-suffix { position: relative; }
.input-suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }

.switch { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; margin: 0; font-weight: 400; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: var(--border-strong); position: relative; flex: none; transition: background 0.15s; margin-top: 1px; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform 0.15s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch strong { display: block; font-weight: 600; }
.switch small { color: var(--muted); font-size: 12.5px; }

.choice-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choice { position: relative; margin: 0; cursor: pointer; font-weight: 400; }
.choice input { position: absolute; opacity: 0; }
.choice .card { display: block; height: 100%; padding: 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); transition: border-color 0.12s, box-shadow 0.12s, background 0.12s; }
.choice .card strong { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin-bottom: 4px; }
.choice .card small { color: var(--muted); font-size: 12.5px; line-height: 1.4; display: block; }
.choice .check { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; }
.choice .check .icon { width: 12px; height: 12px; opacity: 0; color: #fff; }
.choice input:checked + .card { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 3px var(--primary-100); }
.choice input:checked + .card .check { background: var(--primary); border-color: var(--primary); }
.choice input:checked + .card .check .icon { opacity: 1; }
.choice input:focus-visible + .card { outline: 2px solid var(--primary); outline-offset: 2px; }

.range-row { display: flex; align-items: center; gap: 14px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--primary); height: 38px; }
.range-row output { min-width: 48px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: 7px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fbfcfe; }
.data-table .right { text-align: right; }
.data-table tr.is-revoked td { color: var(--muted); }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-main strong { font-weight: 600; color: var(--text); }
.cell-thumb { width: 44px; height: 44px; border-radius: 7px; overflow: hidden; border: 1px solid var(--border); flex: none; }
.cell-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ---------- Tabs ---------- */
.tabs-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.tabs-nav a, .tabs-nav button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 14px; margin-bottom: -1px;
  color: var(--text-2); font: 600 13.5px var(--font); white-space: nowrap;
  border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer;
}
.tabs-nav a:hover, .tabs-nav button:hover { color: var(--text); }
.tabs-nav [aria-current="page"], .tabs-nav [aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.tabs-nav .icon { width: 16px; height: 16px; }
.tabs-nav.compact { margin: 0; padding: 0 12px; }

/* ---------- App header ---------- */
.app-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.app-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.app-title h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-title .muted { margin-top: 4px; font-size: 13px; }

/* ---------- Apps grid ---------- */
.app-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.app-card { display: flex; flex-direction: column; overflow: hidden; color: var(--text); transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s; }
.app-card:hover { color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; height: 108px; background: var(--border); }
.mosaic span { overflow: hidden; }
.mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mosaic.empty { grid-template-columns: 1fr; place-items: center; background: linear-gradient(135deg, var(--primary-50), #eef2fb); color: #9aa6d6; }
.mosaic.empty .icon { width: 30px; height: 30px; }
.app-card-body { padding: 16px 18px 18px; display: grid; gap: 14px; }
.app-card-title { display: flex; align-items: center; gap: 12px; }
.app-card-title .title { flex: 1; min-width: 0; }
.app-card-title strong { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-card-title small { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.app-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--border); padding-top: 12px; }
.app-card-stats div { display: grid; gap: 2px; }
.app-card-stats span { font-size: 12px; color: var(--muted); }
.app-card-stats strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.app-card.create { border-style: dashed; border-width: 1.5px; background: transparent; box-shadow: none; display: grid; place-items: center; min-height: 246px; cursor: pointer; font: inherit; color: var(--text-2); text-align: center; }
.app-card.create:hover { background: var(--surface); color: var(--primary); }
.app-card.create .stat-icon { margin: 0 auto 10px; width: 44px; height: 44px; }

/* ---------- Media library ---------- */
.library { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.folders { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; padding: 10px 8px; }
.folders-title { font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; }
.folder-tree { list-style: none; margin: 0; padding: 0; }
.folder-tree ul { list-style: none; margin: 0; padding: 0; }
.folder-item {
  --depth: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px 7px calc(10px + var(--depth) * 16px);
  border-radius: 7px; color: var(--text-2); font-size: 13.5px;
}
.folder-item:hover { background: var(--surface-2); color: var(--text); }
.folder-item[aria-current="page"] { background: var(--primary-50); color: var(--primary); font-weight: 600; }
.folder-item .icon { width: 16px; height: 16px; color: #9aa3bf; }
.folder-item[aria-current="page"] .icon { color: var(--primary); }
.folder-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-item .count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.folder-item .avatar.sm { width: 18px; height: 18px; font-size: 9px; border-radius: 5px; }
.folder-sep { height: 1px; background: var(--border); margin: 8px 6px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.toolbar h1 { font-size: 20px; }
.toolbar .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; }
.toolbar-actions select { width: auto; height: 36px; font-size: 13px; }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; }
.segmented a, .segmented button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 7px; color: var(--muted); border: 0; background: none; font: 600 12.5px var(--font); cursor: pointer; }
.segmented a:hover, .segmented button:hover { color: var(--text); }
.segmented [aria-current="true"], .segmented [aria-pressed="true"] { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.segmented .icon { width: 16px; height: 16px; }

.bulk-bar {
  position: sticky; top: 72px; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 16px; margin-bottom: 16px;
  background: var(--navy-900); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
}
.bulk-bar .count { font-weight: 600; flex: 1; }
.bulk-bar .btn-ghost { color: #c9d0ee; }
.bulk-bar .btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }

.search-note { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--text-2); }

.folder-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.folder-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--text); }
.folder-tile:hover { color: var(--text); border-color: var(--primary-100); box-shadow: var(--shadow-sm); }
.folder-tile .folder-icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: #fff5e0; color: #d99a1b; }
.folder-tile strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-tile small { color: var(--muted); }
.folder-tile > div { min-width: 0; }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px; }
.asset { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow 0.15s, border-color 0.15s; }
.asset:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.asset-link { display: block; color: var(--text); }
.asset-link:hover { color: var(--text); }
.asset-thumb { position: relative; aspect-ratio: 4 / 3; border-bottom: 1px solid var(--border); overflow: hidden; }
.asset-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.asset-info { padding: 10px 12px 12px; }
.asset-thumb .badge { position: absolute; left: 8px; bottom: 8px; z-index: 1; background: rgba(12, 22, 64, 0.78); color: #fff; backdrop-filter: blur(4px); }
.asset-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.asset-where { margin-top: 4px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.asset-check, .asset-copy { position: absolute; top: 8px; z-index: 2; opacity: 0; transition: opacity 0.12s; }
.asset-check { left: 8px; margin: 0; cursor: pointer; }
.asset-copy { right: 8px; background: rgba(255, 255, 255, 0.95); border-color: var(--border); box-shadow: var(--shadow-sm); width: 30px; height: 30px; }
.asset:hover .asset-check, .asset:hover .asset-copy, .asset:focus-within .asset-check, .asset:focus-within .asset-copy, .asset.is-selected .asset-check { opacity: 1; }
.asset-check input { position: absolute; opacity: 0; }
.checkbox-ui { width: 22px; height: 22px; border-radius: 6px; background: rgba(255,255,255,.95); border: 1.5px solid var(--border-strong); display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.checkbox-ui .icon { width: 14px; height: 14px; color: #fff; opacity: 0; }
.asset-check input:checked + .checkbox-ui, .list-check input:checked + .checkbox-ui { background: var(--primary); border-color: var(--primary); }
.asset-check input:checked + .checkbox-ui .icon, .list-check input:checked + .checkbox-ui .icon { opacity: 1; }
.asset-check input:focus-visible + .checkbox-ui, .list-check input:focus-visible + .checkbox-ui { outline: 2px solid var(--primary); outline-offset: 2px; }
.asset.is-selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.list-check { position: relative; margin: 0; cursor: pointer; display: inline-block; }
.list-check input { position: absolute; opacity: 0; }

.empty-state { text-align: center; padding: 56px 24px; }
.empty-state .empty-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); }
.empty-state .empty-icon .icon { width: 30px; height: 30px; }
.empty-state h2 { font-size: 17px; margin-bottom: 6px; }
.empty-state p { color: var(--muted); max-width: 420px; margin: 0 auto 18px; }

.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 24px; color: var(--muted); }

/* ---------- Asset detail ---------- */
.asset-page { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.viewer { overflow: hidden; }
.viewer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.viewer-meta { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.viewer-stage { display: grid; place-items: center; min-height: 460px; padding: 32px; }
.viewer-stage img { max-width: 100%; max-height: 70vh; width: auto; height: auto; display: block; box-shadow: 0 12px 40px rgba(16, 24, 64, 0.18); }

.inspector { position: sticky; top: 80px; }
.inspector-head { padding: 18px 20px 14px; }
.inspector-head h1 { font-size: 17px; overflow-wrap: anywhere; }
.inspector-head .where { color: var(--muted); font-size: 13px; margin: 4px 0 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inspector-panel { padding: 18px 20px 20px; }
.kv { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px 12px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; color: var(--text); }

.savings { display: grid; gap: 10px; padding: 14px 16px; margin-bottom: 18px; border-radius: var(--radius); background: linear-gradient(135deg, var(--success-50), #f2fbf7); border: 1px solid #c9ecdc; }
.savings-top { display: flex; align-items: baseline; justify-content: space-between; }
.savings-top strong { font-size: 24px; color: var(--success); letter-spacing: -0.02em; }
.savings-top span { color: #3c7a60; font-size: 12.5px; }
.compare { display: grid; gap: 6px; font-size: 12px; color: var(--text-2); }
.compare-row { display: grid; grid-template-columns: 70px 1fr 64px; gap: 8px; align-items: center; }
.compare-row .right { text-align: right; font-variant-numeric: tabular-nums; }
.compare .meter { background: rgba(19, 146, 95, 0.12); }
.compare .meter.grey { background: rgba(19, 146, 95, 0.12); }
.compare .meter.grey > span { background: #9fb4ab; }

.size-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.size-item { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.size-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.size-item-top strong { font-size: 13.5px; }
.size-item-top span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

.code-block { position: relative; margin: 0; }
.code-block pre { margin: 0; padding: 14px 16px; background: var(--navy-950); color: #d9def5; border-radius: var(--radius); font-size: 12.5px; line-height: 1.6; overflow: auto; white-space: pre; }
.code-block .btn { position: absolute; top: 8px; right: 8px; height: 28px; padding: 0 9px; font-size: 12px; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #dfe4f7; box-shadow: none; }
.code-block .btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.code-block + .code-block, .label + .code-block { margin-top: 8px; }
.doc-preview pre { max-height: 560px; white-space: pre-wrap; }

/* ---------- Keys ---------- */
.key-reveal { padding: 18px 20px; border-radius: var(--radius); background: linear-gradient(135deg, #0f1c52 0%, #22308f 100%); color: #fff; margin-bottom: 20px; box-shadow: var(--shadow); }
.key-reveal h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.key-reveal p { color: #c7cef0; margin: 6px 0 14px; }
.key-reveal .input-group input { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; height: 42px; }
.key-reveal .input-group .btn { height: 42px; }
.key-mask { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); }

/* ---------- Sizes editor ---------- */
.sizes-table td { padding: 8px 10px; }
.sizes-table th { padding: 10px; }
.sizes-table input, .sizes-table select { height: 36px; }
.sizes-table .col-name { width: 32%; }
.sizes-table .col-num { width: 17%; }
.sizes-table .col-fit { width: 26%; }
.sizes-table .col-x { width: 44px; }

.fit-help { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
.fit-help div { font-size: 12.5px; color: var(--muted); }
.fit-help strong { color: var(--text); display: block; font-size: 12.5px; }

.save-bar { position: sticky; bottom: 0; z-index: 15; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; margin-top: 20px; background: rgba(255,255,255,.95); backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 -4px 24px rgba(16,24,64,.06); }

.danger-zone { border-color: #f1ccd2; }
.danger-zone .panel-head { border-bottom-color: #f6dde1; }
.danger-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px; }
.danger-row + .danger-row { border-top: 1px solid var(--border); }
.danger-row p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

/* ---------- Dialogs ---------- */
dialog.modal { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in 0.18s ease-out; }
dialog.modal::backdrop { background: rgba(7, 14, 43, 0.55); backdrop-filter: blur(2px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; }
.modal-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }
.modal-foot .actions { margin-left: auto; }

.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 36px 20px; margin: 4px 0 0; cursor: pointer; text-align: center; font-weight: 400;
  border: 2px dashed #c3cbe6; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--primary-50), #fff);
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.is-over { border-color: var(--primary); background: var(--primary-50); }
.drop-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: #fff; color: var(--primary); box-shadow: var(--shadow-sm); margin-bottom: 4px; }
.drop-icon .icon { width: 28px; height: 28px; }
.drop-title { font-size: 16px; font-weight: 650; color: var(--text); }
.drop-sub { font-size: 13px; color: var(--muted); }
.drop-sub u { color: var(--primary); text-decoration: none; font-weight: 600; }

.upload-queue { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.upload-queue:empty { display: none; }
.q-item { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.q-thumb { width: 44px; height: 44px; border-radius: 7px; overflow: hidden; flex: none; border: 1px solid var(--border); }
.q-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.q-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.q-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.q-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-size { color: var(--muted); white-space: nowrap; }
.q-bar { height: 5px; border-radius: 99px; background: var(--primary-50); overflow: hidden; }
.q-bar span { display: block; height: 100%; width: 0; background: var(--primary); border-radius: inherit; transition: width 0.2s; }
.q-status { font-size: 12.5px; color: var(--muted); }
.q-item.done .q-bar span { background: var(--success); }
.q-item.done .q-status { color: var(--success); }
.q-item.failed .q-bar span { background: var(--danger); }
.q-item.failed .q-status { color: var(--danger); }
.q-item.processing .q-bar span { background: linear-gradient(90deg, var(--primary) 0%, #8d9bf5 50%, var(--primary) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: 0 0; } }

/* ---------- Sign in ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-art {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 48px; color: #fff;
  background: radial-gradient(900px 500px at 10% 110%, rgba(91, 111, 240, 0.55), transparent 60%), radial-gradient(700px 500px at 110% -10%, rgba(52, 211, 153, 0.18), transparent 60%), var(--navy-950);
}
.auth-art .brand { padding: 0; }
.auth-art h2 { font-size: 34px; line-height: 1.15; font-weight: 700; max-width: 460px; letter-spacing: -0.02em; }
.auth-art p { color: #aab4d8; max-width: 440px; font-size: 15px; margin-top: 12px; }
.tiles { position: absolute; right: -60px; top: 50%; transform: translateY(-50%) rotate(-8deg); display: grid; grid-template-columns: repeat(3, 120px); gap: 14px; opacity: 0.9; }
.tiles span { height: 120px; border-radius: 16px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); display: grid; place-items: center; }
.tiles span:nth-child(2n) { background: linear-gradient(135deg, rgba(91,111,240,.45), rgba(52,72,197,.15)); }
.tiles span:nth-child(3n) { background: linear-gradient(135deg, rgba(52,211,153,.3), rgba(52,211,153,.05)); }
.tiles .icon { width: 30px; height: 30px; color: rgba(255,255,255,.55); }
.auth-art .copy { position: relative; z-index: 1; }
.auth-art .foot { position: relative; z-index: 1; color: #6f7aa8; font-size: 13px; }
.auth-form { display: grid; place-items: center; padding: 32px; background: #fff; }
.auth-form form { width: min(380px, 100%); }
.auth-form h1 { font-size: 24px; margin-bottom: 6px; }
.auth-form .lead { color: var(--muted); margin-bottom: 24px; }
.auth-form .btn { width: 100%; height: 42px; margin-top: 6px; }

.error-page { max-width: 520px; margin: 60px auto; text-align: center; padding: 40px 32px; }
.error-page .code { font-size: 56px; font-weight: 800; color: var(--primary); letter-spacing: -0.03em; line-height: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-page { grid-template-columns: 1fr; }
  .inspector { position: static; }
}
@media (max-width: 1000px) {
  .grid-2-1, .grid-1-1 { grid-template-columns: 1fr; }
  .library { grid-template-columns: 1fr; }
  .folders { position: static; max-height: 260px; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; width: var(--sidebar-w); transform: translateX(-100%); transition: transform 0.2s; }
  .sidebar.is-open { transform: none; box-shadow: var(--shadow-lg); }
  .topbar .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; gap: 10px; }
  .search { display: none; }
  .content { padding: 18px 16px; }
  .choice-cards, .fields-2 { grid-template-columns: 1fr; }
  .topbar .btn-upload span { display: none; }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.account-text { min-width: 0; }
.error-title { margin: 12px 0 8px; }
.mt-20 { margin-top: 20px; }
.mt-16 { margin-top: 16px; }
.inspector-panel .code-block pre { max-height: 260px; white-space: pre-wrap; word-break: break-all; }
.actions.center { justify-content: center; }
.input-confirm { width: 180px; }
.data-table td { white-space: nowrap; }
.data-table .cell-main strong { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.grid-2-1, .grid-1-1 { align-items: start; }

/* ==========================================================================
   Storage
   ========================================================================== */

/* Provider marks. A neutral tile so brand colours of any kind sit calmly. */
.provider-logo-wrap {
  width: 56px; height: 56px; flex: none; border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
}
.provider-logo-wrap.sm { width: 40px; height: 40px; border-radius: var(--radius-sm); }
.provider-logo-wrap.lg { width: 56px; height: 56px; }
/* object-fit keeps a non-square logo from being squashed into the tile */
.provider-logo { width: 30px; height: 30px; display: block; object-fit: contain; }
.provider-logo-wrap.sm .provider-logo { width: 24px; height: 24px; }

/* Picker */
.provider-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 14px; }
.provider-card {
  display: grid; gap: 10px; align-content: start; padding: 18px;
  color: var(--text); transition: box-shadow 0.15s, border-color 0.15s, transform 0.15s;
}
.provider-card:hover { color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.provider-card:hover .provider-logo-wrap { border-color: var(--border-strong); }
.provider-card:hover .provider-cta { color: var(--primary); }
.provider-card:hover .provider-cta .icon { transform: translateX(2px); }
.provider-name { display: grid; gap: 1px; }
.provider-name strong { font-size: 15.5px; line-height: 1.3; }
.provider-name small { color: var(--muted); font-size: 12.5px; }
.provider-blurb { color: var(--text-2); font-size: 13px; line-height: 1.45; min-height: 37px; }
.provider-facts { display: grid; gap: 5px; padding-top: 10px; border-top: 1px solid var(--border); }
.provider-facts .fact { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.provider-facts .fact .icon { width: 14px; height: 14px; flex: none; }
.provider-cta { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 13px; font-weight: 600; color: var(--text-2); transition: color 0.15s; }
.provider-cta .icon { width: 15px; height: 15px; transition: transform 0.15s; }

/* Connected buckets */
.bucket-card.is-off { opacity: 0.72; }
.bucket-head { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.bucket-id { flex: 1; min-width: 0; }
.bucket-id h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 16px; line-height: 1.3; }
.bucket-id .bucket-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.bucket-id p { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 13px; }
.bucket-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.bucket-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 14px 20px; }
.bucket-stats div { display: grid; gap: 2px; min-width: 0; }
.bucket-stats span { font-size: 12px; color: var(--muted); }
.bucket-stats strong { font-size: 15px; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bucket-stats code { font-size: 13px; }
.bucket-foot { gap: 16px; }
.bucket-foot .asset-link { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bucket-foot .actions { flex: none; }

/* details/summary reuses the panel header styling */
details.panel > summary { cursor: pointer; list-style: none; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-right: 4px; transition: transform 0.15s; }
details.panel[open] > summary::after { transform: rotate(-135deg); }

.subtle { color: var(--muted); text-decoration: none; border-bottom: 1px dashed var(--border-strong); }
.subtle:hover { color: var(--primary); }
.subtle.warn { display: inline-flex; align-items: center; gap: 5px; color: var(--warning); border-bottom-color: transparent; font-weight: 600; }
.subtle.warn .icon { width: 15px; height: 15px; }
.dot.warn { background: var(--warning); }

@media (max-width: 900px) {
  .bucket-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
}
@media (max-width: 720px) {
  .bucket-head { flex-wrap: wrap; }
  .bucket-actions { width: 100%; justify-content: flex-start; }
  .bucket-foot { flex-direction: column; align-items: flex-start; }
  .bucket-foot .asset-link { max-width: 100%; }
}
