:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-soft: #f7f9f8;
  --surface-strong: #eef2f0;
  --line: #dfe5e2;
  --line-strong: #cbd5d0;
  --text: #17201d;
  --muted: #6c7974;
  --muted-2: #8c9793;
  --sidebar: #121a18;
  --sidebar-line: #26312e;
  --green: #087b54;
  --green-dark: #056443;
  --green-soft: #e6f4ed;
  --amber: #a15c06;
  --amber-soft: #fff2dc;
  --red: #b33b35;
  --red-soft: #fdecea;
  --blue: #28679c;
  --blue-soft: #e8f1f8;
  --shadow: 0 10px 30px rgba(22, 38, 32, 0.06);
  --sidebar-width: 224px;
  --radius: 6px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body { background: var(--bg); font-size: 14px; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { width: 18px; height: 18px; stroke-width: 1.8; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background: radial-gradient(ellipse at 20% 0%, #dcebe2, transparent 55%), var(--bg); }
.login-card { width: min(100%, 410px); padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.login-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 32px; }
.login-brand > div, .login-brand > div > span { display: block; }
.login-brand > div > span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.login-card h1 { margin: 0 0 8px; font-size: 24px; }
.login-description { margin: 0 0 24px; color: var(--muted); }
.login-card form { display: grid; gap: 18px; }
.login-card .button { width: 100%; min-height: 42px; justify-content: center; }
.login-card .input { min-height: 42px; }
.login-error, .account-form-error { margin: 0; color: var(--red); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.login-status { min-height: 18px; margin: 16px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.account-control { position: relative; min-width: 0; }
.account-button { display: flex; align-items: center; gap: 9px; padding: 4px 7px; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: var(--radius); text-align: left; }
.account-button:hover, .account-button[aria-expanded="true"] { border-color: var(--line); background: var(--surface-soft); }
.account-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; color: var(--green); background: var(--green-soft); }
.account-copy { display: grid; gap: 3px; min-width: 0; }
.account-copy strong { font-size: 13px; }
.account-copy > span { max-width: 260px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: 320px; max-width: calc(100vw - 32px); display: grid; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 12px 32px rgba(22, 38, 32, .15); }
.account-menu > .button { justify-content: flex-start; }
.account-menu form { display: grid; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.account-form-note { margin: 0; color: var(--muted); line-height: 1.6; font-size: 12px; }
.tenant-banner { flex: 0 0 100%; padding: 8px 12px; color: #65410b; background: var(--amber-soft); border: 1px solid #ead4ac; border-left: 3px solid var(--amber); border-radius: var(--radius); font-weight: 650; font-size: 13px; overflow-wrap: anywhere; }
.topbar:has(.tenant-banner:not([hidden])) { flex-wrap: wrap; row-gap: 10px; }
.account-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.account-company-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.account-company { min-width: 180px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); padding: 12px 14px; text-align: left; cursor: pointer; }
.account-company span, .account-company small { display: block; }
.account-company small { color: var(--muted); margin-top: 4px; }
.account-company.is-active { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.account-center .section-head { flex-wrap: wrap; }
.account-table { min-width: 740px; }
.account-center .cell-main { overflow-wrap: anywhere; }
.account-center .table-wrap { max-width: 100%; }
.account-menu .select { width: 100%; }
#accountAdminForm .field:has(input[type="hidden"]) { display: none; }
#accountAdminForm .field > span, #loginForm .field > span, #tenantSwitchForm .field > span { color: var(--muted); font-size: 12px; }
.account-button:focus-visible, .login-card button:focus-visible, .account-menu button:focus-visible, .account-center button:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

@media (max-width: 1100px) {
  .topbar:has(.account-control) { flex-wrap: wrap; }
  .topbar:has(.account-control) .topbar-actions { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
}
@media (max-width: 760px) {
  .login-card { padding: 25px; }
  .topbar:has(.account-control) .topbar-actions { width: 100%; }
  .account-control { margin-left: auto; }
  .account-copy > span { max-width: min(230px, 58vw); }
  .account-menu { position: fixed; right: 16px; top: 145px; max-height: calc(100dvh - 165px); overflow-y: auto; }
  .tenant-banner { font-size: 12px; }
}

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 14px 12px; color: #dce5e1; background: var(--sidebar); border-right: 1px solid #0b110f; z-index: 40; transition: width .18s ease; }
.brand-row { height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 4px 14px; border-bottom: 1px solid var(--sidebar-line); }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; color: #0d3b2c; background: #e6f1ec; border-radius: 6px; font-size: 17px; font-weight: 800; }
.brand-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.brand-copy strong { color: #fff; font-size: 15px; white-space: nowrap; }
.brand-copy span { margin-top: 3px; color: #87958f; font-size: 11px; white-space: nowrap; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); background: var(--surface); }
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.sidebar .icon-button { color: #b9c5c0; background: transparent; border-color: transparent; }
.sidebar-toggle { margin-left: auto; }
.nav-list { flex: 1; overflow-y: auto; padding-top: 12px; }
.nav-item { width: 100%; min-height: 38px; display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin-bottom: 3px; border: 0; border-radius: 5px; color: #aebbb6; background: transparent; text-align: left; }
.nav-item:hover { color: #fff; background: #1d2925; }
.nav-item.is-active { color: #fff; background: #155c45; box-shadow: inset 3px 0 #4bd09b; }
.nav-item svg { flex: 0 0 18px; }
.nav-item span { white-space: nowrap; }
.nav-label { padding: 15px 10px 7px; color: #63716c; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.sidebar-foot { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 11px 10px 2px; border-top: 1px solid var(--sidebar-line); }
.sidebar-foot div { display: flex; flex-direction: column; }
.sidebar-foot strong { color: #dce5e1; font-size: 12px; }
.sidebar-foot span:not(.status-dot) { margin-top: 2px; color: #71807a; font-size: 10px; }
.status-dot { width: 8px; height: 8px; display: inline-block; flex: 0 0 8px; border-radius: 50%; background: #9aa5a1; box-shadow: 0 0 0 3px rgba(154,165,161,.12); }
.status-dot.is-ok { background: #31bd7f; box-shadow: 0 0 0 3px rgba(49,189,127,.14); }
.status-dot.is-error { background: #dd5d53; box-shadow: 0 0 0 3px rgba(221,93,83,.14); }

.app-shell.is-collapsed { grid-template-columns: 68px minmax(0, 1fr); }
.app-shell.is-collapsed .sidebar { width: 68px; }
.app-shell.is-collapsed .brand-copy, .app-shell.is-collapsed .nav-item span, .app-shell.is-collapsed .nav-label, .app-shell.is-collapsed .sidebar-foot div { display: none; }
.app-shell.is-collapsed .brand-row { justify-content: center; }
.app-shell.is-collapsed .sidebar-toggle { position: absolute; top: 66px; left: 17px; }
.app-shell.is-collapsed .nav-list { padding-top: 56px; }
.app-shell.is-collapsed .nav-item { justify-content: center; padding: 8px; }
.app-shell.is-collapsed .sidebar-foot { justify-content: center; }

.main-area { min-width: 0; }
.app-shell.is-workspace-scroll-locked { height: 100vh; min-height: 0; overflow: hidden; }
.app-shell.is-workspace-scroll-locked .main-area { height: 100vh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.app-shell.is-workspace-scroll-locked .topbar { flex: 0 0 auto; }
.topbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 24px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(10px); }
.topbar-title { display: flex; align-items: center; gap: 10px; }
.topbar-title h1 { margin: 3px 0 0; font-size: 25px; line-height: 1.1; letter-spacing: 0; }
.breadcrumb { color: var(--muted-2); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.scroll-top-button { position: fixed; right: 26px; bottom: 28px; z-index: 45; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; color: #fff; background: var(--green); border: 1px solid var(--green-dark); border-radius: 50%; box-shadow: 0 8px 24px rgba(11, 91, 62, .28); }
.scroll-top-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.scroll-top-button:focus-visible { outline: 3px solid rgba(35, 149, 103, .28); outline-offset: 2px; }
.environment-state { min-height: 34px; display: inline-flex; align-items: center; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 12px; font-weight: 700; }
.environment-state.is-development { color: var(--blue); background: var(--blue-soft); border-color: #c2d8ea; }
.environment-state.is-production { color: var(--red); background: var(--red-soft); border-color: #efc2be; }
.db-state { min-height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 11px; color: var(--muted); border: 1px solid var(--line); background: var(--surface-soft); border-radius: var(--radius); font-size: 12px; }
.mobile-menu { display: none; }
.view-root { padding: 20px 24px 36px; }
.view-root.is-workspace-scroll-locked { min-height: 0; flex: 1 1 auto; overflow: hidden; padding-bottom: 20px; }

.page-stack { min-width: 0; display: grid; gap: 14px; max-width: 1800px; margin: 0 auto; }
.section { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.section-head { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 15px; border-bottom: 1px solid var(--line); }
.section-title { min-width: 0; }
.section-title h2 { margin: 0; font-size: 15px; }
.section-title p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.section-body { padding: 15px; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; }
.toolbar-spacer { flex: 1; }
.demo-banner { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: #f1f8f4; border: 1px solid #c9e4d6; border-left: 3px solid var(--green); border-radius: var(--radius); }
.demo-banner-copy { min-width: 0; display: grid; gap: 3px; }
.demo-banner-copy strong { font-size: 13px; }
.demo-banner-copy span { color: var(--muted); font-size: 11px; }
.demo-banner-actions { display: flex; gap: 7px; margin-left: auto; }

.package-list { display: grid; gap: 11px; padding: 12px; }
.package-list-page > .section > .section-head { position: sticky; top: var(--topbar-height, 78px); z-index: 20; background: rgba(255,255,255,.97); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(10px); }
.package-list-page .section-title > p { margin-top: 7px; }
.package-progress-row, .package-progress-summary { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.package-progress-stat { min-height: 26px; display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid transparent; border-radius: 999px; font-variant-numeric: tabular-nums; }
button.package-progress-stat { font: inherit; cursor: pointer; transition: filter .15s ease, transform .15s ease, box-shadow .15s ease; }
button.package-progress-stat:hover { filter: saturate(1.15); transform: translateY(-1px); box-shadow: 0 3px 9px rgba(30, 54, 44, .1); }
button.package-progress-stat:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.package-progress-stat span { font-size: 10px; font-weight: 650; }
.package-progress-stat strong { font-size: 13px; line-height: 1; }
.package-progress-stat.is-total { color: #405a6b; background: #eef4f7; border-color: #d4e1e8; }
.package-progress-stat.is-generated { color: #23699a; background: #e9f4fb; border-color: #c8e1f0; }
.package-progress-stat.is-images { color: #9a5b08; background: #fff3df; border-color: #f2d7aa; }
.package-progress-stat.is-completed { color: #08704d; background: #e7f6ef; border-color: #c4e7d7; }
.package-progress-stat.is-visible { color: #6f4d96; background: #f3eef9; border-color: #ded0ed; }
.package-summary-refresh { min-height: 26px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 999px; font-size: 10px; font-weight: 650; }
.package-summary-refresh:hover { color: var(--green-dark); background: var(--green-soft); border-color: #c9e8da; }
.package-summary-refresh:focus-visible { outline: 2px solid rgba(8,123,84,.24); outline-offset: 1px; }
.package-summary-refresh svg { width: 13px; height: 13px; }
.package-filter-bar { width: min(1120px, 100%); display: grid; grid-template-columns: minmax(240px, 1.5fr) 155px minmax(180px, 1fr) 145px auto; grid-template-areas: "search date channel status sync"; align-items: stretch; gap: 8px; padding: 8px; background: #f3f6f4; border: 1px solid #e0e7e3; border-radius: 10px; }
.package-filter-item { min-width: 0; min-height: 54px; display: grid; align-content: center; gap: 2px; padding: 6px 10px; background: #fff; border: 1px solid #d9e2dd; border-radius: 8px; transition: border-color .15s ease, box-shadow .15s ease; }
.package-filter-item:hover { border-color: #bccbc3; }
.package-filter-item:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,123,84,.09); }
.package-filter-search { grid-area: search; padding: 0 10px; }
.package-filter-date { grid-area: date; }
.package-filter-channel { grid-area: channel; }
.package-filter-status { grid-area: status; }
.package-filter-label { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 700; line-height: 1.2; }
.package-filter-label svg { width: 11px; height: 11px; }
.package-filter-item > .input, .package-filter-item > .select { height: 25px; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; font-size: 12px; font-weight: 650; }
.package-filter-item > .input:focus, .package-filter-item > .select:focus { box-shadow: none; }
.package-filter-sync { grid-area: sync; min-height: 54px; padding-right: 15px; padding-left: 15px; border-radius: 8px; }
.package-search-control { position: relative; display: flex; align-items: center; }
.package-search-control > svg { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; color: var(--muted-2); transform: translateY(-50%); pointer-events: none; }
.package-search-control .input { height: 52px; padding: 0 36px 0 39px; background: transparent; border: 0; border-radius: 0; box-shadow: none; font-size: 13px; }
.package-search-control .input::placeholder { color: #929d98; }
.package-search-control:focus-within .input { box-shadow: none; }
.package-search-control:focus-within > svg { color: var(--green); }
.package-search-clear { position: absolute; top: 50%; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; padding: 0; color: var(--muted); background: #edf2ef; border: 0; border-radius: 50%; transform: translateY(-50%); }
.package-search-clear:hover { color: var(--text); background: #e0e8e4; }
.package-search-clear svg { width: 14px; height: 14px; }
.package-card { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.package-card.is-inspection-card { box-shadow: 0 0 0 2px rgba(8,123,84,.18); }
.is-inspection-target { position: relative; z-index: 2; outline: 3px solid #ef9f19 !important; outline-offset: 2px; box-shadow: 0 0 0 7px rgba(239,159,25,.2) !important; }
.package-card.copy-in_progress { border-color: #d8a900; box-shadow: inset 0 0 0 1px #f0ce55; }
.package-card.copy-completed { border-color: #239567; box-shadow: inset 0 0 0 1px #70c5a0; }
.package-card.copy-in_progress .package-card-head { background: #fff9df; }
.package-card.copy-completed .package-card-head { background: #e8f7ef; }
.package-card.source-incomplete { color: #68716d; background: #eef1ef; border-color: #c9cfcc; box-shadow: none; }
.package-card.source-incomplete .package-card-head { background: #e4e8e6; }
.package-card.source-incomplete .package-modules { opacity: .58; }
.package-card.source-incomplete button { cursor: not-allowed; }
.source-incomplete-note { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; color: #555e5a; background: #d6dbd8; border: 1px solid #bdc5c1; border-radius: 4px; font-size: 12px; }
.package-card-head { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 8px 4px 11px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.package-sequence { min-width: 22px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; }
.package-head-meta { min-width: 0; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.package-head-meta > * { padding-right: 7px; border-right: 1px solid var(--line); }
.package-head-meta > *:last-child { padding-right: 0; border-right: 0; }
.package-head-meta strong { max-width: 420px; overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; }
.package-channel-identity { min-width: 180px; max-width: 360px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 1px 5px; }
.channel-label { grid-row: 1 / span 2; align-self: stretch; display: inline-flex; align-items: center; padding: 0 5px; color: var(--green-dark); background: var(--green-soft); border-radius: 3px; font-size: 9px; font-weight: 700; }
.channel-primary, .channel-secondary { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.channel-primary { color: var(--text); font-size: 11px; font-weight: 700; }
.channel-secondary { color: var(--muted); font-size: 9px; }
.package-version { padding: 2px 6px !important; color: var(--green-dark); background: var(--green-soft); border-right: 0 !important; border-radius: 999px; font-weight: 700; }
.package-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.detail-icon-button { width: 30px; height: 30px; flex: 0 0 30px; }
.package-modules { display: grid; grid-template-columns: minmax(360px, 1.3fr) minmax(180px, .6fr) minmax(300px, 1.1fr) minmax(200px, .8fr); align-items: stretch; }
.package-module { min-width: 0; height: 100%; padding: 7px 9px 8px; border-right: 1px solid var(--line); }
.package-module:last-child { border-right: 0; }
.package-module h3 { margin: 0 0 5px; color: var(--muted); font-size: 10px; }
.package-module-title, .package-module-cover, .package-module-text, .package-module-community { display: flex; flex-direction: column; }
.title-list, .cover-list, .community-list { min-height: 0; display: grid; gap: 4px; flex: 1; }
.title-list, .cover-list { grid-template-rows: repeat(3, minmax(0, 1fr)); }
.title-pair { position: relative; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.title-pair:last-child { padding-bottom: 0; border-bottom: 0; }
.cover-pair { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 3px 4px; }
.cover-pair strong { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }
.cover-pair strong span { margin-left: 6px; color: var(--text); font-weight: 500; }
.cover-pair .copy-cell { height: 100%; align-items: center; }
.community-pair { display: grid; gap: 5px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.community-pair:last-child { padding-bottom: 0; border-bottom: 0; }
.description-pair { min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin: 4px 0; flex: 1; }
.description-pair .read-cell { height: 100%; }
.description-pair .copy-cell { height: 100%; }
.read-cell { min-width: 0; padding: 5px 6px; background: var(--surface-soft); border-radius: 4px; }
.read-cell-label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 650; }
.read-cell-value { color: #26332e; font-size: 10px; line-height: 1.32; white-space: pre-wrap; overflow-wrap: anywhere; }
.description-pair .read-cell-value { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 7; white-space: normal; }
.description-copy-cell .copy-cell-value { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 7; white-space: normal; }
.description-translation-cell { border: 1px solid var(--line); }
.package-playlist-list { display: grid; gap: 3px; padding: 6px 7px; background: #e7f4ee; border: 1px solid #cce5d9; border-radius: 4px; }
.package-playlist-head { display: flex; align-items: center; justify-content: space-between; color: var(--green-dark); font-size: 10px; }
.package-playlist-row { min-width: 0; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 5px; padding: 4px 5px; background: rgba(255,255,255,.72); border-radius: 3px; }
.package-playlist-row.is-selected { box-shadow: inset 0 0 0 1px #82c6a7; background: #fff; }
.playlist-order { color: var(--muted); font-size: 9px; font-weight: 700; text-align: center; }
.playlist-names { min-width: 0; display: grid; gap: 1px; }
.playlist-names strong, .playlist-names small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-names strong { color: var(--text); font-size: 10px; }
.playlist-names small { color: var(--muted); font-size: 9px; }
.playlist-selected { padding: 2px 5px; color: var(--green-dark); background: var(--green-soft); border-radius: 999px; font-size: 8px; font-weight: 700; white-space: nowrap; }
.copy-cell { position: relative; width: 100%; min-height: 28px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 3px 6px; padding: 4px 6px; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 4px; text-align: left; }
.copy-cell:hover { color: var(--green-dark); border-color: #9acdb7; background: var(--green-soft); }
.copy-cell-label { font-size: 10px; font-weight: 700; }
.copy-cell-value { grid-column: 1 / -1; color: #26332e; font-size: 10px; font-weight: 500; line-height: 1.32; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-hint { position: absolute; top: 6px; right: 6px; opacity: 0; color: var(--muted); transition: opacity .12s ease; }
.copy-cell:hover .copy-hint, .copy-cell:focus-visible .copy-hint, .copy-cell.is-copied .copy-hint { opacity: 1; }
.copy-hint svg { width: 13px; height: 13px; }
.copy-cell-full { padding-right: 25px; }
.video-copy-cell { width: auto; min-width: 132px; min-height: 28px; display: flex; align-items: center; gap: 6px; padding: 3px 22px 3px 7px; }
.video-copy-cell .copy-cell-value { grid-column: auto; overflow: hidden; max-width: 92px; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.community-list { grid-auto-rows: minmax(0, 1fr); }
.community-pair { height: 100%; grid-template-rows: auto minmax(0, 1fr) auto; }
.community-schedule { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.community-schedule strong { color: var(--text); font-size: 9px; font-weight: 650; }
.serial-cell { width: 44px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.community-pair .copy-cell:first-child { height: 100%; }
.community-pair .copy-cell-value { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; }
.package-asset-list, .package-detail-assets { display: flex; flex-wrap: wrap; gap: 6px; }
.package-asset-link { min-width: 0; display: flex; align-items: center; gap: 7px; padding: 4px 6px; color: var(--green-dark); background: #f1f8f4; border: 1px solid #c9e4d6; border-radius: 4px; text-align: left; }
.package-asset-link:hover { border-color: #75bf9e; background: #e3f5eb; }
.package-asset-link img { width: 58px; height: 33px; display: block; flex: 0 0 auto; object-fit: cover; border-radius: 3px; }
.package-asset-link span { display: flex; align-items: center; gap: 4px; overflow: hidden; font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.package-asset-link svg { width: 12px; height: 12px; flex: 0 0 auto; }
.package-asset-missing { min-height: 33px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 7px; color: var(--muted); background: var(--surface-soft); border: 1px dashed var(--line-strong); border-radius: 4px; font-size: 9px; }
.package-asset-missing strong { color: #9a6b00; font-size: 9px; }
.cover-pair > .package-asset-link, .cover-pair > .package-asset-missing { grid-column: 1 / -1; }
.package-detail-assets { margin-top: 10px; }
.package-detail-assets .package-asset-link img { width: 132px; height: 74px; }
.package-detail-assets .package-asset-link span { font-size: 11px; }
.copy-cell:disabled { cursor: default; color: var(--muted-2); background: var(--surface-soft); border-style: dashed; opacity: .58; }
.copy-cell.is-copied { color: #075d40; background: #dff4e9; border-color: #75bf9e; }
.copy-cell.is-copy-complete, .full-output-copy.is-copy-complete { color: #075d40; background: #e3f5eb; border-color: #35a978; box-shadow: inset 0 0 0 1px #8ed1b4; }
.module-empty { grid-column: 1 / -1; padding: 9px; color: var(--muted-2); background: var(--surface-soft); border-radius: 4px; font-size: 11px; text-align: center; }
.detail-page-toolbar { display: flex; align-items: center; gap: 10px; }
.package-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.package-summary > div { min-width: 0; padding: 11px 13px; border-right: 1px solid var(--line); }
.package-summary > div:last-child { border-right: 0; }
.package-summary span { display: block; color: var(--muted); font-size: 10px; }
.package-summary strong { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.detail-result-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.detail-result-group > h2 { display: flex; align-items: center; gap: 9px; margin: 0; padding: 11px 13px; border-bottom: 1px solid var(--line); font-size: 14px; }
.detail-result-group > h2 span { color: var(--muted); font-size: 11px; font-weight: 500; }
.full-output { position: relative; width: 100%; display: block; padding: 12px 13px; color: var(--text); background: transparent; border: 0; border-bottom: 1px solid var(--line); text-align: left; }
.full-output:last-child { border-bottom: 0; }
.full-output-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.full-output-head h3 { margin: 0; color: var(--muted); font-size: 11px; }
.full-output-body { margin-top: 8px; color: #26332e; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.full-output-copy:hover { background: var(--green-soft); }
.full-output-copy .copy-hint { top: 11px; right: 13px; }
.full-output-copy:hover .copy-hint, .full-output-copy:focus-visible .copy-hint, .full-output-copy.is-copied .copy-hint { opacity: 1; }

.button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 12px; border: 1px solid transparent; border-radius: var(--radius); font-weight: 600; white-space: nowrap; }
.button svg { width: 16px; height: 16px; }
.button-primary { color: #fff; background: var(--green); border-color: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-secondary { color: var(--text); background: var(--surface); border-color: var(--line); }
.button-secondary:hover { border-color: var(--line-strong); background: var(--surface-soft); }
.button-danger { color: var(--red); background: var(--surface); border-color: #efc5c1; }
.button-quiet { color: var(--green-dark); background: var(--green-soft); border-color: #c5e5d7; }
.button:disabled { opacity: .46; cursor: not-allowed; }
.button-small { min-height: 29px; padding: 4px 9px; font-size: 12px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.drama-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.drama-kpis .kpi { min-height: 88px; }
.drama-kpis .kpi-value { margin-top: 9px; font-size: 25px; }
.kpi { min-height: 108px; padding: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.kpi-head svg { color: var(--green); }
.kpi-value { margin-top: 13px; font-size: 30px; font-weight: 750; line-height: 1; }
.kpi-foot { margin-top: 9px; color: var(--muted-2); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .72fr); gap: 14px; }

.table-wrap { overflow-x: auto; }
.channel-schedule-table { overflow-x: auto; overflow-y: visible; overscroll-behavior-x: contain; }
.schedule-toolbar .search-field { min-width: 230px; flex: 1 1 280px; }
.schedule-view-switch { display: flex; align-items: end; gap: 5px; }
.drama-filter-body { padding-bottom: 12px; }
.drama-library-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; }
.drama-library-toolbar .search-field { min-width: 260px; flex: 1 1 320px; }
.drama-library-table { max-height: calc(100vh - 330px); overflow: auto; }
.drama-library-table .data-table thead { position: sticky; top: 0; z-index: 4; }
.drama-library-table .data-table th { box-shadow: 0 1px 0 var(--line); }
.drama-progress-table { max-height: calc(100vh - 245px); overflow: auto; }
.drama-progress-page { height: 100%; grid-template-rows: minmax(0, 1fr); }
.drama-progress-page > .section { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.drama-progress-page .drama-progress-table { min-height: 0; max-height: none; flex: 1 1 auto; overscroll-behavior: contain; }
.drama-progress-table .data-table thead { position: sticky; top: 0; z-index: 4; }
.drama-progress-table .data-table th { box-shadow: 0 1px 0 var(--line); }
.drama-progress-table .data-table { table-layout: fixed; }
.drama-progress-table .data-table th,
.drama-progress-table .data-table td { padding: 8px 5px; }
.drama-progress-table .data-table th { text-align: center; }
.drama-progress-table .data-table th:nth-child(1) { width: 34px; }
.drama-progress-table .data-table th:nth-child(2) { width: 160px; text-align: left; }
.drama-progress-table .data-table th:nth-child(3) { width: 34px; }
.drama-progress-table .data-table th:nth-child(n+4):nth-child(-n+12) { width: 64px; white-space: normal; line-height: 1.2; }
.drama-progress-table .data-table th:nth-child(13) { width: 80px; }
.drama-progress-table .data-table th:nth-child(14) { width: 110px; }
.drama-progress-table .data-table th:nth-child(15) { width: 78px; }
.drama-progress-table .data-table th:nth-child(16) { width: 104px; }
.drama-progress-title-cell { width: 160px; }
.drama-progress-title-cell .cell-main { display: -webkit-box; max-width: 150px; white-space: normal; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.drama-progress-title-cell .cell-sub { max-width: 150px; }
.drama-progress-batch-cell,
.drama-progress-node-cell { text-align: center; white-space: nowrap; }
.drama-progress-excluded-cell { text-align: center; }
.drama-progress-node-cell .tag { padding-right: 5px; padding-left: 5px; }
.drama-progress-spec-cell,
.drama-progress-updated-cell { display: table-cell; text-align: center; white-space: nowrap; }
.drama-progress-spec-cell > span,
.drama-progress-updated-cell > span { display: block; line-height: 1.45; }
.drama-progress-spec-cell .mono { color: var(--muted); font-size: 11px; }
.drama-progress-updated-cell { color: var(--muted); font-size: 11px; }
.drama-progress-overall-cell .progress { min-width: 0; }
.drama-progress-actions-cell .row-actions { gap: 4px; }
.drama-progress-row.is-in-progress > td { background: #fff8dc; }
.drama-progress-row.is-completed > td { background: #edf8f2; }
.drama-progress-row.is-not-producing > td,
.drama-library-row.is-not-producing > td { background: #ffd9d6; }
.drama-progress-row.is-in-progress:hover > td { background: #fff3c7; }
.drama-progress-row.is-completed:hover > td { background: #e3f3eb; }
.drama-progress-row.is-not-producing:hover > td,
.drama-library-row.is-not-producing:hover > td { background: #ffcbc7; }
.status-action { padding: 0; background: transparent; border: 0; border-radius: 4px; }
.status-action:hover .tag { box-shadow: 0 0 0 2px rgba(8,123,84,.16); }
.cell-summary { display: -webkit-box; max-width: 360px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.45; }
.pagination { min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 9px 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.detail-tabs { display: flex; gap: 3px; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.detail-tab { min-height: 34px; padding: 6px 12px; color: var(--muted); background: transparent; border: 0; border-bottom: 2px solid transparent; font-weight: 650; }
.detail-tab:hover { color: var(--text); }
.detail-tab.is-active { color: var(--green-dark); border-bottom-color: var(--green); }
.drama-detail-content { padding-top: 14px; }
.production-node-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.language-tier { margin-bottom: 14px; }
.language-tier header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; color: var(--muted); }
.language-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.language-toggle { min-height: 72px; display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; padding: 9px; color: var(--text); background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius); text-align: left; }
.language-toggle strong { color: var(--muted); font-size: 11px; }
.language-toggle small { color: var(--muted-2); text-align: right; }
.language-toggle.is-covered { background: var(--green-soft); border-color: #b8ddcd; }
.language-toggle.is-covered strong { color: var(--green-dark); }
.language-toggle:disabled { cursor: default; opacity: 1; }
.detail-actions { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.detail-block p { margin: 0; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.field-help { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.cadence-table-wrap { max-height: calc(100vh - 210px); overflow: auto; }
.cadence-table-wrap .data-table thead { position: sticky; top: 0; z-index: 4; }
.cadence-table-wrap .data-table th { box-shadow: 0 1px 0 var(--line); }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.data-table th { padding: 10px 11px; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 650; text-align: left; white-space: nowrap; }
.data-table td { padding: 11px; border-bottom: 1px solid #edf0ef; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafcfb; }
.cell-main { display: block; max-width: 320px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { display: block; margin-top: 3px; max-width: 360px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cadence-slot-stack { display: grid; align-content: center; }
.cadence-slot-item { min-height: 38px; display: flex; flex-direction: column; justify-content: center; }
.cadence-slot-item.has-divider { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); }
.data-table td.cadence-time-cell { padding: 6px; }
.cadence-time-box { min-height: 46px; padding: 4px 8px; border-left: 3px solid transparent; border-radius: 4px; }
.cadence-time-box.is-local { background: #edf8f2; border-left-color: #69a98b; }
.cadence-time-box.is-local .cell-main { color: #075f42; }
.cadence-time-box.is-beijing { background: #edf5fb; border-left-color: #6b9fc4; }
.cadence-time-box.is-beijing .cell-main { color: #225f8f; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.row-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; color: #4d5b56; background: #edf1ef; border: 1px solid #e0e6e3; border-radius: 4px; font-size: 11px; white-space: nowrap; }
.tag.is-green { color: #096443; background: var(--green-soft); border-color: #c9e8da; }
.tag.is-amber { color: var(--amber); background: var(--amber-soft); border-color: #f1d8ad; }
.tag.is-red { color: var(--red); background: var(--red-soft); border-color: #f4cbc7; }
.tag.is-blue { color: var(--blue); background: var(--blue-soft); border-color: #cbdfea; }

.progress { min-width: 120px; }
.progress-row { display: flex; justify-content: space-between; margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.progress-track { height: 6px; overflow: hidden; background: #e7ece9; border-radius: 3px; }
.progress-bar { height: 100%; background: var(--green); border-radius: 3px; }
.node-strip { display: flex; gap: 4px; min-width: 180px; }
.node-dot { width: 25px; height: 6px; background: #e3e8e5; border-radius: 2px; }
.node-dot.is-done { background: var(--green); }
.node-dot.is-active { background: #e0a540; }
.node-dot.is-failed { background: var(--red); }

.activity-list { display: grid; }
.activity { position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 11px 0; border-bottom: 1px solid #edf0ef; }
.activity:last-child { border-bottom: 0; }
.activity::before { content: ""; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #55b68b; }
.activity strong { display: block; font-size: 12px; }
.activity p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.empty-state { min-height: 210px; display: grid; place-items: center; padding: 30px; text-align: center; }
.empty-icon { width: 42px; height: 42px; display: grid; place-items: center; margin: 0 auto 12px; color: var(--green); background: var(--green-soft); border-radius: 6px; }
.empty-state h3 { margin: 0; font-size: 15px; }
.empty-state p { max-width: 430px; margin: 6px auto 14px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.loading { min-height: 340px; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 24px; height: 24px; border: 2px solid #dce5e1; border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { min-width: 150px; display: grid; gap: 5px; }
.field label { color: var(--muted); font-size: 11px; font-weight: 600; }
.input, .select, .textarea { width: 100%; color: var(--text); background: #fff; border: 1px solid var(--line-strong); border-radius: var(--radius); outline: none; }
.input, .select { height: 36px; padding: 0 10px; }
.textarea { min-height: 100px; padding: 9px 10px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,123,84,.09); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; grid-column: 1 / -1; }
.search-field { flex: 1 1 260px; }

.modal-backdrop, .drawer-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(12,18,16,.46); }
.modal-backdrop { display: grid; place-items: center; padding: 20px; }
.modal { width: min(680px, 100%); max-height: calc(100vh - 40px); overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 24px 70px rgba(0,0,0,.22); }
.modal-head, .drawer-head { min-height: 59px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2, .drawer-head h2 { margin: 0; font-size: 17px; }
.modal-body { max-height: calc(100vh - 100px); overflow-y: auto; padding: 16px; }
.drawer-backdrop { display: flex; justify-content: flex-end; }
.drawer { width: min(680px, 100%); height: 100%; overflow: hidden; background: var(--surface); box-shadow: -18px 0 60px rgba(0,0,0,.18); }
.drawer-body { height: calc(100% - 62px); overflow-y: auto; padding: 16px; }
.drawer:has(.channel-hub) { width: min(920px, 100%); }
.channel-hub-tabs { overflow-x: auto; }
.channel-hub-tabs .detail-tab { flex: 0 0 auto; }
.channel-hub-panel { padding-top: 14px; }
.channel-hub-identity { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.channel-hub-form { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.hub-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.hub-columns > section { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.hub-columns h3 { margin: 0 0 10px; font-size: 13px; }
.hub-record-list { display: grid; gap: 10px; }
.hub-record { display: grid; gap: 7px; padding: 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.hub-record + .hub-record { margin-top: 8px; }
.hub-record header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hub-record p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.hub-report { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.hub-report + .hub-report { margin-top: 12px; }
.hub-report > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.hub-report > header strong, .hub-report > header .cell-sub { display: block; }
.hub-empty-note { padding: 28px 16px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.eyebrow { color: var(--muted); font-size: 10px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.detail-item { padding: 11px; background: #fff; }
.detail-item span { display: block; color: var(--muted); font-size: 10px; }
.detail-item strong { display: block; margin-top: 4px; font-size: 12px; word-break: break-word; }
.detail-block { margin-top: 14px; }
.detail-block h3 { margin: 0 0 8px; font-size: 13px; }
.result-item + .result-item { margin-top: 8px; }
.result-item p, .result-prompts p { margin: 5px 0 0; color: var(--muted); line-height: 1.55; white-space: pre-wrap; }
.result-prompts { display: grid; gap: 7px; margin-top: 9px; }
.result-prompts > div { padding-top: 8px; border-top: 1px solid var(--line); }
.preserve-lines { white-space: pre-wrap; }

.toast-stack { position: fixed; top: 88px; right: 20px; z-index: 200; display: grid; gap: 8px; }
.toast { width: min(340px, calc(100vw - 40px)); padding: 11px 13px; color: #fff; background: #26322e; border-radius: 6px; box-shadow: 0 12px 34px rgba(0,0,0,.18); font-size: 12px; animation: toast-in .16s ease-out; }
.toast.is-error { background: #9d342f; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }

.segmented { display: inline-flex; padding: 3px; background: var(--surface-strong); border-radius: 6px; }
.segment { min-height: 29px; padding: 4px 10px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; }
.segment.is-active { color: var(--text); background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.stat-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; color: #0a6746; background: var(--green-soft); border: 1px solid #cae8da; border-radius: 5px; font-weight: 800; }
.avatar-image { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 4px; }
.identity-cell { display: flex; align-items: center; gap: 9px; }
.code-preview { max-height: 420px; overflow: auto; margin: 0; padding: 13px; color: #dfe8e4; background: #17201d; border-radius: 6px; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }

.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px; align-items: start; }
.settings-tabs { display: grid; gap: 4px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.settings-tab { min-height: 40px; display: flex; align-items: center; gap: 9px; padding: 7px 9px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 5px; text-align: left; font-weight: 650; }
.settings-tab svg { width: 17px; height: 17px; }
.settings-tab:hover { color: var(--text); background: var(--surface-soft); }
.settings-tab.is-active { color: var(--green-dark); background: var(--green-soft); border-color: #c4e5d6; }
.settings-content { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.settings-content-head { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.settings-content-head h2 { margin: 0; font-size: 17px; }
.settings-content-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.setting-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.setting-value { min-width: 0; padding: 13px 15px; background: #fff; }
.setting-value span { display: block; color: var(--muted); font-size: 10px; }
.setting-value strong { display: block; margin-top: 5px; overflow-wrap: anywhere; font-size: 12px; }
.environment-switch-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.environment-switch-panel > div:first-child { min-width: 0; display: grid; gap: 4px; }
.environment-switch-panel strong { font-size: 13px; }
.environment-switch-panel span { color: var(--muted); font-size: 11px; }
.environment-segmented { flex: 0 0 auto; display: grid; grid-template-columns: repeat(2, 104px); padding: 3px; background: var(--surface-strong); border: 1px solid var(--line); border-radius: var(--radius); }
.environment-segment { min-height: 34px; padding: 0 10px; color: var(--muted); background: transparent; border: 0; border-radius: 4px; font-size: 12px; font-weight: 700; }
.environment-segment:hover:not(:disabled) { color: var(--text); background: #fff; }
.environment-segment.is-active { color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 0 0 1px #bfd7e9; cursor: default; }
.environment-segment.is-active.is-production { color: var(--red); background: var(--red-soft); box-shadow: inset 0 0 0 1px #efc0bc; }
.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
.integration-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.integration-card > header, .integration-account-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.integration-card h3 { margin: 0; font-size: 14px; }
.integration-card p, .integration-account-head span { display: block; margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.integration-account { display: grid; gap: 8px; margin: 10px 0; padding: 10px; background: var(--surface-soft); border-radius: 5px; }
.credential-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.credential-row div { min-width: 0; }
.credential-row strong, .credential-row span { display: block; }
.credential-row span { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.settings-muted { padding: 12px 0; color: var(--muted); font-size: 11px; }
.package-path { max-width: 320px; }
.app-icon-panel { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; padding: 16px; border-bottom: 1px solid var(--line); }
.app-icon-panel img { width: 132px; height: 132px; object-fit: cover; border: 1px solid var(--line); border-radius: 22px; }
.app-icon-copy { min-width: 0; }
.app-icon-copy h3, .settings-subhead h3 { margin: 0; font-size: 14px; }
.app-icon-copy p { margin: 5px 0 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.app-icon-form { display: flex; align-items: center; gap: 8px; margin-top: 13px; }
.app-icon-form .input { flex: 1 1 280px; padding: 6px; }
.settings-subhead { padding: 12px 15px; border-bottom: 1px solid var(--line); }
.cadence-count-select { min-width: 132px; }
.cadence-template-list { display: grid; gap: 10px; padding: 12px; }
.cadence-template-form { overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.cadence-template-form > header { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.cadence-template-form h3 { margin: 0; font-size: 14px; }
.cadence-template-form header span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.cadence-template-slots { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 1px; background: var(--line); }
.cadence-template-slot { min-width: 0; display: grid; align-content: start; gap: 8px; padding: 11px; background: #fff; }
.cadence-template-slot > strong { font-size: 12px; }
.cadence-template-slot .field { gap: 4px; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 44px; }
.input-suffix span { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); color: var(--muted); font-size: 10px; pointer-events: none; }
.workspace-settings-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); }
.image-import-panel { display: grid; grid-template-columns: minmax(180px, .8fr) repeat(2, minmax(220px, 1fr)) auto; align-items: end; gap: 10px; padding: 14px 16px; }
.image-import-panel .input { padding: 6px; }
.operation-progress { min-height: 18px; grid-column: 1 / -1; color: var(--green-dark); font-size: 12px; }
.operation-progress:empty { display: none; }
.inline-spinner { width: 14px; height: 14px; flex: 0 0 auto; border: 2px solid rgba(255,255,255,.45); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
.inline-spinner-dark { border-color: rgba(8,123,84,.25); border-top-color: var(--green-dark); }
.media-gallery-filters { display: flex; align-items: end; gap: 8px; }
.media-gallery-filters label { display: grid; gap: 4px; color: var(--muted); font-size: 10px; }
.media-gallery-filters .select { min-width: 160px; }
.media-gallery-filters label:nth-child(3) .select { min-width: 240px; }
.media-assets-section { overflow: visible; }
.media-assets-fixed-panel { position: sticky; top: var(--topbar-height, 78px); z-index: 20; background: rgba(255,255,255,.97); box-shadow: 0 1px 0 var(--line); backdrop-filter: blur(10px); }
.media-assets-section #mediaGalleryContent { overflow: visible; }
.media-assets-section > .pagination { background: #fff; }
.media-batch-progress { min-height: 58px; display: flex; align-items: center; gap: 22px; padding: 10px 15px; border-bottom: 1px solid var(--line); background: #fbfcfb; }
.media-batch-progress > div { min-width: 80px; display: grid; gap: 3px; }
.media-batch-progress span { color: var(--muted); font-size: 10px; }
.media-batch-progress strong { font-size: 14px; }
.media-batch-status, .media-missing-status { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; font-size: 11px; font-weight: 700; }
.media-missing-actions { display: inline-flex; align-items: center; gap: 5px; }
.media-missing-link { width: 27px; height: 27px; display: inline-grid; place-items: center; padding: 0; color: var(--red); background: #fff; border: 1px solid #efc2be; border-radius: 50%; cursor: pointer; }
.media-missing-link:hover { color: #fff; background: var(--red); border-color: var(--red); }
.media-missing-link svg { width: 14px; height: 14px; }
.media-batch-status { min-height: 32px; margin-left: auto; padding: 6px 12px; }
.media-batch-status.is-complete { color: var(--green-dark); background: var(--green-soft); border: 1px solid #bfe0d0; }
button.media-batch-status.is-incomplete, .media-missing-status { color: var(--red); background: var(--red-soft); border: 1px solid #efc2be; }
button.media-batch-status.is-incomplete:hover, .media-missing-status:hover { border-color: var(--red); box-shadow: 0 0 0 3px rgba(179,59,53,.08); }
.media-missing-status { min-height: 25px; padding: 4px 8px; }
.package-missing-linkage { display: flex; align-items: center; gap: 18px; padding: 12px 14px; color: #7f2925; background: var(--red-soft); border: 1px solid #efc2be; border-radius: var(--radius); }
.package-missing-linkage > div:first-child { display: grid; gap: 2px; }
.package-missing-linkage > div:first-child span { font-size: 11px; }
.package-missing-linkage-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.package-image-prompt-target { padding: 4px; border-radius: 8px; transition: background .18s ease, box-shadow .18s ease; }
.package-image-prompt-target.is-missing-prompt-target { background: #fff5f3; box-shadow: 0 0 0 3px rgba(179,59,53,.42); }
.media-gallery-summary { padding: 10px 15px; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line); }
.loading-inline { min-height: 150px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.media-package-focus { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 15px; color: var(--green-dark); background: #edf8f2; border-bottom: 1px solid #c9e4d6; }
.media-package-focus[hidden] { display: none; }
.media-package-focus div { min-width: 0; display: grid; gap: 3px; }
.media-package-focus strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.media-package-focus span { color: var(--muted); font-size: 10px; }
.media-gallery { display: grid; }
.media-gallery-group { min-width: 0; border-bottom: 1px solid var(--line); }
.media-gallery-group.is-complete { background: #f2fbf6; box-shadow: inset 4px 0 var(--green); }
.media-gallery-group.is-incomplete { background: #fff7f6; box-shadow: inset 4px 0 var(--red); }
.media-gallery-group.is-complete .media-gallery-meta { background: #ebf8f1; }
.media-gallery-group.is-incomplete .media-gallery-meta { background: #fff0ee; }
.media-gallery-group.is-missing-target { outline: 3px solid rgba(179,59,53,.35); outline-offset: -3px; }
.media-gallery-group:last-child { border-bottom: 0; }
.media-gallery-meta { min-height: 66px; display: grid; grid-template-columns: minmax(180px, 1.25fr) minmax(170px, 1fr) minmax(190px, 1fr) 95px 150px auto; align-items: center; gap: 16px; padding: 10px 15px; background: var(--surface-soft); }
.media-gallery-meta > div { min-width: 0; }
.media-gallery-meta span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.media-gallery-meta strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.media-video-id { display: block; overflow: hidden; margin-top: 4px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.media-gallery-assets { min-height: 132px; display: flex; align-items: start; gap: 12px; overflow-x: auto; padding: 13px 15px 15px; }
.media-gallery-empty { min-height: 90px; display: flex; align-items: center; padding: 0 10px; color: var(--red); font-size: 12px; }
.media-gallery-item { width: 150px; flex: 0 0 150px; }
.media-gallery-thumb { width: 150px; height: 84px; display: block; overflow: hidden; padding: 0; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 5px; }
.media-gallery-thumb:hover { border-color: var(--green); box-shadow: 0 0 0 3px rgba(8,123,84,.09); }
.media-gallery-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.media-gallery-name { width: 100%; display: flex; align-items: center; justify-content: center; gap: 4px; overflow: hidden; padding: 7px 3px 0; color: var(--green-dark); background: transparent; border: 0; font-size: 11px; }
.media-gallery-name:hover span, .media-viewer-filename:hover { text-decoration: underline; }
.media-gallery-name svg { width: 13px; height: 13px; flex: 0 0 auto; }
.media-gallery-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-viewer { position: fixed; inset: 0; z-index: 300; display: grid; grid-template-rows: 68px minmax(0, 1fr) 18px; color: #fff; background: rgba(8,12,11,.96); transition: grid-template-rows .22s ease; }
.media-viewer.is-strip-open { grid-template-rows: 68px minmax(0, 1fr) 142px; }
.media-viewer > header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 22px; border-bottom: 1px solid rgba(255,255,255,.12); }
.media-viewer > header div { min-width: 0; }
.media-viewer > header strong, .media-viewer > header span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-viewer > header strong { font-size: 15px; }
.media-viewer > header span { margin-top: 4px; color: rgba(255,255,255,.6); font-size: 11px; }
.media-viewer-close { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; padding: 0; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.2); border-radius: 50%; }
.media-viewer-close:hover { background: rgba(255,255,255,.16); }
.media-viewer-stage { position: relative; min-height: 0; display: grid; place-items: center; overflow: hidden; padding: 26px 96px; }
.media-viewer-stage > img { max-width: 100%; max-height: 100%; display: block; object-fit: contain; box-shadow: 0 18px 55px rgba(0,0,0,.34); }
.media-viewer-arrow { position: absolute; top: 50%; width: 46px; height: 64px; display: grid; place-items: center; padding: 0; transform: translateY(-50%); color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 7px; }
.media-viewer-arrow:hover { background: rgba(255,255,255,.18); }
.media-viewer-arrow.is-left { left: 22px; }
.media-viewer-arrow.is-right { right: 22px; }
.media-viewer-strip { min-height: 0; overflow: hidden; background: rgba(0,0,0,.58); border-top: 1px solid rgba(255,255,255,.12); }
.media-viewer-strip-handle { width: 100%; height: 18px; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0; color: rgba(255,255,255,.72); background: rgba(255,255,255,.06); border: 0; font-size: 9px; }
.media-viewer-strip-handle svg { width: 12px; height: 12px; transition: transform .22s ease; }
.media-viewer.is-strip-open .media-viewer-strip-handle svg { transform: rotate(180deg); }
.media-viewer-strip-content { height: 124px; display: flex; align-items: start; justify-content: center; gap: 10px; overflow-x: auto; padding: 7px 20px 10px; opacity: 0; transition: opacity .14s ease .03s; }
.media-viewer.is-strip-open .media-viewer-strip-content { opacity: 1; }
.media-viewer-strip-content article { width: 126px; flex: 0 0 126px; padding: 4px; border: 2px solid transparent; border-radius: 6px; }
.media-viewer-strip-content article.is-active { border-color: #4bd09b; background: rgba(75,208,155,.1); }
.media-viewer-mini { width: 114px; height: 64px; display: block; overflow: hidden; padding: 0; background: #202a27; border: 0; border-radius: 4px; }
.media-viewer-mini img { width: 100%; height: 100%; display: block; object-fit: cover; }
.media-viewer-filename { width: 100%; overflow: hidden; padding: 6px 2px 1px; color: rgba(255,255,255,.82); background: transparent; border: 0; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-required { min-height: 118px; display: flex; align-items: center; gap: 13px; padding: 18px; }
.workspace-required > span { width: 42px; height: 42px; display: grid; place-items: center; color: var(--green-dark); background: var(--green-soft); border-radius: 6px; }
.workspace-required > span svg { width: 20px; height: 20px; }
.workspace-required div { min-width: 0; flex: 1; }
.workspace-required strong { font-size: 13px; }
.workspace-required p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }

@media (max-width: 1500px) {
  .package-list-page > .section > .section-head { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
  .package-filter-bar { width: 100%; grid-template-columns: 155px minmax(180px, 1fr) 145px; grid-template-areas: "search search sync" "date channel status"; }
}
@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .media-gallery-filters { width: 100%; flex-wrap: wrap; }
  .media-gallery-filters label { flex: 1 1 180px; }
  .media-gallery-filters .select, .media-gallery-filters label:last-child .select { width: 100%; min-width: 0; }
  .package-modules { display: block; }
  .package-module { border-right: 0; border-bottom: 1px solid var(--line); }
  .package-module:last-child { border-bottom: 0; }
  .cadence-template-slots { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .image-import-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-gallery-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .app-shell.is-workspace-scroll-locked { height: auto; overflow: visible; }
  .app-shell.is-workspace-scroll-locked .main-area { height: auto; display: block; overflow: visible; }
  .sidebar, .app-shell.is-collapsed .sidebar { position: fixed; left: -240px; width: 224px; transition: left .18s ease; box-shadow: 16px 0 50px rgba(0,0,0,.24); }
  .app-shell.mobile-nav-open .sidebar { left: 0; }
  .app-shell.is-collapsed .brand-copy, .app-shell.is-collapsed .nav-item span, .app-shell.is-collapsed .nav-label, .app-shell.is-collapsed .sidebar-foot div { display: flex; }
  .app-shell.is-collapsed .sidebar-toggle { position: static; }
  .app-shell.is-collapsed .nav-list { padding-top: 12px; }
  .app-shell.is-collapsed .nav-item { justify-content: flex-start; padding: 8px 10px; }
  .topbar { min-height: 68px; padding: 10px 14px; }
  .media-assets-fixed-panel { top: var(--topbar-height, 68px); }
  .media-batch-progress { align-items: stretch; flex-wrap: wrap; gap: 10px 18px; }
  .media-batch-status { width: 100%; margin-left: 0; }
  .mobile-menu { display: inline-grid; }
  .topbar-title h1 { font-size: 20px; }
  .media-gallery-meta { grid-template-columns: 1fr 1fr; gap: 10px; }
  .media-gallery-meta .button { width: 100%; }
  .media-viewer { grid-template-rows: 62px minmax(0, 1fr) 18px; }
  .media-viewer.is-strip-open { grid-template-rows: 62px minmax(0, 1fr) 124px; }
  .media-viewer-stage { padding: 12px 48px; }
  .media-viewer-arrow { width: 36px; height: 50px; }
  .media-viewer-arrow.is-left { left: 7px; }
  .media-viewer-arrow.is-right { right: 7px; }
  .media-viewer-strip-content { height: 106px; justify-content: flex-start; padding: 7px 9px; }
  .breadcrumb, .db-state { display: none; }
  .view-root { padding: 13px 12px 28px; }
  .view-root.is-workspace-scroll-locked { height: auto; overflow: visible; padding-bottom: 28px; }
  .drama-progress-page { height: auto; display: grid; }
  .drama-progress-page > .section { display: block; overflow: visible; }
  .drama-progress-page .drama-progress-table { max-height: none; flex: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { min-height: 94px; padding: 12px; }
  .kpi-value { font-size: 25px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .toolbar { width: 100%; }
  .toolbar .button { flex: 1; }
  .demo-banner { align-items: stretch; flex-direction: column; }
  .demo-banner-actions { margin-left: 0; }
  .demo-banner-actions .button { flex: 1; }
  .package-card-head { align-items: center; flex-wrap: wrap; }
  .package-list-page > .section > .section-head { top: var(--topbar-height, 68px); display: flex; }
  .package-filter-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "search search" "date status" "channel channel" "sync sync"; }
  .package-filter-sync { min-height: 46px; }
  .package-head-meta { flex: 1 1 100%; flex-wrap: wrap; white-space: normal; }
  .package-card-actions { justify-content: flex-start; }
  .package-modules { grid-template-columns: 1fr; }
  .package-module, .package-module:nth-child(2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .package-module:last-child { border-bottom: 0; }
  .package-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .package-summary > div:nth-child(2) { border-right: 0; }
  .package-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .title-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .production-node-grid, .language-grid { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setting-grid, .integration-grid { grid-template-columns: 1fr; }
  .environment-switch-panel { align-items: stretch; flex-direction: column; }
  .environment-segmented { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-icon-panel { grid-template-columns: 88px minmax(0, 1fr); }
  .app-icon-panel img { width: 88px; height: 88px; border-radius: 15px; }
  .app-icon-form { align-items: stretch; flex-direction: column; }
  .cadence-template-slots { grid-template-columns: 1fr; }
  .workspace-settings-form, .image-import-panel { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 7px 7px 0 0; }
  .drawer { width: 100%; }
  .channel-hub-identity, .hub-columns { grid-template-columns: 1fr; }
  .topbar-actions .button span { display: none; }
  .scroll-top-button { right: 14px; bottom: 18px; }
}
