.commerce-body { min-height:100vh; margin:0; color:var(--creator-text); background:var(--creator-black); font:15px system-ui,sans-serif; }
.commerce-body .production-page { max-width:1200px; }
.commerce-body .production-surface { border:1px solid var(--creator-line); border-radius:12px; background:var(--creator-dialog); }
.commerce-body :is(.primary-button,.secondary-button) { display:inline-flex; align-items:center; justify-content:center; min-height:36px; padding:6px 13px; border:1px solid var(--creator-line); border-radius:8px; color:var(--creator-text); background:var(--creator-control); font:inherit; font-weight:600; text-decoration:none; white-space:nowrap; transition:background .16s,border-color .16s; }
.commerce-body .primary-button { border-color:#a2ee7c; color:var(--creator-accent-ink); background:var(--creator-action-fill); }
.commerce-body .secondary-button:not(:disabled):hover { border-color:var(--creator-edge); background:var(--creator-hover); }
.commerce-body .primary-button:not(:disabled):hover { background:var(--creator-action-fill-hover); }
.commerce-body .primary-button:disabled { border-color:#383838; color:#a4a4a4; background:#252525; }
.commerce-body .modal-content { border:1px solid #3a3a3a; border-radius:13px; color:var(--creator-text); background:var(--creator-dialog); }
.commerce-body .production-field-error { color:#ffb8c7; }
.commerce-body #commerce-message[data-tone=success] { color:#a7edd2; }
.commerce-creator-bar { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px clamp(16px,4vw,56px); border-bottom:1px solid #2e2e2e; background:#181818; }
.commerce-creator-bar > div, .commerce-creator-brand { display:flex; align-items:center; gap:12px; }
.commerce-creator-brand { color:#f2f2f2; text-decoration:none; font-weight:730; }
.commerce-creator-brand img, .commerce-creator-brand svg { width:34px; height:34px; color:var(--creator-accent); }
.commerce-balance { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.commerce-balance p { color:#b9b6cd; margin:8px 0 0; }
.commerce-balance p strong { color:#e2d3ff; font-variant-numeric:tabular-nums; }
.commerce-block { margin-top:26px; }
.commerce-packages { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(100%,225px),1fr)); gap:12px; margin-top:12px; }
.commerce-package { padding:18px; }
.commerce-package h3 { font-size:15px; margin:0 0 5px; overflow-wrap:anywhere; }
.commerce-package p { margin:6px 0 16px; color:#b9b6cd; }
.commerce-package p strong { font-size:24px; color:#eeebff; }
.commerce-package > div { display:flex; align-items:center; justify-content:space-between; gap:10px; color:#d5c4ff; font-weight:700; }
.commerce-note { margin:12px 0 0; color:#b9b6cd; }
.commerce-site, .commerce-records { padding:16px; }
.commerce-site-facts { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,235px),1fr)); gap:12px; margin:0 0 16px; }
.commerce-site-facts > div { min-height:92px; padding:12px; border:1px solid #ffffff16; border-radius:10px; background:#10101b55; }
.commerce-site-facts dt, .commerce-order-facts dt { color:#b6b2c9; font-size:13px; font-weight:550; }
.commerce-site-facts dd { margin:5px 0 0; overflow-wrap:anywhere; }
.commerce-site-facts .commerce-home-video-setting { grid-column:1 / -1; }
.commerce-site-facts[data-partner-quota] > div { min-height:78px; }
.commerce-site-facts[data-partner-quota] dd { font-size:22px; font-weight:650; line-height:1.2; font-variant-numeric:tabular-nums; }
.commerce-home-video { display:block; width:min(100%,360px); aspect-ratio:16 / 9; margin-top:8px; border-radius:8px; background:#080910; }
.commerce-home-copy, .commerce-home-video-field { margin-top:16px; padding-top:16px; border-top:1px solid #ffffff16; }
.commerce-home-copy { min-width:0; }
.commerce-home-copy legend { float:none; width:auto; margin:0; font-size:15px; font-weight:650; }
.commerce-home-copy > p { margin:4px 0 12px; color:#b6b2c9; font-size:12px; }
.commerce-video-progress:not(:empty) { display:block; margin-top:8px; color:#a2eafa; }
.commerce-tabs, .commerce-toolbar, .commerce-pages, .commerce-numbers { display:flex; align-items:center; flex-wrap:wrap; gap:7px; }
.commerce-tabs { margin:0 0 12px; }
.commerce-tabs a { text-decoration:none; }
.commerce-tabs [aria-current=page], .commerce-pages [aria-current=page] { background:#372957; border-color:#7d63bf; color:#fff; }
.commerce-toolbar { margin-bottom:12px; }
.commerce-records h2 + .commerce-toolbar { margin-top:12px; }
.commerce-toolbar input { width:min(100%,270px); }
.commerce-toolbar select { width:auto; }
.commerce-add { margin-left:auto; }
.commerce-table { --bs-table-bg:transparent; --bs-table-color:#e9e6f6; --bs-table-border-color:#ffffff16; margin:0; }
.commerce-table th { color:#b6b2c9; font-size:13px; font-weight:600; white-space:nowrap; }
.commerce-table th, .commerce-table td { padding:10px 8px; vertical-align:middle; }
.commerce-table td { min-width:65px; overflow-wrap:anywhere; }
.commerce-table td small { display:block; margin-top:2px; color:#b6b2c9; }
.commerce-table td code { color:#dbcaff; }
.commerce-table .secondary-button { white-space:nowrap; }
.commerce-empty { color:#aaa5c2 !important; text-align:center; }
.commerce-image, .commerce-logo { display:block; width:60px; height:52px; object-fit:contain; }
.commerce-image { border-radius:5px; background:#f4f3f8; }
.commerce-pager { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px; margin-top:13px; color:#b6b2c9; }
.commerce-pages[hidden], .commerce-form [hidden] { display:none; }
.commerce-pages button:disabled { opacity:.45; }
.commerce-state { display:inline-flex; padding:3px 8px; border-radius:5px; color:#d7cde7; background:#2c2640; font-size:12px; white-space:nowrap; }
.commerce-state:is([data-state=paid],[data-state=active],[data-state=used]) { color:#a7edd2; background:#183930; }
.commerce-state[data-state=review] { color:#ffd99f; background:#412f20; }
.commerce-state:is([data-state=rejected],[data-state=revoked]) { color:#ffc5cf; background:#422633; }
.commerce-state:is([data-state=disabled],[data-state=expired]) { color:#c1bbce; background:#2b2a37; }
.commerce-form { display:flex; min-height:0; flex-direction:column; overflow:hidden; }
.commerce-form p:last-child { margin-bottom:0; }
.commerce-field { display:grid; gap:5px; margin-bottom:11px; color:#eae4f8; }
.commerce-field small { color:#b6b2c9; }
.commerce-check { display:block; margin:-4px 0 12px; }
.commerce-order-facts { display:grid; grid-template-columns:max-content minmax(0,1fr); gap:6px 14px; }
.commerce-order-facts dd { margin:0; overflow-wrap:anywhere; }
.commerce-codes { resize:vertical; font-family:monospace; margin-bottom:9px; }
.commerce-qr { display:block; width:210px; max-width:100%; height:auto; margin:14px auto; padding:8px; border-radius:8px; background:#fff; }
#commerce-message[data-tone=error] { color:#ffb8c7; }
@media(max-width:575px) {
  .commerce-creator-bar > div > span { display:none; }
  .commerce-toolbar input { width:100%; }
  .commerce-add { margin-left:0; }
}.commerce-payment-options { display:grid; gap:9px; }
.commerce-payment-options button { justify-content:flex-start; padding:12px 15px; }
.commerce-key { font-family:monospace; resize:vertical; }
.commerce-payment-box { padding:14px; border:1px solid #ffffff20; border-radius:10px; background:#201c31; text-align:center; }
.commerce-payment-box canvas { image-rendering:pixelated; }
.commerce-payment-box .commerce-qr { margin:4px auto 14px; max-width:100%; }
.commerce-payment-box a { margin-top:9px; }

/* Homepage short-drama management */
#home-drama-admin { overflow:hidden; }
.home-drama-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px 20px; padding:18px 20px; }
.home-drama-filters, .home-drama-filter-actions, .home-drama-admin-actions { display:flex; align-items:center; gap:8px; }
.home-drama-filters input { width:clamp(145px,18vw,248px); }
.home-drama-filters select { width:clamp(120px,12vw,155px); }
.home-drama-filters :is(input,select) { min-height:38px; font-size:13px; }
.home-drama-toolbar :is(button,a) { white-space:nowrap; }
.home-drama-table { width:100%; border-collapse:collapse; }
.home-drama-table thead { background:#ffffff05; }
.home-drama-table :is(th,td) { padding:12px 16px; border-top:1px solid #ffffff12; }
.home-drama-table :is(th,td):first-child { padding-left:20px; }
.home-drama-table :is(th,td):last-child { padding-right:20px; }
.home-drama-table th:first-child { width:37%; }
.home-drama-table th:last-child { width:1%; }
.home-drama-table tbody tr:hover { background:#ffffff03; }
.home-drama-table-title { display:flex; align-items:center; gap:12px; min-width:0; }
.home-drama-table-title > :is(img,span) { flex:none; display:grid; place-items:center; width:66px; height:42px; border-radius:8px; object-fit:cover; background:#222036; color:#c9aff9; }
.home-drama-table-title > div { min-width:0; }
.home-drama-table-title strong { overflow-wrap:anywhere; }
.home-drama-table-title small { max-width:35ch; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.home-drama-category { display:inline-block; padding:3px 8px; border:1px solid #b9abef34; border-radius:7px; background:#9e84e712; color:#e0d6fb; font-size:12px; overflow-wrap:anywhere; }
.home-drama-category.is-unset { border-color:#ffffff18; background:#ffffff06; color:#b7b3ca; }
.home-drama-row-actions .secondary-button { padding-inline:9px; }
.home-drama-row-actions [data-drama-delete]:hover { border-color:#fb71856b; color:#fda4af; background:#ef44441a; }
.home-drama-table td.commerce-empty { padding:46px 16px; }
.home-drama-empty-copy { display:grid; gap:5px; }
.home-drama-empty-copy strong { font-size:15px; color:#f4f1ff; }
#home-drama-admin .commerce-pager { margin:0; padding:12px 20px; border-top:1px solid #ffffff12; font-size:13px; }
#home-drama-modal > .modal-dialog {
  width:min(640px, calc(100% - 2 * var(--studio-modal-inset)));
  max-width:none;
  height:calc(100% - 2 * var(--studio-modal-inset));
  margin:var(--studio-modal-inset) auto;
}
#home-drama-modal > .modal-dialog > .modal-content { height:auto; max-height:100%; }
#home-drama-modal .modal-body { --studio-scroll-thumb:#49475c; scrollbar-gutter:auto; }
#home-drama-modal .production-field-error:empty { display:none; }
.home-drama-form-grid { display:grid; align-items:start; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; }
.home-drama-form-grid .commerce-field { min-width:0; }
.home-drama-category-heading { display:flex; align-items:center; justify-content:space-between; gap:4px 8px; flex-wrap:wrap; }
.home-drama-category-toggle { padding:0; border:0; border-radius:3px; background:transparent; color:#c9b8fb; font-size:12px; }
.home-drama-category-toggle:hover { color:#f0e8ff; text-decoration:underline; }
.home-drama-category-field > .form-select { min-height:38px; }
.home-drama-category-create { display:grid; gap:5px; }
.home-drama-media-grid .form-control { font-size:13px; }
.home-drama-admin-preview { width:100%; max-height:165px; margin-bottom:12px; background:#0a0b13; }
@media(max-width:1050px) {
  .home-drama-table, .home-drama-table tbody { display:block; }
  .home-drama-table thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .home-drama-table tbody tr { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); align-items:start; gap:12px 8px; padding:14px 20px; border-top:1px solid #ffffff12; }
  .home-drama-table tbody td:is(:first-child,:last-child), .home-drama-table tbody td { min-width:0; padding:0; border:0; }
  .home-drama-table td[data-label]::before { content:attr(data-label); display:block; margin-bottom:4px; color:#b6b2c9; font-size:12px; }
  .home-drama-table :is(.home-drama-work,.home-drama-row-actions,.commerce-empty) { grid-column:1/-1; }
  .home-drama-table td.commerce-empty { padding:30px 0; }
  .home-drama-row-actions .home-drama-admin-actions { flex-wrap:wrap; }
}
@media(max-width:520px) {
  .home-drama-toolbar, .home-drama-table tbody tr, #home-drama-admin .commerce-pager { padding-inline:12px; }
  .home-drama-toolbar { align-items:stretch; }
  .home-drama-filters { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); width:100%; }
  .home-drama-filters :is(input,select) { width:100%; }
  .home-drama-filter-actions { grid-column:1/-1; }
  .home-drama-toolbar > .home-drama-admin-actions { width:100%; justify-content:flex-end; padding-top:10px; border-top:1px solid #ffffff12; }
  .home-drama-table-title small { max-width:100%; }
  .home-drama-media-grid { grid-template-columns:minmax(0,1fr); gap:0; }
}

.template-import-help { color: var(--creator-muted); font-size: 13px; line-height: 1.65; }
.template-import-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.template-import-summary > div { display: grid; gap: 5px; flex: 1 1 140px; padding: 10px 12px; border: 1px solid var(--creator-line); border-radius: 9px; }
.template-import-summary span { color: var(--creator-muted); font-size: 12px; }
.template-import-preview { max-height: 280px; margin-bottom: 14px; overflow: auto; border: 1px solid var(--creator-line); border-radius: 9px; }
.template-import-preview .commerce-table { width: 100%; margin: 0; table-layout: fixed; }
.template-import-preview :is(th, td) { padding: 9px 12px; overflow-wrap: anywhere; }
.template-import-preview th:first-child { width: 27%; }
.template-import-preview th:last-child { width: 72px; }

#template-admin { min-width:0; overflow:hidden; }
.template-admin-nav { border-bottom:1px solid #ffffff12; }
.template-admin-tabs { display:flex; flex-wrap:wrap; gap:4px; padding:4px; border:1px solid #ffffff14; border-radius:10px; background:#08091166; }
.template-admin-tab { display:block; padding:6px 12px; border:1px solid transparent; border-radius:7px; color:#b6b2c9; font-size:13px; text-decoration:none; }
.template-admin-tab:is(:hover,[aria-current=page]) { color:#f4f1ff; background:#ffffff0c; }
.template-admin-tab[aria-current=page] { background:#a08be824; border-color:#a08be833; font-weight:600; }
#template-admin .home-drama-toolbar > .home-drama-admin-actions { flex-wrap:wrap; }
.template-admin-status { margin:0 20px 14px; padding:9px 12px; border:1px solid #86ddbc35; border-radius:8px; background:#86ddbc10; color:#a7edd2; font-size:13px; }
.template-admin-status[data-kind=error] { border-color:#fda4af40; background:#ef444414; color:#ffc5cf; }
.template-admin-status:empty, #template-admin :is(#template-admin-publish,#template-admin-archive)[hidden] { display:none; }
.template-admin-table th:first-child { width:auto; }
.template-admin-table th:not(:first-child) { width:1%; }
#template-admin[data-tab=templates] .template-admin-table th:nth-child(2) { width:19%; }
.template-admin-table .template-action-heading { text-align:right; }
.template-admin-table .home-drama-table-title strong { line-height:1.5; }
.template-admin-table .home-drama-table-title > :is(img,span) { width:60px; height:48px; }
.template-cover-meta { display:flex; align-items:center; flex-wrap:wrap; gap:3px 8px; margin-top:4px; }
.template-cover-meta .commerce-state { font-size:11px; }
.template-cover-meta button { background:none; border:0; border-radius:4px; padding:2px; color:#c9efff; font-size:12px; }
.template-cover-meta button:hover { text-decoration:underline; }
.template-cover-meta button:disabled { opacity:.65; }
.template-admin-table .template-cover-empty { font-size:11px; color:#b6b2c9; }
.template-admin-table .template-order { font-variant-numeric:tabular-nums; }
.template-admin-table .home-drama-row-actions > div { flex-wrap:nowrap; justify-content:flex-end; }
.template-admin-table [data-template-publication] { color:#c9efff; }
.template-admin-table [data-template-delete]:hover { border-color:#fb71856b; color:#fda4af; background:#ef44441a; }
#template-admin .commerce-pager { margin:0; padding:12px 20px; border-top:1px solid #ffffff12; font-size:13px; }
#template-editor-error:empty { display:none; }
@media(max-width:1050px) {
  .template-admin-table tbody tr { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .template-admin-table .home-drama-row-actions > div { flex-wrap:wrap; }
}
@media(max-width:520px) {
  .template-admin-status { margin-inline:12px; }
  #template-admin .commerce-pager { padding-inline:12px; }
}
