:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --muted-light: #94a3b8;
  --line: #e2e8f0;
  --line-subtle: #f1f5f9;
  --brand: #ea580c;
  --brand-dark: #c2410c;
  --brand-light: #ffedd5;
  --teal: #0f766e;
  --blue: #2563eb;
  --green: #10b981;
  --red: #ef4444;
  --amber: #f59e0b;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 14px -2px rgba(15, 23, 42, 0.06), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 32px -4px rgba(15, 23, 42, 0.07), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --radius: 20px;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  scroll-padding-top: 86px;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--ink);
  background: radial-gradient(circle at 10% 0, rgba(249, 115, 22, 0.05) 0, transparent 40rem),
              radial-gradient(circle at 90% 10%, rgba(14, 165, 233, 0.04) 0, transparent 40rem),
              #f8fafc;
  font-family: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; }
button.is-api-loading, [role="button"].is-api-loading {
  position: relative !important;
  pointer-events: none !important;
  cursor: wait !important;
  color: transparent !important;
}
button.is-api-loading > *, [role="button"].is-api-loading > * { visibility: hidden !important; }
button.is-api-loading::after, [role="button"].is-api-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -10px 0 0 -10px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  color: #64748b;
  animation: api-button-spin .7s linear infinite;
}
button.primary.is-api-loading::after { color: #fff; }
@keyframes api-button-spin { to { transform: rotate(360deg); } }
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  padding-right: 38px !important;
  cursor: pointer;
}
select::-ms-expand { display: none; }
select:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ea580c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
select:disabled, .field.is-disabled select {
  cursor: not-allowed;
  background-color: #f1f5f9;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}
h1,h2,h3,strong,b { text-rendering: optimizeLegibility; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
.is-hidden { display: none !important; }

.app-shell { width: min(100%,1660px); margin: 0 auto; padding: 0 clamp(20px,3vw,48px) 72px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 4px 16px -4px rgba(15, 23, 42, 0.04);
}
.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; text-decoration: none; transition: opacity .16s ease; flex-shrink: 0; }
.brand:hover { opacity: .9; }
.brand-mark { width: 36px; height: 36px; display: block; flex: 0 0 36px; filter: drop-shadow(0 4px 10px rgba(234,88,12,.25)); }
.brand-mark img { display: block; width: 100%; height: 100%; }
.brand-copy strong, .brand-copy small, .brand strong, .brand small { display: block; }
.brand strong { font-size: 1.08rem; font-weight: 850; letter-spacing: -.03em; color: var(--ink); line-height: 1.1; }
.brand small { margin-top: 2px; color: #ea580c; font-size: .68rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.nav-tabs { align-self: center; display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid rgba(226,232,240,.9); border-radius: 14px; background: rgba(241,245,249,.85); box-shadow: inset 0 1px 2px rgba(15,23,42,.03); white-space: nowrap; flex-shrink: 0; }
.nav-tabs a { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 38px; min-height: 38px; padding: 0 14px; border-radius: 10px; color: #64748b; font-size: .84rem; font-weight: 650; letter-spacing: -.01em; transition: all .18s cubic-bezier(0.16,1,0.3,1); text-decoration: none; white-space: nowrap; flex-shrink: 0; }
.nav-tabs a span { white-space: nowrap; display: inline-block; }
.nav-tabs a:hover { color: #0f172a; background: rgba(255,255,255,.7); }
.nav-tabs a.active { color: #0f172a; background: #ffffff; box-shadow: 0 2px 8px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04); font-weight: 750; }
.nav-tabs a.active::after { display: none; }
.nav-tabs a > i { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 24px; border-radius: 7px; color: #64748b; background: rgba(255,255,255,.6); font-style: normal; transition: all .18s; }
.nav-tabs a > i svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-tabs a.active > i { color: #ffffff; background: linear-gradient(135deg,var(--brand),#ea580c); box-shadow: 0 3px 8px rgba(234,88,12,.32); }
.nav-toggle { display: none; width: 38px; height: 38px; padding: 0; border: 1px solid #e2e8f0; border-radius: 10px; background: #ffffff; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 1px 3px rgba(15,23,42,.04); transition: all .16s ease; flex-shrink: 0; }
.nav-toggle:hover { border-color: #cbd5e1; background: #f8fafc; }
.nav-toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #334155; transition: all .18s ease; }
.nav-badge { min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px; color: #fff; background: var(--brand); font-size: .68rem; font-weight: 800; line-height: 1; }
.nav-badge.is-zero { background: #e2e8f0; color: #64748b; }
.nav-badge.has-active { background: linear-gradient(135deg,var(--brand),#ea580c); box-shadow: 0 2px 6px rgba(234,88,12,.35); animation: pulseBadge 2s infinite; }
@keyframes pulseBadge { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.topbar-actions { justify-self: end; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.system-state { flex-shrink: 0; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; font-size: .75rem; font-weight: 750; padding: 6px 13px; border-radius: 999px; box-shadow: 0 1px 3px rgba(16,185,129,.08); letter-spacing: -.01em; }
.system-state .system-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16,185,129,.2); animation: statusPing 2.5s infinite; }
.system-state .system-text { display: inline-block; white-space: nowrap; font-size: .75rem; font-weight: 750; color: #047857; line-height: 1.2; }
@keyframes statusPing { 0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,.2); } 50% { box-shadow: 0 0 0 5px rgba(16,185,129,.35); } }
.user-menu { flex-shrink: 0; position: relative; }
.user-menu-button { display: inline-flex; align-items: center; gap: 9px; padding: 4px 12px 4px 5px; border: 1px solid #e2e8f0; border-radius: 999px; background: #ffffff; cursor: pointer; text-align: left; transition: all .16s ease; box-shadow: 0 1px 3px rgba(15,23,42,.04); }
.user-menu-button:hover { border-color: #cbd5e1; box-shadow: 0 3px 8px rgba(15,23,42,.08); }
.user-menu-button #userAvatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #ffffff; background: linear-gradient(135deg, #0ea5e9, #0284c7); font-size: .8rem; font-weight: 850; box-shadow: 0 2px 6px rgba(14,165,233,.25); }
.user-menu-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.user-menu-button strong { font-size: .76rem; font-weight: 750; color: #0f172a; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-button small { font-size: .65rem; color: #64748b; font-weight: 600; }
.user-menu-chevron { display: inline-flex; align-items: center; justify-content: center; color: #94a3b8; transition: transform .2s ease; margin-left: 2px; }
.user-menu-chevron svg { width: 14px; height: 14px; display: block; }
.user-menu.open .user-menu-chevron { transform: rotate(180deg); }
.user-menu-popover { position: absolute; z-index: 50; top: calc(100% + 8px); right: 0; width: 220px; display: none; padding: 6px; border: 1px solid #e2e8f0; border-radius: 14px; background: #ffffff; box-shadow: 0 12px 30px rgba(15,23,42,.12); }
.user-menu.open .user-menu-popover { display: grid; gap: 2px; animation: popoverIn .16s ease; }
@keyframes popoverIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.user-menu-popover a, .user-menu-popover button { width: 100%; min-height: 38px; display: flex; align-items: center; border: 0; border-radius: 9px; padding: 8px 12px; color: #475467; background: transparent; font-size: .78rem; font-weight: 700; text-align: left; transition: all .15s; }
.user-menu-popover a:hover, .user-menu-popover button:hover, .user-menu-popover a.active { color: var(--brand-dark); background: #fff7ed; }
.user-menu-popover-header { padding: 8px 12px 10px; border-bottom: 1px solid #f1f5f9; margin-bottom: 4px; }
.user-menu-popover-header strong { display: block; font-size: 0.82rem; font-weight: 750; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-popover-header small { display: block; font-size: 0.68rem; color: #64748b; margin-top: 2px; }
.auth-logout { min-height: 34px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 11px; color: #475467; background: rgba(255,255,255,.9); cursor: pointer; font-size: .74rem; font-weight: 800; }
.auth-logout:hover { border-color: var(--brand); color: var(--brand-dark); }

.view { animation: reveal .25s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 32px; padding: 50px 0 30px; }
.page-heading h1 { max-width: 980px; margin: 7px 0 10px; padding: .08em 0 .04em; overflow: visible; font-size: clamp(2.35rem,3.45vw,3.65rem); line-height: 1.12; letter-spacing: -.045em; text-wrap: balance; }
.page-heading p { margin: 0; color: var(--muted); font-size: 1rem; }
.eyebrow { color: var(--brand-dark); font-size: .72rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }

.workflow-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(300px,330px); align-items: start; gap: 24px; }
.workflow-main { display: grid; gap: 20px; }
.card { border: 1px solid rgba(218,225,232,.9); border-radius: var(--radius); background: rgba(255,255,255,.96); box-shadow: 0 12px 34px rgba(31,45,61,.07); }
.step-card { padding: clamp(22px,2.1vw,30px); }
.step-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.step-heading > span { flex: 0 0 auto; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--ink); font-size: .82rem; font-weight: 800; }
.step-heading h2, .sticky-card h2 { margin: 0 0 4px; font-size: 1.1rem; letter-spacing: 0; font-weight: 700; line-height: 1.35; }
.step-heading p, .fine-print { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }

.drop-zone { position: relative; min-height: 184px; border: 1.5px dashed #c4ced9; border-radius: 17px; background: linear-gradient(145deg,#fbfcfd,#f6f8fa); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s, transform .2s, box-shadow .2s; }
.drop-zone:hover, .drop-zone.dragging,.drop-zone:focus-within { border-color: var(--brand); background: #fff7f2; box-shadow: 0 0 0 4px rgba(239,107,58,.08); transform: translateY(-1px); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--brand); font-size: 1.6rem; }
.drop-zone small { color: var(--muted); }
.source-divider { position: relative; display: grid; place-items: center; margin: 17px 0; color: var(--muted); font-size: .75rem; font-weight: 750; }
.source-divider::before { content: ""; position: absolute; left: 0; right: 0; height: 1px; background: var(--line); }
.source-divider span { position: relative; padding: 0 12px; background: #fff; }
.link-source-field { display: grid; grid-template-columns: 42px 1fr; gap: 5px 12px; padding: 15px; border: 1px solid #d7dee6; border-radius: 15px; background: linear-gradient(135deg,#f8fbff,#fff); }
.link-source-icon { grid-row: 1; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg,var(--teal),#24918c); font-size: 1.15rem; font-weight: 900; }
.link-source-copy { align-self: center; }
.link-source-copy strong, .link-source-copy small { display: block; }
.link-source-copy strong { font-size: .88rem; }
.link-source-copy small { margin-top: 3px; color: var(--muted); font-size: .76rem; font-weight: 500; }
.link-source-field textarea { grid-column: 1 / -1; width: 100%; margin-top: 8px; resize: vertical; min-height: 92px; border: 1px solid #d7dee6; border-radius: 11px; outline: none; color: var(--ink); background: #fff; padding: 11px 12px; line-height: 1.5; transition: border-color .15s, box-shadow .15s; }
.link-source-field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(23,107,104,.1); }
.cookie-source-field { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); }
.cookie-source-field strong, .cookie-source-field small { display: block; }
.cookie-source-field strong { font-size: .8rem; }
.cookie-source-field small { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.cookie-source-field input { width: min(100%,280px); max-width: 280px; color: var(--muted); font-size: .75rem; }
.cookie-source-field input::file-selector-button { min-height: 34px; margin-right: 10px; border: 1px solid #d7dee6; border-radius: 9px; padding: 6px 11px; color: var(--ink); background: #fff; cursor: pointer; font-weight: 750; }
.cookie-source-field input::file-selector-button:hover { border-color: var(--brand); color: var(--brand-dark); }
.douyin-auth-card { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; margin-top: 10px; padding: 13px; border: 1px solid #cfe4e2; border-radius: 13px; background: linear-gradient(135deg,#f0faf9,#fff); }
.douyin-auth-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg,#121923,var(--teal)); font-size: .72rem; font-weight: 900; }
.douyin-auth-copy strong, .douyin-auth-copy small { display: block; }
.douyin-auth-copy strong { font-size: .84rem; }
.douyin-auth-copy small { margin-top: 3px; color: var(--muted); font-size: .73rem; }
.douyin-auth-copy small.authenticated { color: var(--green); font-weight: 750; }
.douyin-auth-actions { display: flex; gap: 7px; }
.source-browser-tabs { display: inline-flex; gap: 6px; margin: 0 0 14px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: #eef2f7; }
.source-browser-tab { min-width: 112px; min-height: 42px; padding: 9px 18px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; transition: .18s ease; }
.source-browser-tab:hover { color: var(--ink); background: rgba(255,255,255,.7); }
.source-browser-tab.is-active { color: #fff; background: linear-gradient(135deg, #0f172a, #334155); box-shadow: 0 6px 16px rgba(15,23,42,.16); }

.tiktok-auth-card { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; margin-bottom: 18px; padding: 14px; border: 1px solid #d8dbe2; border-radius: 14px; background: linear-gradient(135deg,#f5f5f7,#fff 58%,#eefcfb); }
.tiktok-auth-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: linear-gradient(145deg,#0e1116 20%,#202633); box-shadow: -3px 2px 0 #25f4ee, 3px -2px 0 #fe2c55; font-size: 1.3rem; font-weight: 900; }
.tiktok-auth-copy strong, .tiktok-auth-copy small { display: block; }
.tiktok-auth-copy strong { font-size: .85rem; }
.tiktok-auth-copy small { margin-top: 3px; color: var(--muted); font-size: .74rem; }
.tiktok-auth-copy small.authenticated { color: var(--green); font-weight: 750; }
.tiktok-auth-actions { display: flex; gap: 7px; }
.tiktok-browser-fallback { margin: 0 0 20px; border: 1px solid #dbe5e7; border-radius: 15px; color: var(--muted); background: rgba(255,255,255,.72); box-shadow: 0 8px 24px rgba(27,39,51,.04); overflow: hidden; }
.tiktok-browser-fallback > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 11px 16px; cursor: pointer; color: #536273; background: linear-gradient(100deg,#f8fafb,#f1f7f6); font-size: .78rem; font-weight: 750; transition: color .16s, background .16s; }
.tiktok-browser-fallback > summary::-webkit-details-marker { display: none; }
.tiktok-browser-fallback > summary::marker { content: ''; }
.tiktok-browser-fallback > summary::before { content: '＋'; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 8px; color: var(--teal); background: #e3f2f0; font-size: .9rem; font-weight: 850; transition: transform .2s; }
.tiktok-browser-fallback > summary::after { content: 'Yêu cầu quyền video.upload'; margin-left: auto; color: #8a98a8; font-size: .69rem; font-weight: 550; }
.tiktok-browser-fallback > summary:hover { color: var(--teal); background: linear-gradient(100deg,#f5fbfa,#eaf6f4); }
.tiktok-browser-fallback[open] > summary { border-bottom: 1px solid #dbe5e7; }
.tiktok-browser-fallback[open] > summary::before { content: '−'; transform: rotate(180deg); }
.tiktok-browser-fallback > .tiktok-account-bar { margin: 14px; box-shadow: none; border-color: #e4e9ee; }
.tiktok-browser-fallback > .tiktok-consent { margin: 0 14px 14px; }
.tiktok-button { min-height: 38px; color: #fff; background: #151820; padding: 8px 13px; font-size: .78rem; }
.tiktok-schedule-field { padding: 14px; border: 1px solid #bde4e1; border-radius: 13px; background: linear-gradient(135deg,#f1fbfa,#fff); }
.tiktok-schedule-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; }
.tiktok-schedule-controls > span { min-height: 43px; display: inline-flex; align-items: center; border-radius: 10px; padding: 8px 12px; color: var(--teal); background: #e5f6f4; font-size: .75rem; font-weight: 800; white-space: nowrap; }
.tiktok-schedule-field > small { color: var(--muted); font-size: .72rem; font-weight: 550; line-height: 1.45; }
.tiktok-consent { grid-column: 1 / -1; margin: -2px 0 0; padding: 11px 13px; border-left: 3px solid #25bdb7; border-radius: 8px; color: var(--muted); background: #f3faf9; font-size: .75rem; font-weight: 550; line-height: 1.5; }
.link-list:empty { display: none; }
.link-item .file-item-icon { color: #fff; background: var(--ink); }
.file-list { display: grid; gap: 8px; margin-top: 12px; }
.file-item { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.file-item-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; color: var(--teal); background: #eaf5f4; font-size: .73rem; font-weight: 900; }
.file-item strong { display: block; max-width: 620px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.file-item small { color: var(--muted); }
.file-remove, .icon-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.file-remove:hover { color: var(--red); }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; min-width: 0; }
.field-grid > *, .subtitle-editor > * { min-width: 0; }
.field { display: grid; align-content: start; min-width: 0; gap: 7px; color: #344054; font-size: .82rem; font-weight: 700; }
.field.wide { grid-column: 1 / -1; }
.field input, .jobs-toolbar input { width: 100%; min-width: 0; min-height: 43px; border: 1px solid #d7dee6; border-radius: 11px; outline: none; color: var(--ink); background-color: #fff; padding: 9px 12px; transition: border-color .15s, box-shadow .15s; }
.field select, .jobs-toolbar select { width: 100%; min-width: 0; min-height: 43px; border: 1px solid #d7dee6; border-radius: 11px; outline: none; color: var(--ink); background-color: #fff; padding: 9px 38px 9px 12px; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .jobs-toolbar input:focus, .jobs-toolbar select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(239,107,58,.11); }
.field.is-disabled { opacity: .48; }
.field.is-disabled input, .field.is-disabled select { cursor: not-allowed; background-color: #f1f3f5; }
.mode-hint { grid-column: 1 / -1; margin: -2px 0 0; padding: 11px 13px; border-radius: 10px; color: #176b68; background: #eef8f7; font-size: .78rem; font-weight: 650; line-height: 1.5; }
.checkbox-field { display: flex; align-items: center; align-self: end; min-height: 43px; flex-direction: row; padding: 8px 11px; border: 1px solid #d7dee6; border-radius: 11px; background: var(--surface-soft); }
.checkbox-field input { min-height: 0; width: 17px; height: 17px; accent-color: var(--brand); }
.advanced { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 15px; }
.advanced summary { color: var(--teal); cursor: pointer; font-size: .84rem; font-weight: 800; }
.details-body { margin-top: 15px; }

.subtitle-editor { display: grid; grid-template-columns: minmax(440px, .9fr) minmax(480px, 1.1fr); align-items: start; gap: 22px; }
.subtitle-editor .field-grid { align-content: start; gap: 18px 26px; }
.subtitle-editor .field > input:not([type="checkbox"]),
.subtitle-editor .field > select { height: 54px; min-height: 54px; }
.subtitle-editor .checkbox-field { align-self: end; height: 54px; min-height: 54px; margin-top: 0; gap: 10px; }
.subtitle-editor .checkbox-field span { min-width: 0; line-height: 1.3; }
.subtitle-preview { position: relative; min-height: 270px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 17px; background: linear-gradient(160deg,#202b35 0%,#41535d 54%,#b67a61 100%); isolation: isolate; }
.preview-glow { position: absolute; width: 210px; height: 210px; top: -45px; left: -25px; border-radius: 50%; background: rgba(255,185,123,.42); filter: blur(22px); }
.preview-person { position: absolute; width: 130px; height: 200px; left: calc(50% - 65px); bottom: -35px; border-radius: 70px 70px 25px 25px; background: linear-gradient(#f5c7af 0 40%,#111c29 41%); box-shadow: 0 0 50px rgba(0,0,0,.25); }
.preview-chinese, .preview-vietnamese { position: absolute; left: 8%; right: 8%; text-align: center; color: #fff; font-weight: 800; text-shadow: 0 2px 4px #000, 1px 0 2px #000; transition: .2s ease; }
.preview-chinese { bottom: 27px; font-size: 17px; }
.preview-vietnamese { bottom: 27px; z-index: 2; font-size: 17px; background: rgba(0,0,0,.55); border-radius: 5px; padding: 3px 7px; }
.subtitle-preview.mode-above .preview-vietnamese { bottom: 58px; background: rgba(0,0,0,.3); }
.subtitle-preview.mode-above .preview-chinese { opacity: 1; }
.subtitle-preview.mode-replace .preview-chinese { opacity: .18; }
.subtitle-preview.mode-bottom .preview-vietnamese { bottom: 16px; }

.workflow-sidebar { position: relative; }
.sticky-card { position: sticky; top: 94px; padding: 25px; border-top: 3px solid var(--brand); box-shadow: 0 18px 44px rgba(31,45,61,.1); }
.sticky-card > .eyebrow { display: block; margin-bottom: 7px; }
.summary-list { margin: 20px 0; }
.summary-list div { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.summary-list dt { color: var(--muted); font-size: .82rem; }
.summary-list dd { margin: 0; font-size: .84rem; font-weight: 800; text-align: right; }
.button { min-height: 43px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; padding: 10px 16px; font-weight: 800; cursor: pointer; transition: transform .15s, box-shadow .15s, opacity .15s, border-color .15s, color .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: linear-gradient(135deg,var(--brand),#f2924f); box-shadow: 0 9px 20px rgba(239,107,58,.23); }
.button.secondary { border: 1px solid var(--line); color: var(--ink); background: #fff; }
.button.full { width: 100%; }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.fine-print { margin-top: 14px; text-align: center; }
.upload-progress { margin-top: 15px; }
.upload-progress > div:first-child { display: flex; justify-content: space-between; margin-bottom: 7px; font-size: .78rem; }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #edf0f3; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--brand),#f5ad68); transition: width .25s; }

/* Jobs View Header */
.jobs-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; padding-top: 8px; }
.jobs-header-copy { max-width: 680px; }
.jobs-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: rgba(234, 88, 12, 0.08); border: 1px solid rgba(234, 88, 12, 0.2); color: var(--brand-dark); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px; }
.live-pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.7); animation: live-pulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1); }
@keyframes live-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(234, 88, 12, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(234, 88, 12, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(234, 88, 12, 0); }
}
.jobs-header h1 { font-size: 2.2rem; font-weight: 850; letter-spacing: -0.035em; color: #0f172a; line-height: 1.18; margin: 0 0 6px; }
.jobs-header p { font-size: 0.9rem; color: #64748b; margin: 0; line-height: 1.45; }
.new-batch-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px; font-size: 0.88rem; font-weight: 700; background: linear-gradient(135deg, #ea580c 0%, #f97316 100%); color: #ffffff; box-shadow: 0 6px 18px -3px rgba(234, 88, 12, 0.35); transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); white-space: nowrap; text-decoration: none; border: 0; }
.new-batch-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -4px rgba(234, 88, 12, 0.45); }
.new-batch-btn .btn-icon-svg { stroke: currentColor; flex-shrink: 0; }

/* Metric Stat Cards */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.metric-card { padding: 18px 20px; border: 1px solid rgba(226, 232, 240, 0.85); border-radius: 18px; background: #ffffff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 6px 16px -4px rgba(15, 23, 42, 0.04); transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: transparent; transition: background 0.2s; }
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.08), 0 4px 10px -2px rgba(15, 23, 42, 0.03); }
.metric-queued::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.metric-queued:hover { border-color: rgba(245, 158, 11, 0.4); }
.metric-processing::before { background: linear-gradient(90deg, #0284c7, #38bdf8); }
.metric-processing:hover { border-color: rgba(2, 132, 199, 0.4); }
.metric-completed::before { background: linear-gradient(90deg, #10b981, #34d399); }
.metric-completed:hover { border-color: rgba(16, 185, 129, 0.4); }
.metric-failed::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.metric-failed:hover { border-color: rgba(239, 68, 68, 0.4); }
.metric-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.metric-title { color: #475467; font-size: 0.8rem; font-weight: 650; letter-spacing: 0.01em; }
.metric-badge { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 0.85rem; font-weight: 700; transition: transform 0.2s ease; }
.metric-card:hover .metric-badge { transform: scale(1.08); }
.queued-badge { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.processing-badge { background: #f0f9ff; color: #0284c7; border: 1px solid #bae6fd; }
.completed-badge { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.failed-badge { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.metric-value { display: block; font-size: 2.25rem; font-weight: 850; color: #0f172a; line-height: 1.1; letter-spacing: -0.04em; font-feature-settings: "cv02", "cv03", "cv04", "cv11", "tnum"; }
.metric-desc { display: block; margin-top: 6px; font-size: 0.74rem; color: #64748b; font-weight: 500; }

/* Jobs Panel */
.jobs-panel { border: 1px solid #e2e8f0; border-radius: 20px; background: #ffffff; box-shadow: 0 4px 24px -4px rgba(15, 23, 42, 0.05), 0 1px 2px rgba(15, 23, 42, 0.02); overflow: hidden; }

/* Toolbar */
.jobs-toolbar { display: grid; grid-template-columns: minmax(280px, 1fr) 220px 42px; gap: 12px; padding: 14px 20px; border-bottom: 1px solid #f1f5f9; background: #ffffff; align-items: center; }
.jobs-toolbar .search-box { position: relative; width: 100%; }
.jobs-toolbar .search-box .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #94a3b8; display: grid; place-items: center; pointer-events: none; }
.jobs-toolbar .search-box input { width: 100%; min-height: 42px; border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 14px 8px 42px; font-size: 0.85rem; font-family: inherit; color: #0f172a; background: #f8fafc; outline: none; transition: all 0.18s ease; }
.jobs-toolbar .search-box input:focus { background: #ffffff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.12); }
.filter-select-wrap select { width: 100%; min-height: 42px; border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 38px 8px 14px; font-size: 0.84rem; font-family: inherit; color: #334155; background-color: #f8fafc; outline: none; cursor: pointer; transition: all 0.18s ease; }
.filter-select-wrap select:hover { border-color: #cbd5e1; background-color: #ffffff; }
.filter-select-wrap select:focus { background-color: #ffffff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.12); }
.refresh-btn { width: 42px; height: 42px; min-height: 42px; border: 1px solid #e2e8f0; border-radius: 12px; background: #f8fafc; color: #475467; display: grid; place-items: center; cursor: pointer; transition: all 0.18s ease; }
.refresh-btn:hover { background: #ffffff; border-color: #cbd5e1; color: var(--brand-dark); transform: translateY(-1px); box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05); }
.refresh-symbol { display: inline-block; transform-origin: center; transition: transform 0.4s ease; stroke: currentColor; }
.refresh-btn.is-refreshing .refresh-symbol { animation: spin-refresh 0.75s linear infinite; }
@keyframes spin-refresh { to { transform: rotate(360deg); } }

/* Bulk Actions */
.bulk-actions { display: flex; justify-content: space-between; align-items: center; padding: 11px 20px; border-bottom: 1px solid #f1f5f9; background: #fafbfc; min-height: 48px; }
.bulk-select-group { display: flex; align-items: center; gap: 12px; }
.select-all { display: inline-flex; align-items: center; gap: 8px; color: #334155; cursor: pointer; font-size: 0.82rem; font-weight: 650; user-select: none; }
.select-all input, .job-select input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); cursor: pointer; border-radius: 5px; }
.selected-count-badge { font-size: 0.74rem; color: #64748b; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #f1f5f9; border: 1px solid #e2e8f0; transition: all 0.2s ease; }
.selected-count-badge:not(:empty):not(:contains("Chưa")) { background: #fff7ed; color: var(--brand-dark); border-color: #fed7aa; font-weight: 700; }
.bulk-buttons { display: flex; gap: 8px; }
.bulk-buttons button { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; border: 1px solid #cbd5e1; border-radius: 999px; padding: 5px 13px; color: #334155; background: #ffffff; cursor: pointer; font-size: 0.76rem; font-weight: 700; transition: all 0.18s ease; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); }
.bulk-buttons button .btn-icon { display: grid; place-items: center; }
.bulk-buttons button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-dark); background: #fffaf5; transform: translateY(-1px); }
.bulk-buttons button.danger:hover:not(:disabled) { border-color: #f87171; color: #dc2626; background: #fef2f2; }
.bulk-buttons button:disabled { opacity: 0.45; cursor: not-allowed; background: #f8fafc; border-color: #e2e8f0; color: #94a3b8; box-shadow: none; }

/* Jobs Table Container & Horizontal Scroll */
.jobs-table-container { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.jobs-table-container::-webkit-scrollbar { height: 6px; }
.jobs-table-container::-webkit-scrollbar-track { background: #f8fafc; }
.jobs-table-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
.jobs-table-container::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Table Column Header */
.jobs-table-header { display: grid; grid-template-columns: 28px minmax(200px, 1.8fr) minmax(120px, 0.9fr) 115px minmax(120px, 0.9fr) minmax(140px, 1fr) 375px; gap: 14px; align-items: center; padding: 12px 22px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-size: 0.72rem; font-weight: 750; color: #64748b; text-transform: uppercase; letter-spacing: 0.05em; min-width: 1180px; }
.col-actions { text-align: right; padding-right: 2px; }

/* Job List & Row */
.jobs-list { min-height: 240px; min-width: 1180px; }
.job-row { display: grid; grid-template-columns: 28px minmax(200px, 1.8fr) minmax(120px, 0.9fr) 115px minmax(120px, 0.9fr) minmax(140px, 1fr) 375px; gap: 14px; align-items: center; padding: 14px 22px; border-bottom: 1px solid #f1f5f9; background: #ffffff; transition: all 0.18s ease; position: relative; min-width: 1180px; }
.job-owner { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.job-owner strong, .job-owner small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-owner strong { font-size: .78rem; color: #334155; }
.job-owner small { font-size: .68rem; color: #94a3b8; }
.job-owner-pending { color: #94a3b8; }
.job-row:last-child { border-bottom: 0; }
.job-row:hover { background: #fbfcfe; }
.job-row.selected { background: #fff9f5; box-shadow: inset 3px 0 0 var(--brand); }
.upload-row { background: linear-gradient(90deg, #fffaf5 0%, #ffffff 100%); box-shadow: inset 3px 0 0 var(--brand); }
.upload-row.upload-failed { background: linear-gradient(90deg, #fef2f2 0%, #ffffff 100%); box-shadow: inset 3px 0 0 #ef4444; }
.job-select { display: grid; place-items: center; }
.upload-indicator { font-weight: 800; color: var(--brand); font-size: 0.85rem; }
.upload-row.upload-failed .upload-indicator { color: #ef4444; }
.job-file { min-width: 0; display: flex; align-items: center; gap: 14px; }

/* File & Video Badges */
.video-icon-badge { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #0284c7, #0369a1); color: #ffffff; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08); transition: transform 0.2s ease; }
.job-row:hover .video-icon-badge { transform: scale(1.05); }
.video-icon-badge.status-accent-completed { background: linear-gradient(135deg, #059669, #047857); }
.video-icon-badge.status-accent-failed, .video-icon-badge.status-accent-cancelled { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.video-icon-badge.status-accent-queued, .video-icon-badge.status-accent-scheduled { background: linear-gradient(135deg, #d97706, #b45309); }
.video-icon-badge.status-accent-processing { background: linear-gradient(135deg, var(--brand), #ea580c); box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25); }
.video-icon-badge svg { fill: currentColor; }
.upload-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 0.72rem; font-weight: 800; transition: transform 0.2s ease; }
.active-upload-icon { background: linear-gradient(135deg, var(--brand), #ea580c); color: #ffffff; box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25); animation: pulse-upload 2s infinite ease-in-out; }
@keyframes pulse-upload { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.failed-upload-icon { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* File Meta & Source URL */
.job-file-meta { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.job-title-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.job-name-text, .job-file-meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: inherit; font-size: 0.88rem; font-weight: 650; color: #0f172a; line-height: 1.35; }
.job-file-meta small { display: inline-flex; align-items: center; gap: 6px; color: #64748b; font-size: 0.72rem; }
.upload-badge { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 6px; font-size: 0.68rem; font-weight: 700; white-space: nowrap; }
.badge-uploading { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.badge-failed { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.source-url-row { display: inline-flex; align-items: center; gap: 6px; color: #64748b; font-size: 0.74rem; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; background: #f8fafc; padding: 2px 8px; border-radius: 6px; border: 1px solid #e2e8f0; max-width: 100%; min-width: 0; }
.source-link-icon { flex-shrink: 0; color: #94a3b8; }
.url-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: #f1f5f9; color: #475467; font-size: 0.68rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid #e2e8f0; }
.single-tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: #f8fafc; color: #64748b; font-size: 0.68rem; border: 1px solid #f1f5f9; }

/* Status Pills */
.status-pill { display: inline-flex; align-items: center; gap: 6px; width: fit-content; padding: 4px 10px; border-radius: 999px; font-size: 0.73rem; font-weight: 700; line-height: 1.3; white-space: nowrap; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-completed { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.status-processing { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.status-processing .status-dot { box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2); animation: pulse-dot 1.5s infinite; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }
.status-queued, .status-cancelling { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.status-scheduled { background: #f0fdfa; color: #115e59; border: 1px solid #99f6e4; }
.status-failed, .status-cancelled { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Job Progress & Step Details */
.job-progress { display: grid; grid-template-columns: 1fr 42px; align-items: center; gap: 10px; min-width: 0; }
.job-progress .progress-track { height: 8px; background: #e2e8f0; border-radius: 999px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,0.06); position: relative; }
.job-progress .progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; transition: width 0.3s ease; background: linear-gradient(90deg, var(--brand), #f5ad68); }
.job-progress .progress-track.progress-processing span,
.job-progress .progress-track.progress-active span,
.progress-processing span,
.progress-active span {
  background-color: #ea580c;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.28) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.28) 50%, rgba(255, 255, 255, 0.28) 75%, transparent 75%, transparent),
    linear-gradient(90deg, #ea580c 0%, #f97316 50%, #fb923c 100%);
  background-size: 24px 24px, 100% 100%;
  animation: progress-stripes 1s linear infinite;
  box-shadow: 0 0 8px rgba(234, 88, 12, 0.45);
}
@keyframes progress-stripes {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 24px 0, 0 0; }
}
.job-progress .progress-track.progress-completed span,
.progress-completed span {
  background: linear-gradient(90deg, #10b981, #059669);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.35);
}
.job-progress .progress-track.progress-failed span,
.progress-failed span {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
}
.job-progress .progress-track.progress-queued span,
.job-progress .progress-track.progress-scheduled span,
.progress-queued span,
.progress-scheduled span {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.3);
}
.job-progress small { color: #334155; font-size: 0.76rem; font-weight: 750; text-align: right; font-feature-settings: "tnum"; }

.job-step { min-width: 0; }
.job-step strong { display: block; font-size: 0.78rem; color: #1e293b; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-step small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #64748b; font-size: 0.72rem; margin-top: 2px; }

/* Action Buttons Cluster */
.job-actions { display: flex; justify-content: flex-end; align-items: center; gap: 5px; flex-wrap: nowrap; min-width: 0; }
.btn-job-action { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; height: 30px; padding: 0 9px; border: 1px solid #e2e8f0; border-radius: 8px; background: #ffffff; color: #475467; font-size: 0.74rem; font-weight: 650; cursor: pointer; white-space: nowrap; transition: all 0.18s ease; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.btn-job-action .btn-icon { display: grid; place-items: center; flex-shrink: 0; }
.btn-job-action:hover { background: #f8fafc; border-color: #cbd5e1; color: #0f172a; transform: translateY(-1px); box-shadow: 0 2px 5px rgba(15, 23, 42, 0.06); }
.btn-job-action.tiktok-review-action { background: #0f172a; border-color: #0f172a; color: #ffffff; font-weight: 700; box-shadow: 0 3px 8px rgba(15, 23, 42, 0.2); }
.btn-job-action.tiktok-review-action:hover { background: #000000; border-color: #000000; color: #ffffff; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3); }
.btn-job-action.btn-download:hover { border-color: #14b8a6; color: #0f766e; background: #f0fdfa; }
.btn-job-action.btn-zip:hover { border-color: #818cf8; color: #4338ca; background: #eef2ff; }
.btn-job-action.btn-retry:hover { border-color: var(--brand); color: var(--brand); background: #fff7ed; }
.btn-job-action.btn-delete:hover { border-color: #f87171; color: #dc2626; background: #fef2f2; }
.btn-job-action.btn-cancel:hover, .btn-job-action.btn-dismiss:hover { border-color: #f59e0b; color: #b45309; background: #fffbeb; }

/* Empty State */
.empty-state { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #64748b; padding: 48px 24px; }
.empty-icon-wrap { width: 64px; height: 64px; border-radius: 16px; background: #f8fafc; border: 1px solid #e2e8f0; display: grid; place-items: center; color: #94a3b8; margin-bottom: 14px; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04); }
.empty-state strong { font-size: 1rem; color: #0f172a; font-weight: 700; margin-bottom: 4px; }
.empty-state small { font-size: 0.82rem; color: #64748b; max-width: 380px; margin-bottom: 18px; line-height: 1.45; }
.empty-state-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; border-radius: 11px; font-size: 0.84rem; font-weight: 700; background: linear-gradient(135deg, #ea580c 0%, #f97316 100%); color: #ffffff; text-decoration: none; box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25); transition: all 0.2s ease; }
.empty-state-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(234, 88, 12, 0.35); }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: min(380px,calc(100vw - 32px)); padding: 13px 16px; border-radius: 12px; color: #fff; background: #17202d; box-shadow: 0 15px 35px rgba(0,0,0,.22); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; z-index: 20; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--red); }
.auth-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow-y: auto; padding: 24px; background: radial-gradient(circle at 18% 5%, rgba(239,107,58,.22), transparent 32rem), rgba(18,27,39,.92); backdrop-filter: blur(9px); }
.auth-card { width: min(430px,100%); padding: 34px; border: 1px solid rgba(255,255,255,.7); border-radius: 24px; background: rgba(255,255,255,.98); box-shadow: 0 30px 90px rgba(0,0,0,.3); }
.auth-brand-mark { width: 52px; height: 52px; display: block; margin-bottom: 20px; filter: drop-shadow(0 12px 14px rgba(239,107,58,.24)); }
.auth-brand-mark img { display: block; width: 100%; height: 100%; }
.auth-card h1 { margin: 6px 0 8px; font-size: 2rem; letter-spacing: -.045em; }
.auth-card > p { margin: 0 0 24px; color: var(--muted); font-size: .88rem; line-height: 1.55; }
.auth-form { display: grid; gap: 15px; }
.auth-form label { display: grid; gap: 7px; color: #344054; font-size: .8rem; font-weight: 750; }
.auth-form input { width: 100%; min-height: 46px; border: 1px solid #d7dee6; border-radius: 12px; outline: none; padding: 10px 12px; color: var(--ink); background: #fff; }
.auth-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(239,107,58,.12); }
.auth-form label small { color: var(--muted); font-size: .7rem; font-weight: 500; }
.auth-mode-toggle { width: 100%; margin-top: 14px; border: 0; padding: 7px; color: var(--brand-dark); background: transparent; cursor: pointer; font-size: .78rem; font-weight: 750; text-align: center; }
.auth-mode-toggle:hover { text-decoration: underline; }
.auth-message { min-height: 20px; margin-top: 16px; color: var(--muted); font-size: .73rem; line-height: 1.45; }
.auth-message.error { color: var(--red); font-weight: 700; }


/* ========================================================
   DOUYIN CLOUD BROWSER (#douyinView) Modern SaaS Redesign
   ======================================================== */
.douyin-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; padding-top: 10px; }
.douyin-header-copy { max-width: 720px; }
.douyin-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px; border-radius: 999px; background: rgba(239, 107, 58, 0.08); border: 1px solid rgba(239, 107, 58, 0.2); color: var(--brand); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px; }
.douyin-header h1 { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; color: #0f172a; line-height: 1.18; margin: 0 0 6px; }
.douyin-header p { font-size: 0.9rem; color: #64748b; margin: 0; line-height: 1.5; }
.back-to-create-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 11px; font-size: 0.84rem; font-weight: 700; color: #334155; background: #ffffff; border: 1px solid #cbd5e1; transition: all 0.15s ease; white-space: nowrap; text-decoration: none; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.back-to-create-btn:hover { border-color: var(--brand); color: var(--brand-dark); transform: translateY(-1px); }

.douyin-browser-card { overflow: hidden; padding: 0; border: 1px solid #e2e8f0; border-radius: 20px; background: #ffffff; box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05); display: flex; flex-direction: column; }
.douyin-browser-topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 22px; border-bottom: 1px solid #e2e8f0; background: #ffffff; }
.douyin-browser-state { min-width: 0; display: flex; align-items: center; gap: 14px; }
.douyin-browser-state > div { min-width: 0; }
.douyin-browser-state strong, .douyin-browser-state small { display: block; }
.douyin-browser-state strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.94rem; font-weight: 750; color: #0f172a; letter-spacing: -0.01em; }
.douyin-browser-state small { margin-top: 2px; color: #64748b; font-size: 0.76rem; }

.browser-state-dot { flex: 0 0 12px; width: 12px; height: 12px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15); transition: all 0.2s ease; }
.browser-state-dot.available { background: var(--amber); box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2); animation: pulse-dot 1.8s infinite; }
.browser-state-dot.authenticated { background: var(--green); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.25); }

.douyin-browser-actions { display: flex; align-items: center; gap: 9px; }
.douyin-browser-actions .button { min-height: 38px; height: 38px; padding: 0 15px; font-size: 0.8rem; font-weight: 700; border-radius: 10px; display: inline-flex; align-items: center; gap: 7px; transition: all 0.15s ease; }
.douyin-browser-actions .sync-btn { background: linear-gradient(135deg, var(--brand), #ea580c); color: #ffffff; border: 1px solid transparent; box-shadow: 0 2px 8px rgba(239, 107, 58, 0.25); }
.douyin-browser-actions .sync-btn:hover:not(:disabled) { background: linear-gradient(135deg, #e05e2e, #c2410c); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(239, 107, 58, 0.35); }
.douyin-browser-actions .reload-btn, .douyin-browser-actions .logout-btn { background: #f8fafc; color: #475569; border: 1px solid #cbd5e1; }
.douyin-browser-actions .reload-btn:hover:not(:disabled) { background: #ffffff; color: #0f172a; border-color: #94a3b8; transform: translateY(-1px); }
.douyin-browser-actions .logout-btn:hover:not(:disabled) { color: #ef4444; border-color: #fca5a5; background: #fef2f2; transform: translateY(-1px); }
.douyin-browser-actions button:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* Cloud Browser Window Shell */
.douyin-window-mock { display: flex; flex-direction: column; background: #0f172a; }
.douyin-window-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 18px; background: #0b1120; border-top: 1px solid #1e293b; border-bottom: 1px solid #1e293b; color: #94a3b8; }
.traffic-lights { display: flex; align-items: center; gap: 7px; width: 68px; }
.traffic-lights .light { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.traffic-lights .light.red { background: #ef4444; }
.traffic-lights .light.yellow { background: #f59e0b; }
.traffic-lights .light.green { background: #10b981; }

.browser-address-bar { display: inline-flex; align-items: center; gap: 8px; padding: 5px 16px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 8px; color: #cbd5e1; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.74rem; letter-spacing: 0.01em; max-width: 400px; width: 100%; justify-content: center; }
.browser-address-bar .lock-icon { font-size: 0.75rem; opacity: 0.85; }
.browser-status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.25); border-radius: 999px; color: #34d399; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.browser-status-chip .chip-dot { color: #10b981; font-size: 0.6rem; }

.douyin-browser-stage { position: relative; width: 100%; height: min(74vh, 820px); min-height: 600px; overflow: hidden; background: #070a10; }
.douyin-browser-stage iframe { display: block; width: 100%; height: 100%; border: 0; background: #070a10; }
.douyin-browser-loading { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #f8fafc; background: rgba(7, 10, 16, 0.94); backdrop-filter: blur(8px); }
.douyin-browser-loading .browser-spinner { width: 38px; height: 38px; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: var(--brand); border-radius: 50%; animation: browser-spin 0.85s linear infinite; }
.douyin-browser-loading strong { font-size: 0.98rem; font-weight: 750; color: #ffffff; letter-spacing: -0.01em; }
.douyin-browser-loading small { font-size: 0.78rem; color: #94a3b8; }
@keyframes browser-spin { to { transform: rotate(360deg); } }

.douyin-browser-footer { display: flex; align-items: flex-start; gap: 12px; padding: 15px 22px; background: #f8fafc; border-top: 1px solid #e2e8f0; color: #475569; font-size: 0.8rem; line-height: 1.55; }
.footer-tip-icon { font-size: 1.15rem; flex-shrink: 0; margin-top: -1px; }
.douyin-browser-footer p { margin: 0; }
.douyin-browser-footer strong { color: #0f172a; font-weight: 750; }


@media (max-width: 1050px) {
  .workflow-grid { grid-template-columns: 1fr; }
  .sticky-card { position: static; }
  .workflow-sidebar { order: -1; }
  .sticky-card .summary-list { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
  .summary-list div { display: block; }
}

@media (max-width: 1240px) {
  .topbar { grid-template-columns: auto 1fr auto; gap: 12px; }
  .nav-tabs { justify-self: center; gap: 2px; }
  .nav-tabs a { padding: 0 9px; font-size: .81rem; gap: 6px; }
  .nav-tabs a > i { width: 22px; height: 22px; flex-basis: 22px; }
  .nav-tabs a > i svg { width: 14px; height: 14px; }
  .user-menu-button strong { max-width: 100px; }
}

@media (min-width: 1051px) and (max-width: 1240px) {
  .workflow-grid { grid-template-columns: minmax(0,1fr) 290px; }
}

@media (max-width: 1400px) {
  .subtitle-editor { grid-template-columns: 1fr; }
  .subtitle-preview { width: 100%; }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 0 max(14px,env(safe-area-inset-right)) calc(36px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));
  }
  .auth-logout { min-height: 44px; }
  .page-heading { align-items: flex-start; gap: 14px; padding: 28px 0 20px; }
  .page-heading h1 { font-size: clamp(2rem,9vw,2.65rem); line-height: 1.03; }
  .page-heading p { font-size: .92rem; line-height: 1.5; }
  .page-heading .button { display: none; }
  .workflow-sidebar { order: 0; }
  .field-grid,.metric-grid { grid-template-columns: 1fr 1fr; }
  .card { border-radius: 17px; }
  .step-card { padding: 19px; }
  .button,.field input,.field select,.jobs-toolbar input,.jobs-toolbar select { min-height: 46px; }
  .checkbox-field { min-height: 48px; }
  .drop-zone { padding: 22px 14px; }
  .cookie-source-field input { min-height: 44px; }
  .file-remove { width: 44px; height: 44px; }
  .jobs-panel > .jobs-toolbar, .jobs-toolbar:not([class*="admin-"]) {
    display: grid;
    grid-template-columns: 1fr 42px;
    grid-template-areas:
      "search search"
      "filter refresh";
    gap: 10px;
    padding: 12px;
  }
  .jobs-panel > .jobs-toolbar .search-box, .jobs-toolbar:not([class*="admin-"]) .search-box { grid-area: search; width: 100%; }
  .jobs-panel > .jobs-toolbar .filter-select-wrap, .jobs-toolbar:not([class*="admin-"]) .filter-select-wrap { grid-area: filter; width: 100%; min-width: 0; }
  .jobs-panel > .jobs-toolbar .refresh-btn, .jobs-toolbar:not([class*="admin-"]) .refresh-btn { grid-area: refresh; width: 42px; height: 42px; min-height: 42px; }
  .icon-button { min-height: 42px; }
  .bulk-actions { padding: 11px 13px; }
  .bulk-actions > strong { display: none; }
  .bulk-buttons { display: flex; gap: 8px; }
  .bulk-buttons button { min-height: 38px; padding: 0 12px; }
  .select-all { min-height: 38px; }
  .job-row { grid-template-columns: 28px minmax(0,1fr); gap: 9px 10px; padding: 14px 14px; }
  .job-select { grid-column: 1; grid-row: 1; min-width: 28px; min-height: 34px; align-self: start; }
  .job-file { grid-column: 2; grid-row: 1; align-items: flex-start; }
  .job-file strong { display: -webkit-box; white-space: normal; line-height: 1.35; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .status-pill { grid-column: 2; grid-row: 2; justify-self: start; align-self: center; }
  .job-owner { grid-column: 2; grid-row: 2; justify-self: end; align-self: center; text-align: right; max-width: 55%; }
  .job-progress { grid-column: 1 / -1; grid-row: 3; }
  .job-step { grid-column: 1 / -1; grid-row: 4; display: block; }
  .job-actions { grid-column: 1 / -1; grid-row: 5; display: flex; flex-wrap: wrap; gap: 6px; }
  .empty-state { min-height: 190px; padding: 24px 16px; }

  .douyin-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .douyin-header-actions { width: 100%; }
  .back-to-create-btn { width: 100%; justify-content: center; }
  .douyin-browser-topbar { align-items: stretch; flex-direction: column; gap: 14px; }
  .douyin-browser-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .douyin-browser-actions .sync-btn { grid-column: 1 / -1; justify-content: center; }
  .douyin-browser-actions .reload-btn, .douyin-browser-actions .logout-btn { justify-content: center; }
  .traffic-lights { display: none; }
  .douyin-browser-stage { height: 70vh; min-height: 480px; }

}

@media (max-width: 600px) {
  .page-heading h1 { font-size: clamp(2rem,10.5vw,2.45rem); }
  .field-grid,.sticky-card .summary-list { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .step-card { padding: 16px; }
  .step-heading { gap: 11px; margin-bottom: 17px; }
  .step-heading h2,.sticky-card h2 { font-size: 1.02rem; }
  .step-heading p { font-size: .8rem; }
  .drop-zone { min-height: 150px; }
  .source-divider span { max-width: 82%; text-align: center; }
  .link-source-field { grid-template-columns: 38px minmax(0,1fr); padding: 13px; }
  .link-source-icon { width: 38px; height: 38px; }
  .link-source-copy small { line-height: 1.4; }
  .cookie-source-field { align-items: flex-start; flex-direction: column; }
  .cookie-source-field input { width: 100%; max-width: 100%; min-height: 44px; }
  .douyin-auth-card,.tiktok-auth-card { grid-template-columns: 42px minmax(0,1fr); }
  .douyin-auth-actions,.tiktok-auth-actions { grid-column: 1 / -1; width: 100%; }
  .douyin-auth-actions .button,.tiktok-auth-actions .button { flex: 1; min-height: 44px; }
  .source-browser-tabs { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); width: 100%; }
  .source-browser-tab { min-width: 0; padding-inline: 8px; }
  .tiktok-schedule-controls { grid-template-columns: 1fr; }
  .tiktok-schedule-controls > span { min-height: 38px; justify-content: center; }
  .file-item { grid-template-columns: 34px minmax(0,1fr) 44px; padding: 9px 8px 9px 10px; }
  .file-item strong { max-width: none; }
  .metric-grid { gap: 9px; }
  .metric-grid article { padding: 14px 15px; }
  .metric-grid strong { font-size: 1.65rem; }
  .subtitle-editor .checkbox-field { margin-top: 0; }
  .subtitle-preview { min-height: 220px; }
  .sticky-card { padding: 19px; }
  .summary-list { margin: 14px 0; }
  .summary-list div { display: flex; padding: 9px 0; }
  .jobs-panel { border-radius: 15px; }
  input:not([type="checkbox"]):not([type="radio"]),select,textarea { font-size: 16px; }
  .toast { left: max(12px,env(safe-area-inset-left)); right: max(12px,env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom)); max-width: none; }
  .auth-gate { padding: max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left)); }
  .auth-card { padding: 26px 20px; border-radius: 18px; }
  .auth-card h1 { font-size: 1.7rem; }

  .douyin-browser-card { margin-right: calc(-1 * max(0px,env(safe-area-inset-right))); margin-left: calc(-1 * max(0px,env(safe-area-inset-left))); border-radius: 16px; }
  .douyin-browser-topbar { padding: 14px; }
  .douyin-browser-state strong { white-space: normal; }
  .douyin-window-bar { padding: 8px 12px; }
  .browser-status-chip { display: none; }
  .browser-address-bar { max-width: none; }
  .douyin-browser-stage { min-height: 420px; }
  .douyin-browser-footer { padding: 14px 16px; }
}

@media (max-width: 374px) {
  .app-shell { padding-left: max(10px,env(safe-area-inset-left)); padding-right: max(10px,env(safe-area-inset-right)); }
  .brand small { display: none; }
  .nav-tabs a { padding: 0 6px; font-size: .86rem; }
  .page-heading h1 { font-size: 2rem; }
  .step-card { padding: 14px; }

}

@media (max-height: 500px) and (max-width: 900px) {
  
}

@media (hover: none) {
  .button:hover,.drop-zone:hover { transform: none; }
}

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

/* TikTok: prepare after rendering, review on the left, live Studio on the right. */
.tiktok-flow { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 0 0 24px; }
.tiktok-flow > div { padding: 16px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.tiktok-flow span { display: block; color: var(--teal); font-size: .7rem; font-weight: 800; margin-bottom: 10px; }
.tiktok-flow strong, .tiktok-flow small { display: block; }
.tiktok-flow strong { font-size: .83rem; }
.tiktok-flow small { font-size: .72rem; color: var(--muted); margin-top: 5px; line-height: 1.5; }
.tiktok-connect-strip { display: flex; align-items: center; gap: 16px; justify-content: space-between; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.tiktok-connect-strip strong { font-size: .9rem; }
.tiktok-connect-strip p { color: var(--muted); font-size: .78rem; line-height: 1.6; margin: 5px 0 0; }
.tiktok-connect-strip .button { flex-shrink: 0; font-size: .78rem; }
/* ========================================================
   SOCIAL PUBLISHING HUB (#tiktokView) Modern SaaS Redesign
   ======================================================== */
.tiktok-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 20px;
  padding-top: 18px;
}
.tiktok-header::before {
  content: "";
  position: absolute;
  width: 480px;
  height: 160px;
  top: -40px;
  left: -60px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(234, 88, 12, 0.08), transparent 70%);
  pointer-events: none;
}
.tiktok-header-copy { max-width: 680px; }
.tiktok-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(234, 88, 12, 0.08);
  border: 1px solid rgba(234, 88, 12, 0.2);
  color: #c2410c;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.tiktok-dot {
  color: #fe2c55;
  font-weight: 900;
  font-size: 0.82rem;
  display: inline-block;
  transform: translateY(-1px);
}
.tiktok-header h1 {
  font-size: 1.85rem;
  font-weight: 850;
  letter-spacing: -0.035em;
  color: #0f172a;
  line-height: 1.2;
  margin: 0 0 5px;
}
.tiktok-header p {
  font-size: 0.88rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
}
.back-to-jobs-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  min-height: 40px;
  border-radius: 11px;
  font-size: 0.82rem;
  font-weight: 750;
  color: #334155;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.back-to-jobs-btn:hover {
  border-color: #ea580c;
  color: #c2410c;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.15);
  transform: translateY(-1px);
}

/* Connection Hub — 6-Column Symmetrical Layout */
.tiktok-connection-hub {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  margin-bottom: 18px;
}
.channel-facebook,
.channel-youtube,
.channel-instagram {
  grid-column: span 2;
}
.channel-official,
.channel-studio {
  grid-column: span 3;
}

.tiktok-channel-card {
  position: relative;
  padding: 20px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  cursor: pointer;
}
.tiktok-channel-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.tiktok-channel-card:hover {
  transform: translateY(-3px);
  border-color: #cbd5e1;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}
.tiktok-channel-card:hover::before,
.tiktok-channel-card.is-active-platform::before {
  opacity: 1;
}

/* Individual Card Accent Lines on Hover & Active */
.channel-facebook::before { background: linear-gradient(90deg, #1877f2, #3b82f6); }
.channel-youtube::before { background: linear-gradient(90deg, #ef4444, #f97316); }
.channel-instagram::before { background: linear-gradient(90deg, #833ab4, #fd1d1d 50%, #fcb045); }
.channel-official::before { background: linear-gradient(90deg, #25f4ee, #fe2c55); }
.channel-studio::before { background: linear-gradient(90deg, #0ea5e9, #6366f1); }

/* Card Active States */
.channel-facebook.is-active-platform {
  border-color: #1877f2;
  box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.25), 0 8px 24px rgba(24, 119, 242, 0.12);
}
.channel-youtube.is-active-platform {
  border-color: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.25), 0 8px 24px rgba(239, 68, 68, 0.12);
}
.channel-instagram.is-active-platform {
  border-color: #db2777;
  box-shadow: 0 0 0 2px rgba(219, 39, 119, 0.25), 0 8px 24px rgba(219, 39, 119, 0.12);
}
.channel-official.is-active-platform {
  border-color: #0f172a;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.25), 0 8px 24px rgba(0, 0, 0, 0.15);
}
.channel-studio.is-active-platform {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25), 0 8px 24px rgba(2, 132, 199, 0.12);
}

.platform-indicator-pill {
  display: none;
}
.is-active-platform .platform-indicator-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 750;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  margin-left: auto;
}
.indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}
.btn-card-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.74rem;
  font-weight: 750;
  padding: 0 10px;
  min-height: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-card-switch:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}
.is-active-platform .btn-card-switch {
  background: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

.channel-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.channel-badge-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #ffffff;
  transition: transform 0.2s ease;
}
.tiktok-channel-card:hover .channel-badge-wrap {
  transform: scale(1.05);
}
.facebook-badge-wrap {
  background: linear-gradient(135deg, #1877f2, #0d5bb5);
  box-shadow: 0 4px 14px rgba(24, 119, 242, 0.28);
}
.youtube-badge-wrap {
  background: linear-gradient(135deg, #ff0000, #cc0000);
  box-shadow: 0 4px 14px rgba(255, 0, 0, 0.28);
}
.instagram-badge-wrap {
  background: linear-gradient(135deg, #833ab4, #fd1d1d 55%, #fcb045);
  box-shadow: 0 4px 14px rgba(225, 48, 108, 0.3);
}
.official-badge-wrap {
  background: #010101;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  color: #ffffff;
  filter: drop-shadow(-1px -1px 0 rgba(37, 244, 238, 0.4)) drop-shadow(1px 1px 0 rgba(254, 44, 85, 0.4));
}
.studio-badge-wrap {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
  color: #38bdf8;
}

.channel-meta {
  flex: 1;
  min-width: 0;
}
.channel-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.channel-title-row strong {
  font-size: 0.96rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.015em;
}
.channel-pill {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
}
.pill-facebook { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.pill-youtube { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.pill-instagram { background: #fdf2f8; color: #be185d; border: 1px solid #fbcfe8; }
.pill-official { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.pill-studio { background: #f0fdfa; color: #0f766e; border: 1px solid #99f6e4; }

.channel-status {
  margin: 4px 0 0;
  font-size: 0.77rem;
  color: #64748b;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.select-account {
  margin-top: 10px;
  width: 100%;
  min-height: 38px;
  padding: 6px 36px 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 9px;
  border: 1px solid #cbd5e1;
  background-color: #f8fafc;
  color: #0f172a;
  outline: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.select-account:focus {
  border-color: var(--brand);
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(239, 107, 58, 0.12);
}

.channel-actions,
.studio-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Channel Action Buttons */
.tiktok-btn {
  min-height: 38px;
  height: 38px;
  padding: 0 16px;
  font-size: 0.8rem;
  font-weight: 750;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}
.btn-facebook {
  background: linear-gradient(135deg, #1877f2, #1464cc);
  box-shadow: 0 3px 10px rgba(24, 119, 242, 0.25);
}
.btn-facebook:hover:not(:disabled) {
  background: linear-gradient(135deg, #1464cc, #0d5bb5);
  box-shadow: 0 6px 18px rgba(24, 119, 242, 0.35);
  transform: translateY(-1px);
}
.btn-youtube {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 3px 10px rgba(239, 68, 68, 0.25);
}
.btn-youtube:hover:not(:disabled) {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}
.btn-instagram {
  background: linear-gradient(135deg, #833ab4, #fd1d1d 55%, #fcb045);
  box-shadow: 0 3px 10px rgba(225, 48, 108, 0.25);
}
.btn-instagram:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(225, 48, 108, 0.38);
  transform: translateY(-1px);
}
.btn-tiktok-api {
  background: #010101;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}
.btn-tiktok-api:hover:not(:disabled) {
  background: #111827;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
}
.btn-tiktok-studio {
  background: linear-gradient(135deg, var(--brand), #ea580c);
  box-shadow: 0 3px 10px rgba(239, 107, 58, 0.28);
}
.btn-tiktok-studio:hover:not(:disabled) {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  box-shadow: 0 6px 18px rgba(239, 107, 58, 0.38);
  transform: translateY(-1px);
}

.channel-actions .small-btn,
.studio-actions .small-btn {
  min-height: 38px;
  height: 38px;
  padding: 0 13px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.channel-actions .small-btn:hover:not(:disabled),
.studio-actions .small-btn:hover:not(:disabled) {
  border-color: #94a3b8;
  color: #0f172a;
  background: #f8fafc;
}
#facebookDisconnect:hover:not(:disabled),
#youtubeDisconnect:hover:not(:disabled),
#instagramDisconnect:hover:not(:disabled),
#tiktokApiDisconnect:hover:not(:disabled),
#tiktokBrowserLogout:hover:not(:disabled) {
  border-color: #fca5a5;
  color: #ef4444;
  background: #fef2f2;
}

/* Tip Bar */
.tiktok-tip-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
  border: 1px solid #ccfbf1;
  border-left: 4px solid var(--teal);
  color: #0f766e;
  font-size: 0.78rem;
  line-height: 1.5;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.04);
}
.tip-badge-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ccfbf1;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}
.tip-text { flex: 1; min-width: 0; }
.tip-text strong { color: #115e59; font-weight: 750; }


/* Segmented Platform Selector Navigation Bar */
.platform-tab-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  margin-bottom: 22px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.03);
}
.platform-tab-nav::-webkit-scrollbar {
  display: none;
}
.platform-tab-btn {
  flex: 1 0 auto;
  flex-shrink: 0;
  min-width: max-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 11px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
  box-sizing: border-box;
}
.platform-tab-btn:hover {
  background: rgba(255, 255, 255, 0.7);
  color: #0f172a;
}
.platform-tab-btn.is-active {
  background: #ffffff;
  color: #0f172a;
  border-color: rgba(203, 213, 225, 0.7);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  font-weight: 800;
}
.tab-badge-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #ffffff;
  transition: transform 0.15s ease;
}
.platform-tab-btn:hover .tab-badge-icon,
.platform-tab-btn.is-active .tab-badge-icon {
  transform: scale(1.08);
}
.official-mini-icon {
  background: #010101;
  color: #25f4ee;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.studio-mini-icon {
  background: #0f172a;
  color: #38bdf8;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
}
.facebook-mini-icon {
  background: linear-gradient(135deg, #1877f2, #0d5bb5);
  box-shadow: 0 2px 6px rgba(24, 119, 242, 0.28);
}
.youtube-mini-icon {
  background: linear-gradient(135deg, #ff0000, #cc0000);
  box-shadow: 0 2px 6px rgba(255, 0, 0, 0.28);
}
.instagram-mini-icon {
  background: linear-gradient(135deg, #833ab4, #fd1d1d 55%, #fcb045);
  box-shadow: 0 2px 6px rgba(225, 48, 108, 0.3);
}
.tab-btn-title {
  font-size: 0.82rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
  white-space: nowrap;
}
.tab-btn-badge {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  font-weight: 750;
  flex-shrink: 0;
  white-space: nowrap;
}
.platform-tab-btn.is-active[data-platform-target="tiktok-api"] .tab-btn-badge {
  background: #ecfdf5;
  color: #059669;
}
.platform-tab-btn.is-active[data-platform-target="tiktok-studio"] .tab-btn-badge {
  background: #fff7ed;
  color: #ea580c;
}
.platform-tab-btn.is-active[data-platform-target="facebook"] .tab-btn-badge {
  background: #eff6ff;
  color: #1d4ed8;
}
.platform-tab-btn.is-active[data-platform-target="youtube"] .tab-btn-badge {
  background: #fef2f2;
  color: #b91c1c;
}
.platform-tab-btn.is-active[data-platform-target="instagram"] .tab-btn-badge {
  background: #fdf2f8;
  color: #be185d;
}

/* Workspace Grid (2 Columns) */
.tiktok-workspace {
  display: grid;
  grid-template-columns: minmax(380px, 1.05fr) minmax(500px, 1.45fr);
  gap: 24px;
  align-items: start;
}
.workspace-card-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}
.step-badge {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--brand), #ea580c);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 0.88rem;
  font-weight: 850;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.28);
}
.step-studio {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.25);
  color: #38bdf8;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.step-official {
  background: #010101;
  color: #25f4ee;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.step-facebook {
  background: linear-gradient(135deg, #1877f2, #0d5bb5);
  box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}
.step-youtube {
  background: linear-gradient(135deg, #ff0000, #cc0000);
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.3);
}
.step-instagram {
  background: linear-gradient(135deg, #833ab4, #fd1d1d 55%, #fcb045);
  box-shadow: 0 4px 12px rgba(225, 48, 108, 0.3);
}
.workspace-card-heading h2 {
  margin: 0 0 2px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.workspace-card-heading p {
  margin: 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.45;
}

/* Column 1: Review Card */
.tiktok-review-card {
  padding: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 12px 36px -4px rgba(15, 23, 42, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.tiktok-review-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 18px 42px -6px rgba(15, 23, 42, 0.09);
}
.video-selector-field { margin-bottom: 18px; }
.field-label-group {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.field-title {
  font-size: 0.82rem;
  font-weight: 750;
  color: #0f172a;
}
.field-hint {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
}
.video-selector-field select {
  width: 100%;
  min-height: 46px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 8px 40px 8px 14px;
  font-size: 0.86rem;
  font-weight: 600;
  font-family: inherit;
  color: #0f172a;
  background-color: #f8fafc;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
.video-selector-field select:hover {
  background-color: #ffffff;
  border-color: #94a3b8;
}
.video-selector-field select:focus {
  background-color: #ffffff;
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.12);
}

.tiktok-empty {
  text-align: center;
  padding: 48px 20px;
  border: 2px dashed #cbd5e1;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
}
.empty-video-icon {
  font-size: 2.6rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.06));
}
.tiktok-empty strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}
.tiktok-empty p {
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.6;
  max-width: 340px;
  margin: 0 auto 18px;
}
.tiktok-empty .button {
  min-height: 38px;
  padding: 0 16px;
  font-weight: 700;
  border-radius: 10px;
}

.video-preview-wrapper {
  margin-bottom: 18px;
  background: #080c14;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
  box-shadow: 0 10px 28px -4px rgba(0, 0, 0, 0.22);
}
#tiktokVideoPreview {
  width: 100%;
  height: 290px;
  object-fit: contain;
  background: #000000;
  border-radius: 12px;
  display: block;
}
.tiktok-filename {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  margin: 8px 4px 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.tiktok-filename::before {
  content: "🎬";
  font-size: 0.85rem;
}

.caption-editor-section { margin-bottom: 18px; }
.caption-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.char-count-pill {
  font-size: 0.72rem;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
#tiktokCaption {
  width: 100%;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  padding: 13px 15px;
  min-height: 135px;
  resize: vertical;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #0f172a;
  font-family: inherit;
  background: #fafbfc;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
#tiktokCaption:hover {
  background: #ffffff;
  border-color: #94a3b8;
}
#tiktokCaption:focus {
  background: #ffffff;
  border-color: #ea580c;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.12);
}

.tiktok-caption-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.ai-suggest-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #a7f3d0;
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
  color: #047857;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.79rem;
  font-weight: 750;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(16, 185, 129, 0.08);
}
.ai-suggest-btn:hover:not(:disabled) {
  background: #d1fae5;
  border-color: #6ee7b7;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.2);
}
.sparkle-icon { color: #10b981; font-size: 0.95rem; }
.copy-caption-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.79rem;
  font-weight: 700;
  transition: all 0.15s ease;
}
.copy-caption-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
  transform: translateY(-1px);
}

.tiktok-caption-suggestion {
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid #99f6e4;
  border-left: 4px solid var(--teal);
  border-radius: 14px;
  background: linear-gradient(135deg, #f0fdfa 0%, #ffffff 100%);
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.06);
}
.suggestion-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 0.84rem;
  font-weight: 750;
}
.tiktok-caption-suggestion p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.6;
  font-size: 0.84rem;
  color: #1e293b;
  margin: 0 0 8px;
}
.tiktok-caption-suggestion small {
  color: #64748b;
  font-size: 0.72rem;
  display: block;
  margin-bottom: 12px;
}
.suggestion-actions { display: flex; gap: 8px; }

.composer-hint-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-top: 18px;
  color: #475569;
  font-size: 0.77rem;
  line-height: 1.55;
}
.composer-hint-icon {
  color: var(--brand);
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.composer-hint-text {
  flex: 1;
  min-width: 0;
}

.tiktok-repost-notice {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 15px;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffffff 80%);
  color: #9a3412;
  box-shadow: 0 4px 16px rgba(234, 88, 12, 0.06);
}
.tiktok-repost-copy { display: flex; align-items: flex-start; gap: 10px; }
.tiktok-repost-icon {
  display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px;
  border-radius: 9px; background: #ffedd5; color: #ea580c; font-size: 1rem; font-weight: 850;
}
.tiktok-repost-notice p { margin: 2px 0 0; color: #7c2d12; font-size: 0.79rem; line-height: 1.55; }
.tiktok-repost-button {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; min-height: 42px; padding: 10px 14px;
  border: 1px solid #fb923c; border-radius: 11px;
  color: #fff; background: linear-gradient(135deg, #f97316, #ea580c);
  box-shadow: 0 7px 16px rgba(234, 88, 12, 0.2);
  cursor: pointer; font: inherit; font-size: 0.8rem; font-weight: 800;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.tiktok-repost-button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.03); box-shadow: 0 10px 20px rgba(234, 88, 12, 0.26); }
.tiktok-repost-button:focus-visible { outline: 3px solid rgba(249, 115, 22, .22); outline-offset: 2px; }
.tiktok-repost-button:disabled { border-color: #e2e8f0; color: #94a3b8; background: #f8fafc; box-shadow: none; cursor: not-allowed; }
.tiktok-repost-button-icon { font-size: 1rem; }
.tiktok-repost-arrow { margin-left: auto; font-size: 1rem; }

.tiktok-publish-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.tiktok-publish-controls .field select,
.tiktok-publish-controls .field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 11px;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-family: inherit;
  background-color: #ffffff;
  color: #0f172a;
  outline: none;
}
.tiktok-publish-controls .field select { padding-right: 36px; }
.tiktok-publish-controls .field select:focus,
.tiktok-publish-controls .field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(239, 107, 58, 0.12);
}

.tiktok-check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 0.78rem;
  line-height: 1.5;
  color: #334155;
  cursor: pointer;
  margin-bottom: 18px;
  transition: all 0.15s ease;
}
.tiktok-check:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.tiktok-check input {
  margin-top: 3px;
  width: 17px;
  height: 17px;
  accent-color: var(--brand);
  flex-shrink: 0;
  cursor: pointer;
}

.publish-cta-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.publish-official-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  border-radius: 13px;
  background: #010101 !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.publish-official-btn:hover:not(:disabled) {
  background: #111827 !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38), 0 0 16px rgba(37, 244, 238, 0.2);
}
.publish-official-btn .tiktok-note-symbol {
  color: #25f4ee;
  font-size: 1.1rem;
}
.publish-studio-btn {
  min-height: 44px;
  border-radius: 12px;
  font-size: 0.84rem;
  font-weight: 750;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  transition: all 0.15s ease;
  cursor: pointer;
}
.publish-studio-btn:hover:not(:disabled) {
  border-color: var(--brand);
  color: var(--brand-dark);
  background: #fffaf5;
}

/* Column 2: Platform Specific Publishing Panels */
.tiktok-console-container {
  position: relative;
  width: 100%;
}
.platform-publish-panel {
  display: none;
  padding: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03), 0 12px 36px -4px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.platform-publish-panel:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 18px 42px -6px rgba(15, 23, 42, 0.09);
}
.platform-publish-panel.is-active {
  display: block;
  animation: panelSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes panelSlideIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.panel-tiktok-api { border-top: 3px solid #0f172a; }
.panel-tiktok-studio { border-top: 3px solid #ea580c; }
.panel-facebook { border-top: 3px solid #1877f2; }
.panel-youtube { border-top: 3px solid #ef4444; }
.panel-instagram { border-top: 3px solid #db2777; }

.panel-status-pill {
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.platform-panel-content {
  margin-top: 4px;
}

/* In-Panel Connection Strip */
.panel-account-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.account-strip-info {
  flex: 1 1 220px;
  min-width: 0;
}
.account-strip-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.account-strip-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0f172a;
}
.panel-account-strip .channel-status {
  margin: 0;
  font-size: 0.79rem;
  color: #475569;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.panel-account-strip .channel-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
  flex-shrink: 0;
}
.panel-account-strip .select-account {
  margin-top: 8px;
  width: 100%;
  max-width: 320px;
}
.account-strip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.studio-account-strip {
  align-items: center;
}
.studio-account-strip .studio-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Status Attempt Banner - High-Grade Attention Alert */
.tiktok-attempt {
  padding: 18px 20px;
  border: 1px solid #fed7aa;
  border-left: 4px solid #ea580c;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffbeb 0%, #ffffff 88%);
  margin-bottom: 20px;
  box-shadow: 0 4px 18px rgba(234, 88, 12, 0.08);
  animation: panelSlideIn 0.25s ease;
}
.tiktok-attempt strong {
  color: #9a3412;
  font-size: 0.92rem;
  font-weight: 850;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.tiktok-attempt strong::before {
  content: "⚠️";
  font-size: 1rem;
}
.tiktok-attempt p {
  font-size: 0.82rem;
  line-height: 1.6;
  margin: 8px 0 14px;
  color: #451a03;
}
.tiktok-text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  background: #ffedd5;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-size: 0.77rem;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tiktok-text-button:hover {
  background: #fed7aa;
  color: #9a3412;
}
.tiktok-check {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  margin: 14px 0;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tiktok-check:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.tiktok-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  accent-color: #ea580c;
  cursor: pointer;
  flex-shrink: 0;
}
.tiktok-check span {
  font-size: 0.81rem;
  font-weight: 650;
  color: #1e293b;
  line-height: 1.45;
}
.tiktok-attempt-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
#tiktokPublishButton {
  min-height: 42px;
  padding: 0 22px;
  border-radius: 11px;
  font-size: 0.83rem;
  font-weight: 800;
  border: 0;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
#tiktokPublishButton:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
  filter: brightness(1.04);
}
#tiktokPublishButton:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
#tiktokResolveButton {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 0.81rem;
  font-weight: 750;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.18s ease;
}
#tiktokResolveButton:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #0f172a;
  transform: translateY(-1px);
}
#tiktokResolveButton:disabled {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

/* Mock Browser Window Container */
.browser-window-mock {
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 18px;
  overflow: hidden;
  background: #080c14;
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06);
  margin-bottom: 14px;
}
.browser-window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 18px;
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.traffic-lights { display: flex; gap: 7px; width: 60px; }
.traffic-lights .light {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.2);
}
.traffic-lights .red { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); }
.traffic-lights .yellow { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); }
.traffic-lights .green { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); }
.browser-address-bar {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  padding: 5px 16px;
  font-size: 0.74rem;
  color: #cbd5e1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}
.browser-address-bar .lock-icon { font-size: 0.75rem; color: #10b981; }
.browser-bar-spacer { width: 60px; }

.tiktok-browser-stage {
  position: relative;
  background: #07090e;
  height: 640px;
  min-height: 640px;
  width: 100%;
}
.tiktok-browser-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.tiktok-browser-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  height: 100%;
  padding: 40px;
  text-align: center;
  color: #ffffff;
}
.placeholder-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #38bdf8;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  filter: drop-shadow(-2px 0 0 #25f4ee) drop-shadow(2px 0 0 #fe2c55);
}
.tiktok-browser-placeholder strong {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #f8fafc;
  letter-spacing: -0.02em;
}
.tiktok-browser-placeholder p {
  max-width: 360px;
  color: #94a3b8;
  font-size: 0.84rem;
  line-height: 1.6;
  margin: 0;
}

.tiktok-studio-footnote {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.55;
  padding: 8px 4px 4px;
}
.footnote-shield { flex-shrink: 0; font-size: 0.95rem; }

.channel-badge-mini {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #ffffff;
  flex-shrink: 0;
}
.instagram-mini-icon {
  background: linear-gradient(135deg, #833ab4, #fd1d1d 55%, #fcb045);
  box-shadow: 0 3px 8px rgba(225, 48, 108, 0.25);
}
.facebook-mini-icon {
  background: linear-gradient(135deg, #1877f2, #0d5bb5);
  box-shadow: 0 3px 8px rgba(24, 119, 242, 0.25);
}
.youtube-mini-icon {
  background: linear-gradient(135deg, #ff0000, #cc0000);
  box-shadow: 0 3px 8px rgba(255, 0, 0, 0.25);
}

.instagram-option {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: -2px 0 14px;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.instagram-option input {
  width: 16px;
  height: 16px;
  accent-color: #db2777;
}

.instagram-publish-btn {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #833ab4, #fd1d1d 55%, #fcb045);
  font-size: 0.86rem;
  font-weight: 750;
  box-shadow: 0 4px 14px rgba(225, 48, 108, 0.25);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.instagram-publish-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(225, 48, 108, 0.35);
}

.btn-facebook-publish {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #1877f2, #1464cc);
  font-size: 0.86rem;
  font-weight: 750;
  box-shadow: 0 4px 14px rgba(24, 119, 242, 0.25);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-facebook-publish:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(24, 119, 242, 0.35);
}

.btn-youtube-publish {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  font-size: 0.86rem;
  font-weight: 750;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-youtube-publish:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(239, 68, 68, 0.35);
}

.fine-print {
  margin: 18px 0 0;
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.5;
  text-align: center;
}
.studio-head {
  justify-content: space-between;
  align-items: flex-start;
}
.studio-heading-text { flex: 1; }
.external-browser-link {
  align-self: flex-start;
  padding: 7px 14px;
  font-size: 0.78rem;
  font-weight: 750;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  transition: all 0.15s ease;
}
.external-browser-link:hover {
  background: #ffffff;
  border-color: var(--brand);
  color: var(--brand-dark);
}

.tiktok-publish-status {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #ccfbf1;
  border-radius: 12px;
  background: #f0fdfa;
}
.tiktok-publish-status strong { color: var(--teal); font-size: 0.84rem; font-weight: 750; }
.tiktok-publish-status p { margin: 6px 0 10px; color: #475569; font-size: 0.78rem; line-height: 1.6; }
.job-actions .tiktok-review-action { color: var(--teal); border-color: #b6d7d1; }



/* ========================================================
   ADMIN WORKSPACE (#adminView) Modern SaaS Redesign
   ======================================================== */
.admin-view { --admin-accent: #ef6b3a; padding-bottom: 36px; }

.admin-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; padding-top: 10px; }
.admin-header-copy { max-width: 720px; }
.admin-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: rgba(239, 107, 58, 0.08); border: 1px solid rgba(239, 107, 58, 0.2); color: var(--brand); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px; }
.admin-header h1 { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; color: #0f172a; line-height: 1.18; margin: 0 0 6px; }
.admin-header p { font-size: 0.9rem; color: #64748b; margin: 0; line-height: 1.5; }

.admin-refresh-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; height: 40px; padding: 0 16px; border-radius: 11px; font-size: 0.82rem; font-weight: 750; color: #334155; background: #ffffff; border: 1px solid #cbd5e1; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04); transition: all 0.15s ease; white-space: nowrap; }
.admin-refresh-btn:hover { border-color: var(--brand); color: var(--brand-dark); transform: translateY(-1px); }
.admin-refresh-btn:hover .refresh-symbol { transform: rotate(90deg); }
.refresh-symbol { font-size: 1.1rem; line-height: 1; transition: transform 0.25s ease; display: inline-block; }

/* Admin Metric Stat Cards */
.admin-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.admin-metric { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 104px; padding: 20px 22px; border: 1px solid #e2e8f0; border-radius: 18px; background: #ffffff; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03); transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); overflow: hidden; }
.admin-metric::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: transparent; transition: background 0.2s; }
.admin-metric:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07); border-color: #cbd5e1; }
.admin-metric.total::before { background: linear-gradient(90deg, #64748b, #94a3b8); }
.admin-metric.approved::before { background: linear-gradient(90deg, #10b981, #34d399); }
.admin-metric.pending::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.admin-metric.danger::before { background: linear-gradient(90deg, #ef4444, #f87171); }

.metric-info span { display: block; color: #64748b; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.01em; margin-bottom: 6px; }
.metric-info strong { display: block; color: #0f172a; font-size: 2.1rem; font-weight: 850; line-height: 1; letter-spacing: -0.04em; font-feature-settings: "cv02", "cv03", "cv04", "cv11"; }
.admin-metric.danger strong { color: #dc2626; }

.admin-metric-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 1.2rem; font-weight: 850; flex-shrink: 0; }
.total .admin-metric-icon { background: #f1f5f9; color: #475569; }
.approved .admin-metric-icon { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.pending .admin-metric-icon { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.danger .admin-metric-icon { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

/* Admin Quick Create Panel */
.admin-create-panel { margin-bottom: 22px; padding: 0; overflow: hidden; border: 1px solid #e2e8f0; border-radius: 18px; background: #ffffff; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03); transition: border-color 0.2s; }
.admin-create-panel summary { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px; list-style: none; padding: 14px 20px; color: #0f172a; cursor: pointer; user-select: none; transition: background 0.15s; }
.admin-create-panel summary:hover { background: #f8fafc; }
.admin-create-panel summary::-webkit-details-marker { display: none; }
.admin-create-panel summary::marker { content: ""; display: none; }

.summary-left { display: flex; align-items: center; gap: 12px; }
.admin-summary-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #f0fdfa; color: #0f766e; border: 1px solid #ccfbf1; font-size: 1.1rem; font-weight: 850; flex-shrink: 0; }
.summary-left strong { display: block; font-size: 0.92rem; font-weight: 750; color: #0f172a; letter-spacing: -0.01em; }
.summary-left small { display: block; font-size: 0.74rem; color: #64748b; margin-top: 1px; }

.summary-toggle-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 0.72rem; font-weight: 700; transition: all 0.15s; }
.summary-toggle-pill i { display: inline-flex; align-items: center; justify-content: center; font-style: normal; transition: transform 0.2s ease; }
.summary-toggle-pill i svg { width: 13px; height: 13px; display: block; }
.admin-create-panel[open] .summary-toggle-pill i { transform: rotate(180deg); }
.admin-create-panel[open] summary { border-bottom: 1px solid #f1f5f9; }

.admin-create-form { display: grid; grid-template-columns: 1.3fr 1.1fr 1fr 0.85fr 0.85fr auto; align-items: end; gap: 12px; padding: 20px 22px 24px; background: #fafbfc; }
.admin-create-form label { display: flex; flex-direction: column; gap: 6px; color: #334155; font-size: 0.76rem; font-weight: 750; }
.admin-create-form input, .admin-create-form select { width: 100%; min-width: 0; min-height: 42px; border: 1px solid #cbd5e1; border-radius: 10px; outline: none; padding: 8px 12px; color: #0f172a; background-color: #ffffff; font-size: 0.82rem; transition: all 0.15s ease; }
.admin-create-form select { padding-right: 36px; }
.admin-create-form input:focus, .admin-create-form select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(239, 107, 58, 0.12); }
.admin-create-submit { min-height: 42px; height: 42px; padding: 0 18px; font-size: 0.82rem; font-weight: 750; border-radius: 10px; background: linear-gradient(135deg, var(--brand), #ea580c); color: #ffffff; white-space: nowrap; box-shadow: 0 3px 10px rgba(239, 107, 58, 0.25); border: 0; cursor: pointer; transition: all 0.15s ease; }
.admin-create-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(239, 107, 58, 0.35); }

/* Accounts Table Panel */
.admin-accounts-panel { overflow: hidden; border: 1px solid #e2e8f0; border-radius: 20px; background: #ffffff; box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04); }
.admin-toolbar {
  border-bottom: 1px solid #f1f5f9;
  background: #ffffff;
}
.admin-account-toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px) 200px; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid #f1f5f9; background: #ffffff; }
.admin-jobs-toolbar { display: grid; grid-template-columns: minmax(200px, 1.2fr) minmax(180px, 1.5fr) minmax(150px, 1fr) minmax(150px, 1fr) auto; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid #f1f5f9; background: #ffffff; }
.admin-audit-toolbar { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(220px, 320px) auto; align-items: center; gap: 14px; padding: 16px 22px; border-bottom: 1px solid #f1f5f9; background: #ffffff; }
.admin-list-title strong { display: block; font-size: 0.98rem; font-weight: 800; color: #0f172a; letter-spacing: -0.01em; }
.admin-list-title small { display: block; color: #64748b; font-size: 0.74rem; margin-top: 1px; }

.admin-search { position: relative; width: 100%; }
.admin-search > span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 1.15rem; pointer-events: none; }
.admin-search input { width: 100%; min-height: 42px; border: 1px solid #cbd5e1; border-radius: 11px; padding: 8px 12px 8px 38px; font-size: 0.84rem; color: #0f172a; background: #f8fafc; outline: none; transition: all 0.15s ease; }
.admin-search input:focus { background: #ffffff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(239, 107, 58, 0.12); }

.admin-filter-wrap select { width: 100%; min-height: 42px; border: 1px solid #cbd5e1; border-radius: 11px; padding: 8px 36px 8px 12px; font-size: 0.82rem; color: #334155; background-color: #f8fafc; outline: none; cursor: pointer; transition: all 0.15s ease; }
.admin-filter-wrap select:focus { background-color: #ffffff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(239, 107, 58, 0.12); }

.admin-account-head { display: grid; grid-template-columns: minmax(250px, 1.5fr) repeat(4, minmax(120px, 0.85fr)) 80px; align-items: center; gap: 14px; padding: 12px 22px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; color: #64748b; font-size: 0.7rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.col-action-title { text-align: right; }

.admin-accounts-list { min-height: 200px; }
.admin-account-row { display: grid; grid-template-columns: minmax(250px, 1.5fr) repeat(4, minmax(120px, 0.85fr)) 80px; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid #f1f5f9; transition: background 0.15s ease; }
.admin-account-row:hover { background: #f8fafc; }
.admin-account-row:last-child { border-bottom: 0; }

.admin-account-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.admin-avatar { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 0.95rem; font-weight: 850; color: #ffffff; background: linear-gradient(135deg, #0f766e, #115e59); box-shadow: 0 4px 10px rgba(15, 118, 110, 0.2); flex-shrink: 0; }
.admin-avatar.avatar-owner { background: linear-gradient(135deg, #0f172a, #334155); box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2); }
.admin-avatar.avatar-admin { background: linear-gradient(135deg, #c2410c, #ea580c); box-shadow: 0 4px 10px rgba(234, 88, 12, 0.2); }
.admin-avatar.avatar-editor { background: linear-gradient(135deg, #1d4ed8, #3b82f6); box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2); }
.admin-avatar.avatar-viewer { background: linear-gradient(135deg, #475569, #64748b); box-shadow: 0 4px 10px rgba(71, 85, 105, 0.2); }

.user-meta-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.name-edit-wrap input { width: 100%; min-width: 0; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; font-size: 0.9rem; font-weight: 800; color: #0f172a; background: transparent; transition: all 0.15s ease; font-family: inherit; }
.name-edit-wrap input:hover { background: #ffffff; border-color: #cbd5e1; }
.name-edit-wrap input:focus { background: #ffffff; border-color: var(--brand); outline: none; box-shadow: 0 0 0 2px rgba(239, 107, 58, 0.15); }

.user-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.74rem; font-weight: 600; color: #0f766e; padding: 0 6px; display: block; }
.user-join-date { font-size: 0.68rem; color: #94a3b8; padding: 0 6px; display: block; }
.admin-user-quota { font-size: 0.68rem; color: #c2410c; padding: 1px 6px 0; display: block; font-weight: 700; }

.admin-account-field { position: relative; min-width: 0; }
.field-label-inline { display: none; }
.admin-account-field select { width: 100%; min-width: 0; min-height: 38px; border: 1px solid #cbd5e1; border-radius: 10px; outline: none; padding: 6px 32px 6px 12px; font-size: 0.78rem; font-weight: 650; color: #334155; background-color: #ffffff; background-position: right 10px center; transition: all 0.15s ease; cursor: pointer; }
.admin-account-field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(239, 107, 58, 0.12); }
.admin-account-field select:disabled { color: #94a3b8; background-color: #f1f5f9; border-color: #e2e8f0; cursor: not-allowed; }

.admin-account-field.status-approved select { background-color: #ecfdf5; border-color: #a7f3d0; color: #047857; font-weight: 750; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23047857' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); }
.admin-account-field.status-pending select { background-color: #fffbeb; border-color: #fde68a; color: #b45309; font-weight: 750; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b45309' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); }
.admin-account-field.status-suspended select, .admin-account-field.status-rejected select { background-color: #fef2f2; border-color: #fecaca; color: #b91c1c; font-weight: 750; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b91c1c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); }

.admin-action-cell { display: flex; justify-content: flex-end; }
.btn-admin-save { min-height: 36px; height: 36px; padding: 0 14px; border-radius: 9px; font-size: 0.76rem; font-weight: 750; border: 1px solid #cbd5e1; background: #ffffff; color: #0f172a; display: inline-flex; align-items: center; gap: 5px; cursor: pointer; transition: all 0.15s ease; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.btn-admin-save:hover:not(:disabled) { background: #0f172a; color: #ffffff; border-color: #0f172a; transform: translateY(-1px); }
.btn-admin-save:disabled { opacity: 0.5; cursor: not-allowed; }
.save-icon { font-size: 0.8rem; font-weight: 900; }

@media(max-width: 1180px) {
  .admin-account-head, .admin-account-row { grid-template-columns: minmax(220px, 1.4fr) repeat(4, minmax(110px, 0.8fr)) 74px; gap: 10px; padding: 12px 16px; }
}

@media(max-width: 960px) {
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-create-form { grid-template-columns: 1fr 1fr; }
  .admin-create-submit { grid-column: 1 / -1; width: 100%; justify-content: center; }
  .admin-account-head { display: none; }
  .admin-account-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; border-radius: 14px; border: 1px solid #e2e8f0; margin: 12px; background: #ffffff; }
  .admin-account-user { grid-column: 1 / -1; padding-bottom: 6px; border-bottom: 1px solid #f1f5f9; }
  .field-label-inline { display: block; font-size: 0.68rem; font-weight: 750; color: #64748b; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.03em; }
  .admin-action-cell { grid-column: 1 / -1; }
  .btn-admin-save { width: 100%; justify-content: center; min-height: 42px; }
}

@media(max-width: 680px) {
  .admin-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .admin-header-actions { width: 100%; }
  .admin-refresh-btn { width: 100%; justify-content: center; }
  .admin-account-toolbar { grid-template-columns: 1fr; gap: 10px; }
  .admin-create-form { grid-template-columns: 1fr; }
}

@media(max-width: 520px) {
  .admin-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .admin-account-row { grid-template-columns: 1fr; margin: 8px 0; padding: 12px; }
}

.admin-subtabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
}
.admin-subtab {
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}
.admin-subtab:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.04);
}
.admin-subtab.active {
  color: var(--brand);
  background: rgba(239, 107, 58, 0.08);
  border-color: rgba(239, 107, 58, 0.25);
}
.audit-warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 14px;
  margin-bottom: 20px;
  color: #92400e;
}
.audit-warning-banner strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.audit-warning-banner p {
  font-size: 0.82rem;
  margin: 0;
  line-height: 1.45;
}
.admin-jobs-head, .admin-jobs-row {
  display: grid;
  grid-template-columns: 110px minmax(160px, 1.2fr) minmax(180px, 1.5fr) 110px 100px 130px 100px;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
}
.admin-jobs-head {
  font-size: 0.72rem;
  font-weight: 750;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.admin-jobs-row {
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
  transition: background 0.15s ease;
}
.admin-jobs-row:hover {
  background: #f8fafc;
}
.admin-audit-head, .admin-audit-row {
  display: grid;
  grid-template-columns: 140px minmax(160px, 1fr) 140px 100px minmax(140px, 1fr) minmax(180px, 1.5fr);
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
}
.admin-audit-head {
  font-size: 0.72rem;
  font-weight: 750;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}
.admin-audit-row {
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.82rem;
  transition: background 0.15s ease;
}
.admin-audit-row:hover {
  background: #f8fafc;
}
.audit-metadata-code {
  font-family: monospace;
  font-size: 0.75rem;
  background: #f1f5f9;
  padding: 3px 6px;
  border-radius: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================================================
   BILLING & SUBSCRIPTIONS (#billingView) Modern SaaS Redesign
   ======================================================== */
.billing-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 26px; padding-top: 10px; }
.billing-header-copy { max-width: 680px; }
.billing-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: rgba(239, 107, 58, 0.08); border: 1px solid rgba(239, 107, 58, 0.2); color: var(--brand); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 8px; }
.billing-sparkle { font-size: 0.8rem; }
.billing-header h1 { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.03em; color: #0f172a; line-height: 1.18; margin: 0 0 6px; }
.billing-header p { font-size: 0.9rem; color: #64748b; margin: 0; line-height: 1.5; }

.billing-current-card { min-width: 240px; padding: 14px 18px; border: 1px solid #cbd5e1; border-radius: 16px; background: linear-gradient(135deg, #ffffff, #f8fafc); box-shadow: 0 4px 14px rgba(15, 23, 42, 0.04); display: flex; flex-direction: column; gap: 8px; }
.current-plan-header { display: flex; align-items: center; gap: 8px; }
.plan-status-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); animation: pulse-dot 2s infinite; }
.current-plan-kicker { font-size: 0.68rem; font-weight: 750; letter-spacing: 0.04em; color: #64748b; text-transform: uppercase; }
.current-plan-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.current-plan-body strong { font-size: 1.35rem; font-weight: 850; letter-spacing: -0.02em; color: #0f172a; }
.current-payment-badge { padding: 4px 11px; border-radius: 999px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; font-size: 0.72rem; font-weight: 750; }

.billing-notice { position: sticky; top: 82px; z-index: 24; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding: 14px 18px; border: 1px solid #fdba74; border-radius: 14px; color: #9a3412; background: rgba(255, 247, 237, .96); backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%); box-shadow: 0 8px 24px rgba(154, 52, 18, .1); font-size: 0.82rem; line-height: 1.5; }
.billing-notice strong { color: #7c2d12; font-size: .86rem; white-space: nowrap; }
.billing-notice span { color: #9a3412; text-align: right; }

/* Pricing Plan Grid */
.billing-plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-bottom: 26px; align-items: stretch; }
.billing-plan { position: relative; display: flex; flex-direction: column; padding: 24px 20px; border: 1px solid #e2e8f0; border-radius: 20px; background: #ffffff; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03); transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
.billing-plan:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08); border-color: #cbd5e1; }
.billing-plan.is-selectable { cursor: pointer; }
.billing-plan.is-selectable:focus-visible { outline: 3px solid rgba(234, 88, 12, .25); outline-offset: 3px; }
.billing-plan.is-selected { border-color: var(--brand); background: linear-gradient(180deg, #fff7ed 0%, #ffffff 42%); box-shadow: 0 0 0 2px rgba(234, 88, 12, .16), 0 16px 36px rgba(234, 88, 12, .14); transform: translateY(-4px); }
.billing-plan.is-selected::after { content: "✓ Đã chọn"; position: absolute; top: 15px; right: 18px; padding: 4px 9px; border-radius: 999px; color: #fff; background: var(--brand); font-size: .66rem; font-weight: 850; box-shadow: 0 4px 10px rgba(234, 88, 12, .25); }
.billing-plan.is-selected .plan-icon { visibility: hidden; }
.billing-plan.featured { border-color: #fed7aa; background: linear-gradient(180deg, #fffbf8 0%, #ffffff 40%); box-shadow: 0 10px 30px rgba(239, 107, 58, 0.12); }
.billing-plan.featured::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 20px 20px 0 0; background: linear-gradient(90deg, var(--brand), #ea580c); }
.billing-plan.current { border: 2px solid #0f172a; box-shadow: 0 6px 20px rgba(15, 23, 42, 0.06); }

.plan-card-header { margin-bottom: 8px; }
.plan-badge-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.plan-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 0.68rem; font-weight: 750; letter-spacing: 0.03em; text-transform: uppercase; }
.badge-standard { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.badge-featured { background: #fff7ed; color: var(--brand-dark); border: 1px solid #ffedd5; }
.badge-current { background: #0f172a; color: #ffffff; }
.status-pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: #10b981; animation: pulse-dot 1.8s infinite; }
.star-icon { color: var(--brand); font-size: 0.75rem; }
.plan-icon { font-size: 1.25rem; line-height: 1; }
.billing-plan h2 { font-size: 1.35rem; font-weight: 800; color: #0f172a; margin: 0 0 6px; letter-spacing: -0.02em; }
.billing-plan p { font-size: 0.78rem; color: #64748b; line-height: 1.45; margin: 0; min-height: 38px; }
.billing-plan p strong { color: #0f172a; font-weight: 750; }

.plan-price-wrap { margin: 18px 0 16px; padding-bottom: 16px; border-bottom: 1px solid #f1f5f9; }
.plan-price { display: block; font-size: 1.75rem; font-weight: 850; color: #0f172a; letter-spacing: -0.03em; line-height: 1.1; font-feature-settings: "tnum"; }
.plan-price small { font-size: 0.74rem; font-weight: 600; color: #64748b; letter-spacing: 0; margin-left: 4px; }

.plan-features { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 11px; flex: 1; }
.plan-features li { display: flex; align-items: flex-start; gap: 9px; font-size: 0.77rem; color: #334155; line-height: 1.45; }
.feature-icon { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 0.65rem; font-weight: 900; flex-shrink: 0; margin-top: 1px; }
.feature-icon.check { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.feature-icon.dash { background: #f1f5f9; color: #94a3b8; }
.feature-muted { color: #94a3b8; }

.plan-card-action { margin-top: auto; }
.plan-card-action .button { width: 100%; min-height: 42px; height: 42px; font-size: 0.82rem; font-weight: 750; border-radius: 11px; justify-content: center; }
.billing-plan.featured .button.primary { background: linear-gradient(135deg, var(--brand), #ea580c); box-shadow: 0 4px 14px rgba(239, 107, 58, 0.3); }
.billing-plan.featured .button.primary:hover { box-shadow: 0 8px 20px rgba(239, 107, 58, 0.42); transform: translateY(-1px); }
.current-plan-btn:disabled { background: #f8fafc !important; color: #0f172a !important; border-color: #cbd5e1 !important; opacity: 1 !important; font-weight: 750 !important; cursor: default !important; }
.enterprise-btn { display: inline-flex; align-items: center; justify-content: space-between; padding: 0 16px; background: #f8fafc; border: 1px solid #cbd5e1; color: #0f172a; text-decoration: none; }
.enterprise-btn:hover { background: #0f172a; color: #ffffff; border-color: #0f172a; transform: translateY(-1px); }

/* Checkout Card */
.payment-checkout { display: grid; grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.2fr); gap: 32px; padding: 32px; border: 1px solid #e2e8f0; border-radius: 20px; background: #ffffff; box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04); margin-bottom: 24px; }
.payment-checkout.is-focused { animation: billing-checkout-focus 1.35s ease; }
@keyframes billing-checkout-focus { 0%, 100% { border-color: #e2e8f0; box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04); } 35% { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(234, 88, 12, .12), 0 14px 34px rgba(234, 88, 12, .14); } }
.payment-checkout-copy h2 { font-size: 1.35rem; font-weight: 800; color: #0f172a; margin: 8px 0 6px; letter-spacing: -0.02em; }
.payment-checkout-copy p { font-size: 0.82rem; color: #64748b; line-height: 1.55; margin: 0 0 16px; }

.checkout-guarantees { display: grid; gap: 10px; margin-top: 14px; padding-top: 16px; border-top: 1px solid #f1f5f9; }
.guarantee-item { display: flex; align-items: flex-start; gap: 11px; padding: 10px 14px; border-radius: 12px; background: #f8fafc; border: 1px solid #f1f5f9; }
.guarantee-icon { font-size: 1.15rem; flex-shrink: 0; margin-top: 1px; }
.guarantee-item strong { display: block; font-size: 0.8rem; font-weight: 750; color: #0f172a; }
.guarantee-item small { display: block; font-size: 0.72rem; color: #64748b; margin-top: 1px; }

.payment-form { display: grid; gap: 14px; }
.form-field-wrap { display: grid; gap: 7px; color: #334155; font-size: 0.78rem; font-weight: 750; }
.form-field-wrap select { width: 100%; min-height: 44px; border: 1px solid #cbd5e1; border-radius: 11px; padding: 8px 38px 8px 14px; font-size: 0.84rem; color: #0f172a; background-color: #f8fafc; outline: none; transition: all 0.15s ease; cursor: pointer; }
.form-field-wrap select:focus { background-color: #ffffff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(239, 107, 58, 0.12); }

.providers-fieldset { border: 0; padding: 0; margin: 0 0 8px; }
.providers-fieldset legend { font-size: 0.78rem; font-weight: 750; color: #334155; margin-bottom: 10px; display: block; }
.payment-methods-grid { display: grid; gap: 10px; }
.payment-method { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 64px; border: 1.5px solid #e2e8f0; border-radius: 14px; background: #ffffff; cursor: pointer; transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1); }
.payment-method:hover:not(.disabled) { border-color: #cbd5e1; background: #f8fafc; }
.payment-method:has(input:checked) { border-color: var(--brand); background: #fffbf9; box-shadow: 0 0 0 3px rgba(239, 107, 58, 0.12); }
.payment-method.disabled { opacity: 0.55; cursor: not-allowed; }
.payment-method input[type="radio"] { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0; }
.payment-logo { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 1.15rem; font-weight: 850; flex-shrink: 0; color: #ffffff; }
.payment-logo-bank { background: linear-gradient(135deg, #0284c7, #0369a1); box-shadow: 0 3px 8px rgba(2, 132, 199, 0.25); }
.payment-logo-momo { background: linear-gradient(135deg, #d82d8b, #a50064); box-shadow: 0 3px 8px rgba(216, 45, 139, 0.25); font-size: 1.05rem; }
.payment-logo-zalo { background: linear-gradient(135deg, #0068ff, #0050c8); box-shadow: 0 3px 8px rgba(0, 104, 255, 0.25); font-size: 1.05rem; }
.payment-meta { flex: 1; min-width: 0; }
.payment-meta strong { display: block; font-size: 0.84rem; font-weight: 750; color: #0f172a; }
.payment-meta small { display: block; margin-top: 2px; color: #64748b; font-size: 0.72rem; line-height: 1.4; }
.method-check { color: var(--brand); font-size: 0.8rem; margin-left: auto; }
.method-unavailable { color: #94a3b8; font-size: 0.72rem; font-style: normal; font-weight: 600; margin-left: auto; }

.checkout-submit-btn { width: 100%; min-height: 46px; height: 46px; font-size: 0.88rem; font-weight: 750; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: linear-gradient(135deg, var(--brand), #ea580c); color: #ffffff; box-shadow: 0 4px 14px rgba(239, 107, 58, 0.32); transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.checkout-submit-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(239, 107, 58, 0.42); }
.btn-lock { font-size: 0.95rem; }

/* Payment Instructions Voucher */
.payment-instructions { grid-column: 1 / -1; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; padding: 26px; border: 1.5px solid #cbd5e1; border-radius: 18px; background: linear-gradient(145deg, #f8fafc, #ffffff); box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05); align-items: start; }
.bank-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.bank-qr-frame { padding: 12px; background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06); width: 220px; max-width: 100%; }
.bank-qr-frame img { width: 100%; aspect-ratio: 1; display: block; object-fit: contain; }
.bank-qr-caption { font-size: 0.72rem; color: #64748b; font-weight: 600; }

.bank-transfer-detail { display: flex; flex-direction: column; gap: 14px; }
.detail-kicker { display: inline-flex; align-items: center; gap: 7px; color: #047857; font-size: 0.74rem; font-weight: 750; text-transform: uppercase; letter-spacing: 0.03em; }
.transfer-total { font-size: 2rem; font-weight: 900; color: #0f172a; margin: 0; letter-spacing: -0.03em; font-feature-settings: "tnum"; }
.transfer-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.transfer-specs div { padding: 12px 14px; border-radius: 12px; background: #ffffff; border: 1px solid #e2e8f0; }
.transfer-specs dt { font-size: 0.68rem; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.transfer-specs dd { margin: 4px 0 0; font-size: 0.88rem; font-weight: 800; color: #0f172a; word-break: break-all; }
.copyable-value { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.highlight-content { color: var(--brand-dark); background: #fff7ed; padding: 2px 6px; border-radius: 6px; border: 1px solid #fed7aa; display: inline-block; }
.transfer-note-box { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 12px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; font-size: 0.76rem; line-height: 1.5; }
.transfer-note-box p { margin: 0; }
.mini-copy-btn { border: 0; background: transparent; cursor: pointer; font-size: 0.88rem; padding: 2px 6px; margin-left: 6px; border-radius: 6px; transition: all 0.15s ease; vertical-align: middle; }
.mini-copy-btn:hover { background: rgba(15, 23, 42, 0.08); transform: scale(1.15); }
.transfer-action-buttons { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.transfer-confirm-btn { min-height: 42px; padding: 0 18px; font-size: 0.84rem; font-weight: 750; border-radius: 11px; background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 3px 10px rgba(16, 185, 129, 0.28); color: #ffffff; }
.transfer-confirm-btn:hover:not(:disabled) { background: linear-gradient(135deg, #059669, #047857); box-shadow: 0 6px 16px rgba(16, 185, 129, 0.38); transform: translateY(-1px); }
.transfer-cancel-btn { min-height: 42px; padding: 0 16px; font-size: 0.82rem; font-weight: 700; border-radius: 11px; color: #64748b; }
.transfer-cancel-btn:hover:not(:disabled) { color: #ef4444; border-color: #fca5a5; background: #fef2f2; }

/* History Card */
.billing-history { border: 1px solid #e2e8f0; border-radius: 20px; background: #ffffff; box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03); overflow: hidden; }
.billing-history-header { padding: 20px 24px; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; justify-content: space-between; }
.history-title-wrap { display: flex; align-items: center; gap: 12px; }
.history-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #f1f5f9; color: #475569; font-size: 1.1rem; }
.history-title-wrap h2 { margin: 0; font-size: 1.15rem; font-weight: 750; color: #0f172a; letter-spacing: -0.01em; }
.history-title-wrap p { margin: 2px 0 0; font-size: 0.77rem; color: #64748b; }
.billing-orders { min-height: 100px; }
.billing-order-item { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 24px; border-bottom: 1px solid #f1f5f9; transition: background 0.15s ease; flex-wrap: wrap; }
.billing-order-item:hover { background: #f8fafc; }
.billing-order-item:last-child { border-bottom: 0; }
.order-main { display: flex; align-items: center; gap: 12px; }
.order-icon { font-size: 1.25rem; }
.order-code { display: block; font-size: 0.84rem; font-weight: 750; color: #0f172a; font-family: ui-monospace, monospace; }
.order-date { display: block; font-size: 0.72rem; color: #64748b; margin-top: 1px; }
.order-amount-status { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.order-amount { font-size: 0.95rem; font-weight: 800; color: #0f172a; font-feature-settings: "tnum"; }
.order-status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.status-dot-mini { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.order-paid { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.order-pending { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
.order-failed, .order-cancelled, .order-expired { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.order-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.mini-btn { min-height: 30px; height: 30px; padding: 0 11px; font-size: 0.74rem; font-weight: 750; border-radius: 8px; }
.mini-btn.cancel-btn { color: #64748b; }
.mini-btn.cancel-btn:hover { color: #ef4444; border-color: #fca5a5; background: #fef2f2; }

/* Create workflow — modern studio layout */
#createView { padding-bottom: 48px; }
.create-page-heading { position: relative; align-items: end; overflow: visible; padding: 34px 0 20px; }
.create-page-heading::before { content: ""; position: absolute; width: 340px; height: 180px; top: -60px; left: -120px; z-index: -1; border-radius: 50%; background: radial-gradient(circle, rgba(239, 107, 58, 0.12), transparent 70%); pointer-events: none; }
.create-heading-copy { min-width: 0; overflow: visible; padding-top: 2px; }
.create-badge-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.eyebrow-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #fff7ed; border: 1px solid #ffedd5; color: var(--brand-dark); font-size: 0.72rem; font-weight: 850; letter-spacing: 0.05em; text-transform: uppercase; }
.eyebrow-note { color: var(--muted); font-size: 0.75rem; font-weight: 600; }
.create-page-heading h1 { max-width: 780px; margin: 4px 0 8px; padding: .12em 0 .08em; overflow: visible; font-size: clamp(1.8rem, 2.5vw, 2.45rem); line-height: 1.2; letter-spacing: -0.035em; color: var(--ink); }
.create-page-heading p { max-width: 620px; line-height: 1.55; font-size: 0.92rem; color: var(--muted); margin: 0; }
.create-heading-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; }
.heading-status-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
.status-ping { width: 7px; height: 7px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.view-jobs-cta { gap: 8px; font-size: 0.82rem; font-weight: 750; border-radius: 11px; padding: 8px 14px; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04); }
.view-jobs-cta b { font-size: 0.95rem; }

/* Stepper bar */
.workflow-steps-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 22px; padding: 6px; border: 1px solid rgba(226, 232, 240, 0.9); border-radius: 16px; background: rgba(255, 255, 255, 0.85); box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03); backdrop-filter: blur(12px); }
.workflow-steps-nav a { position: relative; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 54px; border-radius: 11px; padding: 8px 12px; color: var(--muted); text-decoration: none; transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1); }
.workflow-steps-nav a:hover { color: var(--ink); background: rgba(255, 255, 255, 0.9); }
.workflow-steps-nav a.is-active { color: var(--ink); background: #ffffff; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04); }
.step-nav-badge { flex: 0 0 28px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: #475467; background: #f1f5f9; font-size: 0.72rem; font-weight: 850; transition: all 0.18s; }
.workflow-steps-nav a.is-active .step-nav-badge { color: #ffffff; background: linear-gradient(135deg, var(--brand), #f97316); box-shadow: 0 4px 10px rgba(239, 107, 58, 0.32); }
.workflow-steps-nav strong, .workflow-steps-nav small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workflow-steps-nav strong { font-size: 0.82rem; font-weight: 750; color: inherit; }
.workflow-steps-nav small { margin-top: 1px; color: var(--muted); font-size: 0.66rem; font-weight: 550; }

/* Workflow Layout Grid */
#createView .workflow-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
#createView .workflow-main { display: grid; gap: 20px; }
#createView .step-card { position: relative; overflow: hidden; padding: 26px 28px; border-radius: 18px; border: 1px solid rgba(226, 232, 240, 0.9); background: #ffffff; box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02); scroll-margin-top: 86px; }
#createView .step-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(180deg, var(--brand), rgba(239, 107, 58, 0.15) 70%, transparent); }
#createView .config-step-card::before { background: linear-gradient(180deg, var(--teal), rgba(23, 107, 104, 0.15) 70%, transparent); }
#createView .subtitle-step-card::before { background: linear-gradient(180deg, #6366f1, rgba(99, 102, 241, 0.15) 70%, transparent); }
#createView .publish-step-card::before { background: linear-gradient(180deg, #0f172a, rgba(15, 23, 42, 0.15) 70%, transparent); }

#createView .step-heading { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; }
.step-badge { flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #ffffff; background: linear-gradient(135deg, #1e293b, #0f172a); font-size: 0.85rem; font-weight: 850; box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15); }
#createView .step-heading h2 { margin: 0 0 3px; font-size: 1.15rem; font-weight: 700; letter-spacing: 0; line-height: 1.35; color: var(--ink); }
#createView .step-heading p { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.45; }

/* STEP 1: Video Sources */
.source-options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.source-options-grid .drop-zone { position: relative; min-height: 204px; border: 2px dashed #cbd5e1; border-radius: 16px; background: linear-gradient(180deg, #f8fafc, #f1f5f9 65%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; cursor: pointer; padding: 24px; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.source-options-grid .drop-zone:hover, .source-options-grid .drop-zone.dragging { border-color: var(--brand); background: #fff7ed; transform: translateY(-2px); box-shadow: 0 8px 24px -4px rgba(239, 107, 58, 0.14); }
.source-options-grid .drop-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: #ffffff; color: var(--brand); box-shadow: 0 4px 12px rgba(239, 107, 58, 0.12); margin-bottom: 2px; }
.source-options-grid .drop-icon svg { width: 24px; height: 24px; }
.source-options-grid .drop-zone strong { font-size: 0.88rem; font-weight: 750; color: var(--ink); max-width: 240px; line-height: 1.35; }
.source-options-grid .drop-zone small { color: var(--muted); font-size: 0.74rem; font-weight: 550; }
.source-option-kicker { color: var(--brand-dark); font-size: 0.66rem; font-weight: 850; letter-spacing: 0.07em; text-transform: uppercase; }
.drop-zone .source-option-kicker { position: absolute; top: 14px; left: 16px; }

.source-options-grid .link-source-field { border: 1px solid #e2e8f0; border-radius: 16px; background: linear-gradient(180deg, #f8fafc, #ffffff); padding: 18px; display: flex; flex-direction: column; gap: 10px; cursor: text; }
.link-source-top { display: flex; align-items: center; gap: 12px; }
.link-source-icon { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--teal), #0f766e); color: #ffffff; box-shadow: 0 4px 12px rgba(23, 107, 104, 0.18); }
.link-source-icon svg { width: 20px; height: 20px; }
.link-source-copy strong { display: block; font-size: 0.88rem; font-weight: 750; color: var(--ink); }
.link-source-copy small { display: block; margin-top: 1px; color: var(--muted); font-size: 0.72rem; }
.link-source-copy strong, .link-source-copy small, .source-options-grid .drop-zone strong { overflow-wrap: normal; word-break: normal; }
.source-options-grid .link-source-field textarea { width: 100%; min-height: 100px; height: 100px; border: 1px solid #cbd5e1; border-radius: 11px; padding: 10px 12px; font-size: 0.8rem; font-family: inherit; resize: none; outline: none; background: #ffffff; color: var(--ink); line-height: 1.45; transition: border-color .15s, box-shadow .15s; }
.source-options-grid .link-source-field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(23, 107, 104, 0.12); }

.source-auth-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 12px; margin-top: 14px; }
.douyin-auth-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid #ccfbf1; border-radius: 13px; background: linear-gradient(135deg, #f0fdfa, #ffffff); }
.douyin-auth-icon { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #0f172a, var(--teal)); color: #fff; font-size: 0.74rem; font-weight: 800; }
.douyin-auth-copy { flex: 1; min-width: 0; }
.douyin-auth-copy strong { display: block; font-size: 0.82rem; font-weight: 700; color: var(--ink); }
.douyin-auth-copy small { display: block; margin-top: 1px; color: var(--muted); font-size: 0.7rem; }
.douyin-auth-copy small.authenticated { color: var(--green); font-weight: 700; }
.douyin-auth-actions { flex: 0 0 auto; display: flex; gap: 6px; }

.cookie-source-field { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 13px; background: #f8fafc; cursor: pointer; transition: all 0.15s ease; }
.cookie-source-field:hover { border-color: #cbd5e1; background: #f1f5f9; }
.cookie-label-wrap { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.cookie-label-wrap > div { min-width: 0; }
.cookie-icon { font-size: 1.25rem; flex: 0 0 auto; }
.cookie-label-wrap strong { display: block; font-size: 0.8rem; font-weight: 700; color: var(--ink); letter-spacing: 0; }
.cookie-label-wrap small { display: block; margin-top: 1px; color: var(--muted); font-size: 0.68rem; line-height: 1.35; }
.cookie-source-field input { flex: 0 0 auto; width: auto; max-width: 175px; font-size: 0.72rem; color: var(--muted); cursor: pointer; }
.cookie-source-field input::file-selector-button { min-height: 32px; margin-right: 6px; border: 1px solid #cbd5e1; border-radius: 8px; padding: 5px 10px; background: #fff; color: var(--ink); cursor: pointer; font-size: 0.72rem; font-weight: 700; transition: all 0.15s; }
.cookie-source-field input::file-selector-button:hover { border-color: var(--brand); color: var(--brand-dark); }
.small-btn { min-height: 32px; padding: 5px 10px; font-size: 0.72rem; border-radius: 8px; white-space: nowrap; }

/* STEP 2: Configuration Stack */
.config-stack { display: grid; gap: 16px; }
.batch-name-card { padding: 14px 18px; border: 1px solid #e2e8f0; border-radius: 14px; background: linear-gradient(180deg, #f8fafc, #ffffff); }
.field-label-group { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; margin-bottom: 6px; }
.field-title { font-size: 0.78rem; font-weight: 750; color: #334155; }
.field-hint { font-size: 0.7rem; color: var(--muted); font-weight: 500; }
.input-with-icon { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 13px; font-size: 1rem; color: var(--muted); pointer-events: none; }
.input-with-icon input { padding-left: 38px; }

/* Mode Selection Cards */
.mode-cluster { padding: 18px 20px; border: 1px solid #e2e8f0; border-radius: 16px; background: #ffffff; }
.cluster-header { margin-bottom: 14px; }
.cluster-badge { display: inline-block; font-size: 0.64rem; font-weight: 850; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-dark); background: #fff7ed; border: 1px solid #ffedd5; padding: 2px 7px; border-radius: 6px; margin-bottom: 4px; }
.cluster-header h3 { margin: 2px 0 3px; font-size: 0.96rem; font-weight: 800; color: var(--ink); }
.cluster-header p { margin: 0; font-size: 0.78rem; color: var(--muted); line-height: 1.45; }

.mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.mode-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 16px 15px; border: 2px solid #e2e8f0; border-radius: 14px; background: #ffffff; cursor: pointer; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); outline: none; }
.mode-card:hover { border-color: #cbd5e1; transform: translateY(-2px); box-shadow: 0 6px 18px -3px rgba(15, 23, 42, 0.06); }
.mode-card.is-selected { border-color: var(--brand); background: linear-gradient(180deg, #fff7ed 0%, #ffffff 42%); box-shadow: 0 0 0 1px var(--brand), 0 8px 22px -4px rgba(239, 107, 58, 0.16); transform: translateY(-2px); }
.mode-card-header { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 10px; }
.mode-card-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 1.15rem; background: #f1f5f9; }
.mode-card.is-selected .mode-card-icon { background: #ffedd5; }
.mode-card-pill { font-size: 0.64rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 7px; border-radius: 999px; background: #f1f5f9; color: #64748b; }
.mode-card-pill.featured { background: #ffedd5; color: var(--brand-dark); font-weight: 850; }
.mode-card-title { font-size: 0.88rem; font-weight: 800; color: #0f172a; margin-bottom: 4px; }
.mode-card-desc { font-size: 0.72rem; color: #64748b; line-height: 1.45; margin: 0; }

.mode-select-fallback { display: none; }
.mode-hint { padding: 11px 14px; border-radius: 11px; background: #f0fdfa; border: 1px solid #ccfbf1; color: #0f766e; font-size: 0.76rem; font-weight: 650; line-height: 1.48; margin: 0; }

/* Language Bridge Panel */
.language-bridge-panel { display: grid; gap: 14px; }
.language-flow-card { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; padding: 14px 16px; border: 1px solid #e2e8f0; border-radius: 14px; background: linear-gradient(180deg, #f8fafc, #ffffff); }
.language-flow-arrow { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #f1f5f9; color: var(--brand); margin-bottom: 5px; flex: 0 0 34px; }
.language-flow-arrow svg { width: 17px; height: 17px; }
.recognition-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Voice & Audio Mixer Cluster */
.voice-audio-cluster { padding: 18px 20px; border: 1px solid #e2e8f0; border-radius: 16px; background: #ffffff; }
.cluster-title-wrap { display: flex; flex-direction: column; gap: 2px; }
.cluster-subtitle { margin: 0; font-size: 0.75rem; color: var(--muted); }
.voice-inactive-notice { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border-radius: 13px; background: linear-gradient(135deg, #f8fafc, #f1f5f9); border: 1px solid #e2e8f0; margin: 12px 0 16px; }
.notice-icon { font-size: 1.25rem; flex: 0 0 auto; }
.notice-copy { flex: 1; }
.notice-copy strong { display: block; font-size: 0.8rem; font-weight: 750; color: #1e293b; margin-bottom: 2px; }
.notice-copy p { margin: 0; font-size: 0.73rem; color: var(--muted); line-height: 1.4; }
.voice-audio-cluster.mode-sub-only .voice-audio-sections { opacity: 0.45; filter: grayscale(0.6); pointer-events: none; user-select: none; transition: opacity .2s ease; }
.voice-audio-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.sub-cluster { padding: 14px 16px; border: 1px solid #e2e8f0; border-radius: 13px; background: #fbfcfd; }
.sub-cluster-title { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; font-size: 0.8rem; font-weight: 800; color: #1e293b; }
.sub-cluster-icon { font-size: 1rem; }

/* Advanced details */
#createView .advanced { margin-top: 14px; border-top: 1px solid #e2e8f0; padding-top: 12px; }
#createView .advanced summary { width: fit-content; border-radius: 8px; padding: 6px 12px; background: #f0fdfa; color: #0f766e; font-size: 0.76rem; font-weight: 750; cursor: pointer; transition: background .15s; }
#createView .advanced summary:hover { background: #ccfbf1; }

/* STEP 3: Subtitle Placement & Monitor */
.subtitle-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: 20px; align-items: start; }
.subtitle-controls-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.subtitle-preview-shell { display: grid; gap: 8px; align-content: start; }
.subtitle-preview-shell > small { color: var(--muted); font-size: 0.7rem; text-align: center; }
.subtitle-preview { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 16px; background: linear-gradient(160deg, #090d16 0%, #1e293b 55%, #7c2d12 100%); isolation: isolate; box-shadow: 0 16px 36px -4px rgba(15, 23, 42, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.1); }
.preview-badge-pill { position: absolute; top: 10px; left: 12px; z-index: 5; padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.15); color: #e2e8f0; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em; }

/* STEP 4: TikTok Flow */
.tiktok-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; padding: 14px 18px; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; margin-bottom: 18px; }
.tiktok-flow-item { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; }
.tiktok-flow-num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #0f172a; color: #fff; font-size: 0.74rem; font-weight: 850; margin-bottom: 2px; }
.tiktok-flow-item strong { font-size: 0.8rem; font-weight: 800; color: #0f172a; }
.tiktok-flow-item small { font-size: 0.68rem; color: var(--muted); }
.tiktok-flow-arrow { display: inline-flex; align-items: center; justify-content: center; color: #94a3b8; }
.tiktok-flow-arrow svg { width: 16px; height: 16px; display: block; }
.tiktok-connect-strip { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding: 14px 16px; border: 1px solid #e2e8f0; border-radius: 13px; background: linear-gradient(135deg, #f8fafc, #ffffff); }
.tiktok-connect-left { display: flex; align-items: center; gap: 11px; }
.tiktok-connect-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #0f172a; color: #fff; font-size: 1.1rem; flex: 0 0 36px; box-shadow: -2px 1px 0 #25f4ee, 2px -1px 0 #fe2c55; }
.tiktok-connect-left strong { display: block; font-size: 0.82rem; font-weight: 750; color: var(--ink); }
.tiktok-connect-left p { margin: 1px 0 0; font-size: 0.72rem; color: var(--muted); }

/* SIDEBAR: Sticky Summary */
#createView .workflow-sidebar { position: relative; }
#createView .sticky-card { position: sticky; top: 88px; overflow: hidden; padding: 0; border: 1px solid rgba(226, 232, 240, 0.9); border-radius: 18px; background: #ffffff; box-shadow: 0 12px 36px -4px rgba(15, 23, 42, 0.08); }
#createView .sticky-card::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--brand), #f59e0b 55%, var(--teal)); }
.summary-heading { display: flex; align-items: center; gap: 12px; padding: 18px 20px 4px; }
.summary-heading .summary-icon { flex: 0 0 38px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #ffffff; background: linear-gradient(135deg, var(--teal), #0f766e); box-shadow: 0 6px 14px rgba(23, 107, 104, 0.22); }
.summary-heading .summary-icon svg { width: 19px; height: 19px; }
.summary-heading .eyebrow { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--teal); margin-bottom: 3px; }
.summary-heading h2 { margin: 0; font-size: 1.08rem; font-weight: 700; letter-spacing: 0; line-height: 1.35; color: var(--ink); }
#createView .summary-list { margin: 14px 20px; padding: 4px 14px; border: 1px solid #e2e8f0; border-radius: 14px; background: #f8fafc; }
#createView .summary-list div { display: flex; justify-content: space-between; align-items: center; min-height: 38px; padding: 8px 0; border-bottom: 1px solid #e2e8f0; }
#createView .summary-list div:last-child { border-bottom: 0; }
#createView .summary-list dt { font-size: 0.74rem; color: #64748b; font-weight: 600; }
#createView .summary-list dd { margin: 0; font-size: 0.78rem; font-weight: 800; color: #0f172a; text-align: right; max-width: 60%; }
.summary-count { color: var(--brand-dark); font-weight: 900; }
.summary-mode { color: var(--teal); }

#createView .create-submit { display: flex; align-items: center; justify-content: space-between; min-height: 50px; width: calc(100% - 36px) !important; margin: 4px 18px 0 !important; border-radius: 13px; padding: 11px 18px; box-sizing: border-box; background: linear-gradient(135deg, var(--brand), #ea580c); color: #ffffff; font-size: 0.92rem; font-weight: 700; border: 0; cursor: pointer; box-shadow: 0 8px 24px -4px rgba(239, 107, 58, 0.42); transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1); }
.create-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 28px -4px rgba(239, 107, 58, 0.5); }
.create-submit b { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.24); font-size: 1rem; flex-shrink: 0; }
.create-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.upload-progress { width: calc(100% - 36px) !important; margin: 12px 18px 0 !important; box-sizing: border-box; }
.upload-progress-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 0.74rem; color: #475467; }
.summary-assurance { display: flex; align-items: flex-start; gap: 8px; margin: 14px 18px 18px !important; width: calc(100% - 36px) !important; box-sizing: border-box; font-size: 0.72rem; color: #64748b; line-height: 1.48; }
.assurance-icon { flex: 0 0 auto; color: var(--green); font-weight: 900; font-size: 0.85rem; }

/* Responsive adjustments */
@media(max-width: 1180px) {
  #createView .workflow-grid { grid-template-columns: minmax(0, 1fr); }
  #createView .workflow-main { min-width: 0; }
  #createView .workflow-sidebar { order: -1; min-width: 0; }
  #createView .sticky-card { position: static; }
  #createView .sticky-card .summary-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 8px 12px; }
  #createView .sticky-card .summary-list div { flex-direction: column; align-items: flex-start; gap: 3px; border-bottom: 0; border-right: 1px solid #e2e8f0; padding: 4px 10px; }
  #createView .sticky-card .summary-list div:last-child { border-right: 0; }
  #createView .sticky-card .summary-list dd { max-width: 100%; text-align: left; }
}

@media(max-width: 1200px) {
  #createView .subtitle-editor { grid-template-columns: 1fr; }
}

@media(max-width: 960px) {
  .billing-notice { top: 76px; align-items: flex-start; flex-direction: column; gap: 2px; padding: 11px 14px; }
  .billing-notice span { text-align: left; }
  #createView .workflow-grid { grid-template-columns: 1fr; }
  #createView .workflow-sidebar { order: -1; }
  #createView .sticky-card { position: static; }
  #createView .sticky-card .summary-list { display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 12px; }
  #createView .sticky-card .summary-list div { flex-direction: column; align-items: flex-start; gap: 3px; border-bottom: 0; border-right: 1px solid #e2e8f0; padding: 4px 8px; }
  #createView .sticky-card .summary-list div:last-child { border-right: 0; }
  #createView .sticky-card .summary-list dd { text-align: left; max-width: none; }
  .source-auth-row { grid-template-columns: 1fr; }
  .voice-audio-sections { grid-template-columns: 1fr; }
}

@media(max-width: 520px) {
  .douyin-auth-card { align-items: flex-start; flex-wrap: wrap; }
  .douyin-auth-actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .douyin-auth-actions .button { width: 100%; }
  .cookie-source-field { grid-template-columns: 1fr; }
  .cookie-source-field input { width: 100%; max-width: 100%; }
}

@media(max-width: 768px) {
  .workflow-steps-nav { grid-template-columns: repeat(4, minmax(90px, 1fr)); overflow-x: auto; scroll-snap-type: x proximity; }
  .workflow-steps-nav a { scroll-snap-align: start; min-height: 48px; padding: 6px 8px; }
  .workflow-steps-nav small { display: none; }
  .source-options-grid { grid-template-columns: 1fr; }
  .mode-cards { grid-template-columns: 1fr; }
  .language-flow-card { grid-template-columns: 1fr; }
  .language-flow-arrow { margin: 0 auto; transform: rotate(90deg); }
  .recognition-grid { grid-template-columns: 1fr; }
  .create-page-heading { padding-top: 20px; }
  .create-heading-actions { display: none; }
  #createView .sticky-card .summary-list { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  #createView .sticky-card .summary-list div { border-right: 0; border-bottom: 1px solid #e2e8f0; }
}

@media(max-width: 600px) {
  #createView .step-card { padding: 18px 16px; }
  .tiktok-flow { grid-template-columns: 1fr; gap: 8px; }
  .tiktok-flow-arrow { display: none; }
  .tiktok-connect-strip { flex-direction: column; align-items: stretch; }
  .tiktok-connect-strip .button { width: 100%; text-align: center; }
}

@media(max-width: 1200px) {
  .billing-plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media(max-width: 960px) {
  .billing-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .billing-current-card { width: 100%; min-width: 0; }
  .payment-checkout { grid-template-columns: 1fr; gap: 24px; padding: 22px; }
  .payment-instructions { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .transfer-specs { grid-template-columns: 1fr; }
}

@media(max-width: 650px) {
  .billing-plans { grid-template-columns: 1fr; }
  .billing-order-item { flex-direction: column; align-items: flex-start; gap: 10px; }
  .order-amount-status { width: 100%; justify-content: space-between; }
}

@media(max-width: 1040px) {
  .topbar {
    height: 68px;
    position: sticky;
    top: 0;
    width: 100%;
    box-sizing: border-box;
  }
  .nav-toggle { display: inline-flex; }
  .nav-tabs {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    justify-self: stretch !important;
    align-self: stretch !important;
    margin: 0 !important;
    z-index: 50;
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(226,232,240,.95);
    border-radius: 18px;
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 20px 48px rgba(15,23,42,.15);
  }
  .nav-tabs.open {
    display: grid !important;
    animation: popoverIn .18s ease;
  }
  .nav-tabs a {
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    height: 46px;
    min-height: 46px;
    padding: 0 14px;
    font-size: .88rem;
    border-radius: 12px;
    gap: 10px;
    white-space: nowrap;
  }
  .nav-tabs a span {
    flex: 1;
    text-align: left;
    white-space: nowrap;
  }
  .nav-tabs a .nav-badge {
    margin-left: auto;
    flex-shrink: 0;
  }
  .nav-tabs a.active {
    background: #fff7ed !important;
    color: var(--brand-dark) !important;
    font-weight: 750 !important;
    box-shadow: none !important;
  }
  .nav-tabs a > i {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
  }
  .nav-tabs a > i svg {
    width: 16px;
    height: 16px;
  }
}

@media(max-width: 768px) {
  .user-menu-copy,
  .user-menu-chevron {
    display: none !important;
  }
  .user-menu-button {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
  }
  .user-menu-button #userAvatar {
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(23, 107, 104, 0.28) !important;
  }
  .payment-checkout { grid-template-columns: 1fr; }
  .payment-instructions { grid-column: auto; }
  .payment-instructions dl { grid-template-columns: 1fr 1fr; }
}

@media(max-width: 600px) {
  .system-state .system-text { display: none; }
  .system-state { padding: 7px; border-radius: 50%; }
  .nav-tabs { grid-template-columns: 1fr; }
  .billing-heading { display: grid; }
  .billing-current { width: 100%; }
  .billing-plans { grid-template-columns: 1fr; }
  .billing-plan { min-height: 0; }
  .payment-checkout { padding: 18px; }
  .payment-method { grid-template-columns: auto 38px minmax(0,1fr); }
  .payment-method > i { grid-column: 3; }
  .payment-instructions dl { grid-template-columns: 1fr; }
  .payment-instructions { grid-template-columns: 1fr; }
  .billing-orders article { align-items: flex-start; }
}

@media(max-width: 1040px) {
  .jobs-table-container { overflow-x: visible; }
  .jobs-table-header { display: none; }
  .jobs-list { min-width: 0; }
  .job-row { min-width: 0; width: 100%; grid-template-columns: 28px minmax(0, 1fr); gap: 10px 12px; padding: 14px 16px; }
  .job-select { grid-column: 1; grid-row: 1; align-self: start; padding-top: 4px; }
  .job-file { grid-column: 2; grid-row: 1; }
  .job-owner { grid-column: 2; grid-row: 2; }
  .status-pill { grid-column: 2; grid-row: 3; }
  .job-progress { grid-column: 1 / -1; grid-row: 4; }
  .job-actions { grid-column: 1 / -1; grid-row: 5; justify-content: flex-start; flex-wrap: wrap; }
  .tiktok-connection-hub {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .tiktok-channel-card {
    grid-column: span 1;
  }
  .channel-studio {
    grid-column: 1 / -1;
  }
  .tiktok-workspace { grid-template-columns: 1fr; }
  .tiktok-browser-stage { height: 520px; }
}

@media(max-width: 860px) {
  .jobs-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .jobs-panel > .jobs-toolbar, .jobs-toolbar:not([class*="admin-"]) {
    grid-template-columns: 1fr 42px;
    grid-template-areas:
      "search search"
      "filter refresh";
    gap: 10px;
  }
  .jobs-panel > .jobs-toolbar .search-box, .jobs-toolbar:not([class*="admin-"]) .search-box { grid-area: search; width: 100%; }
  .jobs-panel > .jobs-toolbar .filter-select-wrap, .jobs-toolbar:not([class*="admin-"]) .filter-select-wrap { grid-area: filter; width: 100%; min-width: 0; }
  .jobs-panel > .jobs-toolbar .refresh-btn, .jobs-toolbar:not([class*="admin-"]) .refresh-btn { grid-area: refresh; width: 42px; height: 42px; }
  .job-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 14px 16px;
  }
  .job-select { grid-column: 1; grid-row: 1; align-self: start; padding-top: 4px; }
  .job-file { grid-column: 2; grid-row: 1; }
  .status-pill { grid-column: 2; grid-row: 2; justify-self: start; align-self: center; }
  .job-owner { grid-column: 2; grid-row: 2; justify-self: end; align-self: center; text-align: right; max-width: 55%; }
  .job-progress { grid-column: 1 / -1; grid-row: 3; }
  .job-step { grid-column: 1 / -1; grid-row: 4; }
  .job-actions { grid-column: 1 / -1; grid-row: 5; justify-content: flex-start; flex-wrap: wrap; }
  .tiktok-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .tiktok-publish-controls { grid-template-columns: 1fr; }
}

/* ========================================================
   COMPREHENSIVE MOBILE RESPONSIVE SYSTEM (Phone Viewports <= 640px)
   Covers: Jobs, Create, TikTok, Douyin, Billing, Admin & App Shell
   ======================================================== */
@media(max-width: 640px) {
  /* 0. App Shell & Navigation */
  .app-shell {
    padding: 0 max(12px, env(safe-area-inset-right)) calc(54px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }
  .topbar {
    height: 60px;
    padding: 0 2px;
  }
  .brand strong { font-size: 0.95rem; }
  .brand small { display: none; }
  .brand-mark { width: 30px; height: 30px; flex: 0 0 30px; }
  .topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .system-state {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
  }
  .system-state .system-text { display: none; }
  .user-menu {
    flex-shrink: 0;
    position: relative;
    display: inline-flex;
    align-items: center;
  }
  .user-menu-copy,
  .user-menu-chevron {
    display: none !important;
  }
  .user-menu-button {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
  }
  .user-menu-button #userAvatar {
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(23, 107, 104, 0.3) !important;
  }
  .user-menu.open .user-menu-button #userAvatar {
    box-shadow: 0 0 0 3px rgba(239, 107, 58, 0.35) !important;
  }
  .user-menu-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: -6px;
    width: 220px;
    border-radius: 16px;
  }
  .nav-toggle {
    display: inline-flex;
    width: 36px;
    height: 36px;
    padding: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(15,23,42,.04);
    transition: all .16s ease;
  }
  .nav-toggle span {
    display: block;
    width: 16px;
    height: 2px;
    margin: 0 !important;
    border-radius: 2px;
    background: #334155;
    transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .nav-toggle[aria-expanded="true"] {
    background: #fff7ed;
    border-color: var(--brand);
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
  .nav-tabs {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    justify-self: stretch !important;
    align-self: stretch !important;
    margin: 0 !important;
    grid-template-columns: 1fr !important;
    gap: 6px;
    padding: 10px;
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(15,23,42,.16);
  }
  .nav-tabs a {
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: 48px !important;
    height: 48px !important;
    font-size: 0.88rem !important;
    padding: 0 14px !important;
    border-radius: 12px !important;
    gap: 12px !important;
  }
  .nav-tabs a span {
    flex: 1 !important;
    text-align: left !important;
    white-space: nowrap !important;
  }
  .nav-tabs a .nav-badge {
    margin-left: auto !important;
    flex-shrink: 0 !important;
  }
  .nav-tabs a.active {
    background: #fff7ed !important;
    color: var(--brand-dark) !important;
    font-weight: 750 !important;
    box-shadow: none !important;
  }
  .nav-tabs a > i {
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px !important;
    border-radius: 8px !important;
  }
  .nav-tabs a > i svg {
    width: 16px !important;
    height: 16px !important;
  }
  .page-heading {
    padding: 22px 0 14px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .page-heading h1 {
    font-size: clamp(1.6rem, 7.5vw, 2.1rem);
    line-height: 1.15;
    margin: 2px 0 6px;
  }
  .page-heading p {
    font-size: 0.82rem;
    line-height: 1.45;
  }

  /* 1. Jobs View (#jobsView) */
  .jobs-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  .jobs-header-actions { width: 100%; }
  .new-batch-btn {
    width: 100%;
    justify-content: center;
    min-height: 42px;
    font-size: 0.86rem;
    border-radius: 11px;
  }
  .metric-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
    margin-bottom: 16px;
  }
  .metric-card {
    padding: 12px 14px;
    border-radius: 14px;
    min-height: 80px;
  }
  .metric-title { font-size: 0.72rem; }
  .metric-value {
    font-size: 1.55rem;
    line-height: 1.1;
    margin: 4px 0 2px;
  }
  .metric-desc { font-size: 0.68rem; line-height: 1.35; }
  .metric-badge { width: 24px; height: 24px; font-size: 0.75rem; border-radius: 7px; }

  .jobs-panel { border-radius: 16px; }
  .jobs-panel > .jobs-toolbar, .jobs-toolbar:not([class*="admin-"]) {
    display: grid;
    grid-template-columns: 1fr 42px;
    grid-template-areas:
      "search search"
      "filter refresh";
    gap: 8px;
    padding: 10px 12px;
  }
  .jobs-panel > .jobs-toolbar .search-box, .jobs-toolbar:not([class*="admin-"]) .search-box {
    grid-area: search;
    width: 100%;
  }
  .jobs-panel > .jobs-toolbar .search-box input, .jobs-toolbar:not([class*="admin-"]) .search-box input {
    min-height: 42px;
    font-size: 0.82rem;
    padding-left: 36px;
  }
  .jobs-panel > .jobs-toolbar .filter-select-wrap, .jobs-toolbar:not([class*="admin-"]) .filter-select-wrap {
    grid-area: filter;
    width: 100%;
    min-width: 0;
  }
  .jobs-panel > .jobs-toolbar .filter-select-wrap select, .jobs-toolbar:not([class*="admin-"]) .filter-select-wrap select {
    min-height: 42px;
    font-size: 0.82rem;
    width: 100%;
  }
  .jobs-panel > .jobs-toolbar .refresh-btn, .jobs-toolbar:not([class*="admin-"]) .refresh-btn {
    grid-area: refresh;
    width: 42px;
    height: 42px;
    min-height: 42px;
  }

  .bulk-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
  }
  .bulk-select-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .bulk-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .bulk-buttons button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    height: 38px;
    padding: 0 4px;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: 9px;
  }

  .job-row {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px 10px;
    padding: 12px 12px;
    border-radius: 0;
  }
  .job-select {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    min-height: 34px;
    padding-top: 0;
  }
  .job-file {
    grid-column: 2;
    grid-row: 1;
    gap: 10px;
    min-width: 0;
    align-items: flex-start;
  }
  .video-icon-badge, .upload-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 9px;
  }
  .job-file-meta { min-width: 0; flex: 1; }
  .job-file-meta strong {
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
  }
  .status-pill {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
    align-self: center;
    font-size: 0.68rem;
    padding: 2px 8px;
    margin: 0;
  }
  .job-owner {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
    align-self: center;
    max-width: 55%;
    min-width: 0;
    text-align: right;
  }
  .job-owner strong {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
  }
  .job-owner small {
    display: none;
  }
  .job-progress {
    grid-column: 1 / -1;
    grid-row: 3;
    margin-top: 4px;
  }
  .job-step {
    grid-column: 1 / -1;
    grid-row: 4;
    display: block;
    margin-top: 2px;
  }
  .job-step strong { font-size: 0.74rem; font-weight: 700; }
  .job-step small {
    font-size: 0.7rem;
    white-space: normal;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    word-break: break-word;
    color: #64748b;
  }
  .job-actions {
    grid-column: 1 / -1;
    grid-row: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed #e2e8f0;
  }
  .job-actions .tiktok-review-action {
    flex: 1 0 100% !important;
    min-height: 38px;
    height: 38px;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 750;
    border-radius: 9px;
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  }
  .job-actions .btn-job-action:not(.tiktok-review-action) {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    min-height: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 0.74rem;
    font-weight: 650;
    justify-content: center;
    border-radius: 9px;
  }
  .upload-row .job-actions button {
    width: 100%;
    flex: 1 0 100%;
    min-height: 36px;
  }

  /* 2. Create View (#createView) */
  .create-page-heading { padding: 20px 0 12px; }
  .create-heading-actions { display: none; }
  .workflow-steps-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin: 0 0 16px;
    padding: 6px;
    border-radius: 14px;
  }
  .workflow-steps-nav a {
    min-height: 44px;
    padding: 6px 8px;
    gap: 8px;
    border-radius: 10px;
  }
  .workflow-steps-nav strong { font-size: 0.76rem; }
  .workflow-steps-nav small { display: none; }
  .step-nav-badge { width: 24px; height: 24px; flex: 0 0 24px; font-size: 0.7rem; border-radius: 7px; }

  #createView .step-card { padding: 16px 14px; border-radius: 16px; }
  .source-options-grid { grid-template-columns: 1fr; gap: 12px; }
  .drop-zone { min-height: 140px; padding: 18px 12px; border-radius: 14px; }
  .link-source-field {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 12px;
    gap: 8px 10px;
    border-radius: 14px;
  }
  .link-source-icon { width: 36px; height: 36px; font-size: 1rem; border-radius: 10px; }
  .link-source-copy strong { font-size: 0.84rem; }
  .link-source-copy small { font-size: 0.72rem; }
  .cookie-source-field {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .cookie-source-field input { width: 100%; max-width: 100%; }
  .douyin-auth-card, .tiktok-auth-card {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border-radius: 14px;
  }
  .douyin-auth-icon, .tiktok-auth-icon { width: 36px; height: 36px; font-size: 1rem; border-radius: 10px; }
  .douyin-auth-actions, .tiktok-auth-actions {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .douyin-auth-actions .button, .tiktok-auth-actions .button {
    width: 100%;
    min-height: 40px;
    justify-content: center;
  }
  .mode-cards { grid-template-columns: 1fr; gap: 10px; }
  .mode-card { padding: 14px; border-radius: 14px; }
  .language-flow-card { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .language-flow-arrow { margin: 0 auto; transform: rotate(90deg); }
  .recognition-grid { grid-template-columns: 1fr; gap: 10px; }
  .processing-grid { grid-template-columns: 1fr; gap: 10px; }
  .voice-audio-sections { grid-template-columns: 1fr; gap: 12px; }
  .subtitle-editor { grid-template-columns: 1fr; gap: 14px; }
  .subtitle-controls-grid { grid-template-columns: 1fr; gap: 10px; }
  .subtitle-preview { aspect-ratio: 16 / 9; max-height: 220px; border-radius: 12px; }
  .tiktok-flow { grid-template-columns: 1fr; gap: 8px; padding: 12px; border-radius: 14px; }
  .tiktok-flow-arrow { display: none; }
  .tiktok-connect-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
    border-radius: 13px;
  }
  .tiktok-connect-strip .button { width: 100%; min-height: 40px; justify-content: center; }
  #createView .workflow-sidebar { order: 99; margin-top: 8px; }
  #createView .sticky-card { position: static; border-radius: 16px; }
  #createView .sticky-card .summary-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    padding: 8px 10px;
    margin: 10px 12px;
  }
  #createView .sticky-card .summary-list div {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 4px 6px;
    border: 0;
  }
  #createView .sticky-card .summary-list dt { font-size: 0.68rem; }
  #createView .sticky-card .summary-list dd { font-size: 0.76rem; max-width: 100%; text-align: left; }
  #createView .create-submit {
    width: calc(100% - 24px) !important;
    margin: 8px 12px 0 !important;
    min-height: 48px;
    border-radius: 12px;
  }
  #createView .summary-assurance {
    width: calc(100% - 24px) !important;
    margin: 10px 12px 14px !important;
  }

  /* 3. TikTok View (#tiktokView) */
  .tiktok-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  .tiktok-header-actions { width: 100%; }
  .back-to-jobs-btn { width: 100%; justify-content: center; min-height: 40px; }
  .tiktok-connection-hub { grid-template-columns: 1fr !important; gap: 12px; }
  .tiktok-channel-card { grid-column: 1 / -1 !important; padding: 16px; border-radius: 16px; }
  .channel-actions,
  .studio-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .channel-actions .tiktok-btn,
  .studio-actions .tiktok-btn {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 40px;
  }
  .channel-actions .button.small-btn,
  .studio-actions .button.small-btn {
    min-height: 36px;
    padding: 0 8px;
    font-size: 0.74rem;
    justify-content: center;
  }
  .platform-tab-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 4px;
    gap: 6px;
    margin-bottom: 16px;
    border-radius: 14px;
    overflow: visible;
  }
  .platform-tab-btn {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 8px;
    border-radius: 10px;
  }
  .platform-tab-btn .tab-btn-title,
  .platform-tab-btn .tab-btn-badge {
    display: none;
  }
  .platform-tab-btn .tab-badge-icon {
    width: 24px;
    height: 24px;
  }
  .tiktok-workspace { grid-template-columns: 1fr; gap: 16px; }
  .tiktok-review-card, .platform-publish-panel, .tiktok-studio-card { padding: 16px; border-radius: 16px; }
  .panel-account-strip {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }
  .account-strip-info { width: 100%; min-width: 0; }
  .panel-account-strip .select-account { max-width: 100%; }
  .account-strip-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .account-strip-actions .button {
    width: 100%;
    justify-content: center;
  }
  .studio-account-strip .studio-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .studio-account-strip .studio-actions .tiktok-btn {
    grid-column: 1 / -1;
  }
  .composer-hint-box { padding: 10px 12px; font-size: 0.72rem; }
  #tiktokVideoPreview { height: 200px; border-radius: 10px; }
  .tiktok-caption-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .ai-suggest-btn, .copy-caption-btn { width: 100%; justify-content: center; min-height: 38px; }
  .suggestion-actions { flex-direction: column; gap: 6px; }
  .suggestion-actions button { width: 100%; min-height: 38px; justify-content: center; }
  .tiktok-publish-controls { grid-template-columns: 1fr; gap: 10px; }
  .publish-cta-group button { min-height: 44px; width: 100%; }
  .browser-window-bar { padding: 8px 10px; gap: 8px; }
  .traffic-lights { display: none; }
  .browser-address-bar {
    max-width: 100%;
    width: 100%;
    font-size: 0.68rem;
    padding: 4px 8px;
  }
  .browser-bar-spacer { display: none; }
  .tiktok-browser-stage { height: 380px; min-height: 320px; }
  .tiktok-studio-footnote { font-size: 0.7rem; padding: 4px 0; }

  /* 4. Douyin View (#douyinView) */
  .douyin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  .douyin-header-actions { width: 100%; }
  .back-to-create-btn { width: 100%; justify-content: center; min-height: 40px; }
  .douyin-browser-card { border-radius: 16px; }
  .douyin-browser-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }
  .douyin-browser-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }
  .douyin-browser-actions .sync-btn {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 42px;
    justify-content: center;
  }
  .douyin-browser-actions .reload-btn, .douyin-browser-actions .logout-btn {
    min-height: 38px;
    justify-content: center;
  }
  .douyin-window-bar { padding: 8px 10px; gap: 8px; }
  .traffic-lights { display: none; }
  .browser-status-chip { display: none; }
  .browser-address-bar {
    max-width: 100%;
    width: 100%;
    font-size: 0.68rem;
    padding: 4px 8px;
  }
  .douyin-browser-stage { height: 52vh; min-height: 360px; }
  .douyin-browser-footer { padding: 12px 14px; font-size: 0.74rem; }

  /* 5. Admin View (#adminView) */
  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  .admin-header-actions { width: 100%; }
  .admin-refresh-btn { width: 100%; justify-content: center; min-height: 40px; }

  /* Subtabs: clean horizontal scrollable pills instead of squished text */
  .admin-subtabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 16px;
    scrollbar-width: none;
    border-bottom: 1px solid #e2e8f0;
  }
  .admin-subtabs::-webkit-scrollbar {
    display: none;
  }
  .admin-subtab {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 10px;
  }

  /* Metrics grid */
  .admin-metrics {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px;
  }
  .admin-metric {
    padding: 12px 14px;
    min-height: 80px;
    border-radius: 14px;
  }
  .metric-info strong { font-size: 1.55rem; }
  .admin-metric-icon { width: 36px; height: 36px; font-size: 1.05rem; border-radius: 10px; }

  /* Create form */
  .admin-create-panel summary { padding: 12px 14px; min-height: 56px; }
  .admin-create-form { grid-template-columns: 1fr; gap: 10px; padding: 14px; }
  .admin-create-submit { width: 100%; min-height: 42px; justify-content: center; }

  /* Admin Toolbars (Account, Jobs, Audit): Full-width 1-column layout */
  .admin-toolbar,
  .admin-account-toolbar,
  .admin-jobs-toolbar,
  .admin-audit-toolbar {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    grid-template-areas: none !important;
    gap: 10px !important;
    padding: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  .admin-list-title {
    width: 100%;
  }
  .admin-search {
    width: 100% !important;
    position: relative;
    box-sizing: border-box;
  }
  .admin-search input {
    width: 100% !important;
    min-height: 42px;
    box-sizing: border-box;
    font-size: 0.84rem;
    padding-left: 36px;
  }
  .admin-filter-wrap {
    width: 100% !important;
    box-sizing: border-box;
  }
  .admin-filter-wrap select {
    width: 100% !important;
    min-height: 42px;
    box-sizing: border-box;
    font-size: 0.84rem;
  }
  .admin-toolbar button {
    width: 100%;
    min-height: 40px;
    justify-content: center;
  }

  /* Admin Account Table & Cards */
  .admin-account-head { display: none; }
  .admin-account-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    margin: 8px 0;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    box-sizing: border-box;
  }
  .admin-account-user {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f5f9;
  }
  .admin-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 0.95rem;
    flex-shrink: 0;
  }
  .user-meta-stack {
    flex: 1;
    min-width: 0;
  }
  .name-edit-wrap input {
    font-size: 0.88rem;
    padding: 2px 4px;
    box-sizing: border-box;
  }
  .user-email {
    font-size: 0.74rem;
    padding: 0 4px;
  }
  .user-join-date {
    font-size: 0.68rem;
    padding: 0 4px;
  }
  .admin-user-quota {
    font-size: 0.68rem;
    padding: 1px 4px 0;
  }
  .admin-account-field {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
  }
  .field-label-inline {
    display: block;
    font-size: 0.68rem;
    font-weight: 750;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .admin-account-field select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    height: 40px;
    border-radius: 10px;
    padding: 6px 26px 6px 10px;
    font-size: 0.8rem;
    box-sizing: border-box;
  }
  .admin-action-cell {
    grid-column: 1 / -1;
    width: 100%;
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px dashed #f1f5f9;
  }
  .btn-admin-save {
    flex: 1;
    min-height: 40px;
    height: 40px;
    justify-content: center;
    font-size: 0.82rem;
    border-radius: 10px;
  }
  .admin-action-cell .mini-btn {
    min-height: 40px;
    min-width: 44px;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
  }

  /* Admin Jobs Table & Cards on Mobile */
  .admin-jobs-head { display: none; }
  .admin-jobs-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border-radius: 14px;
    margin: 8px 0;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-size: 0.82rem;
  }
  .admin-jobs-row code {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--brand);
  }
  .admin-jobs-row .job-filename {
    font-size: 0.84rem;
    font-weight: 650;
    word-break: break-word;
  }
  .admin-jobs-row button {
    width: 100%;
    min-height: 38px;
    justify-content: center;
  }

  /* Admin Audit Log Table & Cards on Mobile */
  .admin-audit-head { display: none; }
  .admin-audit-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border-radius: 14px;
    margin: 8px 0;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    font-size: 0.8rem;
  }
  .audit-warning-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    font-size: 0.78rem;
    border-radius: 12px;
  }

  /* 6. Billing View (#billingView) */
  .billing-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
  }
  .billing-current-card {
    width: 100%;
    min-width: 0;
    padding: 14px 16px;
    border-radius: 14px;
  }
  .billing-plans { grid-template-columns: 1fr; gap: 16px; }
  .billing-plan { padding: 20px 18px; border-radius: 18px; }
  .payment-checkout { grid-template-columns: 1fr; gap: 20px; padding: 18px 16px; border-radius: 18px; }
  .payment-method { padding: 10px 12px; min-height: 56px; border-radius: 12px; }
  .payment-logo { width: 36px; height: 36px; font-size: 1rem; }
  .payment-instructions {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 18px 16px;
    border-radius: 16px;
    text-align: center;
  }
  .bank-qr-frame { width: 180px; margin: 0 auto; }
  .transfer-specs { grid-template-columns: 1fr; gap: 8px; }
  .transfer-specs div { padding: 10px 12px; text-align: left; }
  .transfer-total { font-size: 1.6rem; text-align: center; }
  .billing-order-item { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; }
  .order-amount-status { width: 100%; justify-content: space-between; }
}

/* ========================================================
   ULTRA-COMPACT SCREENS (Phone Viewports <= 380px)
   iPhone SE, Galaxy A0x, small Android screens
   ======================================================== */
@media(max-width: 380px) {
  .app-shell {
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
  }
  .job-actions .btn-job-action:not(.tiktok-review-action) {
    flex: 1 1 calc(50% - 6px);
  }
  .metric-grid { gap: 6px; }
  .metric-card { padding: 10px 12px; }
  .metric-value { font-size: 1.35rem; }
  .admin-metrics { gap: 6px; }
  .admin-metric { padding: 10px 12px; }
  .admin-metric strong { font-size: 1.35rem; }
  .workflow-steps-nav a { padding: 5px 6px; gap: 6px; }
  .workflow-steps-nav strong { font-size: 0.72rem; }
}

/* Source browser workspace — final cascade layer */
#douyinView .source-browser-tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(560px, 100%);
  margin: 0 0 14px;
  padding: 5px;
  gap: 5px;
  border: 1px solid #dce3ec;
  border-radius: 15px;
  background: #e9eef5;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .05);
}

#douyinView .source-browser-tab {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  margin: 0;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  outline: none;
  color: #64748b;
  background: transparent;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

#douyinView .source-browser-tab::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, .14);
}

#douyinView .source-browser-tab:hover:not(.is-active) {
  color: #334155;
  border-color: rgba(148, 163, 184, .24);
  background: rgba(255, 255, 255, .62);
}

#douyinView .source-browser-tab:focus-visible {
  box-shadow: 0 0 0 3px rgba(239, 107, 58, .2);
}

#douyinView .source-browser-tab.is-active {
  color: #0f172a;
  border-color: rgba(203, 213, 225, .8);
  background: #fff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .10);
  transform: translateY(-1px);
}

#douyinView .source-browser-tab[data-source-browser-tab="douyin"].is-active::before {
  background: #0f172a;
  box-shadow: -2px 0 0 #22d3ee, 2px 0 0 #fb2c94;
}

#douyinView .source-browser-tab[data-source-browser-tab="youtube"].is-active::before {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .14);
}

#douyinView .source-browser-tab[data-source-browser-tab="facebook"].is-active::before {
  background: #1877f2;
  box-shadow: 0 0 0 3px rgba(24, 119, 242, .14);
}

#douyinView [data-source-browser-panel] {
  width: 100%;
  animation: source-browser-panel-in .18s ease-out;
}

#douyinView [data-source-browser-panel].is-hidden { display: none !important; }

@keyframes source-browser-panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  #douyinView .source-browser-tabs {
    width: 100%;
    margin-bottom: 10px;
    padding: 4px;
    gap: 3px;
    border-radius: 13px;
  }
  #douyinView .source-browser-tab {
    min-height: 40px;
    padding: 8px 6px;
    gap: 6px;
    border-radius: 9px;
    font-size: .75rem;
  }
  #douyinView .source-browser-tab::before { width: 7px; height: 7px; flex-basis: 7px; }
}


