:root {
  --bg: #0c1216;
  --bg-2: #121a1f;
  --card: #171f25;
  --line: #2a353c;
  --text: #e8eef0;
  --muted: #8b9aa3;
  --teal: #3d9b8f;
  --red: #d45454;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  --side: 248px;
  --side-bg: #0a1014;
  --hover: #182228;
  --thumb: #0a1014;
  --bar: #0e1519;
  --on: #132226;
  --btn: #243038;
}
html[data-theme="light"] {
  --bg: #f3f5f6;
  --bg-2: #ffffff;
  --card: #ffffff;
  --line: #d4dce0;
  --text: #142026;
  --muted: #5b6b73;
  --shadow: 0 10px 28px rgba(20, 32, 38, 0.08);
  --side-bg: #ffffff;
  --hover: #eef2f4;
  --thumb: #e6ebed;
  --bar: #e8eef0;
  --on: #e8f4f2;
  --btn: #e8eef0;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--teal); }
button, input, textarea { font: inherit; }

.app-body { display: flex; height: 100vh; overflow: hidden; }
.side {
  width: var(--side);
  flex: 0 0 var(--side);
  background: var(--side-bg);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: visible;
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.brand { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand strong { letter-spacing: 0.08em; font-size: 11px; color: var(--teal); }
.brand span { font-size: 18px; font-weight: 650; }
.theme-switch {
  width: 46px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: #4a555c;
  padding: 2px;
  display: block;
  cursor: pointer;
  flex: 0 0 46px;
  margin-top: 4px;
}
html[data-theme="light"] .theme-switch { background: #c5ced3; }
.theme-knob {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  display: grid;
  place-items: center;
  transition: transform 0.22s ease;
  transform: translateX(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}
html[data-theme="light"] .theme-knob { transform: translateX(0); }
.theme-icon {
  width: 13px;
  height: 13px;
  display: none;
  fill: none;
  stroke: #111;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.theme-icon-moon { fill: none; }
html[data-theme="dark"] .theme-icon-moon,
html:not([data-theme]) .theme-icon-moon { display: block; }
html[data-theme="light"] .theme-icon-sun { display: block; }
.nav { display: grid; gap: 8px; }
.nav-btn {
  text-align: left;
  border: 0;
  border-radius: 10px;
  padding: 9px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.25;
  cursor: pointer;
}
.nav-btn.on, .nav-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.account { margin-top: auto; position: relative; overflow: visible; }
.acc-pop {
  position: absolute;
  left: 0;
  right: auto;
  width: 276px;
  bottom: calc(100% + 6px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 10px 6px;
  box-shadow: var(--shadow);
  z-index: 30;
}
.acc-pop[hidden] { display: none !important; }
.acc-pop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  white-space: nowrap;
}
.acc-pop-head button {
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  padding: 0;
  font-weight: 650;
  white-space: nowrap;
}
.acc-current {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 8px;
  min-height: 48px;
  margin-bottom: 6px;
}
.acc-current-text { min-width: 0; flex: 1; }
.acc-current-text strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-current-text span {
  display: block;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-hint {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.35;
  margin: 8px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.acc-menu {
  display: grid;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.acc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0 8px;
  cursor: pointer;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  line-height: 40px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  box-sizing: border-box;
  width: 100%;
}
a.acc-item:visited { color: var(--text); }
.acc-item:hover { background: var(--hover); }
.acc-item svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.acc-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  padding: 0 10px;
  cursor: pointer;
  text-align: left;
}
.acc-bar-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.acc-bar-text strong {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acc-bar-text span {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
}
.acc-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--teal);
  color: #061014;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 650;
  flex: 0 0 28px;
}
.acc-check {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.acc-chevron {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  transition: transform 0.18s ease;
}
.account.open .acc-chevron { transform: rotate(180deg); }
.main { flex: 1; padding: 18px 24px 18px; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.main > section:not([hidden]) {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
.topbar .btn-create {
  height: 34px;
  padding: 0 12px;
  font-weight: 500;
  letter-spacing: 0;
}
.usage-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.usage-chip svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.usage-chip .chip-alert { display: none; }
.usage-chip.warn { border-color: #d45454; color: #ffb4b4; }
.usage-chip.warn .chip-ok { display: none; }
.usage-chip.warn .chip-alert { display: block; }
#liveUsageChip svg { fill: currentColor; stroke: none; }
#liveUsageChip.is-live { border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); color: var(--teal); }
.main h1 { margin: 0; font-size: 26px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.login-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 56px 20px 32px;
  background:
    radial-gradient(ellipse at 18% 0%, #163038 0%, var(--bg) 52%);
}
.login-back {
  position: absolute;
  top: 20px;
  left: 24px;
  z-index: 2;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.login-back:hover { color: var(--teal); }
.login-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.login-left {
  padding: 40px 40px 36px;
  background: linear-gradient(180deg, #12333a 0%, #0e1a1e 100%);
  color: #e8eef0;
  display: flex;
  flex-direction: column;
  min-height: 560px;
}
html[data-theme="light"] .login-left {
  background: linear-gradient(180deg, #1f6b66 0%, #164e4a 100%);
}
.login-left-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.login-page .brand { text-decoration: none; color: inherit; }
.login-page .brand strong { font-size: 15px; letter-spacing: 0.08em; color: var(--teal); }
.login-left h1 {
  margin: 48px 0 0;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.login-points {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: #c5d5d8;
}
.login-points li {
  position: relative;
  padding: 8px 0 8px 22px;
  font-size: 15px;
}
.login-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--teal);
}
.login-right {
  padding: 40px 36px 32px;
  display: flex;
  flex-direction: column;
}
.login-right h2 {
  margin: 0 0 22px;
  font-size: 28px;
  letter-spacing: -0.03em;
}
.login-right form { display: flex; flex-direction: column; }
.login-right form[hidden] { display: none !important; }
.login-page .field { margin-bottom: 14px; }
.login-page label { font-size: 12px; margin-bottom: 4px; }
.login-name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}
.login-right input[type="text"],
.login-right input[type="password"],
.login-right input[type="email"],
.login-right .login-go,
.login-right .google-btn {
  height: 42px;
  border-radius: 8px;
}
.login-right input[type="text"],
.login-right input[type="password"],
.login-right input[type="email"] { padding: 0 12px; }
.login-right .pass-wrap input { padding-right: 52px; }
.login-page .eye {
  right: 8px;
  height: 28px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
}
.login-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 16px;
}
.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.remember input { width: 15px; height: 15px; accent-color: var(--teal); }
.login-right .login-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  font-size: 14px;
}
.login-right .login-go:hover { filter: brightness(1.06); }
.login-right .google-btn { margin-top: 10px; }
.google-btn {
  position: relative;
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 44px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}
.google-btn .google-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
}
.google-btn .google-icon svg { width: 18px; height: 18px; display: block; }
.google-btn:hover:not(:disabled) { border-color: var(--teal); background: var(--hover); }
.google-btn:disabled { opacity: 0.58; cursor: not-allowed; }
.auth-switch {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.auth-switch[hidden] { display: none !important; }
.link-btn {
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  padding: 0;
  font-weight: 650;
}
.link-btn:hover { text-decoration: underline; }
.login-right .banner { margin-top: 12px; }
.login-right .banner.info {
  color: var(--text);
  background: var(--on);
  border: 1px solid var(--line);
}
@media (max-width: 820px) {
  .login-page { padding-top: 52px; }
  .login-back { top: 14px; left: 16px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-left { min-height: 0; padding: 28px 24px 24px; }
  .login-left h1 { margin-top: 22px; font-size: 28px; }
  .login-right { padding: 28px 24px 24px; }
}

label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
input[type="text"], input[type="password"], input[type="url"], input[type="email"], input[type="tel"] {
  width: 100%;
  height: 42px;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  outline: none;
  color-scheme: dark;
}
input:focus { border-color: var(--teal); }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--bg-2) inset;
  transition: background-color 99999s ease-out;
}

.watch-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.watch-row input { flex: 1; min-width: 0; }
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 46px; }
.eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
}
.eye:hover { color: var(--text); }

.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.btn {
  border: 0;
  border-radius: 7px;
  padding: 5px 11px;
  cursor: pointer;
  background: var(--btn);
  color: var(--text);
  font-size: 13px;
  line-height: 1.15;
  font-weight: 500;
  letter-spacing: 0.015em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:hover {
  background: #314049;
  color: #f3f7f8;
}
html[data-theme="light"] .btn:hover {
  background: #d5dee2;
  color: #10181c;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--btn); color: var(--text); }
.btn-teal { background: var(--teal); color: #06201c; font-weight: 600; }
.btn-teal:hover { background: #4aada0; color: #041210; }
.btn-red { background: var(--red); color: #fff; font-weight: 600; }
.btn-red:hover { background: #e26666; color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-ghost:hover {
  background: color-mix(in srgb, var(--teal) 12%, transparent);
  border-color: var(--teal);
  color: var(--text);
}
.btn-wide { width: 100%; }

.banner {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #2a1c1c;
  color: #f0c4c4;
  display: none;
}
.banner.show { display: block; }

.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 0 0 18px; }
.notice-list { display: grid; gap: 8px; margin: 0 0 14px; }
.notice-list[hidden] { display: none !important; }
.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--card);
}
.notice-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.notice-body { flex: 1; min-width: 0; }
.notice-body strong { display: block; font-size: 13px; line-height: 1.3; }
.notice-body p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.notice-go {
  border: 0;
  background: transparent;
  color: var(--teal);
  padding: 4px 0 0;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
}
.notice-x {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.notice-x svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.notice-x:hover { color: var(--text); }
.notice.info { border-color: #2f6f68; background: #12201e; color: #b7e4dc; }
.notice.success { border-color: #3d7a4a; background: #142018; color: #b7e4c2; }
.notice.warning { border-color: #8a6a2a; background: #221c10; color: #ead4a0; }
.notice.error { border-color: #6a2a2a; background: #211416; color: #ffb4b4; }
html[data-theme="light"] .notice.info { background: #e8f4f2; color: #14443e; }
html[data-theme="light"] .notice.success { background: #e8f6ec; color: #1d4a2a; }
html[data-theme="light"] .notice.warning { background: #f8f0dc; color: #5c4714; }
html[data-theme="light"] .notice.error { background: #fdecee; color: #6a2424; }
.dash-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 2px 0 10px;
}
.dash-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  min-width: 0;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: thin;
}
.dash-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  height: 36px;
  padding: 0 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
  flex: 0 0 auto;
  max-width: 240px;
}
.dash-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-tab-count {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.dash-tab.on .dash-tab-count { color: var(--teal); }
.dash-tab:hover { color: var(--text); }
.dash-tab.on {
  color: var(--text);
  font-weight: 700;
  border-bottom-color: var(--teal);
}
.dash-tab.on .ui-icon:not(.brand-icon) { color: var(--teal); }
.dash-tab .ui-icon,
.dash-actions .ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  display: block;
  overflow: visible;
  shape-rendering: geometricPrecision;
}
.dash-tab .ui-icon { transform: translateY(0.5px); }
.dash-tab .brand-icon {
  width: 18px;
  height: 18px;
  flex-basis: 18px;
  color: #9aa6ad;
}
.dash-tab.on .brand-icon,
.dash-tab:hover .brand-icon { color: #c5ced3; }
html[data-theme="light"] .dash-tab .brand-icon { color: #6b787f; }
html[data-theme="light"] .dash-tab.on .brand-icon,
html[data-theme="light"] .dash-tab:hover .brand-icon { color: #2f3b41; }
.dash-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dash-actions .btn-create {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  line-height: 1;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}
.dash-actions .btn-create.on { border-color: var(--teal); color: var(--teal); }
.dash-actions .btn-create-primary,
.btn-create-primary { border-color: var(--teal); color: var(--teal); }
.dash-actions .btn-create-primary:hover,
.btn-create-primary:hover { background: var(--on); }
.filter-wrap { position: relative; }
.filter-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 12;
  display: grid;
}
.filter-menu[hidden] { display: none !important; }
.filter-opt {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
}
.filter-opt:hover, .filter-opt.on { background: var(--hover); color: var(--teal); }
.dash-line { height: 1px; background: var(--line); margin: 0 0 16px; }
.btn-create {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 0;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
}
.btn-create:hover { border-color: var(--teal); color: var(--teal); }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 0;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge.live { border-color: #d45454; color: #ffb4b4; background: transparent; }
.badge.ready { border-color: var(--teal); color: #9ee0b4; background: transparent; }
.badge.uploading, .badge.processing, .badge.connecting { border-color: var(--teal); color: #9ad4cb; background: transparent; }
.badge.error { border-color: var(--red); color: #f0a0a0; background: transparent; }
.badge.need { border-color: #c4a46a; color: #e8d0a0; background: transparent; }
.badge.setup { border-color: #6b7a80; color: #b7c2c6; background: transparent; }
.err {
  color: #f0c4c4;
  font-size: 12px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.empty-board {
  grid-column: 1 / -1;
  padding: 36px 8px 12px;
}
.empty-board h2 { margin: 0 0 8px; font-size: 22px; }
.empty-board p { margin: 0; }
.stream-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: auto;
}
.thumb {
  aspect-ratio: 16/9;
  background: var(--thumb) center/cover no-repeat;
  position: relative;
  cursor: pointer;
}
.thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
  transition: background 0.15s ease;
}
.thumb:hover::after {
  background: rgba(255, 255, 255, 0.07);
}
.thumb:has(.thumb-upload)::after,
.thumb:has(.thumb-upload):hover::after {
  background: transparent;
}
.thumb.empty { background: var(--thumb); }
.thumb-tl {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.thumb-st {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: rgba(8, 12, 14, 0.58);
  color: #d8e2e6;
}
.thumb-st svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}
.thumb-st.live { color: #ffb4b4; }
.thumb-st.ready { color: #9ee0b4; }
.thumb-st.busy { color: var(--teal); }
.thumb-st.err { color: #f0a0a0; }
.thumb-st.need { color: #e8d0a0; }
.thumb-st.setup { color: #8b989e; }
.thumb-health {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 3;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(8, 12, 14, 0.72);
  color: #c8d2d6;
  -webkit-font-smoothing: antialiased;
}
.thumb-health.excellent { color: #9ee0b4; }
.thumb-health.ok { color: #e8d0a0; }
.thumb-health.poor { color: #f0a0a0; }
.thumb-watch {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(8, 12, 14, 0.78);
  color: #fff;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}
.thumb-watch.off { opacity: 0.42; }
.thumb-watch:hover {
  background: var(--teal);
  color: #061014;
}
.thumb-watch.off:hover {
  background: rgba(8, 12, 14, 0.78);
  color: #fff;
  opacity: 0.7;
}
.thumb-watch svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card-move {
  display: flex;
  gap: 6px;
  padding: 0 0 10px;
}
.stream-card-body {
  display: flex;
  flex-direction: column;
  padding: 12px 13px 13px;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--text);
  min-width: 0;
}
.card-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stream-card .card-title .plat-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
.plat-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: #9aa6ad;
  overflow: visible;
  shape-rendering: geometricPrecision;
}
.thumb-tl .plat-icon { color: #d5dde0; }
html[data-theme="light"] .plat-icon { color: #6b787f; }
html[data-theme="light"] .thumb-tl .plat-icon { color: #d5dde0; }
.stream-card .meta {
  margin: 0 0 11px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
}
.stream-card .card-status { margin: 0 0 14px; }
.stream-card .err { margin: 0 0 10px; }
.stream-card .badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 3px;
  letter-spacing: 0.03em;
}
.stream-card .badge.ready {
  background: color-mix(in srgb, var(--teal) 12%, transparent);
}
.stream-card .badge.live {
  background: color-mix(in srgb, #d45454 12%, transparent);
}
.stream-card .badge.need {
  background: color-mix(in srgb, #c4a46a 12%, transparent);
}
.stream-card .badge.setup {
  background: color-mix(in srgb, #8b989e 12%, transparent);
}
.stream-card .actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
}
.stream-card .actions .btn {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 4px;
  line-height: 1;
  border: 1px solid var(--line);
  box-sizing: border-box;
}
.stream-card .actions .btn:hover {
  background: #314049;
  color: #f3f7f8;
  border-color: #45555e;
}
.stream-card .actions .btn-wait {
  font-weight: 500;
  color: #8b989e;
  border-color: #4a585e;
  background: transparent;
  cursor: pointer;
}
.stream-card .actions .btn-wait:hover {
  background: #2a3338;
  color: #c5d0d4;
  border-color: #5a686e;
}
.stream-card .actions .btn-wait:disabled,
.stream-card .actions .btn-wait:disabled:hover {
  opacity: 0.55;
  cursor: not-allowed;
  background: transparent;
  color: #8b989e;
  border-color: #4a585e;
}
.stream-card .actions .btn-teal {
  font-weight: 500;
  border-color: var(--teal);
}
.stream-card .actions .btn-teal:hover {
  background: #4aada0;
  color: #041210;
  border-color: #4aada0;
}
.stream-card .actions .btn-red {
  font-weight: 500;
  border-color: var(--red);
}
.stream-card .actions .btn-red:hover {
  background: #e26666;
  color: #fff;
  border-color: #e26666;
}
.stream-card .actions .btn-ghost {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--red) 38%, var(--line));
  color: #c99292;
  font-weight: 500;
}
.stream-card .actions .btn-ghost:hover {
  background: color-mix(in srgb, var(--red) 12%, transparent);
  border-color: color-mix(in srgb, var(--red) 58%, var(--line));
  color: #e4b0b0;
}
.stream-card .actions .btn:disabled:hover {
  background: var(--btn);
  color: var(--text);
  border-color: var(--line);
}
.stream-card .actions .btn-teal:disabled:hover {
  background: var(--teal);
  color: #06201c;
  border-color: var(--teal);
}
.stream-card .actions .btn-ghost:disabled:hover {
  background: transparent;
  color: #c99292;
  border-color: color-mix(in srgb, var(--red) 38%, var(--line));
}
html[data-theme="light"] .stream-card .actions .btn:hover {
  background: #d5dee2;
  color: #10181c;
  border-color: #b8c4ca;
}
html[data-theme="light"] .stream-card .actions .btn-teal:hover {
  background: #4aada0;
  color: #041210;
  border-color: #4aada0;
}
html[data-theme="light"] .stream-card .actions .btn-ghost {
  color: #a05656;
}
html[data-theme="light"] .stream-card .actions .btn-ghost:hover {
  color: #8a3e3e;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  flex: 0 0 auto;
}
.editor .field { margin-bottom: 8px; }
.editor .field input { padding: 8px 10px; }
.settings-grid .field:last-child,
.settings-grid .field-wide { grid-column: 1 / -1; }

.tabs { display: flex; gap: 8px; margin: 8px 0 10px; }
.tab, .dest, .q { border: 1px solid var(--line); padding: 5px 11px; }
.tab.on, .dest.on, .q.on { background: var(--teal); color: #06201c; font-weight: 400; }
.editor-tabs {
  display: flex;
  gap: 4px;
  margin: 2px 0 10px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 8;
  overflow: visible;
}
.editor-tab-set {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 8px;
}
.editor-tabs .tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 8px 10px 8px 16px;
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.03em;
}
.editor-tabs .tab.on {
  background: transparent;
  color: var(--text);
  border-bottom-color: var(--teal);
}
.editor-tabs .tab:hover { color: var(--text); }
.tip {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.tip-btn {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #7d8d95;
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 50%;
}
.tip-btn svg { width: 15px; height: 15px; display: block; }
.tip-btn:hover,
.tip.is-open .tip-btn { color: var(--teal); }
.tip-pop {
  position: absolute;
  left: 0;
  right: auto;
  top: auto;
  bottom: calc(100% + 8px);
  transform: none;
  width: 236px;
  padding: 11px 12px 12px;
  background: #141c21;
  border: 1px solid #2f3c44;
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.tip-pop::before {
  content: "";
  position: absolute;
  top: auto;
  bottom: -5px;
  left: 14px;
  width: 9px;
  height: 9px;
  background: #141c21;
  border-left: 0;
  border-top: 0;
  border-right: 1px solid #2f3c44;
  border-bottom: 1px solid #2f3c44;
  transform: rotate(45deg);
}
.tip:hover .tip-pop,
.tip.is-open .tip-pop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.tip-pop b {
  display: block;
  margin: 0 0 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #9aa8af;
}
.tip-pop p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
  color: #d5dee2;
}
html[data-theme="light"] .tip-pop {
  background: #fff;
  border-color: #d8e0e4;
  box-shadow: 0 14px 36px rgba(16, 24, 28, 0.12);
}
html[data-theme="light"] .tip-pop::before {
  background: #fff;
  border-color: #d8e0e4;
}
html[data-theme="light"] .tip-pop p { color: #2a353c; }

.lib {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.lib-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-2);
  cursor: pointer;
  text-align: left;
  padding: 0;
  color: inherit;
}
.lib-item.on { outline: 2px solid var(--teal); }
.lib-item .pic { aspect-ratio: 16/9; background: var(--thumb) center/cover no-repeat; }
.lib-item .pic.audio, .lib-item .pic.plus {
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--muted);
}
.lib-item .pic.plus { font-size: 42px; font-weight: 300; color: var(--teal); }
.lib-item p { margin: 8px; font-size: 12px; }
.lib-item .lib-body { padding: 8px; }
.lib-item .lib-name { margin: 0 0 4px; font-size: 13px; font-weight: 650; word-break: break-word; }
.lib-item .lib-meta, .lib-item .used { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.lib-item .row { padding: 0 8px 8px; }
.lib-item.on { outline: 2px solid var(--teal); box-shadow: 0 0 0 1px var(--teal); }
.lib-item:hover { border-color: #3d5360; }
.lib-item.playing { outline: 2px solid #c9a24a; }

.lib-stage { margin: 0 0 16px; max-width: 860px; }
.picked-bar {
  display: grid;
  gap: 6px;
  margin: 4px 0 8px;
  flex: 0 0 auto;
}
.picked-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
}
.selected-line { margin: 0; font-size: 13px; flex: 1; min-width: 160px; }
.btn-sm { padding: 3px 8px; font-size: 12px; border-radius: 6px; line-height: 1.15; }
.icon-play, .icon-more {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: var(--btn);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
  flex: 0 0 28px;
}
.icon-play { background: var(--teal); color: #06201c; }
.icon-play svg {
  width: 12px;
  height: 12px;
  display: block;
  fill: currentColor;
}
.icon-play .bars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 12px;
  height: 12px;
}
.icon-play .bars i {
  display: block;
  width: 2.5px;
  height: 10px;
  flex: 0 0 2.5px;
  background: #06201c;
  border-radius: 1px;
}
.icon-more {
  font-size: 16px;
  font-weight: 400;
  color: var(--muted);
  line-height: 1;
  background: transparent;
}
.icon-more:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

#libGrid.audio-list,
#libGrid.media-list,
#sideLib.audio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}
#libGrid.audio-list,
#libGrid.media-list {
  flex: 0 1 auto;
  min-height: 0;
  max-height: none;
}
.edit-media-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.edit-media-actions .btn-ghost {
  min-height: 32px;
  padding: 6px 12px;
  background: transparent;
  font-weight: 400;
}
.edit-media-actions .btn-ghost:hover {
  background: transparent;
  border-color: var(--teal);
  color: var(--text);
}
.edit-media-actions .btn-ghost.on {
  background: transparent;
  border-color: var(--teal);
  color: var(--teal);
}
.edit-now-label {
  margin: 10px 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.edit-lib-pick {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.edit-lib-tabs {
  display: flex;
  gap: 0;
  margin: 0 0 8px;
  border-bottom: 1px solid var(--line);
}
.edit-lib-tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.edit-lib-tab:hover { color: var(--text); }
.edit-lib-tab.on {
  color: var(--text);
  border-bottom-color: var(--teal);
}
.edit-lib-scroll {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(520px, 38vh);
  overflow: auto;
  padding: 2px 2px 4px 0;
}
#view-library {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
#view-library[hidden] { display: none !important; }
.lib-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 0 16px;
  flex: 0 0 auto;
}
.lib-head h1 { margin: 0 0 6px; }
.lib-head .muted {
  margin: 0;
  max-width: 72ch;
  min-height: 1.35em;
}
.lib-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  flex: 0 0 auto;
}
.lib-toolbar .tabs { margin: 0; }
.lib-view-toggle {
  display: flex;
  gap: 8px;
}
.lib-view-toggle[hidden] { display: none !important; }
.upload-rec {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: #8b9aa3;
  -webkit-font-smoothing: antialiased;
  flex: 0 0 auto;
}
.upload-rec b {
  display: block;
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa8af;
}
#sideLib {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  width: 100%;
}
#sideLib.audio-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: none;
  align-content: start;
}
@media (max-width: 900px) {
  #sideLib.audio-list { grid-template-columns: 1fr; }
}
#sideLib.audio-list .upload-row,
#sideLib.audio-list .lib-empty { grid-column: 1 / -1; }
#sideLib.media-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: none;
  align-content: start;
}
@media (max-width: 1280px) {
  #sideLib.media-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  #sideLib.media-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
#sideLib.media-list .upload-row,
#sideLib.media-list .lib-empty { grid-column: 1 / -1; }
#sideLib.media-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#sideLib.media-rows .row-actions { gap: 8px; }
#sideLib.audio-list .row-actions { gap: 8px; }
.lib-empty { margin: 8px 0 0; font-size: 14px; }
.lib-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.lib-card-hit {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.lib-card-thumb {
  aspect-ratio: 16 / 9;
  background: #0e161a center / cover no-repeat;
}
.lib-card-thumb.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.lib-card-body {
  padding: 10px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.lib-card-body .row-actions { margin-top: 6px; gap: 8px; }
.audio-upload {
  width: fit-content;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--teal);
  border-radius: 7px;
  padding: 5px 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.15;
}
.sr-audio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.audio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 42px;
  min-height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  box-sizing: border-box;
  cursor: pointer;
}
.audio-row .row-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 32px;
  line-height: 32px;
}
.audio-row.has-used { height: 42px; min-height: 42px; }
.row-actions {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
}
.row-used {
  display: block;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-row .row-name { flex: 1; }
.media-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  overflow: visible;
  cursor: pointer;
}
.row-name {
  min-width: 0;
  margin: 0;
  padding: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 32px;
  height: 32px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-row .row-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 32px;
  height: 32px;
  white-space: nowrap;
  text-align: right;
  margin-left: auto;
  display: block;
}
.row-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 32px;
  height: 32px;
  white-space: nowrap;
  display: block;
}
.audio-note {
  color: var(--teal);
  font-size: 13px;
  line-height: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  text-align: center;
}
.audio-row .icon-play,
.preview-audio-list .icon-play {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}
.audio-row .icon-play svg,
.preview-audio-list .icon-play svg {
  width: 13px;
  height: 13px;
}
.audio-row .icon-play .bars,
.preview-audio-list .icon-play .bars { height: 12px; width: 12px; gap: 3px; }
.audio-row .icon-play .bars i,
.preview-audio-list .icon-play .bars i {
  width: 2.5px;
  height: 10px;
  flex: 0 0 2.5px;
}
.preview-link {
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 32px;
  height: 32px;
  padding: 0 2px 0 0;
  margin: 0;
  cursor: pointer;
  letter-spacing: 0;
}
.preview-link:hover { color: var(--teal); }
.media-row .icon-more,
.audio-row .icon-more { margin-left: 0; }
.select-btn {
  min-width: 78px;
  border: 1px solid var(--teal);
  background: transparent;
  color: var(--teal);
}
.select-btn:hover {
  background: color-mix(in srgb, var(--teal) 14%, transparent);
  border-color: var(--teal);
  color: var(--teal);
}
.select-btn.on,
.audio-row .select-btn.on,
.media-row .select-btn.on {
  background: var(--teal);
  border-color: var(--teal);
  color: #061014;
}
.select-btn.on:hover {
  background: #4aada0;
  color: #041210;
}
.preview-audio-list .audio-row {
  height: 42px;
  min-height: 42px;
  padding: 0 10px;
}
.upload-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  column-gap: 16px;
  align-items: center;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--teal) 20%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--teal) 5%, var(--bg-2));
  box-sizing: border-box;
}
.upload-row.failed {
  border-color: color-mix(in srgb, var(--red) 36%, var(--line));
  background: color-mix(in srgb, var(--red) 7%, var(--bg-2));
}
.upload-row.ready {
  border-color: color-mix(in srgb, var(--teal) 16%, var(--line));
  background: var(--bg-2);
}
.upload-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.upload-name {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-status {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.upload-bar {
  display: block;
  width: 100%;
  height: 5px;
  margin: 12px 0 0;
  border-radius: 99px;
  background: color-mix(in srgb, var(--line) 82%, #000);
  overflow: hidden;
}
.thumb-bar {
  display: block;
  height: 5px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--line) 82%, #000);
  overflow: hidden;
}
.upload-bar b, .thumb-bar b {
  display: block;
  height: 100%;
  background: color-mix(in srgb, var(--teal) 82%, #fff);
}
.upload-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-spin,
.upload-mark {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  align-self: center;
}
.upload-spin {
  border: 1.6px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-top-color: var(--teal);
  border-radius: 999px;
  box-sizing: border-box;
  animation: upload-spin 0.8s linear infinite;
  transform-origin: 50% 50%;
}
.upload-mark {
  display: grid;
  place-items: center;
  color: var(--teal);
}
.upload-mark.fail { color: #e08a8a; }
.upload-mark svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
@keyframes upload-spin { to { transform: rotate(360deg); } }
.spin-circle,
.go-spin {
  display: block;
  border-style: solid;
  border-radius: 999px;
  box-sizing: border-box;
  animation: upload-spin 0.75s linear infinite;
}
.spin-circle {
  width: 12px;
  height: 12px;
  border-width: 2px;
  border-color: color-mix(in srgb, var(--teal) 28%, transparent);
  border-top-color: var(--teal);
}
.go-spin {
  width: 36px;
  height: 36px;
  border-width: 3px;
  border-color: color-mix(in srgb, #fff 22%, transparent);
  border-top-color: #fff;
  margin-bottom: 4px;
  transform-origin: 50% 50%;
}
.thumb-upload {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  background: #0a1014;
  padding: 16px;
  text-align: center;
}
.thumb-upload svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.thumb-upload strong { font-size: 13px; font-weight: 600; }
.thumb-upload span {
  font-size: 11px;
  color: var(--muted);
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thumb-upload .thumb-bar { width: min(180px, 70%); }
.media-thumb {
  width: 56px;
  height: 32px;
  flex: 0 0 56px;
  border-radius: 4px;
  background: var(--thumb) center/cover no-repeat;
  cursor: pointer;
}
.media-thumb.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}
.audio-row.on, .media-row.on {
  border-color: var(--teal);
  background: var(--on);
}
.audio-row.playing { border-color: #c9a24a; }
.audio-note { color: var(--teal); font-size: 14px; line-height: 1; }
.audio-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.audio-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.audio-head strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-head span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.audio-ctrl { display: flex; align-items: center; gap: 8px; margin-top: 0; flex: 0 0 auto; }
.audio-bar {
  flex: 1;
  height: 8px;
  border: 0;
  padding: 0;
  border-radius: 99px;
  background: var(--bar);
  cursor: pointer;
  overflow: hidden;
}
.audio-bar i { display: block; height: 100%; width: 0; background: var(--teal); }
.audio-time { color: var(--muted); font-size: 12px; min-width: 92px; }
.editor-save {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
  background: var(--card);
}
.split { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.pass-box h3 { margin: 0 0 12px; font-size: 16px; }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 10, 0.72);
  display: grid;
  place-items: center;
  padding: 12px;
  z-index: 20;
}
.overlay[hidden],
.video-stage[hidden],
.video-empty[hidden],
video[hidden],
#confirmYes[hidden] {
  display: none !important;
  pointer-events: none !important;
}
.editor {
  width: min(860px, 100%);
  height: auto;
  max-height: calc(100vh - 24px);
  overflow: auto;
  padding: 16px 18px 12px;
  position: relative;
  display: flex;
  flex-direction: column;
}
.editor .btn,
.editor .btn-sm,
.editor .btn-ghost,
.editor .btn-teal,
.editor .dest,
.editor .q,
.editor .tab,
.editor .eye {
  font-weight: 400;
}
.editor .btn-teal { font-weight: 400; }
.pass-box {
  width: min(520px, 100%);
  height: auto;
  max-height: calc(100vh - 32px);
  overflow: auto;
}
.close-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #8b9aa3;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.close-x svg {
  width: 11px;
  height: 11px;
  display: block;
}
.close-x svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linecap: round;
}
.close-x:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: #e8eef0;
}
html[data-theme="light"] .close-x:hover { color: #142026; }
.pop-overlay { z-index: 40; }
#previewOverlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}
#previewOverlay.is-open:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}
.preview-pop {
  width: min(760px, 100%);
  max-height: calc(100vh - 24px);
  overflow: visible;
  padding: 18px 18px 16px;
  position: relative;
  transform: translateY(8px);
  transition: transform 0.18s ease;
}
#previewOverlay.is-open .preview-pop { transform: none; }
.preview-pop h3 { margin: 0 40px 6px 0; font-size: 18px; font-weight: 400; }
.preview-pop video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  max-height: min(52vh, 480px);
  margin: 0;
  object-fit: contain;
  background: #0e161a;
  border-radius: 8px;
  opacity: 1;
}
.preview-frame {
  position: relative;
  margin: 10px auto 0;
}
.preview-wait {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  background: rgba(8, 14, 18, 0.72);
  color: #d7e2e6;
  font-size: 13px;
  border-radius: 8px;
}
.preview-wait[hidden] { display: none !important; }
.preview-pop video.is-ready { opacity: 1; }
.edit-preview-wrap {
  margin: 10px 0 0;
  flex: 0 0 auto;
}
.edit-preview-wrap video {
  display: block;
  width: 100%;
  max-height: 220px;
  background: #0e161a;
  border-radius: 8px;
  object-fit: contain;
}
.edit-preview-wrap .muted { margin: 6px 0 0; }
.upload-row:not(.failed):not(.ready)::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 1.6px solid color-mix(in srgb, var(--line) 70%, transparent);
  border-top-color: var(--teal);
  border-radius: 999px;
  box-sizing: border-box;
  animation: upload-spin 0.8s linear infinite;
  transform-origin: 50% 50%;
}
.upload-row:not(.failed):not(.ready) .upload-spin { display: none; }
.thumb-upload::before {
  content: "";
  width: 36px;
  height: 36px;
  border: 3px solid color-mix(in srgb, #fff 22%, transparent);
  border-top-color: #fff;
  border-radius: 999px;
  box-sizing: border-box;
  animation: upload-spin 0.8s linear infinite;
  transform-origin: 50% 50%;
  margin-bottom: 4px;
}
.thumb-upload .go-spin { display: none; }
.preview-audio-box { margin-top: 12px; }
.preview-audio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.preview-audio-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}
.preview-audio-head {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 0 0 auto;
}
.preview-audio-bar .audio-row {
  flex: 1;
  min-width: 0;
}
.preview-audio-plus {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--teal);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.preview-audio-plus:hover {
  border-color: var(--teal);
  color: var(--text);
}
.preview-audio-plus span { margin-top: -2px; }
.preview-audio-clear {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.preview-audio-clear:hover {
  border-color: #c99292;
  color: #e4b0b0;
}
.preview-audio-clear span { margin-top: -2px; }
.preview-audio-chosen {
  display: flex;
  align-items: center;
  gap: 8px;
}
.preview-audio-chosen .audio-row {
  flex: 1;
  min-width: 0;
}
.preview-audio-plus.on {
  border-color: var(--teal);
  color: var(--text);
}
.preview-audio-slot {
  position: relative;
  height: calc(42px * 3 + 6px * 2);
  overflow: hidden;
}
.preview-audio-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 12px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  cursor: pointer;
  z-index: 1;
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.16s ease, color 0.16s ease;
}
.preview-audio-hint:hover {
  border-color: var(--teal);
  color: var(--text);
}
.preview-audio-slot.is-open .preview-audio-hint {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}
.preview-audio-slide {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  overflow: auto;
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.preview-audio-slot.is-open .preview-audio-slide {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}
.preview-audio-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.preview-audio-strip strong {
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}
.help-card { padding: 20px; margin-bottom: 18px; }
.notes-wrap,
.account-wrap { max-width: 680px; }
.notes-list { display: flex; flex-direction: column; gap: 14px; }
.note-card { padding: 20px 22px; }
.note-date {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
.note-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}
.note-card p { margin: 0; font-size: 14px; line-height: 1.5; }
.note-card ul {
  margin: 12px 0 0;
  padding-left: 18px;
}
.note-card li {
  margin: 5px 0;
  font-size: 14px;
  line-height: 1.45;
}
.account-card { padding: 20px; margin: 0 0 16px; }
.account-h { margin: 0 0 14px; }
.account-sub {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
}
.account-profile-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.account-profile-text { min-width: 0; }
.account-profile-text strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
}
.account-profile-text span { display: block; font-size: 13px; }
.acc-avatar-lg {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  font-size: 14px;
}
.account-card .opt { color: var(--muted); font-weight: 400; }
.coming-soon {
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
}
.danger-zone {
  border-color: color-mix(in srgb, var(--red) 38%, var(--line));
}
.danger-zone h2 { color: #d38a8a; }
.danger-zone p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.45;
}
.media-info-box {
  width: min(392px, 100%);
  position: relative;
  padding: 22px 22px 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.media-info-box h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: #d7e0e4;
}
.media-info-box.confirm-box p,
.media-info-name {
  margin: 5px 0 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: #7f8f97;
}
.media-info-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-specs {
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}
.media-specs > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.media-specs dt {
  margin: 0;
  color: #7a8a92;
  font-weight: 400;
}
.media-specs dd {
  margin: 0;
  color: #c8d2d6;
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.media-fit {
  margin: 12px 0 0;
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: #7f8f97;
}
.media-fit.warn { color: #d4c4a0; }
.media-info-actions { margin-top: 16px; }
.media-info-box .btn {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.media-info-del {
  color: #c98989;
  border-color: color-mix(in srgb, var(--red) 38%, var(--line));
}
.media-info-del:hover { color: #e0a0a0; }
.delete-box { width: min(460px, 100%); }
.delete-box h2 {
  margin: 0 0 10px;
  font-size: 18px;
}
.bill-wrap {
  width: calc(100% - 48px);
  max-width: 980px;
  margin: 0 auto;
}
.bill-head { margin: 0 0 16px; }
.bill-head h1 { margin: 0; font-size: 24px; font-weight: 600; }
.bill-head p { margin: 6px 0 0; font-size: 13px; }
.bill-h { font-size: 16px; font-weight: 600; margin: 28px 0 10px; }
.bill-seg {
  display: inline-flex;
  flex-wrap: nowrap;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  margin: 0 0 10px;
}
.bill-seg-cycle { display: inline-flex; }
.pill {
  height: 34px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.pill:last-child { border-right: 0; }
.pill.on { background: var(--teal); color: #06201c; font-weight: 600; }
.bill-plan, .pay-box, .bill-info, .bill-invoices {
  padding: 20px;
  margin: 0;
}
.bill-plan-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  gap: 28px;
  align-items: start;
}
.bill-price { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.bill-price strong { font-size: 26px; font-weight: 600; }
.bill-slot-label { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.slot-block { width: min(220px, 100%); margin: 0 0 16px; }
.slot-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
}
.slot-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: var(--btn);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.slot-ctrl input {
  width: 56px;
  height: 28px;
  text-align: center;
  font-weight: 600;
}
.slot-hints {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
.bill-features {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}
.bill-features li { margin: 5px 0; }
.bill-features li::before { content: "✓ "; color: var(--teal); }
.spec-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.spec-grid div {
  border: 1px solid var(--line);
  padding: 10px 12px;
  min-height: 58px;
}
.spec-grid b { display: block; font-size: 15px; font-weight: 600; }
.spec-grid span { color: var(--muted); font-size: 11px; }
.bill-plan-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 18px;
}
.bill-plan-foot .btn-teal {
  height: 42px;
  min-width: 200px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
}
.pay-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.pay-row:last-child { border-bottom: 0; }
.pay-main { min-width: 0; }
.pay-main strong { display: block; font-size: 14px; font-weight: 600; }
.pay-main span { display: block; margin-top: 3px; font-size: 12px; }
.pay-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pay-box .btn-ghost { margin-top: 12px; height: 36px; }
.bill-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.bill-info-grid .field-wide { grid-column: 1 / -1; }
.bill-info .opt { color: var(--muted); font-weight: 400; }
.bill-info .btn-teal { height: 38px; margin-top: 4px; font-weight: 600; }
.inv-table { display: grid; gap: 0; }
.inv-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.8fr 0.7fr 28px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.inv-row:last-child { border-bottom: 0; }
.inv-head { color: var(--muted); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; padding-top: 0; }
.inv-paid {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border: 1px solid #3d7a4a;
  color: #9ee0b4;
  font-size: 11px;
  font-weight: 600;
}
.inv-empty { margin: 8px 0 0; }
@media (max-width: 800px) {
  .bill-wrap { width: calc(100% - 24px); }
  .bill-plan-grid,
  .bill-info-grid { grid-template-columns: 1fr; }
  .bill-plan-foot { justify-content: stretch; }
  .bill-plan-foot .btn-teal { width: 100%; min-width: 0; }
  .inv-row { grid-template-columns: 1fr 1fr; }
  .inv-head { display: none; }
}
.confirm-box {
  width: min(420px, 100%);
  padding: 22px 20px 18px;
  text-align: left;
}
.confirm-box p { margin: 0 0 16px; font-size: 15px; line-height: 1.45; }
.confirm-actions { justify-content: flex-end; }
.pick-stream-box { width: min(480px, 100%); }
.pick-stream-box h2 { margin: 0 0 6px; font-size: 18px; }
.pick-stream-box .muted { margin: 0 0 14px; }
.pick-stream-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 16px;
  max-height: min(50vh, 360px);
  overflow: auto;
}
.pick-stream-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  cursor: pointer;
}
.pick-stream-item strong { grid-column: 1; font-size: 14px; }
.pick-stream-item span {
  grid-column: 1;
  font-size: 12px;
  color: var(--muted);
}
.pick-stream-item em {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-style: normal;
}
.pick-stream-item:hover { border-color: var(--teal); }
.editor h2 { margin: 0 44px 6px 0; font-size: 20px; flex: 0 0 auto; }
.editor > .muted { flex: 0 0 auto; margin: 0 0 8px; }
.editor > .tabs { flex: 0 0 auto; margin: 4px 0 8px; }
.editor-tabs { flex: 0 0 auto; }
.editor > #libHint { flex: 0 0 auto; margin: 0 0 8px; }
.editor > #libProg { flex: 0 0 auto; margin: 6px 0 0; }

@media (max-width: 800px) {
  .app-body { flex-direction: column; }
  .side { width: 100%; flex-basis: auto; }
  .account { margin-top: 0; }
  .acc-pop { width: min(276px, calc(100vw - 24px)); }
  .toolbar { flex-direction: column; align-items: stretch; }
  .settings-grid { grid-template-columns: 1fr; }
}

.support-widget {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  pointer-events: none;
}
.support-fab {
  pointer-events: auto;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: var(--teal);
  color: #061014;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  position: relative;
  transition: filter 0.16s ease, transform 0.16s ease;
}
.support-fab:hover { filter: brightness(1.08); }
.support-fab:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.support-fab svg { width: 22px; height: 22px; display: none; }
.support-fab .support-ico-chat { display: block; }
.support-fab.is-open .support-ico-chat { display: none; }
.support-fab.is-open .support-ico-close { display: block; }
.support-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d45454;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  line-height: 1;
}
.support-panel {
  pointer-events: auto;
  position: absolute;
  right: 0;
  bottom: 64px;
  width: 380px;
  height: 580px;
  max-height: calc(100vh - 96px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.support-panel[hidden] { display: none !important; }
.support-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.support-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 8px;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.support-tab.on { color: var(--text); border-bottom-color: var(--teal); }
#supportViewMessages,
#supportViewArticles {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#supportViewMessages[hidden],
#supportViewArticles[hidden] { display: none !important; }
.support-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px 14px 12px;
  background: #12333a;
  color: #e8eef0;
}
html[data-theme="light"] .support-head { background: #1f6b66; }
.support-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--teal);
  color: #061014;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 34px;
}
.support-head-text { min-width: 0; }
.support-head-text strong { display: block; font-size: 14px; }
.support-head-text span { display: block; margin-top: 2px; font-size: 12px; color: #c5d5d8; }
.support-head-text em {
  display: inline-block;
  margin-top: 6px;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #c9b56a;
}
.support-head-text em.is-online { color: #9ee0b4; }
.support-away {
  margin: 0;
  padding: 8px 14px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.support-thread {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg);
}
.support-msg { max-width: 86%; }
.support-msg p {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  background: var(--card);
  border: 1px solid var(--line);
}
.support-msg time { display: block; margin: 4px 2px 0; font-size: 10px; color: var(--muted); }
.support-msg.mine { align-self: flex-end; }
.support-msg.mine p { background: var(--teal); color: #061014; border-color: var(--teal); }
.support-msg.mine time { text-align: right; }
.support-msg.theirs { align-self: flex-start; }
.support-file {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: inherit;
}
.support-file img {
  display: block;
  max-width: 220px;
  max-height: 140px;
  border-radius: 8px;
  margin-bottom: 4px;
  object-fit: cover;
}
.support-attach-preview[hidden],
.support-emoji[hidden],
.support-article-read[hidden],
.support-back[hidden] { display: none !important; }
.support-attach-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  font-size: 12px;
}
.support-attach-preview span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.support-attach-preview em { color: var(--muted); font-style: normal; }
.support-attach-preview button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}
.support-emoji {
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  padding: 8px;
}
.support-emoji input {
  width: 100%;
  margin-bottom: 8px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
}
.support-emoji-cats { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.support-emoji-cats button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
}
.support-emoji-cats button.on { border-color: var(--teal); color: var(--teal); }
.support-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-height: 140px;
  overflow: auto;
}
.support-emoji-grid button {
  border: 0;
  background: transparent;
  font-size: 18px;
  line-height: 1.4;
  cursor: pointer;
  border-radius: 6px;
}
.support-emoji-grid button:hover { background: var(--card); }
.support-compose {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: var(--card);
}
.support-ico-btn {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 8px;
}
.support-ico-btn:hover { color: var(--text); background: var(--bg-2); }
.support-ico-btn svg { width: 18px; height: 18px; }
.support-article-head { padding: 14px 14px 8px; }
.support-article-head h2 { margin: 0; font-size: 16px; }
.support-back {
  margin: 8px 0 0;
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  padding: 0;
  font-weight: 700;
}
.support-article-search { padding: 0 14px 10px; }
.support-article-search input {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
}
.support-article-list {
  flex: 1;
  overflow: auto;
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.support-article-item {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: inherit;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}
.support-article-item strong { display: block; font-size: 13px; }
.support-article-item span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.support-article-item:hover { border-color: var(--teal); }
.support-article-read {
  flex: 1;
  overflow: auto;
  padding: 0 14px 12px;
  font-size: 13px;
  line-height: 1.5;
}
.support-article-read p { margin: 0 0 10px; }
.support-help-link {
  display: block;
  padding: 10px 14px 14px;
  font-size: 12px;
  font-weight: 700;
}
.support-compose textarea {
  flex: 1;
  min-height: 38px;
  max-height: 88px;
  resize: none;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 8px;
  line-height: 1.35;
}
.support-compose textarea:focus { outline: 1px solid var(--teal); }
.support-send {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #061014;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.support-send svg { width: 18px; height: 18px; }
.support-send:hover { filter: brightness(1.08); }
.support-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 8px;
  font-size: 12px;
  color: var(--muted);
}
.support-typing[hidden] { display: none !important; }
.support-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.support-typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: support-typing-dot 1.1s infinite ease-in-out;
}
.support-typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.support-typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes support-typing-dot {
  0%, 80%, 100% { opacity: 0.28; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.inbox-typing { padding: 0 20px 10px; }
@media (max-width: 640px) {
  .support-widget { right: 12px; bottom: 12px; }
  .support-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 92px);
    bottom: 64px;
  }
}
body.chrome-dim .support-widget { display: none !important; }

.inbox-body { min-height: 100vh; }
.inbox-main { gap: 12px; }
.inbox-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.inbox-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 16px;
  min-height: calc(100vh - 120px);
}
.inbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}
.inbox-item {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--card);
  color: inherit;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}
.inbox-item.on { border-color: var(--teal); }
.inbox-item strong { display: flex; justify-content: space-between; gap: 8px; }
.inbox-item em {
  min-width: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #d45454;
  color: #fff;
  font-style: normal;
  font-size: 11px;
  text-align: center;
}
.inbox-item span, .inbox-item time { display: block; font-size: 12px; margin-top: 3px; }
.inbox-thread { display: flex; flex-direction: column; min-height: 0; padding: 0; overflow: hidden; }
.inbox-thread > .muted {
  margin: 0;
  padding: 22px 28px;
}
.inbox-thread-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.inbox-thread-head h2 { margin: 0 0 4px; font-size: 18px; }
.inbox-msgs { flex: 1; min-height: 220px; padding: 16px 20px; }
@media (max-width: 800px) {
  .inbox-grid { grid-template-columns: 1fr; }
}

.mob-chrome,
.side-backdrop { display: none; }

@media (max-width: 800px) {
  .app-body {
    flex-direction: column;
    min-height: 100dvh;
  }
  .mob-chrome {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 90;
    min-height: 58px;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 12px 12px;
    background: var(--side-bg);
    border-bottom: 1px solid var(--line);
  }
  .mob-brand {
    flex: 1;
    min-width: 0;
    letter-spacing: 0.08em;
    font-size: 12px;
    color: var(--teal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mob-menu {
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    color: var(--text);
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 5px;
    padding: 0;
    cursor: pointer;
  }
  .mob-menu span {
    display: block;
    width: 18px;
    height: 1.5px;
    background: currentColor;
  }
  .mob-create {
    height: 34px;
    padding: 0 10px;
    font-size: 12px;
    white-space: nowrap;
  }
  .side-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 10, 0.55);
    z-index: 70;
  }
  .side-backdrop[hidden] { display: none !important; }
  .side {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    z-index: 80;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    padding-top: calc(76px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    overflow-y: auto;
  }
  body.side-open .side { transform: none; }
  .side .brand-row {
    order: 0;
    justify-content: flex-end;
    margin-bottom: 4px;
  }
  .side .brand { display: none; }
  .side .account { order: 1; margin-top: 0; }
  .side .nav { order: 2; margin-top: 10px; }
  .acc-pop {
    top: calc(100% + 6px);
    bottom: auto;
    width: 100%;
    max-height: min(70vh, 420px);
    overflow: auto;
  }
  .main {
    padding: 12px 14px calc(28px + env(safe-area-inset-bottom, 0px));
  }
  .main h1 { font-size: 22px; }
  .topbar {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    margin: 0 0 12px;
    padding-bottom: 2px;
  }
  .topbar .btn-create { display: none; }
  .usage-chip {
    flex: 0 0 auto;
    height: 32px;
    font-size: 11px;
    padding: 0 8px;
  }
  .dash-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .dash-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .dash-tab {
    flex: 0 0 auto;
    padding: 0 10px;
  }
  .dash-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .dash-actions #create { display: none; }
  .dash-actions .btn-create,
  .dash-actions .filter-wrap {
    width: 100%;
  }
  .dash-actions .btn-create {
    width: 100%;
  }
  .filter-wrap { display: block; }
  .filter-menu { left: 0; right: auto; }
  .board {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .stream-card .card-title { font-size: 15px; }
  .stream-card .actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stream-card .actions .btn {
    height: 40px;
    width: 100%;
    font-size: 13px;
  }
  .stream-card .actions .btn-ghost {
    grid-column: 1 / -1;
  }
  .thumb-watch {
    width: 42px;
    height: 42px;
  }
  .lib-head {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  #sideLib.media-list,
  #sideLib.lib {
    grid-template-columns: 1fr;
  }
  .overlay {
    padding: 0;
    align-items: stretch;
  }
  .editor {
    width: 100%;
    height: auto;
    max-height: 100dvh;
    border-radius: 0;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .editor input,
  .editor textarea {
    font-size: 16px;
  }
  .watch-row {
    flex-wrap: wrap;
  }
  .preview-pop {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }
  .support-widget { z-index: 50; }
}
