/* =========================================================
   星智能发稿平台 · design system
   Design tokens + application shell
   ========================================================= */
:root {
  --bg: #f4f5f9;
  --bg-2: #eef0f6;
  --panel: #ffffff;
  --panel-2: #fbfbfd;
  --ink: #171a26;
  --ink-2: #4c5165;
  --ink-3: #858a9d;
  --ink-4: #b3b7c6;
  --line: #e7e8ef;
  --line-strong: #d9dbe6;
  --brand: #5b5bd6;
  --brand-2: #8b5cf6;
  --brand-deep: #4338ca;
  --brand-soft: #efeffd;
  --brand-wash: #f6f5ff;
  --success: #0f9f6e;
  --success-soft: #e9f9f2;
  --warn: #c27508;
  --warn-soft: #fff7e8;
  --danger: #d54444;
  --danger-soft: #fdeeee;
  --sidebar: #11131f;
  --sidebar-2: #171a2a;
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(18, 21, 35, 0.04);
  --shadow-sm: 0 1px 2px rgba(18, 21, 35, 0.04), 0 6px 18px rgba(18, 21, 35, 0.035);
  --shadow-md: 0 2px 4px rgba(18, 21, 35, 0.04), 0 16px 40px rgba(18, 21, 35, 0.07);
  --shadow-lg: 0 30px 80px rgba(18, 21, 35, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --sidebar-w: 256px;
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(900px 540px at 88% -8%, rgba(124, 92, 255, 0.07), transparent 64%),
    radial-gradient(800px 500px at 10% 4%, rgba(37, 99, 235, 0.045), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; }
svg { display: block; }
::selection { background: rgba(91, 91, 214, 0.18); }

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

:focus-visible {
  outline: 2px solid rgba(91, 91, 214, 0.55);
  outline-offset: 2px;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d5d7e2; border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #b9bccb; background-clip: padding-box; border: 2px solid transparent; }

/* =========================================================
   Shell
   ========================================================= */
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  color: #d7d9e6;
  background:
    radial-gradient(500px 380px at 18% -6%, rgba(124, 92, 255, 0.22), transparent 65%),
    radial-gradient(400px 300px at 110% 30%, rgba(37, 99, 235, 0.12), transparent 70%),
    linear-gradient(175deg, #171a2b 0%, #11131f 56%, #0e101a 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.055);
  overflow: hidden;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: auto -40% -30% -20%;
  height: 300px;
  background: radial-gradient(closest-side, rgba(91, 91, 214, 0.16), transparent);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 20px;
  position: relative;
  z-index: 1;
}
.brand-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(145deg, #8b5cf6 0%, #5b5bd6 52%, #4338ca 100%);
  box-shadow: 0 8px 22px rgba(91, 91, 214, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.brand-mark svg { width: 25px; height: 25px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 19px; letter-spacing: 0.06em; color: #fff; font-weight: 700; }
.brand-text small { margin-top: 3px; font-size: 8.5px; letter-spacing: 0.17em; color: #8f93aa; font-weight: 600; }

.site-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: #e5e7f2;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease;
  position: relative;
  z-index: 1;
}
.site-switch:hover { background: rgba(255, 255, 255, 0.075); border-color: rgba(255, 255, 255, 0.14); }
.site-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(145deg, #f3d9a4, #d8a758);
  color: #51350d;
  font-weight: 700;
  font-size: 13px;
}
.site-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.site-meta strong { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-meta small { font-size: 10.5px; color: #8f94aa; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.site-switch > .icon { width: 15px; height: 15px; color: #7d8298; }

.main-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 19px; position: relative; z-index: 1; flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }
.nav-label {
  padding: 12px 10px 6px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #666b81;
  text-transform: uppercase;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 40px;
  padding: 0 11px;
  border-radius: 10px;
  color: #a4a9be;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.16s ease, color 0.16s ease;
}
.nav-item .icon { width: 17px; height: 17px; color: #7f849b; transition: color 0.16s ease; }
.nav-item:hover { color: #e7e9f4; background: rgba(255, 255, 255, 0.05); }
.nav-item:hover .icon { color: #b9bdd0; }
.nav-item.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.22), rgba(124, 92, 255, 0.085));
  box-shadow: inset 0 0 0 1px rgba(145, 120, 255, 0.16);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #a78bfa, #6d6cf0);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.6);
}
.nav-item.active .icon { color: #b9a8ff; }
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #6d6cf0;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(91, 91, 214, 0.4);
}
.nav-count { margin-left: auto; color: #6f748b; font-size: 10.5px; font-variant-numeric: tabular-nums; }
.nav-pill {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #b6a8ff;
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(139, 92, 246, 0.22);
}
.nav-item .status-dot { margin-left: auto; }
.status-dot {
  width: 6px;
  height: 6px;
  display: inline-block;
  flex: none;
  border-radius: 50%;
  background: #35d39a;
  box-shadow: 0 0 0 3px rgba(53, 211, 154, 0.12);
}
.status-dot.off { background: #f0a95b; box-shadow: 0 0 0 3px rgba(240, 169, 91, 0.12); }

.sidebar-foot { display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; }
.storage-card {
  position: relative;
  padding: 12px 12px 10px;
  border-radius: 14px;
  border: 1px solid rgba(167, 139, 250, 0.16);
  background:
    radial-gradient(180px 80px at 100% 0%, rgba(139, 92, 246, 0.18), transparent 70%),
    linear-gradient(150deg, rgba(124, 92, 255, 0.14), rgba(255, 255, 255, 0.035));
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.storage-head { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: #9a9fb5; }
.storage-head span { display: flex; align-items: center; gap: 6px; }
.storage-head .icon { width: 13px; height: 13px; color: #b9a8ff; }
.storage-state { display: inline-flex; align-items: center; gap: 4px; color: #7f849b; font-size: 8px; }
.storage-state i { width: 5px; height: 5px; border-radius: 50%; background: #4fd6a4; box-shadow: 0 0 0 3px rgba(79, 214, 164, 0.08); }
.storage-figure { display: flex; align-items: baseline; gap: 6px; margin: 9px 0 3px; position: relative; z-index: 1; }
.storage-figure strong { color: #f0f1f8; font-size: 20px; line-height: 1; font-weight: 650; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.storage-figure > span { color: #777c93; font-size: 8.5px; }
.storage-figure small { margin-left: auto; max-width: 116px; color: #858aa1; font-size: 7.5px; line-height: 1.4; text-align: right; }
.storage-track { display: flex; height: 6px; margin-top: 9px; border-radius: 6px; overflow: hidden; background: rgba(255, 255, 255, 0.07); }
.storage-track i { display: block; height: 100%; width: 0; transition: width 0.45s ease; }
.storage-track .image { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.storage-track .video { background: linear-gradient(90deg, #0891b2, #22d3ee); }
.storage-track .doc { background: linear-gradient(90deg, #d97706, #fbbf24); }
.storage-legend { display: flex; flex-wrap: wrap; gap: 5px 8px; margin-top: 7px; color: #8b90a6; font-size: 7.5px; }
.storage-legend span { display: inline-flex; align-items: center; gap: 3px; }
.storage-legend b { color: #b9bdcf; font-weight: 500; font-variant-numeric: tabular-nums; }
.storage-legend i { width: 5px; height: 5px; border-radius: 2px; display: inline-block; }
.storage-legend i.image { background: #a78bfa; }
.storage-legend i.video { background: #22d3ee; }
.storage-legend i.doc { background: #fbbf24; }
.storage-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; color: #70758c; font-size: 8px; }
.storage-foot a { display: inline-flex; align-items: center; gap: 2px; color: #b9a8ff; font-size: 8px; white-space: nowrap; }
.storage-foot a .icon { width: 9px; height: 9px; }
.guide-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-align: left;
  color: #a4a9be;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.guide-link:hover { background: rgba(255, 255, 255, 0.045); border-color: rgba(255, 255, 255, 0.06); }
.guide-link-icon { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 7px; color: #c4b5fd; background: rgba(139, 92, 246, 0.14); }
.guide-link-icon .icon { width: 13px; height: 13px; }
.guide-link > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.guide-link b { font-size: 10.5px; font-weight: 550; color: #d4d6e4; }
.guide-link small { font-size: 8px; color: #777c93; }
.guide-link .guide-arrow { width: 12px; height: 12px; margin-left: auto; color: #686d83; }
.version-entry { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 9px; border: 1px solid transparent; border-radius: 9px; text-align: left; color: #a4a9be; transition: background 0.16s ease, border-color 0.16s ease; }
.version-entry:hover { background: rgba(255, 255, 255, 0.045); border-color: rgba(255, 255, 255, 0.06); }
.version-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #6ee7b7; box-shadow: 0 0 0 3px rgba(110, 231, 183, 0.08); }
.version-entry > span:nth-child(2) { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.version-entry b { color: #c9ccdd; font-size: 9.5px; font-weight: 550; }
.version-entry small { color: #777c93; font-size: 8px; }
.version-entry .guide-arrow { width: 12px; height: 12px; margin-left: auto; color: #686d83; }
.sidebar-connection {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 11px;
  color: #c9ccdd;
}
.adapter-orb {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.15);
}
.adapter-orb .icon { width: 15px; height: 15px; }
.sidebar-connection > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.sidebar-connection small { font-size: 9.5px; color: #737990; }
.sidebar-connection strong { font-size: 11.5px; font-weight: 500; color: #d7d9e6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-live { font-size: 9px; color: #4fd6a4; background: rgba(79, 214, 164, 0.1); padding: 2px 6px; border-radius: 5px; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 76px;
  padding: 0 30px;
  border-bottom: 1px solid rgba(219, 221, 232, 0.78);
  background: rgba(246, 247, 251, 0.82);
  backdrop-filter: saturate(180%) blur(16px);
}
.page-heading { min-width: 0; }
.crumb { font-size: 10.5px; letter-spacing: 0.05em; color: var(--ink-3); margin-bottom: 1px; }
.crumb span { margin: 0 5px; color: var(--ink-4); }
.page-heading h1 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px 0 11px;
  min-width: 242px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-3);
  font-size: 11.5px;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.search-btn:hover { border-color: var(--line-strong); background: #fff; box-shadow: var(--shadow-xs); }
.search-btn .icon { width: 15px; height: 15px; }
.search-btn span { flex: 1; text-align: left; }
.search-btn kbd {
  font-family: var(--font);
  font-size: 9px;
  color: var(--ink-4);
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 4px;
  padding: 1px 4px;
}
.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #4b3512;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(145deg, #f2d9a6, #d9a855);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), var(--shadow-xs);
}
.menu-btn { display: none !important; }
.sidebar-scrim { display: none; }

.app-main { width: 100%; max-width: 1640px; margin: 0 auto; padding: 26px 30px 70px; flex: 1; }

.view { animation: viewIn 0.34s cubic-bezier(0.22, 0.8, 0.3, 1) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

/* =========================================================
   Common components
   ========================================================= */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; }
.card-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--ink-3); }
.soft-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 10px;
  white-space: nowrap;
}
.soft-badge b { color: var(--ink-2); font-weight: 600; }
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
}
.text-link .icon { width: 14px; height: 14px; transition: transform 0.16s ease; }
.text-link:hover .icon { transform: translateX(2px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
  transition: transform 0.14s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}
.btn .icon { width: 15px; height: 15px; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #6d5ce7 0%, #5b5bd6 55%, #4f46c9 100%);
  box-shadow: 0 5px 15px rgba(91, 91, 214, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn.primary:hover { background: linear-gradient(135deg, #7967f0, #6161df 55%, #554bd4); box-shadow: 0 7px 19px rgba(91, 91, 214, 0.3); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink-2); box-shadow: var(--shadow-xs); }
.btn.ghost:hover { border-color: var(--line-strong); color: var(--ink); background: #fff; }
.btn.tiny { height: 29px; padding: 0 9px; font-size: 10.5px; border-radius: 7px; }
.btn.tiny .icon { width: 13px; height: 13px; }
.btn.light { background: #fff; color: #292750; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2); }
.btn.light:hover { background: #f7f6ff; }
.btn.transparent { color: #dcdcf0; border-color: rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.04); }
.btn.transparent:hover { background: rgba(255, 255, 255, 0.09); }
.btn.block { width: 100%; }
.btn.danger-text { color: var(--danger); }
.btn.danger { color: #fff; background: var(--danger); border: 1px solid var(--danger); }
.btn.danger:hover { background: #bf3838; border-color: #bf3838; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn.loading { pointer-events: none; opacity: 0.8; }
.btn.loading .icon { animation: spin 0.9s linear infinite; }
.btn-count {
  min-width: 19px;
  height: 18px;
  padding: 0 5px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 10px;
}
.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 9px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  background: #fff;
  transition: background 0.16s ease, border-color 0.16s ease;
}
.icon-btn:hover { background: var(--panel-2); border-color: var(--line-strong); }
.icon-btn.soft { border-color: transparent; background: var(--brand-soft); color: var(--brand); }
.icon-btn.soft:hover { background: #e5e4fc; }
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 500;
  padding: 0;
}
.link-btn:hover { color: var(--brand); }
.link-btn .icon { width: 13px; height: 13px; }

.progress { height: 6px; border-radius: 10px; background: #eceef4; overflow: hidden; }
.progress.thin { height: 4px; }
.progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #8b5cf6, #5b5bd6); transition: width 0.35s ease; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 10.5px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.01em; }
.field input, .field select {
  width: 100%;
  height: 35px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 12px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: rgba(91, 91, 214, 0.45);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.08);
}
.field input::placeholder { color: var(--ink-4); }
.field-hint { margin: 6px 0 0; font-size: 10px; color: var(--ink-3); }
.input-suffix { position: relative; }
.input-suffix input { padding-right: 38px; }
.input-suffix span { position: absolute; right: 10px; top: 9px; font-size: 10.5px; color: var(--ink-3); }
.select-compact {
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 11px;
  color: var(--ink-2);
}
.search-field {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.search-field .icon { width: 14px; height: 14px; color: var(--ink-3); }
.search-field input { border: 0; outline: none; background: none; width: 160px; font-size: 11.5px; }
.search-field input::placeholder { color: var(--ink-4); }

.segmented {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  gap: 2px;
  border-radius: 9px;
  background: #eef0f6;
  border: 1px solid #e8eaf1;
}
.seg {
  height: 27px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 550;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}
.seg span { margin-left: 3px; font-size: 9px; opacity: 0.7; }
.seg:hover { color: var(--ink-2); }
.seg.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 24, 40, 0.11); }

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 7px 0;
}
.switch-row.wide { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.switch-row > span { display: flex; flex-direction: column; gap: 1px; }
.switch-row b { font-size: 11.5px; font-weight: 550; color: var(--ink-2); }
.switch-row small { font-size: 9.5px; color: var(--ink-3); }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch {
  position: relative;
  width: 32px;
  height: 18px;
  flex: none;
  border-radius: 20px;
  background: #dfe1ea;
  transition: background 0.18s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s cubic-bezier(0.3, 0.9, 0.3, 1.2);
}
.switch-row input:checked + .switch { background: var(--brand); }
.switch-row input:checked + .switch::after { transform: translateX(14px); }
.switch-row input:focus-visible + .switch { outline: 2px solid rgba(91, 91, 214, 0.4); outline-offset: 2px; }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 24px;
  min-height: 300px;
}
.empty-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 14px;
}
.empty-icon .icon { width: 24px; height: 24px; }
.empty-state h3 { margin: 0 0 5px; font-size: 15px; }
.empty-state p { margin: 0 0 18px; color: var(--ink-3); font-size: 12px; }

.skeleton-card { min-height: 122px; background: linear-gradient(100deg, #fff 30%, #f8f8fc 50%, #fff 70%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border: 1px solid var(--line); border-radius: var(--radius-lg); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.9s linear infinite; }

/* =========================================================
   Dashboard
   ========================================================= */
.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 28px;
  min-height: 338px;
  padding: 38px 42px;
  border-radius: 26px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(700px 420px at 6% -10%, rgba(124, 92, 255, 0.42), transparent 62%),
    radial-gradient(560px 400px at 96% 8%, rgba(37, 99, 235, 0.24), transparent 66%),
    linear-gradient(135deg, #20213c 0%, #151728 48%, #10111c 100%);
  box-shadow: 0 24px 60px rgba(18, 20, 36, 0.2);
}
.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(800px 500px at 70% 20%, #000 10%, transparent 75%);
  pointer-events: none;
}
.hero-panel::after {
  content: "";
  position: absolute;
  right: -100px;
  bottom: -180px;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 60px rgba(255, 255, 255, 0.018), 0 0 0 120px rgba(255, 255, 255, 0.014);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 2; align-self: center; max-width: 560px; }
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: #a6a9c6;
  text-transform: uppercase;
}
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: #57e3b1; box-shadow: 0 0 0 0 rgba(87, 227, 177, 0.5); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(87, 227, 177, 0.4); } 70% { box-shadow: 0 0 0 7px rgba(87, 227, 177, 0); } 100% { box-shadow: 0 0 0 0 rgba(87, 227, 177, 0); } }
.eyebrow-sep { width: 14px; height: 1px; background: rgba(255, 255, 255, 0.2); }
.hero-copy h2 {
  margin: 15px 0 12px;
  font-size: clamp(31px, 3.1vw, 43px);
  line-height: 1.18;
  letter-spacing: -0.035em;
  font-weight: 650;
}
.hero-copy h2 em {
  font-style: normal;
  background: linear-gradient(100deg, #c4b5fd 0%, #a5b4fc 48%, #7dd3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-copy > p { margin: 0; max-width: 440px; color: #aeb1c9; font-size: 12.5px; line-height: 1.8; }
.hero-actions { display: flex; align-items: center; gap: 10px; margin-top: 23px; }
.hero-proof { display: flex; align-items: center; gap: 12px; margin-top: 26px; font-size: 10px; color: #777d9b; }
.hero-proof strong { color: #d9dbec; font-size: 13px; font-weight: 600; margin-right: 2px; }
.proof-line { width: 1px; height: 12px; background: rgba(255, 255, 255, 0.12); }

.hero-visual { position: relative; z-index: 2; align-self: center; display: flex; align-items: center; justify-content: center; min-height: 260px; }
.pipeline-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 370px;
  padding: 13px;
  border-radius: 16px;
  color: #dfe1ef;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(18px);
  transform: rotate(-1.4deg);
}
.pipeline-top { display: flex; align-items: center; gap: 8px; padding: 1px 4px 11px; font-size: 8px; letter-spacing: 0.08em; color: #757a97; font-family: var(--font-mono); }
.mini-dots { display: flex; gap: 3px; margin-right: 2px; }
.mini-dots i { width: 5px; height: 5px; border-radius: 50%; background: #444961; }
.mini-dots i:first-child { background: #e06868; }
.mini-dots i:nth-child(2) { background: #d9a94c; }
.mini-dots i:nth-child(3) { background: #4cbf8f; }
.pipeline-live { margin-left: auto; color: #69e0b6; font-size: 7.5px; letter-spacing: 0.12em; border: 1px solid rgba(105, 224, 182, 0.2); background: rgba(105, 224, 182, 0.08); padding: 1px 5px; border-radius: 4px; }
.pipeline-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.045); border: 1px solid rgba(255, 255, 255, 0.065); }
.pipeline-thumb { position: relative; width: 53px; height: 42px; flex: none; border-radius: 7px; overflow: hidden; background: linear-gradient(135deg, #7c5cff, #4338ca); }
.pipeline-thumb span { position: absolute; border-radius: 50%; }
.thumb-a { width: 30px; height: 30px; right: -8px; top: -9px; background: rgba(255, 255, 255, 0.22); }
.thumb-b { width: 38px; height: 1px; left: 8px; bottom: 12px; background: rgba(255, 255, 255, 0.55); border-radius: 2px; }
.thumb-c { width: 22px; height: 1px; left: 8px; bottom: 8px; background: rgba(255, 255, 255, 0.3); border-radius: 2px; }
.pipeline-info { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; flex: 1; }
.pipeline-info b { font-size: 10.5px; font-weight: 500; color: #e6e7f1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipeline-info small { font-size: 8.5px; color: #7c819c; }
.pipeline-check { width: 20px; height: 20px; display: grid; place-items: center; flex: none; border-radius: 50%; color: #6fe5b9; background: rgba(111, 229, 185, 0.1); }
.pipeline-check .icon { width: 11px; height: 11px; }
.pipeline-steps { display: flex; align-items: flex-start; justify-content: space-between; padding: 15px 4px 13px; }
.pipeline-step { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; width: 64px; }
.pipeline-step > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; color: #6f748d; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.07); }
.pipeline-step .icon { width: 12px; height: 12px; }
.pipeline-step b { font-size: 8.5px; font-weight: 500; color: #9ca0b8; }
.pipeline-step small { font-size: 7.5px; color: #5f647c; }
.pipeline-step.done > span { color: #6fe5b9; background: rgba(111, 229, 185, 0.1); border-color: rgba(111, 229, 185, 0.14); }
.pipeline-step.done b { color: #c2c5d6; }
.pipeline-step.active > span { color: #c4b5fd; background: rgba(139, 92, 246, 0.2); border-color: rgba(167, 139, 250, 0.32); box-shadow: 0 0 18px rgba(139, 92, 246, 0.2); }
.pipeline-step.active b { color: #e0d9ff; }
.step-link { flex: 1; height: 1px; background: rgba(255, 255, 255, 0.09); margin-top: 12px; }
.pipeline-progress { position: relative; padding-top: 9px; }
.pipeline-progress::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); }
.pipeline-progress > span { position: absolute; left: 0; top: 7px; width: 72%; height: 3px; border-radius: 3px; background: linear-gradient(90deg, #8b5cf6, #60a5fa); }
.pipeline-progress small { display: block; margin-top: 7px; font-size: 8px; color: #747993; }
.pipeline-progress b { position: absolute; right: 0; top: 0; font-size: 8px; color: #b7a8ff; }

.float-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 8.5px;
  color: #c9ccdf;
  background: rgba(28, 30, 48, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
  white-space: nowrap;
}
.float-chip .icon { width: 12px; height: 12px; color: #a78bfa; }
.chip-format { top: -7px; right: 22px; transform: rotate(2deg); }
.chip-size { left: 2px; bottom: 26px; transform: rotate(1.6deg); }
.chip-video { right: 24px; bottom: -8px; transform: rotate(-1.6deg); }
@media (max-width: 1640px) {
  .float-chip { display: none; }
}

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.stat-card {
  position: relative;
  padding: 17px 18px 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stat-card::after { content: ""; position: absolute; right: -38px; top: -38px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(closest-side, var(--stat-wash, rgba(91, 91, 214, 0.06)), transparent); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--stat-color, var(--brand)); background: var(--stat-wash, var(--brand-soft)); }
.stat-icon .icon { width: 16px; height: 16px; }
.stat-trend { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; color: var(--success); background: var(--success-soft); border-radius: 5px; padding: 2px 6px; }
.stat-trend.neutral { color: var(--ink-3); background: var(--panel-2); }
.stat-value { margin-top: 13px; font-size: 27px; line-height: 1.1; font-weight: 650; letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 11px; color: var(--ink-3); font-weight: 500; margin-left: 3px; letter-spacing: 0; }
.stat-label { margin-top: 4px; font-size: 10.5px; color: var(--ink-3); }
.stat-spark { position: absolute; right: 14px; bottom: 14px; display: flex; align-items: flex-end; gap: 2px; height: 22px; opacity: 0.65; }
.stat-spark i { width: 3px; border-radius: 2px; background: var(--stat-color, var(--brand)); opacity: 0.26; }
.stat-spark i:nth-child(3n) { opacity: 0.55; }
.stat-spark i:last-child { opacity: 0.9; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr); gap: 18px; margin-top: 18px; }
.dashboard-grid > .card { padding: 20px; }
.recent-card, .queue-card { min-height: 320px; }
.recent-list { margin-top: 14px; }
.recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 6px;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.recent-row + .recent-row { border-top: 1px solid #f0f1f6; border-radius: 0; }
.recent-row:hover { background: #fafafe; }
.recent-thumb { width: 52px; height: 39px; flex: none; border-radius: 7px; object-fit: cover; background: var(--bg-2); border: 1px solid var(--line); }
.recent-main { min-width: 0; flex: 1; }
.recent-main b { display: block; font-size: 12px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-main span { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 9.5px; color: var(--ink-3); }
.recent-main span i { width: 2px; height: 2px; border-radius: 50%; background: var(--ink-4); }
.recent-side { display: flex; align-items: center; gap: 10px; flex: none; }
.recent-date { font-size: 9.5px; color: var(--ink-3); }
.recent-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s ease; }
.recent-row:hover .recent-actions { opacity: 1; }
.mini-icon-btn { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 6px; color: var(--ink-3); }
.mini-icon-btn:hover { color: var(--ink); background: var(--panel-2); }
.mini-icon-btn .icon { width: 13px; height: 13px; }
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 550;
  background: var(--success-soft);
  color: var(--success);
  white-space: nowrap;
}
.status-chip::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.status-chip.draft { background: #f1f2f7; color: var(--ink-3); }
.status-chip.future { background: var(--warn-soft); color: var(--warn); }
.status-chip.failed { background: var(--danger-soft); color: var(--danger); }
.status-chip.running { background: var(--brand-soft); color: var(--brand); }

.queue-state { display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--ink-3); padding: 3px 7px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line); }
.queue-state i { width: 5px; height: 5px; border-radius: 50%; background: #b6bac8; }
.queue-state.active { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.queue-state.active i { background: var(--brand); animation: pulse 1.8s infinite; }
.queue-state.done { color: var(--success); background: var(--success-soft); border-color: transparent; }
.queue-state.done i { background: var(--success); }
.dash-queue { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.dash-job { padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.dash-job-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dash-job-top b { font-size: 10.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-job-top span { font-size: 8.5px; color: var(--ink-3); flex: none; }
.dash-job .progress { margin-top: 7px; height: 3px; }
.dash-job p { margin: 6px 0 0; font-size: 8.5px; color: var(--ink-3); display: flex; justify-content: space-between; }
.queue-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 174px; color: var(--ink-3); text-align: center; gap: 6px; }
.queue-empty span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-4); margin-bottom: 3px; }
.queue-empty b { font-size: 11.5px; font-weight: 550; color: var(--ink-2); }
.queue-empty small { font-size: 9.5px; }
.queue-card-foot { margin-top: 12px; }

.lower-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(280px, 0.9fr); }
.chart { margin-top: 18px; display: flex; align-items: flex-end; gap: 8px; height: 145px; padding: 0 4px 2px; border-bottom: 1px dashed var(--line); }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.chart-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.chart-bar { width: min(28px, 64%); min-height: 5px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #c4b5fd, #8b5cf6); opacity: 0.55; transition: opacity 0.15s ease, transform 0.15s ease; position: relative; }
.chart-col:hover .chart-bar { opacity: 1; transform: translateY(-2px); }
.chart-col.today .chart-bar { background: linear-gradient(180deg, #8b5cf6, #5b5bd6); opacity: 1; box-shadow: 0 5px 14px rgba(91, 91, 214, 0.24); }
.chart-bar b { position: absolute; top: -17px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 600; color: var(--brand); opacity: 0; transition: opacity 0.15s ease; }
.chart-col:hover .chart-bar b, .chart-col.today .chart-bar b { opacity: 1; }
.chart-label { font-size: 9px; color: var(--ink-3); white-space: nowrap; }
.chart-col.today .chart-label { color: var(--brand); font-weight: 600; }

.quick-steps { margin-top: 10px; }
.quick-step {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 4px;
  text-align: left;
  border-radius: 8px;
}
.quick-step + .quick-step { border-top: 1px solid #f0f1f6; }
.quick-step:hover span:nth-child(2) b { color: var(--brand); }
.quick-step > .icon { width: 14px; height: 14px; color: var(--ink-4); margin-left: auto; }
.quick-num { font-family: var(--font-mono); font-size: 9px; color: var(--brand); background: var(--brand-soft); border-radius: 5px; padding: 3px 5px; flex: none; }
.quick-step span:nth-child(2) { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.quick-step b { font-size: 11.5px; font-weight: 550; }
.quick-step small { font-size: 9.5px; color: var(--ink-3); }

.connection-body { margin-top: 16px; }
.connection-main { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); }
.connection-main .adapter-icon { width: 36px; height: 36px; }
.connection-main div { min-width: 0; flex: 1; }
.connection-main b { display: block; font-size: 11.5px; font-weight: 600; }
.connection-main small { display: block; font-size: 9.5px; color: var(--ink-3); margin-top: 1px; }
.connection-main .conn-live { color: var(--success); background: var(--success-soft); font-size: 8.5px; padding: 2px 6px; border-radius: 5px; }
.connection-meta { display: flex; justify-content: space-between; margin-top: 11px; font-size: 9.5px; color: var(--ink-3); }
.connection-meta b { color: var(--ink-2); font-weight: 550; }

/* =========================================================
   Publish workspace
   ========================================================= */
.view-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.toolbar-copy h2 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.025em; }
.toolbar-copy p { margin: 4px 0 0; color: var(--ink-3); font-size: 11.5px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.publish-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr) 286px;
  gap: 16px;
  align-items: start;
}
.publish-layout > .settings-panel { grid-column: auto; display: flex; flex-direction: column; gap: 13px; position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow: auto; padding-right: 2px; }
.publish-layout > .settings-panel .side-card { height: auto; }

.queue-panel {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 116px);
  min-height: 560px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.queue-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 16px 15px 12px; border-bottom: 1px solid #f0f1f6; }
.queue-head h3 { margin: 0; font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.queue-head h3 span { font-size: 9.5px; color: var(--brand); background: var(--brand-soft); border-radius: 5px; padding: 1px 5px; }
.queue-head p { margin: 3px 0 0; font-size: 9.5px; color: var(--ink-3); }
.queue-progress-wrap { padding: 10px 14px; border-bottom: 1px solid #f0f1f6; background: #fafaff; }
.queue-progress-label { display: flex; justify-content: space-between; font-size: 9px; color: var(--ink-3); margin-bottom: 6px; }
.queue-progress-label b { color: var(--brand); font-weight: 600; }
.article-list { flex: 1; overflow-y: auto; padding: 8px; }
.article-item {
  position: relative;
  display: flex;
  gap: 9px;
  padding: 8px;
  margin-bottom: 3px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.article-item:hover { background: #fafafd; }
.article-item.active { background: var(--brand-wash); border-color: rgba(91, 91, 214, 0.18); }
.article-thumb { width: 46px; height: 38px; flex: none; border-radius: 6px; object-fit: cover; background: linear-gradient(135deg, #e8e7fb, #f5f4ff); border: 1px solid rgba(91, 91, 214, 0.1); }
.article-thumb.empty { display: grid; place-items: center; color: #a8a5d8; }
.article-thumb.empty .icon { width: 15px; height: 15px; }
.article-body-mini { flex: 1; min-width: 0; }
.article-body-mini b { display: block; font-size: 10.5px; font-weight: 550; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-body-mini .mini-meta { margin-top: 3px; display: flex; align-items: center; gap: 5px; font-size: 8.5px; color: var(--ink-3); }
.article-body-mini .mini-meta .status-chip { font-size: 8px; padding: 1px 4px; }
.article-left-delete { width: 34px; height: 44px; flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 6px; color: #b34a4a; background: #fff8f8; border: 1px solid #f0dada; font-size: 7.5px; line-height: 1; white-space: nowrap; }
.article-left-delete .icon { width: 11px; height: 11px; }
.article-left-delete:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.article-item .item-remove { position: absolute; right: 4px; top: 4px; width: 20px; height: 20px; display: none; place-items: center; border-radius: 5px; color: var(--ink-3); background: rgba(255, 255, 255, 0.9); }
.article-item:hover .item-remove { display: grid; }
.article-item .item-remove:hover { color: var(--danger); background: var(--danger-soft); }
.article-item .item-remove .icon { width: 11px; height: 11px; }
.article-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 44px 16px; color: var(--ink-3); gap: 4px; }
.article-empty span { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink-4); margin-bottom: 4px; }
.article-empty b { font-size: 11px; color: var(--ink-2); font-weight: 550; }
.article-empty small { font-size: 9px; }
.queue-foot { display: flex; align-items: center; gap: 13px; padding: 10px 14px; border-top: 1px solid #f0f1f6; background: #fcfcfe; }
.queue-foot-hint { margin-left: auto; font-size: 8.5px; color: var(--ink-4); }

.editor-card {
  scroll-margin-top: 92px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 116px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.editor-titlebar { padding: 22px 24px 0; }
.title-input {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: none;
  font-size: clamp(22px, 2.2vw, 29px);
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.title-input::placeholder { color: #c2c4d1; font-weight: 600; }
.editor-badges { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-bottom: 12px; }
.format-pill { font-size: 9px; color: var(--brand); background: var(--brand-soft); border-radius: 5px; padding: 2px 6px; font-weight: 550; }
.word-pill { font-size: 9px; color: var(--ink-3); }
.word-pill b { color: var(--ink-2); font-weight: 600; }
.save-state { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; font-size: 9px; color: var(--ink-3); }
.save-state .icon { width: 11px; height: 11px; color: var(--success); }
.save-state.saving .icon { color: var(--ink-4); animation: spin 0.9s linear infinite; }
.format-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 24px 11px; border-bottom: 1px solid #f0f1f6; }
.format-bar .segmented { background: #f3f4f8; }
.format-actions { display: flex; gap: 4px; }
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
  padding: 7px 20px;
  border-bottom: 1px solid #f0f1f6;
  background: #fcfcfe;
}
.toolbar-select {
  height: 28px;
  padding: 0 22px 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 10.5px;
  color: var(--ink-2);
}
.tool-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--ink-3);
  transition: background 0.14s ease, color 0.14s ease;
}
.tool-btn:hover { background: #f0f0f7; color: var(--ink); }
.tool-btn .icon { width: 15px; height: 15px; }
.strike-s { font-size: 12px; text-decoration: line-through; font-weight: 600; }
.toolbar-sep { width: 1px; height: 16px; background: var(--line); margin: 0 4px; }
.toolbar-hint { margin-left: auto; font-size: 8.5px; color: var(--ink-4); }

.content-shell { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 420px; }
.rich-editor {
  flex: 1;
  min-height: 420px;
  padding: 22px 26px 30px;
  outline: none;
  font-size: 14px;
  line-height: 1.9;
  color: #2a2d3b;
  overflow-wrap: break-word;
}
.rich-editor:empty::before { content: attr(data-placeholder); color: #bfc1ce; pointer-events: none; }
.rich-editor h2 { margin: 1.4em 0 0.5em; font-size: 21px; line-height: 1.4; letter-spacing: -0.02em; }
.rich-editor h3 { margin: 1.2em 0 0.4em; font-size: 17px; }
.rich-editor p { margin: 0.7em 0; }
.rich-editor .lead { font-size: 15.5px; color: #4c5165; }
.rich-editor blockquote { margin: 1.2em 0; padding: 10px 16px; border-left: 3px solid #a78bfa; background: #faf8ff; color: #555a70; font-style: normal; }
.rich-editor ul, .rich-editor ol { padding-left: 1.4em; margin: 0.7em 0; }
.rich-editor li { margin: 0.25em 0; }
.rich-editor img { max-width: 100%; border-radius: 10px; margin: 8px 0; }
.rich-editor figure { margin: 14px 0; }
.rich-editor figcaption { font-size: 11px; color: var(--ink-3); text-align: center; margin-top: 5px; }
.rich-editor a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.rich-editor code { font-family: var(--font-mono); font-size: 0.9em; padding: 2px 5px; border-radius: 4px; background: #f1f2f7; }
.rich-editor pre { padding: 14px; border-radius: 9px; background: #1b1d2b; color: #e7e8f3; overflow: auto; font-family: var(--font-mono); font-size: 12px; }
.rich-editor hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.rich-editor table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 12px; }
.rich-editor th, .rich-editor td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; }
.rich-editor th { background: #f8f8fc; }
.rich-editor video { max-width: 100%; border-radius: 10px; }

.code-editor {
  flex: 1;
  width: 100%;
  min-height: 420px;
  padding: 22px 26px;
  border: 0;
  outline: none;
  resize: none;
  background: #fcfcfe;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.85;
  color: #333747;
  tab-size: 2;
}
.code-editor::placeholder { color: #bfc1ce; }
.live-preview { background: #fbfaf7; border-left: 1px solid var(--line); max-height: 680px; overflow: auto; }
.live-preview-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 16px; background: rgba(251, 250, 247, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid #eeebe2; }
.live-preview-head span { font-size: 9.5px; font-weight: 600; color: #6c6a60; letter-spacing: 0.05em; }
.live-preview-head small { font-size: 8.5px; color: #a09c8f; }
.live-preview .article-body { padding: 22px 28px; }
.content-shell.preview-on { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr); align-items: stretch; }
.content-shell.preview-on .rich-editor, .content-shell.preview-on .code-editor { min-height: 520px; }
@media (min-width: 1800px) { .content-shell.preview-on .live-preview { max-height: 720px; } }

.video-block-bar { padding: 10px 24px; background: #fbfaff; border-top: 1px solid #eeecf8; display: flex; align-items: flex-start; gap: 12px; }
.video-block-head { display: flex; align-items: center; gap: 5px; flex: none; padding-top: 3px; color: #5f5a91; font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.video-block-head .icon { width: 13px; height: 13px; color: var(--brand); }
.video-block-head > span { min-width: 16px; height: 16px; display: grid; place-items: center; border-radius: 4px; background: var(--brand-soft); color: var(--brand); font-size: 8px; }
.video-block-head small { margin-left: 3px; font-size: 8px; font-weight: 400; color: var(--ink-3); white-space: normal; }
.video-block-list { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.video-block-chip { display: flex; align-items: center; gap: 5px; max-width: 280px; padding: 3px 4px 3px 7px; border: 1px solid rgba(91, 91, 214, 0.16); border-radius: 6px; background: #fff; font-size: 8.5px; color: var(--ink-2); }
.video-block-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-block-chip button { display: inline-flex; align-items: center; gap: 2px; flex: none; padding: 2px 5px; border-radius: 4px; color: var(--danger); background: var(--danger-soft); font-size: 7.5px; }
.video-block-chip button:hover { background: #f9dada; }
.video-block-chip button .icon { width: 9px; height: 9px; }
.rich-editor .video-block-selected { outline: 2px solid rgba(91, 91, 214, 0.65); outline-offset: 3px; border-radius: 8px; }
.rich-editor figure.video-block-selected { outline: 2px solid rgba(91, 91, 214, 0.65); outline-offset: 3px; }
.rich-editor video { cursor: pointer; }

.excerpt-box { padding: 13px 24px 14px; border-top: 1px solid #f0f1f6; background: #fcfcfe; }.excerpt-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.excerpt-head label { font-size: 10px; font-weight: 600; color: var(--ink-2); }
.excerpt-head span { font-size: 8.5px; color: var(--ink-4); }
.excerpt-box textarea { width: 100%; border: 0; outline: none; resize: vertical; background: transparent; font-size: 11.5px; line-height: 1.7; color: var(--ink-2); min-height: 38px; }
.excerpt-box textarea::placeholder { color: var(--ink-4); }
.editor-actions { display: flex; align-items: center; gap: 12px; padding: 14px 24px; border-top: 1px solid #f0f1f6; }
.editor-hint { display: flex; align-items: center; gap: 5px; font-size: 9px; color: var(--ink-3); }
.editor-hint .icon { width: 12px; height: 12px; color: var(--success); }
.action-group { margin-left: auto; display: flex; align-items: center; gap: 7px; }

.settings-panel { display: flex; flex-direction: column; gap: 13px; }
.side-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); padding: 15px; }
.side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 11px; }
.side-head h3 { margin: 0; font-size: 12px; font-weight: 650; }
.side-note { font-size: 8.5px; color: var(--ink-3); }
.adapter-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 8.5px; color: var(--success); background: var(--success-soft); border-radius: 5px; padding: 2px 6px; }
.adapter-chip i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.status-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: 8px; background: #f1f2f7; }
.status-seg button { height: 27px; border-radius: 6px; color: var(--ink-3); font-size: 10px; font-weight: 550; }
.status-seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 24, 40, 0.1); }
.schedule-field { margin-top: 9px; padding: 9px; border: 1px solid rgba(91, 91, 214, 0.16); background: var(--brand-wash); border-radius: 8px; }
.schedule-field label { display: flex; align-items: center; gap: 5px; font-size: 9px; color: var(--ink-3); margin-bottom: 4px; }
.schedule-field label .icon { width: 11px; height: 11px; }
.schedule-field input { width: 100%; border: 0; background: transparent; outline: none; font-size: 11px; color: var(--ink); }
.side-card .field { margin-top: 9px; }
.side-card .field > span { font-size: 9.5px; }
.side-card .field input { height: 32px; font-size: 11px; }
.tag-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 34px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.tag-editor:focus-within { border-color: rgba(91, 91, 214, 0.45); background: #fff; box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.08); }
.tag-chip { display: inline-flex; align-items: center; gap: 3px; height: 21px; padding: 0 6px; border-radius: 5px; background: #ecebfb; color: var(--brand-deep); font-size: 9px; }
.tag-chip button { display: grid; place-items: center; color: #8b87c9; }
.tag-chip button:hover { color: var(--danger); }
.tag-chip .icon { width: 10px; height: 10px; }
.tag-editor input { flex: 1; min-width: 60px; height: 21px; border: 0; outline: none; background: none; font-size: 10px; }
.tag-editor input::placeholder { color: var(--ink-4); }
.template-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
.template-option { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; text-align: left; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.template-option:hover { border-color: #cfcde9; background: #fdfcff; }
.template-option.active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(91, 91, 214, 0.12); }
.tpl-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.tpl-mini { position: relative; width: 50px; height: 38px; flex: none; border-radius: 4px; background: #f7f7fb; overflow: hidden; border: 1px solid #f0f0f5; }
.tpl-mini::before, .tpl-mini::after { content: ""; position: absolute; }
.tpl-mini[data-template="editorial"] { background: linear-gradient(140deg, #f0eaff, #faf8ff); }
.tpl-mini[data-template="editorial"]::before { left: 7px; right: 7px; top: 6px; height: 17px; background: linear-gradient(135deg, #7c3aed, #a78bfa); border-radius: 2px; }
.tpl-mini[data-template="editorial"]::after { left: 7px; top: 28px; width: 46px; height: 3px; background: #4c3a75; box-shadow: 0 5px 0 #c9c2dd, 0 9px 0 #d8d3e7; }
.tpl-mini[data-template="minimal"] { background: #fff; }
.tpl-mini[data-template="minimal"]::before { left: 7px; top: 8px; width: 26px; height: 3px; background: #2563eb; }
.tpl-mini[data-template="minimal"]::after { left: 7px; top: 16px; width: 58px; height: 2px; background: #26303f; box-shadow: 0 5px 0 #ccd2dd, 0 9px 0 #dbe0e8, 0 13px 0 #dbe0e8; }
.tpl-mini[data-template="newsletter"] { background: #fff; }
.tpl-mini[data-template="newsletter"]::before { left: 17px; right: 17px; top: 7px; height: 2px; background: #0f766e; }
.tpl-mini[data-template="newsletter"]::after { left: 24px; right: 24px; top: 15px; height: 3px; background: #333; box-shadow: 0 6px 0 #cbd5d3, 0 10px 0 #cbd5d3, 0 14px 0 #e2e8e6; }
.tpl-mini[data-template="brand"] { background: linear-gradient(135deg, #fce7f3, #fff7ed); }
.tpl-mini[data-template="brand"]::before { left: 0; right: 0; top: 0; height: 23px; background: linear-gradient(135deg, #db2777, #f97316); }
.tpl-mini[data-template="brand"]::after { left: 7px; top: 29px; width: 42px; height: 3px; background: #7a2949; box-shadow: 0 5px 0 #dcc4ce; }
.tpl-mini[data-template="business"] { background: #f5f7fc; }
.tpl-mini[data-template="business"]::before { left: 0; right: 0; top: 0; height: 5px; background: #1d4ed8; }
.tpl-mini[data-template="business"]::after { left: 7px; top: 12px; width: 52px; height: 3px; background: #1e293b; box-shadow: 0 6px 0 #cbd5e1, 0 10px 0 #dbe3ef, 0 14px 0 #dbe3ef; }
.tpl-mini[data-template="dark"] { background: #111827; border-color: #263244; }
.tpl-mini[data-template="dark"]::before { left: 7px; top: 8px; width: 34px; height: 3px; background: #22d3ee; box-shadow: 0 5px 0 rgba(255,255,255,.28); }
.tpl-mini[data-template="dark"]::after { left: 7px; top: 22px; width: 56px; height: 2px; background: #64748b; box-shadow: 0 4px 0 #475569, 0 8px 0 #334155; }
.tpl-mini[data-template="lifestyle"] { background: linear-gradient(150deg, #fdf6ea, #f8e8d9); border-color: #efe0cf; }
.tpl-mini[data-template="lifestyle"]::before { left: 0; right: 0; top: 0; height: 21px; background: linear-gradient(120deg, #f3d6b4, #e9b98c); }
.tpl-mini[data-template="lifestyle"]::after { left: 7px; top: 27px; width: 44px; height: 3px; background: #7c3f16; border-radius: 2px; box-shadow: 0 5px 0 #cfb49c; }
.tpl-mini[data-template="docs"] { background: #fff; }
.tpl-mini[data-template="docs"]::before { left: 7px; top: 8px; width: 4px; height: 30px; border-radius: 2px; background: #0f766e; }
.tpl-mini[data-template="docs"]::after { left: 15px; top: 9px; width: 48px; height: 2px; background: #334155; box-shadow: 0 5px 0 #94a3b8, 0 9px 0 #94a3b8, 0 14px 0 #dbe3ea; }
.template-option b { display: block; font-size: 10.5px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.template-option small { display: block; font-size: 8px; color: var(--ink-3); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.template-option .tpl-check { position: static; flex: none; margin-left: auto; width: 16px; height: 16px; display: none; place-items: center; border-radius: 50%; color: #fff; background: var(--brand); }
.template-option .tpl-check .icon { width: 9px; height: 9px; }
.template-option.active .tpl-check { display: grid; }
.accent-line { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.accent-line > span { font-size: 9.5px; color: var(--ink-2); font-weight: 550; }
.accent-row { display: flex; gap: 5px; }
.accent-dot { width: 17px; height: 17px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); transition: transform 0.15s ease, box-shadow 0.15s ease; }
.accent-dot:hover { transform: scale(1.1); }
.accent-dot.active { box-shadow: 0 0 0 1.5px var(--ink-2); transform: scale(1.08); }
.option-list { margin-top: 7px; border-top: 1px solid #f2f3f8; padding-top: 4px; }
.option-list .switch-row b { font-size: 10px; }
.option-list .switch-row small { font-size: 8px; }
.range-line { display: flex; align-items: center; gap: 7px; margin-top: 8px; padding-top: 9px; border-top: 1px solid #f2f3f8; font-size: 9px; color: var(--ink-2); }
.range-line input { flex: 1; accent-color: var(--brand); height: 3px; }
.range-line b { font-size: 8.5px; color: var(--ink-3); font-weight: 550; min-width: 28px; text-align: right; }
.cover-drop { position: relative; aspect-ratio: 16 / 9; border-radius: 9px; overflow: hidden; background: var(--panel-2); border: 1px dashed #d6d8e4; display: grid; place-items: center; }
.cover-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-empty { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; padding: 10px; }
.cover-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: #fff; color: var(--ink-3); border: 1px solid var(--line); margin-bottom: 3px; }
.cover-icon .icon { width: 14px; height: 14px; }
.cover-empty b { font-size: 9.5px; font-weight: 550; color: var(--ink-2); }
.cover-empty small { font-size: 8px; color: var(--ink-3); }
.cover-overlay { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 8px; background: linear-gradient(transparent 45%, rgba(10, 12, 22, 0.55)); opacity: 0; transition: opacity 0.16s ease; }
.cover-drop:hover .cover-overlay { opacity: 1; }
.cover-overlay button { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.94); color: #262838; font-size: 9px; }
.cover-overlay .icon { width: 11px; height: 11px; }
.cover-actions { display: flex; gap: 4px; margin-top: 7px; }
.cover-actions .btn { flex: 1; padding: 0 5px; }
.field-hint { margin: 0; }
.seo-preview { display: flex; gap: 8px; margin-top: 11px; padding: 9px; border-radius: 8px; background: var(--panel-2); border: 1px solid #f0f1f6; }
.seo-favicon { width: 23px; height: 23px; flex: none; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(135deg, #8b5cf6, #5b5bd6); color: #fff; font-size: 8px; font-weight: 700; }
.seo-preview div { min-width: 0; }
.seo-preview b { display: block; font-size: 9.5px; font-weight: 550; color: #2b3a67; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seo-preview small { display: block; font-size: 8px; color: #71806d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

/* =========================================================
   Media library
   ========================================================= */
.media-drop {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border: 1px dashed #cfcde6;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.035), rgba(37, 99, 235, 0.02)),
    #fff;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.media-drop.dragging { border-color: var(--brand); background: var(--brand-wash); transform: scale(1.003); }
.drop-visual { flex: none; }.drop-ring { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 13px; color: var(--brand); background: var(--brand-soft); border: 1px solid rgba(91, 91, 214, 0.14); }
.drop-ring .icon { width: 21px; height: 21px; }
.drop-copy { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.drop-copy b { font-size: 13px; font-weight: 600; }
.drop-copy span { font-size: 9.5px; color: var(--ink-3); }
.upload-tray { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.upload-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.upload-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; background: var(--brand-soft); color: var(--brand); overflow: hidden; flex: none; }
.upload-icon img { width: 100%; height: 100%; object-fit: cover; }
.upload-icon .icon { width: 14px; height: 14px; }
.upload-main { flex: 1; min-width: 0; }
.upload-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.upload-top b { font-size: 10px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-top span { font-size: 8.5px; color: var(--ink-3); }
.upload-main .progress { height: 3px; margin-top: 6px; }
.upload-status { font-size: 8.5px; color: var(--success); flex: none; }
.upload-status.error { color: var(--danger); }
.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 20px 0 14px; }
.media-scope-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; }
.upload-scope { display: flex; align-items: center; gap: 8px; }
.upload-scope > span { font-size: 9px; color: var(--ink-3); }
.upload-scope .segmented { background: #fff; border-color: var(--line); }
.upload-scope .seg { height: 24px; font-size: 9px; }
.media-purpose-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 9px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, 0.7); }
.media-select-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 9px; padding: 7px 10px; border: 1px solid rgba(91, 91, 214, 0.18); border-radius: 8px; background: #f7f6ff; }
.media-select-bar[hidden] { display: none; }
.select-count { color: var(--ink-2); font-size: 9.5px; font-weight: 550; }
.select-count b { color: var(--brand); font-size: 13px; }
.select-divider { width: 1px; height: 16px; background: #dedbf1; }
.media-check { position: absolute; left: 8px; top: 8px; z-index: 6; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: rgba(255, 255, 255, 0.94); box-shadow: 0 3px 10px rgba(20, 18, 30, 0.2); cursor: pointer; }
.media-check input { position: absolute; opacity: 0; pointer-events: none; }
.media-check span { width: 15px; height: 15px; display: grid; place-items: center; border: 1.5px solid #cfcbdd; border-radius: 4px; color: #fff; background: #fff; font-size: 10px; line-height: 1; }
.media-check input:checked + span { border-color: var(--brand); background: var(--brand); }
.media-check input:checked + span::after { content: "✓"; }
.media-check input:disabled + span { background: #f1f1f5; border-color: #e0dfe7; }
.media-grid.selecting .media-badge, .media-grid.selecting .media-work-badge, .media-grid.selecting .doc-convertible { display: none; }
.media-grid.selecting .media-hover-actions { display: none; }
.media-card.selected { outline: 2px solid var(--brand); outline-offset: -2px; border-color: var(--brand); }
.media-card.selected .media-thumb { filter: brightness(0.97); }
#mediaDeleteSelectedBtn:disabled { opacity: 0.45; cursor: not-allowed; }
.purpose-label { color: var(--ink-2); font-size: 9px; font-weight: 600; }
.purpose-hint { color: var(--ink-3); font-size: 8.5px; }
.media-work-badge { position: absolute; right: 8px; top: 8px; display: inline-flex; align-items: center; height: 19px; padding: 0 6px; border-radius: 5px; background: rgba(91, 91, 214, 0.82); color: #fff; font-size: 8px; font-weight: 550; backdrop-filter: blur(6px); }
.media-work-badge.photo-essay { background: rgba(219, 39, 119, 0.82); }
.media-work-badge.graphic { background: rgba(180, 83, 9, 0.86); }
.library-tools { display: flex; align-items: center; gap: 7px; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.media-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.media-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.media-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(135deg, #f1f0fb, #f8f7ff); cursor: pointer; }
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.media-card:hover .media-thumb img { transform: scale(1.035); }
.media-badge { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 3px; height: 19px; padding: 0 6px; border-radius: 5px; background: rgba(16, 18, 30, 0.72); color: #fff; font-size: 8px; backdrop-filter: blur(6px); }
.media-badge .icon { width: 10px; height: 10px; }
.media-duration { position: absolute; right: 8px; bottom: 8px; padding: 2px 5px; border-radius: 4px; background: rgba(16, 18, 30, 0.75); color: #fff; font-size: 8px; font-variant-numeric: tabular-nums; }
.media-play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.media-play span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.9); color: #272540; box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2); }
.media-play .icon { width: 16px; height: 16px; margin-left: 2px; }
.media-hover-actions { position: absolute; inset: auto 0 0; display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 8px; background: linear-gradient(transparent, rgba(12, 14, 24, 0.55)); opacity: 0; transition: opacity 0.16s ease; }
.media-card:hover .media-hover-actions { opacity: 1; }
.media-hover-actions button { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; color: #fff; background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px); }
.media-hover-actions button:hover { background: rgba(255, 255, 255, 0.28); }
.media-hover-actions .icon { width: 12px; height: 12px; }
.media-info { padding: 9px 10px 10px; }
.media-name { display: block; font-size: 10px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media-sub { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 3px; font-size: 8.5px; color: var(--ink-3); }
.media-owner { margin-left: auto; color: var(--ink-3); background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; font-size: 7.5px; white-space: nowrap; max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.media-owner.shared { color: #5b5bd6; background: var(--brand-soft); border-color: transparent; }
.picker-owner { color: var(--ink-3) !important; }
.picker-item .picker-owner { margin-top: 2px; font-size: 7.5px; }
.media-refs { color: var(--brand); background: var(--brand-soft); border-radius: 4px; padding: 1px 4px; font-size: 7.5px; }
.media-skeleton { aspect-ratio: 4/3.4; border-radius: 13px; background: linear-gradient(100deg, #fff 30%, #f5f5fa 50%, #fff 70%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border: 1px solid var(--line); }

/* =========================================================
   People library
   ========================================================= */
.people-note { display: flex; align-items: flex-start; gap: 7px; margin: 0 0 13px; padding: 9px 11px; border: 1px solid #e5e3f4; border-radius: 8px; background: #fbfaff; color: var(--ink-3); }
.people-note .icon { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--brand); }
.people-note p { margin: 0; font-size: 9px; line-height: 1.65; }
.people-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 13px; }
.people-stat { display: flex; align-items: center; gap: 7px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.people-stat > span { width: 25px; height: 25px; flex: none; display: grid; place-items: center; border-radius: 7px; color: var(--brand); background: var(--brand-soft); }
.people-stat .icon { width: 13px; height: 13px; }
.people-stat b { color: var(--ink); font-size: 16px; line-height: 1; font-variant-numeric: tabular-nums; }
.people-stat small { color: var(--ink-3); font-size: 8.5px; }
.people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.person-card { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease; }
.person-card:hover { transform: translateY(-2px); border-color: #d5d0ee; box-shadow: var(--shadow-md); }
.person-avatar { width: 46px; height: 46px; flex: none; display: grid; place-items: center; overflow: hidden; border-radius: 50%; color: var(--brand); background: var(--brand-soft); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.person-avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-avatar .icon { width: 19px; height: 19px; }
.person-avatar.large { width: 68px; height: 68px; flex: none; }
.person-copy { min-width: 0; flex: 1; }
.person-copy b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 12px; font-weight: 600; }
.person-copy small { display: block; margin-top: 3px; color: var(--ink-3); font-size: 8.5px; }
.person-strip { display: flex; gap: 3px; flex: none; }
.person-thumb { width: 24px; height: 24px; border-radius: 5px; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); }
.person-thumb img { width: 100%; height: 100%; object-fit: cover; }
.person-arrow { width: 12px; height: 12px; color: var(--ink-4); flex: none; }
.people-progress { margin-top: 13px; padding: 12px 14px; }
.people-progress > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: var(--ink-3); font-size: 9.5px; }
.people-progress b { color: var(--brand); font-size: 8.5px; font-weight: 600; }
.person-detail-head { display: flex; align-items: center; gap: 13px; padding-bottom: 13px; margin-bottom: 13px; border-bottom: 1px solid var(--line); }
.person-detail-head .field { flex: 1; min-width: 0; }
.person-photo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.person-photo { min-width: 0; text-align: left; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.person-photo:hover { border-color: var(--brand); }
.person-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.person-photo small { display: block; padding: 4px 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-size: 7.5px; }
@media (max-width: 900px) {
  .people-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .person-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .people-grid { grid-template-columns: 1fr; }
  .person-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================================================
   Records / library
   ========================================================= */
.records-table { overflow: hidden; padding: 0; }
.record-head, .record-row { display: grid; grid-template-columns: minmax(0, 2.1fr) 0.72fr 0.8fr 0.8fr 0.9fr 84px; gap: 12px; align-items: center; }
.record-head { padding: 11px 16px; background: #fbfbfd; border-bottom: 1px solid var(--line); font-size: 8.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--ink-3); text-transform: uppercase; }
.record-row { padding: 11px 16px; border-bottom: 1px solid #f2f3f7; transition: background 0.14s ease; }
.record-row:last-child { border-bottom: 0; }
.record-row:hover { background: #fbfbfe; }
.record-post { display: flex; align-items: center; gap: 10px; min-width: 0; }
.record-post img { width: 48px; height: 36px; flex: none; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-2); }
.record-post div { min-width: 0; }
.record-post b { display: block; font-size: 11.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.record-post small { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 8.5px; color: var(--ink-3); }
.record-cell { font-size: 10px; color: var(--ink-2); }
.record-cell small { display: block; font-size: 8.5px; color: var(--ink-3); }
.record-actions { display: flex; justify-content: flex-end; gap: 2px; }
.record-stars { display: flex; align-items: center; gap: 5px; font-size: 9px; color: var(--ink-3); }
.record-stars .status-chip { font-size: 8.5px; }

/* =========================================================
   Connections
   ========================================================= */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.settings-readonly-note { display: flex; align-items: flex-start; gap: 7px; margin: 0 0 13px; padding: 9px 11px; border: 1px solid #f0dfba; border-radius: 8px; background: #fffbf1; color: #8a642a; font-size: 9px; line-height: 1.6; }
.settings-readonly-note[hidden] { display: none; }
.settings-readonly-note .icon { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.settings-main.settings-readonly .adapter-option:disabled, .settings-main.settings-readonly .data-action:disabled { opacity: 0.62; cursor: not-allowed; }
.settings-main.settings-readonly .adapter-option:disabled:hover, .settings-main.settings-readonly .data-action:disabled:hover { border-color: var(--line); background: #fff; }
.settings-main { display: flex; flex-direction: column; gap: 16px; }
.settings-main .card { padding: 20px; }
.adapter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.adapter-option { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 14px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease; }
.adapter-option:hover { border-color: #d2d0e8; }
.adapter-option.active { border-color: var(--brand); background: var(--brand-wash); box-shadow: 0 0 0 2px rgba(91, 91, 214, 0.1); }
.adapter-icon { width: 35px; height: 35px; display: grid; place-items: center; border-radius: 10px; flex: none; }
.adapter-icon .icon { width: 17px; height: 17px; }
.adapter-icon.mock { color: var(--brand); background: var(--brand-soft); }
.adapter-icon.wp { color: #fff; background: #21759b; font-size: 16px; font-weight: 700; font-family: Georgia, serif; }
.adapter-icon.hook { color: #0f766e; background: #e6f7f4; }
.adapter-copy { display: flex; flex-direction: column; gap: 2px; }
.adapter-copy b { font-size: 11.5px; font-weight: 600; }
.adapter-copy small { font-size: 9px; color: var(--ink-3); line-height: 1.55; }
.radio-dot { position: absolute; right: 12px; top: 13px; width: 15px; height: 15px; border-radius: 50%; border: 1.5px solid #d2d4df; background: #fff; }
.adapter-option.active .radio-dot { border: 4px solid var(--brand); }
.adapter-fields { margin-top: 17px; padding-top: 16px; border-top: 1px solid #f0f1f6; }
.adapter-fields .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adapter-fields .field.full { grid-column: 1 / -1; }
.adapter-fields .field-hint { margin-top: -1px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.defaults-card .switch-row.wide { margin-top: 15px; }
.connection-result { margin-top: 14px; padding: 11px 13px; border-radius: 9px; font-size: 10.5px; border: 1px solid transparent; }
.connection-result.ok { background: var(--success-soft); border-color: rgba(15, 159, 110, 0.14); color: #087853; }
.connection-result.err { background: var(--danger-soft); border-color: rgba(213, 68, 68, 0.14); color: #a32c2c; }
.connection-result b { display: flex; align-items: center; gap: 5px; font-size: 11px; margin-bottom: 3px; }
.connection-result .icon { width: 14px; height: 14px; }
.connection-result p { margin: 0; line-height: 1.6; opacity: 0.9; }
.connection-result code { background: rgba(0, 0, 0, 0.05); padding: 1px 4px; border-radius: 3px; font-family: var(--font-mono); font-size: 9px; }
.settings-aside { display: flex; flex-direction: column; gap: 13px; }
.help-card { padding: 18px; }
.help-card h3 { margin: 9px 0 6px; font-size: 12.5px; }
.help-card p { margin: 0; font-size: 10px; color: var(--ink-3); line-height: 1.75; }
.help-card code { font-family: var(--font-mono); font-size: 8.5px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px; word-break: break-all; }
.help-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: var(--success); background: var(--success-soft); }
.help-icon .icon { width: 16px; height: 16px; }
.help-steps { margin: 8px 0 0; padding-left: 16px; font-size: 9.5px; color: var(--ink-3); line-height: 1.8; }
.help-steps li { margin-bottom: 4px; }
.help-card .link-btn { margin-top: 10px; color: var(--brand); }
.data-card .card-head { margin-bottom: 12px; }
.data-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.data-action { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; transition: border-color 0.15s ease, background 0.15s ease; }
.data-action:hover { border-color: #d6d4ea; background: var(--panel-2); }
.data-action.danger:hover { border-color: rgba(213, 68, 68, 0.3); background: #fffafa; }
.data-icon { width: 29px; height: 29px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--panel-2); color: var(--ink-3); }
.data-action.danger .data-icon { color: var(--danger); background: var(--danger-soft); }
.data-icon .icon { width: 14px; height: 14px; }
.data-action > span:nth-child(2) { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.data-action b { font-size: 10.5px; font-weight: 550; }
.data-action small { font-size: 8.5px; color: var(--ink-3); }

/* =========================================================
   Test center
   ========================================================= */
.test-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 34px 40px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(600px 380px at 4% -20%, rgba(16, 185, 129, 0.2), transparent 60%),
    radial-gradient(600px 380px at 88% 0%, rgba(124, 92, 255, 0.32), transparent 65%),
    linear-gradient(135deg, #1b1d30, #11131f);
  box-shadow: 0 22px 55px rgba(18, 20, 36, 0.18);
  position: relative;
  overflow: hidden;
}
.test-hero::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.08) 0.7px, transparent 0.7px); background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent, #000 75%); pointer-events: none; }
.test-hero-copy { position: relative; z-index: 2; max-width: 620px; }
.test-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 9px; letter-spacing: 0.08em; color: #a7f3d0; background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.18); border-radius: 6px; padding: 4px 8px; }
.test-badge .icon { width: 12px; height: 12px; }
.test-hero-copy h2 { margin: 14px 0 10px; font-size: clamp(27px, 2.8vw, 37px); line-height: 1.25; letter-spacing: -0.035em; font-weight: 650; }
.test-hero-copy h2 em { font-style: normal; color: #86efac; }
.test-hero-copy p { margin: 0 0 20px; max-width: 490px; color: #a9adc4; font-size: 11.5px; line-height: 1.8; }
.test-score { position: relative; z-index: 2; display: flex; align-items: center; gap: 18px; flex: none; padding-right: 10px; }
.score-ring { position: relative; width: 120px; height: 120px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 6; }
.ring-fill { fill: none; stroke: #34d399; stroke-width: 6; stroke-linecap: round; transition: stroke-dasharray 0.7s cubic-bezier(0.3, 0.9, 0.3, 1); }
.score-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.score-center strong { font-size: 27px; font-weight: 650; letter-spacing: -0.04em; }
.score-center span { font-size: 8.5px; color: #8b90a9; margin-top: 3px; }
.score-meta { display: flex; flex-direction: column; gap: 3px; }
.score-meta span { font-size: 11px; font-weight: 550; color: #e5e7f2; }
.score-meta small { font-size: 8.5px; color: #7f849e; }
.test-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.75fr); gap: 18px; margin-top: 18px; align-items: start; }
.test-results-card { padding: 20px; }
.test-list { margin-top: 12px; display: flex; flex-direction: column; }
.test-item { display: flex; align-items: center; gap: 11px; padding: 10px 2px; border-bottom: 1px solid #f2f3f7; }
.test-item:last-child { border-bottom: 0; }
.test-status-icon { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #f2f3f7; color: var(--ink-4); }
.test-status-icon .icon { width: 13px; height: 13px; }
.test-item.pass .test-status-icon { background: var(--success-soft); color: var(--success); }
.test-item.fail .test-status-icon { background: var(--danger-soft); color: var(--danger); }
.test-item.running .test-status-icon { background: var(--brand-soft); color: var(--brand); }
.test-item.running .test-status-icon .icon { animation: spin 0.9s linear infinite; }
.test-main { flex: 1; min-width: 0; }
.test-main b { display: block; font-size: 11px; font-weight: 550; }
.test-main p { margin: 2px 0 0; font-size: 9px; color: var(--ink-3); line-height: 1.5; overflow-wrap: anywhere; }
.test-duration { font-family: var(--font-mono); font-size: 8.5px; color: var(--ink-3); flex: none; }
.test-summary { margin-top: 13px; padding: 11px 12px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line); font-size: 10px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.test-summary .icon { width: 15px; height: 15px; color: var(--success); }
.test-summary.fail .icon { color: var(--danger); }
.test-aside { display: flex; flex-direction: column; gap: 14px; }
.test-aside .card { padding: 18px; }
.checklist { margin-top: 9px; display: flex; flex-direction: column; }
.check-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 0; cursor: pointer; border-bottom: 1px solid #f4f4f8; }
.check-item:last-child { border-bottom: 0; }
.check-box { width: 16px; height: 16px; margin-top: 1px; flex: none; border: 1.5px solid #d6d8e3; border-radius: 5px; display: grid; place-items: center; color: transparent; background: #fff; transition: background 0.15s ease, border-color 0.15s ease; }
.check-box .icon { width: 10px; height: 10px; }
.check-item input { position: absolute; opacity: 0; }
.check-item input:checked + .check-box { background: var(--brand); border-color: var(--brand); color: #fff; }
.check-item span:last-child { font-size: 9.5px; color: var(--ink-2); line-height: 1.55; }
.check-item input:checked ~ span:last-child { color: var(--ink-3); text-decoration: line-through; }
.checklist-progress { margin-top: 12px; }
.checklist-progress > span { display: block; font-size: 9px; color: var(--ink-3); margin-bottom: 5px; }
.checklist-progress b { color: var(--brand); font-weight: 600; }
.test-tip-card { background: linear-gradient(160deg, #fbfaff, #fff); }
.tip-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--brand-soft); color: var(--brand); }
.tip-icon .icon { width: 15px; height: 15px; }
.test-tip-card h3 { margin: 9px 0 4px; font-size: 11.5px; }
.test-tip-card p { margin: 0; font-size: 9.5px; color: var(--ink-3); line-height: 1.7; }
.api-card { margin-top: 18px; padding: 20px; }
.api-table { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.api-row { display: grid; grid-template-columns: 70px minmax(190px, 0.7fr) minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 12px; border-bottom: 1px solid #f2f3f7; font-size: 9.5px; }
.api-row:last-child { border-bottom: 0; }
.api-row.head { background: #fbfbfd; font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.api-method { display: inline-flex; justify-self: start; padding: 1px 5px; border-radius: 4px; font-family: var(--font-mono); font-size: 7.5px; font-weight: 700; color: #087853; background: var(--success-soft); }
.api-method.post { color: var(--brand); background: var(--brand-soft); }
.api-method.put { color: var(--warn); background: var(--warn-soft); }
.api-method.delete { color: var(--danger); background: var(--danger-soft); }
.api-path { font-family: var(--font-mono); font-size: 8.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.api-desc { color: var(--ink-3); }

/* =========================================================
   Modal / toast / overlays
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 17, 28, 0.46);
  backdrop-filter: blur(7px);
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.24s cubic-bezier(0.22, 0.9, 0.3, 1);
  overflow: hidden;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
.modal.size-lg { max-width: 920px; }
.modal.size-xl { max-width: 1120px; }
.modal.size-sm { max-width: 440px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px 14px; border-bottom: 1px solid #f0f1f6; flex: none; }
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.modal-head p { margin: 3px 0 0; font-size: 10.5px; color: var(--ink-3); }
.modal-close { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: var(--ink-3); }
.modal-close:hover { background: var(--panel-2); color: var(--ink); }
.modal-close .icon { width: 15px; height: 15px; }
.modal-body { padding: 18px 20px; overflow: auto; flex: 1; }
.modal-body.flush { padding: 0; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #f0f1f6; background: #fcfcfe; flex: none; }
.modal-foot .foot-left { margin-right: auto; font-size: 9px; color: var(--ink-3); }
.preview-modal .modal { max-width: 1180px; height: calc(100vh - 48px); }
.preview-modal .modal-body { padding: 0; background: #fbfaf7; }
.preview-frame { width: 100%; height: 100%; border: 0; display: block; background: #fbfaf7; }

/* Welcome / feature guide */
.guide-modal .modal { max-width: 760px; }
.guide-hero {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 15px;
  border: 1px solid rgba(91, 91, 214, 0.12);
  border-radius: 13px;
  background: radial-gradient(300px 150px at 100% 0%, rgba(139, 92, 246, 0.12), transparent 70%), linear-gradient(135deg, #f8f6ff, #fbfcff);
}
.guide-mark { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #8b5cf6, #5b5bd6); box-shadow: 0 7px 18px rgba(91, 91, 214, 0.22); }
.guide-mark svg { width: 25px; height: 25px; }
.guide-eyebrow { display: block; color: var(--brand); font-size: 7.5px; font-weight: 650; letter-spacing: 0.13em; }
.guide-hero h3 { margin: 4px 0 4px; font-size: 17px; letter-spacing: -0.02em; }
.guide-hero p { margin: 0; color: var(--ink-3); font-size: 10px; line-height: 1.7; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.guide-card { display: flex; align-items: flex-start; gap: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.guide-card:hover { border-color: #d8d4ef; background: #fcfbff; }
.guide-icon { width: 29px; height: 29px; flex: none; display: grid; place-items: center; border-radius: 8px; color: var(--guide-tone); background: var(--guide-wash); }
.guide-icon .icon { width: 15px; height: 15px; }
.guide-card b { display: block; color: var(--ink); font-size: 11px; font-weight: 600; }
.guide-card p { margin: 3px 0 0; color: var(--ink-3); font-size: 9px; line-height: 1.65; }
.guide-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 9px 11px; border-radius: 9px; background: var(--panel-2); color: var(--ink-3); }
.guide-note > span { color: var(--success); flex: none; }
.guide-note .icon { width: 13px; height: 13px; }
.guide-note p { margin: 0; font-size: 9px; line-height: 1.65; }
.guide-note b { color: var(--ink-2); }
@media (max-width: 620px) {
  .guide-grid { grid-template-columns: 1fr; }
  .guide-modal .modal-body { padding: 14px; }
}

/* Version and update center */
.update-hero { display: flex; align-items: center; gap: 12px; padding: 15px; border: 1px solid rgba(91, 91, 214, 0.14); border-radius: 12px; background: radial-gradient(320px 160px at 100% 0%, rgba(139, 92, 246, 0.14), transparent 70%), linear-gradient(135deg, #f8f6ff, #fbfcff); }
.update-mark { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(145deg, #8b5cf6, #5b5bd6); box-shadow: 0 7px 18px rgba(91, 91, 214, 0.22); }
.update-mark svg { width: 26px; height: 26px; }
.update-copy { min-width: 0; flex: 1; }
.update-eyebrow { display: block; color: var(--brand); font-size: 7.5px; font-weight: 650; letter-spacing: 0.13em; }
.update-copy h3 { margin: 3px 0 3px; font-size: 17px; letter-spacing: -0.02em; }
.update-copy p { margin: 0; color: var(--ink-3); font-size: 10px; }
.update-copy p b { color: var(--ink-2); font-weight: 600; }
.update-status { display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 4px 7px; border-radius: 6px; color: #087853; background: var(--success-soft); font-size: 9px; font-weight: 550; }
.update-status i { width: 5px; height: 5px; border-radius: 50%; background: #0f9f6e; }
.update-status.available { color: #8a5a09; background: var(--warn-soft); }
.update-status.available i { background: #d97706; }
.update-note { display: flex; align-items: flex-start; gap: 7px; margin: 11px 0 14px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2); color: var(--ink-3); font-size: 9px; line-height: 1.6; }
.update-note .icon { width: 13px; height: 13px; flex: none; margin-top: 1px; color: var(--success); }
.update-note code { color: var(--ink-2); background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 0 3px; }
.update-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.update-section-head span { color: var(--ink-2); font-size: 11px; font-weight: 600; }
.update-section-head small { color: var(--ink-3); font-size: 8.5px; }
.release-list { display: flex; flex-direction: column; gap: 6px; max-height: 350px; overflow-y: auto; padding-right: 3px; }
.release-item { display: flex; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.release-item.current { border-color: rgba(91, 91, 214, 0.22); background: #fbfaff; }
.release-meta { width: 70px; flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.release-version { color: var(--ink-2); font-family: var(--font-mono); font-size: 10px; font-weight: 600; }
.release-date { color: var(--ink-4); font-size: 8.5px; }
.release-current { color: var(--brand); background: var(--brand-soft); border-radius: 3px; padding: 0 4px; font-size: 7.5px; }
.release-body { min-width: 0; }
.release-body h4 { margin: 0 0 3px; color: var(--ink); font-size: 10.5px; font-weight: 600; }
.release-body ul { margin: 0; padding-left: 13px; color: var(--ink-3); font-size: 9px; line-height: 1.7; }
@media (max-width: 560px) {
  .update-hero { align-items: flex-start; flex-wrap: wrap; }
  .update-status { margin-left: 54px; }
  .release-meta { width: 58px; }
}

/* AI workbench */
.ai-config-card { border-color: rgba(91, 91, 214, 0.14); }
.ai-config-lock { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; padding: 8px 9px; border: 1px solid #f0dfba; border-radius: 7px; background: #fffbf1; color: #8a642a; font-size: 8.5px; line-height: 1.5; }
.ai-config-lock[hidden] { display: none; }
.ai-config-lock > span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.ai-config-lock .icon { width: 13px; height: 13px; flex: none; }
.ai-config-lock b { font-weight: 600; }
.ai-test-field { display: flex; flex-direction: column; gap: 7px; }
.ai-test-row { display: flex; align-items: center; gap: 8px; min-height: 31px; }
.ai-test-row small { color: var(--ink-3); font-size: 8px; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-test-row small.ok { color: var(--success); }
.ai-test-row small.error { color: var(--danger); }
.ai-provider-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink-3); font-size: 9px; }
.ai-provider-chip i { width: 6px; height: 6px; border-radius: 50%; background: #d97706; box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.1); }
.ai-provider-chip.configured { color: #087853; border-color: rgba(15, 159, 110, 0.2); background: #f5fdf9; }
.ai-provider-chip.configured i { background: #0f9f6e; box-shadow: 0 0 0 3px rgba(15, 159, 110, 0.11); }
.ai-workbench { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: stretch; }
.ai-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ai-side .card { padding: 13px; }
.ai-status-top { display: flex; align-items: center; gap: 9px; }
.ai-orb { width: 35px; height: 35px; flex: none; display: grid; place-items: center; border-radius: 10px; color: #fff; background: linear-gradient(145deg, #8b5cf6, #5b5bd6); box-shadow: 0 6px 15px rgba(91, 91, 214, 0.2); }
.ai-orb .icon { width: 17px; height: 17px; }
.ai-status-top > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-status-top b { font-size: 11px; }
.ai-status-top small { color: var(--ink-3); font-size: 8px; line-height: 1.4; }
.ai-status-meta { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; padding-top: 9px; border-top: 1px dashed var(--line); }
.ai-status-meta span { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-3); font-size: 8px; }
.ai-status-meta b { color: var(--ink-2); font-family: var(--font-mono); font-size: 8px; font-weight: 500; max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-side .btn.full { width: 100%; justify-content: center; }
.ai-quick-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.ai-quick-list button { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 7px 8px; border-radius: 7px; border: 1px solid transparent; text-align: left; transition: background 0.15s ease, border-color 0.15s ease; }
.ai-quick-list button:hover { background: var(--brand-wash); border-color: rgba(91, 91, 214, 0.12); }
.ai-quick-list button span { color: var(--ink-2); font-size: 9.5px; font-weight: 550; }
.ai-quick-list button small { color: var(--ink-4); font-size: 7.5px; text-align: right; }
.ai-capability-list { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.ai-capability-list li { position: relative; padding-left: 12px; color: var(--ink-3); font-size: 8.5px; }
.ai-capability-list li::before { content: ""; position: absolute; left: 1px; top: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--brand); opacity: 0.55; }
.ai-chat-card { display: flex; flex-direction: column; min-height: 570px; height: calc(100vh - 195px); padding: 0; overflow: hidden; position: relative; }
.ai-chat-head { display: flex; align-items: center; gap: 9px; padding: 12px 15px; border-bottom: 1px solid var(--line); flex: none; }
.ai-history-toggle { margin-left: auto; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-3); background: #fff; font-size: 8.5px; }
.ai-history-toggle:hover { border-color: var(--line-strong); color: var(--brand); }
.ai-chat-head .ai-new-chat { margin-left: 0; }
.ai-history-pop { position: absolute; z-index: 20; top: 56px; right: 14px; width: 286px; max-height: 340px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 14px 32px rgba(24, 25, 48, 0.17); overflow: hidden; }
.ai-history-pop[hidden] { display: none; }
.ai-history-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 8px; border-bottom: 1px solid var(--line); }
.ai-history-head b { font-size: 10px; }
.ai-history-head button { width: 20px; height: 20px; border: 0; border-radius: 4px; color: var(--ink-3); background: transparent; font-size: 15px; line-height: 1; }
.ai-history-head button:hover { background: var(--panel-2); color: var(--ink); }
.ai-history-list { max-height: 290px; overflow-y: auto; padding: 5px; }
.ai-history-item { display: flex; align-items: center; gap: 2px; border-radius: 6px; }
.ai-history-item:hover, .ai-history-item.active { background: var(--brand-wash); }
.ai-history-open { flex: 1; min-width: 0; padding: 7px 6px; text-align: left; border: 0; background: transparent; }
.ai-history-open b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 9px; font-weight: 500; }
.ai-history-open small { display: block; margin-top: 3px; color: var(--ink-4); font-size: 7.5px; }
.ai-history-delete { width: 21px; height: 21px; flex: none; border: 0; border-radius: 4px; color: var(--ink-4); background: transparent; }
.ai-history-delete:hover { color: var(--danger); background: rgba(220, 80, 80, 0.08); }
.ai-history-empty { padding: 22px 10px; margin: 0; text-align: center; color: var(--ink-4); font-size: 8.5px; }
.ai-chat-avatar { width: 31px; height: 31px; flex: none; display: grid; place-items: center; border-radius: 9px; color: #fff; background: linear-gradient(145deg, #8b5cf6, #5b5bd6); }
.ai-chat-avatar .icon { width: 15px; height: 15px; }
.ai-chat-head > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ai-chat-head b { font-size: 11px; }
.ai-chat-head small { color: var(--ink-3); font-size: 8px; }
.ai-chat-online { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); font-size: 8px; }
.ai-chat-online i { width: 5px; height: 5px; border-radius: 50%; background: #0f9f6e; }
.ai-new-chat { margin-left: auto; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-2); background: #fff; font-size: 8.5px; }
.ai-new-chat:hover { border-color: var(--line-strong); color: var(--brand); }
.ai-new-chat + .ai-chat-online { margin-left: 2px; }
.ai-attachments { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.ai-attachments[hidden] { display: none; }
.ai-attachment { display: inline-flex; align-items: center; gap: 5px; max-width: 210px; padding: 3px 6px 3px 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-2); font-size: 8px; }
.ai-attachment img { width: 26px; height: 26px; object-fit: cover; border-radius: 4px; }
.ai-attachment .ai-file-chip { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 4px; color: var(--brand); background: var(--brand-soft); }
.ai-attachment .ai-file-chip .icon { width: 13px; height: 13px; }
.ai-attachment > span:nth-child(2) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-attachment button { color: var(--ink-4); font-size: 13px; line-height: 1; padding: 0 2px; }
.ai-attachment button:hover { color: var(--danger); }
.ai-composer-tools { display: flex; align-items: center; gap: 7px; color: var(--ink-4); font-size: 7.5px; }
.ai-attach-btn { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 5px; color: var(--ink-3); border: 1px solid var(--line); background: #fff; }
.ai-attach-btn:hover { color: var(--brand); border-color: rgba(91, 91, 214, 0.25); }
.ai-attach-btn .icon { width: 12px; height: 12px; }
.ai-web-toggle { display: inline-flex; align-items: center; gap: 3px; height: 23px; padding: 0 6px; border-radius: 5px; color: var(--ink-3); border: 1px solid var(--line); background: #fff; font-size: 8px; }
.ai-web-toggle .icon { width: 11px; height: 11px; }
.ai-web-toggle:hover { color: var(--brand); border-color: rgba(91, 91, 214, 0.25); }
.ai-web-toggle.active { color: var(--brand); border-color: rgba(91, 91, 214, 0.3); background: var(--brand-wash); }
.ai-mode-toggle { display: inline-flex; align-items: center; gap: 3px; height: 23px; padding: 0 6px; border-radius: 5px; color: var(--ink-3); border: 1px solid var(--line); background: #fff; font-size: 8px; }
.ai-mode-toggle .icon { width: 11px; height: 11px; }
.ai-mode-toggle:hover { color: var(--brand); border-color: rgba(91, 91, 214, 0.25); }
.ai-mode-toggle.active { color: #7c4a12; border-color: rgba(217, 119, 6, 0.3); background: #fff8ea; }
.ai-search-card { padding: 9px; }
.ai-search-head { display: flex; align-items: center; gap: 6px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.ai-search-head > span { display: inline-flex; align-items: center; gap: 3px; flex: none; color: var(--brand); font-size: 8px; }
.ai-search-head .icon { width: 11px; height: 11px; }
.ai-search-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 9px; }
.ai-search-head small { flex: none; margin-left: auto; color: var(--ink-4); font-size: 7.5px; }
.ai-search-row { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.ai-search-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ai-search-row a { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.ai-search-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand); font-size: 9px; font-weight: 500; }
.ai-search-row small { flex: none; color: var(--ink-4); font-size: 7.5px; }
.ai-search-row p { margin: 3px 0 0; color: var(--ink-3); font-size: 8.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ai-message-files { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.ai-message-files img { width: 90px; height: 65px; object-fit: cover; border-radius: 6px; border: 1px solid rgba(255,255,255,.3); }
.ai-message-files span { padding: 2px 5px; border-radius: 4px; background: rgba(255,255,255,.16); font-size: 8px; }
.ai-usage-card { margin-top: 14px; padding: 14px; }
.ai-usage-stats { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 11px; }
.ai-usage-stat { min-width: 90px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); }
.ai-usage-stat b { display: block; color: var(--ink); font-size: 13px; font-family: var(--font-mono); }
.ai-usage-stat small { color: var(--ink-3); font-size: 7.5px; }
.ai-usage-users { display: flex; flex-wrap: wrap; gap: 5px; margin: -3px 0 11px; }
.ai-usage-user { display: inline-flex; align-items: center; gap: 5px; padding: 3px 6px; border-radius: 5px; background: var(--brand-wash); color: var(--ink-2); font-size: 8px; }
.ai-usage-user b { color: var(--brand); font-weight: 600; }
.ai-usage-user small { color: var(--ink-3); }
.ai-usage-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.ai-usage-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.ai-usage-table th { padding: 7px 8px; border-bottom: 1px solid var(--line); background: #fafaff; color: var(--ink-3); text-align: left; font-size: 8px; font-weight: 550; white-space: nowrap; }
.ai-usage-table td { padding: 7px 8px; border-bottom: 1px solid #f3f3f8; color: var(--ink-2); font-size: 8.5px; white-space: nowrap; }
.ai-usage-table tbody tr:last-child td { border-bottom: 0; }
.ai-usage-table .usage-user { font-weight: 550; color: var(--ink); }
.ai-usage-table .usage-type { text-transform: uppercase; font-family: var(--font-mono); font-size: 7.5px; color: var(--brand); }
.ai-usage-table .usage-status { color: #087853; }
.ai-usage-table .usage-status.error, .ai-usage-table .usage-status.fallback { color: var(--danger); }
.ai-usage-empty { text-align: center; color: var(--ink-4); padding: 18px !important; }

/* Model center */
.mc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-bottom: 13px; }
.mc-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: linear-gradient(160deg, #fff, #fbfaff); }
.mc-stat > span { color: var(--ink-3); font-size: 8.5px; }
.mc-stat b { color: var(--ink); font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-stat small { color: var(--ink-4); font-size: 7.5px; }
.mc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 14px; align-items: start; }
.mc-main, .mc-aside { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mc-provider-card { padding: 15px; }
.mc-provider-head { display: flex; align-items: center; gap: 10px; }
.mc-brand { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 10px; color: #fff; background: #1d4ed8; font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: -0.03em; }
.mc-provider-copy { min-width: 0; flex: 1; }
.mc-provider-title { display: flex; align-items: center; gap: 7px; }
.mc-provider-title h3 { margin: 0; font-size: 13px; }
.mc-provider-copy p { margin: 3px 0 0; color: var(--ink-4); font-size: 8px; font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-status { display: inline-flex; align-items: center; gap: 4px; padding: 2px 5px; border-radius: 4px; color: #087853; background: var(--success-soft); font-size: 7.5px; }
.mc-status i { width: 4px; height: 4px; border-radius: 50%; background: #0f9f6e; }
.mc-status.off { color: #8a5a09; background: var(--warn-soft); }
.mc-status.off i { background: #d97706; }
.mc-key-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 11px 0; padding: 7px 9px; border-radius: 6px; background: var(--panel-2); color: var(--ink-3); font-size: 8px; }
.mc-key-row b { color: var(--ink-2); font-family: var(--font-mono); font-size: 8px; }
.mc-key-row span:last-child { margin-left: auto; color: var(--ink-4); }
.mc-model-list { display: flex; flex-direction: column; gap: 5px; }
.mc-model-row { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.mc-model-icon { width: 29px; height: 29px; flex: none; display: grid; place-items: center; border-radius: 7px; color: var(--brand); background: var(--brand-soft); }
.mc-model-icon .icon { width: 14px; height: 14px; }
.mc-model-copy { flex: 1; min-width: 0; }
.mc-model-name { display: flex; align-items: center; gap: 5px; min-width: 0; }
.mc-model-name b { font-size: 9px; font-family: var(--font-mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-default-chip { flex: none; padding: 1px 4px; border-radius: 3px; color: var(--brand); background: var(--brand-soft); font-size: 7px; }
.mc-model-copy small { color: var(--ink-4); font-size: 7.5px; }
.mc-model-readonly { color: var(--ink-4); font-size: 8px; }
.mc-empty { padding: 18px; text-align: center; color: var(--ink-3); }
.mc-empty b { display: block; color: var(--ink-2); font-size: 10px; }
.mc-empty p { margin: 4px 0 9px; font-size: 8px; }
.mc-usage-card { padding: 14px; }
.mc-usage-summary { display: flex; gap: 7px; flex-wrap: wrap; margin: 5px 0 9px; }
.mc-usage-summary span { min-width: 70px; padding: 6px 8px; border-radius: 6px; background: var(--panel-2); }
.mc-usage-summary b { display: block; color: var(--ink); font-family: var(--font-mono); font-size: 12px; }
.mc-usage-summary small { color: var(--ink-4); font-size: 7px; }
.mc-usage-mini { display: flex; flex-direction: column; gap: 3px; }
.mc-usage-row { display: grid; grid-template-columns: 55px 42px 1fr 40px; gap: 6px; align-items: center; padding: 5px 6px; border-radius: 5px; background: #fbfbfe; font-size: 8px; }
.mc-usage-row span { color: var(--ink-2); font-weight: 550; overflow: hidden; text-overflow: ellipsis; }
.mc-usage-row b { color: var(--brand); font-family: var(--font-mono); font-size: 7px; text-transform: uppercase; }
.mc-usage-row small { color: var(--ink-3); text-align: right; }
.mc-usage-row i { color: var(--ink-4); font-style: normal; text-align: right; font-size: 7px; }
.mc-usage-empty { padding: 10px; text-align: center; color: var(--ink-4); font-size: 8px; }
.mc-defaults { display: flex; flex-direction: column; gap: 4px; margin-top: 7px; }
.mc-default-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 0; border-bottom: 1px dashed #f0f0f7; }
.mc-default-row:last-child { border-bottom: 0; }
.mc-default-row span { color: var(--ink-3); font-size: 8px; }
.mc-default-row b { color: var(--ink-2); font-family: var(--font-mono); font-size: 7.5px; max-width: 155px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-capabilities { list-style: none; padding: 0; margin: 7px 0 0; display: flex; flex-direction: column; gap: 5px; }
.mc-capabilities li { color: var(--ink-3); font-size: 8.5px; padding-left: 11px; position: relative; }
.mc-capabilities li::before { content: ""; position: absolute; left: 1px; top: 5px; width: 4px; height: 4px; border-radius: 50%; background: var(--brand); opacity: .5; }
.mc-help-note { padding: 13px; }
.mc-help-note h3 { margin: 7px 0 3px; font-size: 10px; }
.mc-help-note p { margin: 0; color: var(--ink-3); font-size: 8px; line-height: 1.6; }
@media (max-width: 1050px) {
  .mc-layout { grid-template-columns: 1fr; }
  .mc-aside { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .mc-help-note { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .mc-stats { grid-template-columns: 1fr 1fr; }
  .mc-aside { display: flex; }
}
.ai-messages { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 11px; background: linear-gradient(180deg, #fcfcff, #fff); }
.ai-message { display: flex; gap: 8px; max-width: 100%; }
.ai-message.user { justify-content: flex-end; }
.ai-message-body { max-width: min(680px, 88%); padding: 9px 11px; border-radius: 10px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: 10px; line-height: 1.7; box-shadow: 0 2px 8px rgba(28, 30, 44, 0.035); }
.ai-message.user .ai-message-body { color: #fff; background: linear-gradient(135deg, #6d5bd0, #5b5bd6); border-color: transparent; }
.ai-message-body p { margin: 0; }
.ai-message-body p + p { margin-top: 6px; }
.ai-message-body .ai-message-hint { color: var(--ink-3); font-size: 9px; }
.ai-message.typing .ai-message-body { padding: 11px 14px; }
.ai-typing { display: inline-flex; gap: 3px; align-items: center; }
.ai-typing i { width: 4px; height: 4px; border-radius: 50%; background: #8b8aa8; animation: aiTyping 1.1s ease-in-out infinite; }
.ai-typing i:nth-child(2) { animation-delay: 0.15s; }
.ai-typing i:nth-child(3) { animation-delay: 0.3s; }
.ai-thinking { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 9px; }
.ai-live-thought { min-width: 170px; padding: 1px 0; }
.ai-live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ai-live-head time { color: var(--ink-4); font-size: 8px; font-family: ui-monospace, monospace; }
.ai-live-steps { margin-top: 7px; padding: 6px 8px; border: 1px solid #ece9fb; border-radius: 7px; background: #fbfaff; display: flex; flex-direction: column; gap: 4px; }
.ai-live-step { display: flex; align-items: center; gap: 6px; min-height: 14px; }
.ai-live-step i { width: 13px; height: 13px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #6a5bd6; font-size: 7px; font-style: normal; background: #eeeaff; }
.ai-live-step.running i { width: 11px; height: 11px; margin: 1px; background: transparent; border: 1.5px solid #c9c1ff; border-top-color: #6a5bd6; animation: aiSpin .7s linear infinite; }
.ai-live-step.done i { color: #0f8a68; background: #e2f7ef; }
.ai-live-step.error i { color: #c23c3c; background: #fdeaea; }
.ai-live-step span { color: #72758a; font-size: 8.5px; line-height: 1.45; }
.ai-live-empty { color: var(--ink-4); font-size: 8.5px; }
@keyframes aiSpin { to { transform: rotate(360deg); } }
.ai-thinking-dots { display: inline-flex; gap: 3px; }
.ai-thinking-dots i { width: 4px; height: 4px; border-radius: 50%; background: #7c5cff; animation: aiTyping 1.1s ease-in-out infinite; }
.ai-thinking-dots i:nth-child(2) { animation-delay: 0.15s; }
.ai-thinking-dots i:nth-child(3) { animation-delay: 0.3s; }
.ai-thought { margin: 0 0 8px; }
.ai-thought-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: var(--ink-3); font-size: 9px; }
.ai-thought-toggle:hover { color: var(--brand); }
.ai-thought-toggle > span { color: var(--brand); }
.ai-thought-toggle small { padding: 1px 4px; border-radius: 3px; color: #6a61c9; background: var(--brand-wash); font-size: 7.5px; }
.ai-thought-toggle i { font-style: normal; transition: transform 0.15s ease; }
.ai-thought-toggle.open i { transform: rotate(180deg); }
.ai-thought-body { margin-top: 6px; padding: 7px 9px; border: 1px solid #ece9fb; border-radius: 7px; background: #fbfaff; }
.ai-thought-step { display: flex; align-items: flex-start; gap: 6px; padding: 2px 0; }
.ai-thought-step b { width: 14px; height: 14px; flex: none; display: grid; place-items: center; border-radius: 50%; color: #6a5bd6; background: #eeeaff; font-size: 7px; }
.ai-thought-step span { color: #7f8194; font-size: 9px; line-height: 1.5; }
.ai-thought-time { margin-top: 5px; padding-top: 5px; border-top: 1px dashed #e8e4fa; color: #a1a3b4; font-size: 8px; text-align: right; }
.ai-stream-text { white-space: pre-wrap; margin: 0; }
.ai-stream-text.is-typing::after { content: "▍"; margin-left: 1px; color: var(--brand); animation: aiCursor 0.75s step-end infinite; }
@keyframes aiCursor { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes aiTyping { 0%, 70%, 100% { opacity: 0.25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-2px); } }
.ai-error { color: var(--danger); }
.ai-result-card { margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.ai-result-media { display: flex; gap: 9px; align-items: center; }
.ai-result-media > a { width: 94px; height: 62px; flex: none; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.ai-result-media img { width: 100%; height: 100%; object-fit: cover; }
.ai-result-media > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-result-media b, .ai-result-doc b, .ai-result-article b { font-size: 9.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-result-media small, .ai-result-doc small, .ai-result-article small { color: var(--ink-3); font-size: 8px; }
.ai-result-media a, .ai-result-doc a, .ai-result-article a { color: var(--brand); font-size: 8.5px; display: inline-flex; align-items: center; gap: 2px; margin-top: 2px; }
.ai-result-media a .icon, .ai-result-article a .icon { width: 10px; height: 10px; }
.ai-result-doc, .ai-result-article { display: flex; gap: 9px; align-items: flex-start; }
.ai-result-doc > div, .ai-result-article > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-download-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.ai-download-row a { margin-top: 0 !important; }
.ai-doc-icon, .ai-article-icon { width: 32px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 6px; color: var(--brand); background: var(--brand-soft); }
.ai-doc-icon .icon, .ai-article-icon .icon { width: 16px; height: 16px; }
.ai-result-warning { margin: 6px 0 0; color: var(--warn); font-size: 8px; }
.ai-result-list { display: flex; flex-direction: column; gap: 4px; }
.ai-list-row { display: flex; align-items: center; gap: 7px; font-size: 8.5px; }
.ai-list-row span { flex: none; color: var(--ink-4); min-width: 36px; }
.ai-list-row b { min-width: 0; flex: 1; font-weight: 500; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-list-row a, .ai-list-row small { flex: none; color: var(--brand); font-size: 8px; }
.ai-result-empty { margin: 0; color: var(--ink-3); font-size: 9px; }
.ai-stat-row { display: flex; gap: 16px; flex-wrap: wrap; }
.ai-stat-row span { display: flex; flex-direction: column; gap: 1px; }
.ai-stat-row b { font-size: 13px; color: var(--ink); }
.ai-stat-row small { font-size: 7.5px; color: var(--ink-4); }
.ai-pending-card { margin-top: 8px; display: flex; align-items: flex-start; gap: 8px; padding: 9px; border: 1px solid rgba(217, 119, 6, 0.22); border-radius: 8px; background: #fffbf1; }
.ai-pending-card > span { color: #b7791f; }
.ai-pending-card > span .icon { width: 14px; height: 14px; }
.ai-pending-card > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-pending-card b { font-size: 9px; color: #7a4e09; }
.ai-pending-card small { font-size: 8px; color: #947040; }
.ai-composer { flex: none; border-top: 1px solid var(--line); padding: 10px 12px 9px; background: #fff; }
.ai-composer textarea { width: 100%; min-height: 42px; max-height: 130px; resize: none; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); padding: 8px 10px; font-size: 10px; line-height: 1.55; outline: 0; }
.ai-composer textarea:focus { border-color: rgba(91, 91, 214, 0.42); background: #fff; box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.08); }
.ai-composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.ai-composer-foot > span { color: var(--ink-4); font-size: 7.5px; }
.ai-send { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: var(--brand); transition: opacity 0.15s ease, transform 0.15s ease; }
.ai-send:hover { transform: translateY(-1px); }
.ai-send:disabled { opacity: 0.5; }
.ai-send .icon { width: 13px; height: 13px; }
@media (max-width: 1050px) {
  .ai-workbench { grid-template-columns: 1fr; }
  .ai-chat-card { height: 560px; min-height: 500px; }
  .ai-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .ai-capability-card { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .ai-side { display: flex; }
  .ai-chat-card { height: 65vh; min-height: 460px; }
  .ai-messages { padding: 12px; }
  .ai-message-body { max-width: 92%; }
}

.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: min(340px, calc(100vw - 44px));
  padding: 11px 13px;
  border-radius: 11px;
  background: #1c1e2e;
  color: #e9eaf3;
  box-shadow: 0 16px 44px rgba(10, 12, 22, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: auto;
  animation: toastIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } }
.toast.leaving { animation: toastOut 0.18s ease both; }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }
.toast-icon { width: 21px; height: 21px; flex: none; display: grid; place-items: center; border-radius: 6px; color: #6ee7b7; background: rgba(110, 231, 183, 0.12); margin-top: 1px; }
.toast-icon .icon { width: 12px; height: 12px; }
.toast.error .toast-icon { color: #fca5a5; background: rgba(252, 165, 165, 0.12); }
.toast.info .toast-icon { color: #c4b5fd; background: rgba(196, 181, 253, 0.12); }
.toast-content { min-width: 0; flex: 1; }
.toast-content b { display: block; font-size: 10.5px; font-weight: 600; margin-bottom: 1px; }
.toast-content p { margin: 0; font-size: 9.5px; line-height: 1.55; color: #a9adc2; overflow-wrap: anywhere; }
.toast-close { color: #6d7188; padding: 1px; }
.toast-close:hover { color: #fff; }
.toast-close .icon { width: 12px; height: 12px; }

.drop-overlay { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; background: rgba(17, 19, 31, 0.5); backdrop-filter: blur(7px); }
.drop-overlay-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 52px 70px; border: 2px dashed rgba(255, 255, 255, 0.35); border-radius: 22px; color: #fff; background: rgba(35, 36, 58, 0.75); text-align: center; }
.drop-overlay-inner span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; background: rgba(255, 255, 255, 0.12); margin-bottom: 7px; }
.drop-overlay-inner .icon { width: 25px; height: 25px; }
.drop-overlay-inner b { font-size: 17px; }
.drop-overlay-inner small { font-size: 10px; color: #b9bdd3; }

/* =========================================================
   Command palette
   ========================================================= */
.palette { max-width: 570px; align-self: flex-start; margin-top: 9vh; }
.palette .modal-body { padding: 0; }
.palette-search { display: flex; align-items: center; gap: 9px; padding: 14px 17px; border-bottom: 1px solid #f0f1f6; }
.palette-search .icon { width: 17px; height: 17px; color: var(--ink-3); }
.palette-search input { flex: 1; border: 0; outline: none; background: none; font-size: 14px; }
.palette-search kbd { font-family: var(--font); font-size: 8.5px; color: var(--ink-4); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; }
.palette-list { max-height: 380px; overflow: auto; padding: 7px; }
.palette-group { padding: 7px 8px 4px; font-size: 8px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-4); }
.palette-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px; border-radius: 8px; text-align: left; }
.palette-item .palette-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: var(--panel-2); color: var(--ink-3); flex: none; overflow: hidden; }
.palette-icon img { width: 100%; height: 100%; object-fit: cover; }
.palette-icon .icon { width: 13px; height: 13px; }
.palette-item b { display: block; font-size: 10.5px; font-weight: 500; }
.palette-item small { display: block; font-size: 8.5px; color: var(--ink-3); }
.palette-item:hover, .palette-item.active { background: var(--brand-wash); }
.palette-item .palette-enter { margin-left: auto; font-size: 8px; color: var(--ink-4); }
.palette-empty { padding: 36px 20px; text-align: center; font-size: 10.5px; color: var(--ink-3); }

/* =========================================================
   Image / video editor
   ========================================================= */
.img-editor { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(250px, 0.75fr); min-height: 460px; }
.img-stage { display: flex; flex-direction: column; background: #f4f4f8; border-right: 1px solid var(--line); }
.img-stage-top { display: flex; align-items: center; justify-content: space-between; padding: 9px 13px; border-bottom: 1px solid #e9e9f0; background: #fbfbfd; }
.img-stage-top span { font-size: 8.5px; color: var(--ink-3); }
.img-stage-top b { font-size: 9px; font-weight: 550; color: var(--ink-2); }
.img-canvas-wrap { flex: 1; display: grid; place-items: center; padding: 20px; min-height: 330px; background-color: #f0f0f5; background-image: linear-gradient(45deg, #e7e7ee 25%, transparent 25%), linear-gradient(-45deg, #e7e7ee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e7e7ee 75%), linear-gradient(-45deg, transparent 75%, #e7e7ee 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; overflow: auto; }
#imageCanvas { max-width: 100%; max-height: 410px; box-shadow: 0 10px 34px rgba(20, 24, 40, 0.18); background: #fff; object-fit: contain; }
.img-controls { padding: 14px; overflow: auto; max-height: 560px; }
.control-section { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid #f0f1f6; }
.control-section:last-child { border-bottom: 0; margin-bottom: 0; }
.control-title { display: flex; align-items: center; justify-content: space-between; font-size: 9.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.control-title small { font-size: 8px; color: var(--ink-3); font-weight: 400; }
.dimension-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: end; }
.dimension-row .field input { height: 31px; font-size: 10.5px; }
.lock-btn { width: 28px; height: 31px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-3); background: var(--panel-2); }
.lock-btn.active { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.lock-btn .icon { width: 13px; height: 13px; }
.preset-row { display: flex; gap: 4px; margin-top: 6px; }
.preset-btn { flex: 1; height: 23px; border-radius: 5px; border: 1px solid var(--line); font-size: 8.5px; color: var(--ink-3); background: #fff; }
.preset-btn:hover { border-color: var(--brand); color: var(--brand); }
.seg-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 2px; border-radius: 7px; background: #f1f2f7; }
.seg-row button { height: 25px; border-radius: 5px; font-size: 9px; color: var(--ink-3); }
.seg-row button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.mini-row { display: flex; gap: 6px; }
.mini-row button { flex: 1; height: 28px; display: inline-flex; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: 9px; color: var(--ink-2); }
.mini-row button:hover { border-color: var(--line-strong); background: var(--panel-2); }
.mini-row .icon { width: 12px; height: 12px; }
.quality-row { display: flex; align-items: center; gap: 7px; }
.quality-row input { flex: 1; accent-color: var(--brand); }
.quality-row b { font-size: 8.5px; color: var(--ink-3); min-width: 30px; text-align: right; }
.img-output { display: flex; align-items: center; gap: 5px; padding: 7px 8px; border-radius: 6px; background: var(--panel-2); font-size: 8.5px; color: var(--ink-3); }
.img-output b { color: var(--ink-2); font-weight: 550; }
.img-editor-foot { display: flex; align-items: center; gap: 7px; }
#imgBg { width: 100%; height: 31px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
#imgBg::-webkit-color-swatch-wrapper { padding: 0; }
#imgBg::-webkit-color-swatch { border: 0; border-radius: 4px; }
.img-editor-foot .foot-left { margin-right: auto; font-size: 8.5px; color: var(--ink-3); }

.video-detail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr); gap: 0; min-height: 390px; }
.video-stage { background: #0e1018; display: grid; place-items: center; padding: 16px; }
.video-stage video { max-height: 400px; width: 100%; border-radius: 8px; background: #000; }
.video-meta-panel { padding: 16px; border-left: 1px solid var(--line); }
.video-meta-list { display: flex; flex-direction: column; gap: 8px; }
.video-meta-row { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--ink-3); }
.video-meta-row b { color: var(--ink-2); font-weight: 550; font-family: var(--font-mono); font-size: 8.5px; }
.poster-box { margin-top: 13px; }
.poster-box .cover-drop { aspect-ratio: 16/9; }
.poster-actions { display: flex; gap: 5px; margin-top: 6px; }
.poster-actions .btn { flex: 1; }

/* =========================================================
   Misc
   ========================================================= */
.kbd { font-family: var(--font-mono); font-size: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; padding: 1px 4px; color: var(--ink-3); }
.fade-in { animation: fadeIn 0.25s ease; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.hint-text { font-size: 9.5px; color: var(--ink-3); line-height: 1.6; }
.danger-text { color: var(--danger) !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =========================================================
   Responsive
   ========================================================= */@media (max-width: 1399px) {
  .publish-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .publish-layout > .settings-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 13px;
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .publish-layout > .settings-panel .side-card { height: 100%; }
}
@media (max-width: 1490px) {
  .search-btn { min-width: 200px; }
  .lower-grid { grid-template-columns: 1fr 1fr; }
  .connection-card { grid-column: 1 / -1; }
}
@media (max-width: 1280px) {
  .app-main { padding: 22px 22px 60px; }
  .topbar { padding: 0 22px; }
  .hero-panel { padding: 32px 34px; }
  .hero-visual { transform: scale(0.92); transform-origin: center right; }
  .stats-grid { gap: 12px; }
  .stat-card { padding: 15px; }
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-aside { display: grid; grid-template-columns: repeat(3, 1fr); }
  .adapter-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 1120px) {
  :root { --sidebar-w: 228px; }
  .sidebar { padding-left: 11px; padding-right: 11px; }
  .hero-panel { grid-template-columns: minmax(0, 1.15fr) minmax(290px, 0.85fr); gap: 16px; }
  .hero-copy h2 { font-size: 32px; }
  .pipeline-card { transform: scale(0.94) rotate(-1.4deg); }
  .float-chip { display: none; }
  .dashboard-grid { grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr); }
  .search-btn { min-width: 160px; }
  .search-btn span { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .test-hero { padding: 30px; }
}
@media (max-width: 980px) {
  .sidebar { transform: translateX(-102%); transition: transform 0.26s cubic-bezier(0.3, 0.8, 0.3, 1); box-shadow: 30px 0 70px rgba(10, 12, 22, 0.25); z-index: 80; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(14, 16, 28, 0.42); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
  .sidebar-scrim.visible { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid !important; }
  .app-main { padding: 20px 20px 60px; }
  .topbar { padding: 0 20px; height: 68px; }
  .hero-panel { grid-template-columns: 1fr; min-height: auto; padding: 30px 32px; }
  .hero-visual { display: none; }
  .hero-copy { max-width: 620px; }
  .hero-copy h2 { font-size: 36px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .lower-grid { grid-template-columns: 1fr 1fr; }
  .connection-card { grid-column: auto; }
  .publish-layout { grid-template-columns: 250px minmax(0, 1fr); }
  .publish-layout > .settings-panel { grid-template-columns: 1fr 1fr; }
  .queue-panel { min-height: 500px; }
  .editor-card { min-height: 620px; }
  .title-input { font-size: 23px; }
  .test-layout { grid-template-columns: 1fr; }
  .test-aside { display: grid; grid-template-columns: 1fr 1fr; }
  .settings-aside { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .search-btn { display: none; }
  .hide-md { display: none; }
  .publish-layout { grid-template-columns: 1fr; }
  .queue-panel { position: static; height: auto; min-height: 0; max-height: none; }
  .article-list { display: flex; gap: 6px; overflow-x: auto; padding: 9px; }
  .article-item { min-width: 210px; margin-bottom: 0; }
  .article-empty { min-width: 100%; padding: 24px; }
  .queue-foot { padding: 8px 12px; }
  .publish-layout > .settings-panel { grid-template-columns: 1fr 1fr; }
  .editor-card { min-height: 0; }
  .content-shell.preview-on { grid-template-columns: 1fr; }
  .content-shell.preview-on .live-preview { border-left: 0; border-top: 1px solid var(--line); max-height: 380px; }
  .toolbar-hint { display: none; }
  .records-table .record-head { display: none; }
  .record-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .record-row .record-cell { display: none; }
  .record-row .record-stars { display: flex; }
  .record-row .record-actions { grid-column: 2; }
  .record-row .record-post { grid-column: 1; }
  .record-row .record-stars { grid-column: 2; display: none; }
  .settings-main .card { padding: 16px; }
  .adapter-grid { grid-template-columns: 1fr; }
  .adapter-option { flex-direction: row; align-items: center; }
  .adapter-copy { flex: 1; }
  .radio-dot { position: static; margin-left: auto; }
  .adapter-fields .form-grid, .form-grid { grid-template-columns: 1fr; }
  .data-actions { grid-template-columns: 1fr; }
  .test-hero { flex-direction: column; align-items: flex-start; gap: 22px; }
  .test-score { padding-right: 0; }
  .api-row { grid-template-columns: 58px minmax(0, 1fr); }
  .api-desc { display: none; }
  .img-editor, .video-detail { grid-template-columns: 1fr; }
  .img-stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .img-canvas-wrap { min-height: 240px; }
  .video-meta-panel { border-left: 0; border-top: 1px solid var(--line); }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-drop { align-items: flex-start; }
  .drop-copy b { font-size: 12px; }
}
@media (max-width: 640px) {
  .app-main { padding: 16px 14px 50px; }
  .topbar { padding: 0 14px; gap: 10px; height: 64px; }
  .page-heading .crumb { display: none; }
  .page-heading h1 { font-size: 16px; }
  .avatar { display: none; }
  #topNew { padding: 0 11px; }
  .hero-panel { padding: 26px 22px; border-radius: 20px; }
  .hero-copy h2 { font-size: 30px; }
  .hero-copy > p { font-size: 11.5px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-proof { flex-wrap: wrap; gap: 8px; }
  .proof-line { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-value { font-size: 22px; }
  .dashboard-grid > .card { padding: 16px; }
  .lower-grid { grid-template-columns: 1fr; }
  .connection-card { grid-column: auto; }
  .view-toolbar { flex-direction: column; align-items: flex-start; gap: 12px; }
  .toolbar-actions { width: 100%; flex-wrap: wrap; }
  .toolbar-actions .btn { flex: 1; padding: 0 9px; }
  .publish-layout > .settings-panel { grid-template-columns: 1fr; }
  .editor-titlebar { padding: 17px 16px 0; }
  .format-bar { padding: 0 16px 10px; flex-wrap: wrap; gap: 6px; }
  .editor-toolbar { padding: 6px 12px; }
  .rich-editor { padding: 18px 16px; }
  .code-editor { padding: 18px 16px; }
  .excerpt-box { padding: 12px 16px; }
  .editor-actions { padding: 12px 16px; flex-wrap: wrap; }
  .editor-hint { display: none; }
  .action-group { margin-left: 0; width: 100%; }
  .action-group .btn { flex: 1; }
  .queue-head { padding: 13px 12px 10px; }
  .media-drop { flex-wrap: wrap; padding: 15px; gap: 11px; }
  .drop-copy { min-width: 100%; order: 3; }
  .media-drop .btn { margin-left: auto; }
  .library-toolbar { flex-direction: column; align-items: stretch; gap: 9px; }
  .library-tools { justify-content: space-between; }
  .search-field { flex: 1; }
  .search-field input { width: 100%; }
  .records-table { border-radius: 12px; }
  .test-hero { padding: 24px 20px; }
  .test-hero-copy h2 { font-size: 28px; }
  .test-aside { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); border-radius: 14px; }
  .modal-head, .modal-body, .modal-foot { padding-left: 15px; padding-right: 15px; }
  .settings-aside { display: flex; }
  .media-grid { gap: 10px; }
  .api-card { padding: 16px; }
  .toast-root { right: 12px; bottom: 12px; }
}
/* =========================================================
   Final component additions
   ========================================================= */
.btn.primary.danger-btn {
  background: linear-gradient(135deg, #e25c5c, #c53d3d);
  box-shadow: 0 5px 15px rgba(197, 61, 61, 0.24);
}
.demo-tag {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 7.5px;
  color: #928bb5;
  background: #f0eef9;
  line-height: 1.6;
}
.post-type-tag {
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 7.5px;
  color: #1d4ed8;
  background: #eaf2ff;
  line-height: 1.6;
}
.queue-state.failed { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.queue-state.failed i { background: var(--danger); }
.queue-progress-label { display: flex; align-items: center; gap: 7px; }
.queue-progress-label b { margin-left: auto; }
.queue-pause {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 8px;
  color: var(--ink-3);
  background: #fff;
  border: 1px solid var(--line);
}
.queue-pause .icon { width: 9px; height: 9px; }
.queue-pause:hover { color: var(--brand); border-color: #cfcdea; }
.queue-pause:disabled { opacity: 0.45; pointer-events: none; }
.queue-pause.active { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.job-retry {
  padding: 0;
  color: var(--danger);
  font-size: 8.5px;
  font-weight: 550;
}
.job-retry:hover { text-decoration: underline; }
.job-error { color: var(--danger) !important; font-size: 8px !important; line-height: 1.45; margin-top: 4px !important; display: block !important; }
.cover-drop.dragging { border-color: var(--brand); background: var(--brand-wash); }
.preview-modal .modal-body { overflow: hidden; display: flex; padding: 0; }
.preview-frame { flex: 1; height: 100%; }
.palette { max-width: 570px; align-self: flex-start; margin-top: 8vh; }
.palette .modal-head { display: none; }
.palette .modal-body { padding: 0; }
.palette-list { max-height: 400px; }
.picker-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.picker-item { text-align: left; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.picker-item:hover { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(91, 91, 214, 0.1); }
.picker-thumb { display: block; aspect-ratio: 4/3; border-radius: 6px; overflow: hidden; background: var(--panel-2); margin-bottom: 5px; }
.picker-thumb img { width: 100%; height: 100%; object-fit: cover; }
.picker-video-icon { display: grid; place-items: center; height: 100%; color: var(--brand); background: var(--brand-soft); }
.picker-item b { display: block; font-size: 9.5px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-item small { display: block; font-size: 8px; color: var(--ink-3); margin-top: 1px; }
.picker-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 48px 20px; text-align: center; color: var(--ink-3); }
.picker-empty .icon { width: 26px; height: 26px; color: var(--ink-4); margin-bottom: 3px; }
.picker-empty b { font-size: 12px; color: var(--ink-2); }
.picker-empty small { font-size: 9.5px; }
.test-item.skip .test-status-icon { background: #f1f2f7; color: var(--ink-3); }
.test-item.idle .test-status-icon { color: var(--ink-4); }
.media-drop { cursor: pointer; }
@media (max-width: 640px) {
  .media-scope-bar { flex-direction: column; align-items: stretch; gap: 9px; }
  .upload-scope { justify-content: space-between; }
  .picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* =========================================================
   Auth gate
   ========================================================= */
body.auth-pending .app-shell { visibility: hidden; }
body.auth-locked .app-shell { display: none; }
body.auth-locked { overflow: hidden; }

.auth-gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(440px, 0.88fr);
  background: #f4f5f9;
}
.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 40px 48px 34px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(760px 520px at 4% -8%, rgba(124, 92, 255, 0.5), transparent 60%),
    radial-gradient(620px 460px at 105% 6%, rgba(37, 99, 235, 0.28), transparent 64%),
    linear-gradient(145deg, #20213b 0%, #141625 52%, #0d0f18 100%);
}
.auth-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(760px 600px at 68% 30%, #000 5%, transparent 78%);
  pointer-events: none;
}
.auth-visual::after {
  content: "";
  position: absolute;
  right: -180px;
  bottom: -230px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 80px rgba(255, 255, 255, 0.018), 0 0 0 160px rgba(255, 255, 255, 0.012);
  pointer-events: none;
}
.auth-brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-mark { width: 43px; height: 43px; }
.auth-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.15; }
.auth-brand strong { font-size: 20px; letter-spacing: 0.08em; }
.auth-brand small { margin-top: 3px; font-size: 8.5px; letter-spacing: 0.2em; color: #9297b0; }
.auth-copy { position: relative; z-index: 2; margin: auto 0; padding: 12vh 0 8vh; max-width: 580px; }
.auth-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 9px; letter-spacing: 0.15em; color: #9ea3c0; }
.auth-eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: #57e3b1; box-shadow: 0 0 0 4px rgba(87, 227, 177, 0.1); }
.auth-copy h2 { margin: 19px 0 17px; font-size: clamp(38px, 4.2vw, 58px); line-height: 1.18; letter-spacing: -0.045em; font-weight: 650; }
.auth-copy > p { margin: 0; max-width: 520px; color: #adb1c8; font-size: 13px; line-height: 1.9; }
.auth-pill-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 17px; }
.auth-pill-row span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 999px; color: #aeb2c7; background: rgba(255, 255, 255, 0.035); font-size: 8.5px; }
.auth-pill-row i { width: 4px; height: 4px; border-radius: 50%; background: #57e3b1; }
.auth-intro { display: flex; align-items: baseline; gap: 10px; margin-top: 25px; }
.auth-intro span { flex: none; color: #a78bfa; font-size: 8px; font-weight: 650; letter-spacing: 0.16em; text-transform: uppercase; }
.auth-intro b { color: #8f94ad; font-size: 10.5px; font-weight: 450; }
.auth-capability-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 11px; }
.auth-capability {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  backdrop-filter: blur(6px);
}
.auth-capability:hover { border-color: rgba(167, 139, 250, 0.28); background: linear-gradient(145deg, rgba(139, 92, 246, 0.11), rgba(255, 255, 255, 0.025)); }
.capability-icon { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 7px; color: #c4b5fd; background: rgba(139, 92, 246, 0.14); }
.capability-icon .icon { width: 14px; height: 14px; }
.auth-capability b { display: block; color: #e2e4ef; font-size: 10.5px; font-weight: 550; line-height: 1.4; }
.auth-capability small { display: block; margin-top: 3px; color: #858aa1; font-size: 8.5px; line-height: 1.55; }
.auth-features { display: flex; flex-direction: column; gap: 11px; margin-top: 34px; }
.auth-features span { display: flex; align-items: center; gap: 10px; color: #d4d6e4; font-size: 11px; }
.auth-features b { font-family: var(--font-mono); font-size: 8px; font-weight: 500; color: #a78bfa; background: rgba(139, 92, 246, 0.12); border: 1px solid rgba(139, 92, 246, 0.18); border-radius: 5px; padding: 3px 6px; }
.auth-quote { position: relative; z-index: 2; border-top: 1px solid rgba(255, 255, 255, 0.09); padding-top: 17px; }
.auth-quote p { margin: 0 0 4px; color: #8f94ad; font-family: var(--font-serif); font-size: 12px; }
.auth-quote span { font-size: 8.5px; color: #61667e; letter-spacing: 0.08em; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 28px; background: #f7f7fb; }
.auth-box { width: 100%; max-width: 390px; padding: 32px 34px 26px; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 60px rgba(20, 24, 40, 0.07); }
.auth-box-head { display: flex; align-items: center; gap: 8px; font-size: 9px; color: var(--ink-3); letter-spacing: 0.04em; }
.auth-mini-mark { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 7px; color: #fff; background: linear-gradient(145deg, #8b5cf6, #5b5bd6); }
.auth-mini-mark svg { width: 15px; height: 15px; }
.auth-tabs { display: flex; gap: 3px; margin: 22px 0 17px; padding: 3px; border-radius: 9px; background: #f1f2f7; }
.auth-tabs button { flex: 1; height: 33px; border-radius: 7px; color: var(--ink-3); font-size: 11px; font-weight: 550; }
.auth-tabs button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 24, 40, 0.1); }
.auth-box h1 { margin: 0; font-size: 23px; letter-spacing: -0.03em; font-weight: 650; }
.auth-subtitle { margin: 5px 0 20px; font-size: 10.5px; color: var(--ink-3); }
.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.auth-field span { font-size: 10px; color: var(--ink-2); font-weight: 600; }
.auth-field input { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); font-size: 12px; transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease; }
.auth-field input:focus { outline: none; border-color: rgba(91, 91, 214, 0.5); background: #fff; box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.08); }
.auth-field input::placeholder { color: var(--ink-4); }
.auth-error { margin-bottom: 10px; padding: 8px 10px; border-radius: 7px; background: var(--danger-soft); color: #a32c2c; font-size: 9.5px; line-height: 1.6; }
.auth-submit { width: 100%; height: 41px; margin-top: 3px; font-size: 12px; }
.auth-switch { margin: 16px 0 0; text-align: center; font-size: 9.5px; color: var(--ink-3); }
.auth-switch button { color: var(--brand); font-size: 9.5px; font-weight: 600; padding: 0; }
.auth-switch button:hover { text-decoration: underline; }
.auth-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; padding-top: 13px; border-top: 1px solid #f1f2f7; font-size: 8px; color: var(--ink-4); }
.auth-foot span:first-child { display: flex; align-items: center; gap: 5px; }

.account-card { display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.account-avatar { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; color: #4b3512; font-size: 15px; font-weight: 700; background: linear-gradient(145deg, #f2d9a6, #d9a855); }
.account-card div { min-width: 0; }
.account-card b { display: block; font-size: 12px; font-weight: 600; }
.account-card small { display: block; margin-top: 2px; font-size: 9px; color: var(--ink-3); }
.account-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; font-size: 9.5px; color: var(--ink-3); }
.account-meta b { font-weight: 550; color: var(--ink-2); font-family: var(--font-mono); font-size: 8.5px; }
.account-password-form { margin-top: 16px; padding-top: 13px; border-top: 1px solid #f1f2f7; display: flex; flex-direction: column; gap: 8px; }
.account-section-title { font-size: 10.5px; font-weight: 600; color: var(--ink-2); }
.account-section-title small { display: block; margin-top: 2px; font-size: 8px; font-weight: 400; color: var(--ink-3); }
.account-password-form .field > span { font-size: 9px; }
.account-password-form .field input { height: 32px; font-size: 10.5px; }

/* =========================================================
   User chip
   ========================================================= */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  background: rgba(255, 255, 255, 0.035);
}
.user-avatar { width: 29px; height: 29px; flex: none; display: grid; place-items: center; border-radius: 9px; color: #4b3512; font-size: 11px; font-weight: 700; background: linear-gradient(145deg, #f2d9a6, #d9a855); }
.sidebar-user-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.sidebar-user-meta strong { font-size: 11px; color: #e0e2ee; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-meta small { font-size: 8.5px; color: #777c93; }
.logout-btn { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 6px; color: #7d8299; }
.logout-btn:hover { color: #fca5a5; background: rgba(252, 165, 165, 0.09); }
.logout-btn .icon { width: 14px; height: 14px; }
button.avatar { padding: 0; border: 0; cursor: pointer; }

.video-publish-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr); gap: 18px; align-items: start; }
.video-publish-preview { border-radius: 12px; overflow: hidden; background: #0e1018; border: 1px solid var(--line); }
.video-publish-preview video { width: 100%; max-height: 360px; display: block; background: #000; }
.video-publish-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 11px; background: #171925; color: #aeb1c6; font-size: 8.5px; }
.video-publish-form { display: flex; flex-direction: column; gap: 10px; }
.video-type-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.video-type-option {
  min-height: 32px;
  padding: 6px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--ink-2);
  font-size: 9.5px;
  font-weight: 550;
  text-align: center;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}
.video-type-option:hover { border-color: #c9c6e5; background: #fff; }
.video-type-option.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-deep); box-shadow: 0 0 0 2px rgba(91, 91, 214, 0.08); }
.video-publish-form textarea:focus { outline: none; border-color: rgba(91, 91, 214, 0.5); background: #fff; box-shadow: 0 0 0 3px rgba(91, 91, 214, 0.08); }
.video-publish-form .form-grid { gap: 9px; }
.video-success { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.video-success img, .video-success-placeholder { width: 64px; height: 42px; flex: none; object-fit: cover; border-radius: 6px; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand); }
.video-success-placeholder .icon { width: 18px; height: 18px; }
.video-success div:last-child { min-width: 0; }
.video-success b { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-success small { display: block; margin-top: 2px; font-size: 9px; color: var(--ink-3); }

/* Photo frame studio */
.frame-studio { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr); gap: 16px; align-items: start; }
.frame-preview { position: relative; display: grid; place-items: center; min-height: 360px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f2f0ec; overflow: hidden; }
.frame-canvas-stage { position: relative; display: inline-block; max-width: 100%; max-height: 560px; line-height: 0; touch-action: none; user-select: none; }
.frame-preview #frameCanvas { display: block; width: auto; max-width: 100%; max-height: 560px; height: auto; object-fit: contain; box-shadow: 0 14px 34px rgba(20, 18, 30, 0.2); }
.frame-overlay { position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-height: none !important; object-fit: fill; pointer-events: none; box-shadow: none !important; }
.frame-scale-line #frameResetLayout { margin-left: auto; flex: none; font-size: 8px; padding: 2px 5px; }
.frame-preview-tag { position: absolute; top: 9px; left: 9px; padding: 3px 6px; border-radius: 5px; background: rgba(17, 17, 17, 0.55); color: #fff; font-size: 8px; backdrop-filter: blur(5px); }
.frame-fullscreen-btn { position: absolute; top: 9px; right: 9px; z-index: 8; display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border-radius: 6px; color: #fff; background: rgba(17, 17, 17, 0.58); font-size: 8.5px; backdrop-filter: blur(6px); }
.frame-fullscreen-btn:hover { background: rgba(17, 17, 17, 0.82); }
.frame-fullscreen-btn .icon { width: 11px; height: 11px; }
.frame-preview:fullscreen { width: 100vw; height: 100vh; min-height: 100vh; padding: 24px; border: 0; border-radius: 0; background: #10131b; display: grid; place-items: center; overflow: hidden; }
.frame-preview:fullscreen .frame-canvas-stage { max-width: none; max-height: none; }
.frame-preview:fullscreen #frameCanvas { max-width: 96vw; max-height: calc(100vh - 78px); }
.frame-preview:fullscreen .frame-preview-tag { top: 18px; left: 20px; font-size: 9px; }
.frame-preview:fullscreen .frame-fullscreen-btn { top: 18px; right: 20px; font-size: 10px; padding: 6px 10px; }
.frame-preview.fallback-fullscreen { position: fixed; inset: 0; z-index: 5000; width: 100vw; height: 100vh; min-height: 100vh; padding: 24px; border: 0; border-radius: 0; background: #10131b; display: grid; place-items: center; overflow: hidden; }
.frame-preview.fallback-fullscreen .frame-canvas-stage { max-width: none; max-height: none; }
.frame-preview.fallback-fullscreen #frameCanvas { max-width: 96vw; max-height: calc(100vh - 78px); }
.frame-preview.fallback-fullscreen .frame-preview-tag { top: 18px; left: 20px; font-size: 9px; }
.frame-preview.fallback-fullscreen .frame-fullscreen-btn { top: 18px; right: 20px; font-size: 10px; padding: 6px 10px; }
body.frame-fallback-open { overflow: hidden; }
.frame-controls { display: flex; flex-direction: column; gap: 11px; }
.frame-size-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.frame-size-fields .field { gap: 4px; }
.frame-size-fields .field > span { font-size: 9px; }
.frame-size-fields .field input { height: 30px; font-size: 10px; }
.frame-scale-line { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); }
.frame-scale-line > span { flex: none; color: var(--ink-2); font-size: 9px; font-weight: 550; }
.frame-scale-line input { flex: 1; min-width: 0; height: 4px; accent-color: var(--brand); }
.frame-scale-line b { flex: none; min-width: 35px; color: var(--brand-deep); font-size: 9px; font-variant-numeric: tabular-nums; text-align: right; }
.frame-style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
.frame-style { display: flex; align-items: center; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); text-align: left; }
.frame-style:hover { border-color: #d2cdea; background: #fff; }
.frame-style.active { border-color: var(--brand); background: var(--brand-soft); }
.frame-style > i { width: 23px; height: 23px; flex: none; border-radius: 5px; border: 1px solid rgba(0, 0, 0, 0.12); }
.frame-style span { min-width: 0; display: flex; flex-direction: column; }
.frame-style b { color: var(--ink-2); font-size: 9px; font-weight: 600; line-height: 1.35; }
.frame-style small { color: var(--ink-3); font-size: 7.5px; line-height: 1.35; }
.frame-custom-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.frame-custom-bar #frameCustomInfo { min-width: 0; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-size: 8px; }
.frame-size-pill { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 4px; border: 1px solid #ddd9ee; background: #f7f5ff; color: var(--brand-deep); font-size: 7.5px; white-space: nowrap; }
.frame-custom-swatch { background-image: linear-gradient(135deg, #f3eee6 25%, #fff 25%, #fff 50%, #f3eee6 50%, #f3eee6 75%, #fff 75%); background-size: 8px 8px !important; border-style: dashed !important; }
.frame-limit { color: var(--ink-4); font-size: 8px; font-weight: 400; }
.frame-related { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.frame-source { position: relative; width: 43px; height: 43px; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: var(--panel-2); padding: 0; }
.frame-source img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame-source span { position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: rgba(15, 15, 20, 0.68); font-size: 11px; line-height: 1; }
.frame-source:hover { border-color: #c8c2e5; }
.frame-source.selected { border-color: var(--brand); }
.frame-source.selected span { background: var(--brand); }
.frame-source:disabled { opacity: 0.35; cursor: not-allowed; }
.frame-no-related { color: var(--ink-3); font-size: 8.5px; padding: 7px 0; }
.frame-selection { display: flex; flex-wrap: wrap; gap: 5px; }
.frame-selected { position: relative; width: 45px; height: 45px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); cursor: pointer; }
.frame-selected.active { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.frame-selected img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame-selected b { position: absolute; left: 0; right: 0; bottom: 0; padding: 1px 3px; background: rgba(15, 15, 20, 0.68); color: #fff; font-size: 6.5px; font-weight: 500; text-align: center; }

/* Inline crop overlay, kept above the frame modal */
.frame-crop-overlay { position: fixed; inset: 0; z-index: 5000; display: grid; place-items: center; padding: 18px; background: rgba(11, 13, 22, 0.7); backdrop-filter: blur(5px); }
.frame-crop-card { width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 28px); display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; background: #fff; box-shadow: 0 24px 70px rgba(10, 12, 22, 0.3); }
.frame-crop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.frame-crop-head h3 { margin: 0; font-size: 15px; font-weight: 650; }
.frame-crop-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 9px; line-height: 1.55; }
.frame-crop-stage { display: grid; place-items: center; padding: 16px; overflow: auto; background: #f2f0ec; }
.frame-crop-stage #cropCanvas { display: block; max-width: 100%; height: auto; max-height: 52vh; box-shadow: 0 10px 28px rgba(20, 18, 30, 0.18); touch-action: none; cursor: grab; }
.frame-crop-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 18px 15px; border-top: 1px solid var(--line); }
.crop-aspects { display: flex; flex-wrap: wrap; gap: 4px; }
.crop-aspect { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink-3); background: var(--panel-2); font-size: 9px; }
.crop-aspect:hover { border-color: #cbc6e7; background: #fff; }
.crop-aspect.active { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-soft); }
.crop-actions { display: flex; gap: 6px; margin-left: auto; }
@media (max-width: 560px) {
  .frame-crop-controls { align-items: stretch; }
  .crop-actions { width: 100%; margin-left: 0; }
  .crop-actions .btn { flex: 1; }
}
@media (max-width: 820px) {
  .frame-studio { grid-template-columns: 1fr; }
  .frame-preview { min-height: 260px; }
}
@media (max-width: 760px) {
  .video-publish-layout { grid-template-columns: 1fr; }
  .video-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================================================
   Audit log
   ========================================================= */
.audit-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 15px; }
.audit-stat { padding: 14px 15px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-xs); display: flex; align-items: center; gap: 11px; }
.audit-stat-icon { width: 33px; height: 33px; flex: none; display: grid; place-items: center; border-radius: 9px; color: var(--brand); background: var(--brand-soft); }
.audit-stat-icon .icon { width: 15px; height: 15px; }
.audit-stat div { min-width: 0; }
.audit-stat b { display: block; font-size: 20px; line-height: 1.1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.audit-stat small { display: block; margin-top: 2px; font-size: 9px; color: var(--ink-3); }
.audit-card { padding: 18px 20px; }
.audit-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 10px; flex-wrap: wrap; }
.audit-table { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.audit-row { display: grid; grid-template-columns: 112px 104px 96px minmax(0, 1fr) 66px 68px 62px 96px; gap: 8px; align-items: center; padding: 8px 11px; border-bottom: 1px solid #f2f3f7; font-size: 9px; }
.audit-row:last-child { border-bottom: 0; }
.audit-row.head { background: #fbfbfd; color: var(--ink-3); font-size: 7.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.audit-row:hover:not(.head) { background: #fbfbfe; }
.audit-time { color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.audit-user { display: flex; align-items: center; gap: 5px; min-width: 0; }
.audit-user span:first-child { width: 19px; height: 19px; flex: none; display: grid; place-items: center; border-radius: 5px; color: #4b3512; background: linear-gradient(145deg, #f2d9a6, #d9a855); font-size: 8px; font-weight: 700; }
.audit-user b { font-size: 9px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-user small { font-size: 7px; color: var(--ink-4); }
.audit-action { display: inline-flex; align-items: center; justify-self: start; padding: 2px 6px; border-radius: 5px; background: var(--brand-soft); color: var(--brand-deep); font-size: 8px; font-weight: 550; white-space: nowrap; }
.audit-action.upload { background: #eaf2ff; color: #1d4ed8; }
.audit-action.publish { background: var(--success-soft); color: #087853; }
.audit-action.delete { background: var(--danger-soft); color: #a32c2c; }
.audit-action.auth { background: #f3eefe; color: #6d28d9; }
.audit-action.document { background: var(--warn-soft); color: #9a5b06; }
.audit-main { min-width: 0; }
.audit-main b { display: block; font-size: 9.5px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-main small { display: block; font-size: 8px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.audit-format { justify-self: start; font-family: var(--font-mono); font-size: 7.5px; color: var(--ink-3); background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 4px; text-transform: uppercase; }
.audit-size { font-size: 8px; color: var(--ink-3); white-space: nowrap; }
.audit-status { justify-self: start; font-size: 8px; color: var(--success); }
.audit-status.fail { color: var(--danger); }
.audit-ip { font-family: var(--font-mono); font-size: 7.5px; color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =========================================================
   Document media
   ========================================================= */
.media-thumb.doc-thumb { display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg, #f2f0fb, #fbfaff); }
.doc-preview { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #706bb0; }
.doc-preview .icon { width: 30px; height: 30px; }
.doc-ext { font-family: var(--font-mono); font-size: 8px; font-weight: 700; letter-spacing: 0.08em; color: #817bc4; background: rgba(255, 255, 255, 0.75); border: 1px solid rgba(129, 123, 196, 0.2); border-radius: 4px; padding: 2px 5px; }
.media-badge.doc { background: rgba(91, 91, 214, 0.8); }
.doc-convertible { position: absolute; right: 8px; top: 8px; font-size: 7.5px; color: #fff; background: rgba(15, 159, 110, 0.85); padding: 2px 5px; border-radius: 4px; backdrop-filter: blur(6px); }
.doc-card .media-name { font-size: 9.5px; }
.doc-detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr); min-height: 360px; }
.doc-preview-pane { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: linear-gradient(145deg, #f5f3fc, #fbfaff); border-right: 1px solid var(--line); padding: 30px; text-align: center; }
.doc-big-icon { width: 76px; height: 76px; display: grid; place-items: center; border-radius: 20px; color: #665fc0; background: #fff; border: 1px solid rgba(91, 91, 214, 0.12); box-shadow: 0 12px 30px rgba(91, 91, 214, 0.1); }
.doc-big-icon .icon { width: 36px; height: 36px; }
.doc-preview-pane h3 { margin: 3px 0 0; font-size: 15px; max-width: 320px; overflow-wrap: anywhere; }
.doc-preview-pane p { margin: 0; font-size: 9.5px; color: var(--ink-3); }
.doc-type-pill { display: inline-flex; padding: 3px 8px; border-radius: 5px; background: var(--brand-soft); color: var(--brand-deep); font-size: 8px; font-weight: 600; letter-spacing: 0.05em; }
.doc-info-pane { padding: 18px; }
.doc-info-list { display: flex; flex-direction: column; gap: 8px; }
.doc-info-row { display: flex; justify-content: space-between; gap: 12px; font-size: 9.5px; color: var(--ink-3); }
.doc-info-row b { color: var(--ink-2); font-weight: 550; font-family: var(--font-mono); font-size: 8.5px; max-width: 62%; overflow-wrap: anywhere; text-align: right; }
.doc-info-note { margin-top: 14px; padding: 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 9px; line-height: 1.65; color: var(--ink-3); }
.doc-modal-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

@media (max-width: 1120px) {
  .auth-gate { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; background: radial-gradient(600px 400px at 50% -10%, rgba(124, 92, 255, 0.09), transparent 65%), #f7f7fb; }
}
@media (max-width: 980px) {
  .audit-stats { grid-template-columns: repeat(2, 1fr); }
  .audit-row { grid-template-columns: 102px 95px 88px minmax(0, 1fr) 60px 58px; }
  .audit-row .audit-format, .audit-row .audit-ip { display: none; }
}
@media (max-width: 760px) {
  .auth-box { padding: 26px 22px 22px; }
  .auth-panel { padding: 18px; }
  .audit-card { padding: 14px; }
  .audit-row { grid-template-columns: 85px 85px minmax(0, 1fr) 52px; }
  .audit-row .audit-action, .audit-row .audit-size, .audit-row .audit-status { display: none; }
  .audit-toolbar { flex-direction: column; align-items: stretch; }
  .audit-toolbar .segmented { overflow-x: auto; }
  .doc-detail { grid-template-columns: 1fr; }
  .doc-preview-pane { border-right: 0; border-bottom: 1px solid var(--line); min-height: 180px; }
}
@media (max-width: 560px) {
  .sidebar-user { display: none; }
}

/* =========================================================
   Readability pass · icons + labels
   ========================================================= */
.nav-label { font-size: 9.5px; }
.nav-item { font-size: 13.5px; }
.nav-item .icon { width: 18px; height: 18px; }
.nav-item .nav-count, .nav-item .nav-pill { font-size: 9px; }
.site-meta strong { font-size: 12px; }
.site-meta small { font-size: 9px; }
.sidebar-user-meta strong { font-size: 12px; }
.sidebar-user-meta small { font-size: 9px; }
.brand-text strong { font-size: 17px; }
.brand-text small { font-size: 7.5px; letter-spacing: 0.13em; }
.search-btn { font-size: 10.5px; }
.search-btn kbd { font-size: 8px; }
.btn { font-size: 11.5px; }
.btn.tiny { font-size: 10px; }
.seg { font-size: 10.5px; }
.search-field input { font-size: 10.5px; }
.select-compact { font-size: 10px; }

.toolbar-copy p, .card-head p, .queue-head p { font-size: 10.5px; }
.toolbar-hint { font-size: 9px; }
.toolbar-select { font-size: 10.5px; height: 29px; }
.tool-btn { width: 30px; height: 30px; position: relative; }
.tool-btn .icon { width: 15.5px; height: 15.5px; }
.tool-btn::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%) translateY(-2px);
  padding: 3px 7px;
  border-radius: 5px;
  background: #1d1c2f;
  color: #fff;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.01em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 30;
  box-shadow: 0 5px 14px rgba(15, 16, 30, 0.22);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.tool-btn:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.format-pill, .word-pill, .save-state { font-size: 9.5px; }
.field input, .field select { font-size: 11.5px; }
.field-hint { font-size: 10px; line-height: 1.55; }
.side-head h3 { font-size: 12.5px; }
.side-note { font-size: 9px; }
.template-option b { font-size: 10.5px; }
.template-option small { font-size: 8.5px; }
.switch-row b { font-size: 10.5px; }
.switch-row small { font-size: 9px; line-height: 1.45; }
.range-line { font-size: 10px; }
.media-name { font-size: 11px; }
.media-sub { font-size: 9.5px; }
.media-owner { font-size: 8.5px; max-width: 112px; }
.media-badge { font-size: 9px; height: 20px; }
.media-badge .icon { width: 11px; height: 11px; }
.media-duration { font-size: 8.5px; }
.media-refs { font-size: 8.5px; }
.picker-item b { font-size: 10px; }
.picker-item small { font-size: 8.5px; }
.picker-owner, .picker-item .picker-owner { font-size: 8.5px; }
.doc-ext { font-size: 9px; }

/* Media actions: icon + visible text label */
.media-hover-actions {
  align-items: flex-end;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  padding: 16px 7px 7px;
  background: linear-gradient(transparent, rgba(12, 14, 24, 0.72));
  opacity: 0.98;
}
.media-hover-actions button {
  width: auto;
  min-width: 0;
  height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  background: rgba(20, 22, 38, 0.72);
  backdrop-filter: blur(10px);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.media-hover-actions button:hover { background: rgba(91, 91, 214, 0.92); border-color: transparent; }
.media-hover-actions .icon { width: 12px; height: 12px; flex: none; }
@media (hover: none) {
  .media-hover-actions { opacity: 1; background: linear-gradient(transparent, rgba(12, 14, 24, 0.55)); }
}

.audit-row { font-size: 9.5px; padding: 9px 11px; }
.audit-row.head { font-size: 8.5px; }
.audit-user b { font-size: 10px; }
.audit-user small { font-size: 8px; }
.audit-action { font-size: 8.5px; }
.audit-main b { font-size: 10.5px; }
.audit-main small { font-size: 8.5px; }
.audit-format, .audit-size, .audit-status, .audit-ip { font-size: 8.5px; }
.audit-stat small { font-size: 10px; }
.record-head { font-size: 9px; }
.record-row { font-size: 10px; }
.record-cell small { font-size: 9px; }
.recent-main b { font-size: 12px; }
.recent-main small, .recent-meta { font-size: 10px; }
.stat-label { font-size: 11px; }
.dash-queue-empty { font-size: 10px; }
.test-item { font-size: 10px; }
.test-item small { font-size: 9px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
