/* 
 * AVATAN ReFlow — Studio interface
 * Presentation only. Existing runtime, storage, license and visibility rules
 * remain authoritative. Remove this stylesheet link to restore the original UI.
 */
:root {
  color-scheme: dark;
  --fb: #80adff;
  --fb-deep: #315fe7;
  --fb-glow: rgba(83, 126, 239, .12);
  --line: #50d29c;
  --line-deep: #138252;
  --accent: #80adff;
  --accent-purple: #ac9ef5;
  --ink: #edf1f8;
  --ink-2: #aab6c9;
  --ink-3: #929fb5;
  --stroke: #2b3546;
  --stroke-2: #263041;
  --bg: #10151e;
  --sidebar-bg: #151c27;
  --card: #19212d;
  --card-inner: #202a38;
  --field-bg: #141c27;
  --seg-bg: #121b28;
  --seg-active-bg: #27364d;
  --block-head-bg: #202a38;
  --elevated: #242f40;
  --topbar: #19212d;
  --danger: #ff9191;
  --warn: #eab967;
  --ok: #50d29c;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .12);
  --shadow-md: 0 3px 14px rgba(0, 0, 0, .08);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .3);
  --studio-soft: #243453;
  --studio-line-soft: #173a30;
  --studio-primary: #3569e8;
  --studio-green: #138252;
  --font: 'Prompt', 'Leelawadee UI', Tahoma, system-ui, sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --fb: #295bd1;
  --fb-deep: #244fb5;
  --line: #11774c;
  --line-deep: #09623c;
  --accent: #295bd1;
  --accent-purple: #7161bb;
  --ink: #202b3e;
  --ink-2: #5a687c;
  --ink-3: #69768a;
  --stroke: #e0e5ed;
  --stroke-2: #e9edf3;
  --bg: #f5f6f9;
  --sidebar-bg: #fff;
  --card: #fff;
  --card-inner: #f7f8fb;
  --field-bg: #fcfcfe;
  --seg-bg: #f0f3f8;
  --seg-active-bg: #fff;
  --block-head-bg: #f7f8fb;
  --elevated: #fff;
  --topbar: #fff;
  --danger: #c73948;
  --warn: #996016;
  --ok: #11774c;
  --shadow-sm: 0 1px 3px rgba(24, 40, 70, .025);
  --shadow-md: 0 3px 16px rgba(24, 40, 70, .035);
  --shadow-lg: 0 24px 70px rgba(24, 40, 70, .14);
  --studio-soft: #edf2ff;
  --studio-line-soft: #eaf7f0;
}
body { background: var(--bg); font-size: 13px; line-height: 1.65; }
.glow-bg { display: none; }
.sidebar {
  width: 258px; flex: 0 0 258px; padding: 20px 16px 16px;
  background: var(--sidebar-bg); border-right: 1px solid var(--stroke);
  backdrop-filter: none; box-shadow: none; z-index: 5;
  justify-content: space-between; gap: 8px;
  overflow: hidden !important;
  height: 100vh !important;
  box-sizing: border-box !important;
}
.brand { gap: 10px; padding: 0 7px 30px; margin-bottom: 16px; border-bottom: 1px solid var(--stroke-2); }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; box-shadow: none; background: transparent; flex-shrink: 0; }
.brand-mark img { width: 40px; height: 40px; object-fit: contain; filter: none; }
.brand-name { font-size: 17px; letter-spacing: -.5px; }
.brand-tag { font-size: 10px; letter-spacing: .35px; color: var(--ink-3); }
.gradient-text { background: none; -webkit-text-fill-color: currentColor; color: var(--fb); }
.nav-section-title { font-size: 9px; letter-spacing: 1.2px; color: var(--ink-3); padding: 0 12px; margin: 8px 0 14px; }
.sidebar-nav { gap: 7px; }
.sidebar-top > .sidebar-bottom { margin: 0 0 18px; }
/* The account card now precedes navigation; open its menu below the trigger. */
.sidebar-top > .sidebar-bottom .kebab-menu {
  top: calc(100% + 8px); bottom: auto;
  min-width: 0; width: 210px; max-width: calc(100vw - 58px);
}
.sidebar .nav-item {
  padding: 11px 12px; gap: 11px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1; background: rgba(16, 26, 46, 0.55);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); min-height: 44px;
  box-sizing: border-box; transition: all 0.2s ease;
}
.sidebar .nav-item:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
  color: #fff;
}
.sidebar .nav-item[data-tab="potogen_studio"] {
  border-color: rgba(139, 92, 246, 0.25);
  background: rgba(15, 23, 42, 0.65);
}
.sidebar .nav-item[data-tab="potogen_studio"]:hover {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(33, 28, 60, 0.85);
}
.sidebar .nav-item[data-tab="fb"] {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(15, 23, 42, 0.65);
}
.sidebar .nav-item[data-tab="fb"]:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(15, 33, 64, 0.85);
}
.sidebar .nav-item[data-tab="line"] {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(15, 23, 42, 0.65);
}
.sidebar .nav-item[data-tab="line"]:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(15, 33, 64, 0.85);
}
.sidebar .nav-item[data-tab="ready_vault"] {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(15, 23, 42, 0.65);
}
.sidebar .nav-item[data-tab="ready_vault"]:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(15, 33, 64, 0.85);
}
:root .sidebar .nav-item.active {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
:root .sidebar .nav-item[data-tab="potogen_studio"].active {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(139, 92, 246, 0.45);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
:root .sidebar .nav-item[data-tab="fb"].active {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
:root .sidebar .nav-item[data-tab="line"].active {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
:root .sidebar .nav-item[data-tab="ready_vault"].active {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.sidebar .nav-item.active::before { display: none; }
.nav-label { font-size: 12.5px; font-weight: 500; color: #fff; }
.sidebar .nav-item .nav-label { color: #fff; }
.nav-ic { width: 22px; height: 24px; font-size: 18px; flex-shrink: 0; }
.nav-ic .brand-ic { width: 21px; height: 21px; }
.nav-item[data-tab="fb"] svg path { fill: #3976e8; }
.account-card { padding: 13px; border-radius: 12px; background: var(--card-inner); box-shadow: none; }
.account-status-row { flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.account-status-title { font-size: 10px; }
.account-user { font-size: 12px; }
.account-sub { font-size: 10px; }
.session-pill { font-size: 9px; }
.theme-toggle { border-radius: 9px; box-shadow: none; }
.theme-toggle:hover { transform: none; box-shadow: none; }
.kebab-menu { bottom: calc(100% + 10px); top: auto; right: 0; width: 210px; border-radius: 12px; background: var(--elevated); box-shadow: var(--shadow-lg); }
.main-workspace { min-width: 0; max-width: none; width: calc(100% - 258px); padding: 8px 32px 64px; overflow: visible; }
.main-workspace { padding-top: 8px !important; }
.panel-section { max-width: 1500px; margin: 0 auto; }
#potogenStudioTab { margin-left: -28px !important; width: calc(100% + 28px) !important; }
.workspace-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 25px; }
.workspace-eyebrow { color: var(--ink-3); font-size: 9px; font-weight: 500; letter-spacing: 2px; margin-bottom: 8px; }
.workspace-heading h1 { font-size: clamp(23px, 2.1vw, 30px); line-height: 1.4; font-weight: 600; letter-spacing: -.7px; margin: 0; color: var(--ink); }
.workspace-heading p { margin: 7px 0 0; color: var(--ink-2); font-size: 13px; }
.heading-dot { display: inline-block; width: 7px; height: 7px; margin: 0 0 3px 10px; border-radius: 50%; background: var(--fb); }
[data-panel="line"] .heading-dot { background: var(--fb); }
.workspace-channel { border: 1px solid var(--stroke); border-radius: 6px; padding: 6px 10px; color: var(--ink-3); font-size: 9px; letter-spacing: 1.1px; white-space: nowrap; }
.hud-grid { display: grid; grid-template-columns: repeat(4, 312px); gap: 10px; margin-bottom: 18px; width: fit-content; max-width: 100%; }
.hud-card { width: 312px; padding: 10px 14px; border-radius: 10px; gap: 10px; min-height: 0 !important; height: auto; align-items: center; box-shadow: var(--shadow-sm); backdrop-filter: none; box-sizing: border-box; }
.hud-card:hover { transform: none; border-color: var(--stroke); }
.hud-card > div:last-child { min-width: 0; }
.hud-ic { width: 32px; height: 32px; min-width: 32px; border-radius: 8px; font-size: 14px; border: 0; }
.hud-ic-fb, .hud-ic-cyan, .hud-ic-indigo { background: var(--studio-soft); }
.hud-ic-emerald { background: #0c2b45 !important; border: 1.5px solid #0284c7 !important; }
.hud-ic-amber { background: var(--card-inner); }
.hud-label { font-size: 10.5px; margin-bottom: 2px; line-height: 1.2; }
.hud-value { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.hud-accent { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* 8-Column Unified HUD Strip (FB 1-4 + LINE 5-8) */
.hud-8col {
  display: grid !important;
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 14px 0 16px 0 !important;
  box-sizing: border-box !important;
}
.hud-8col .hud-card {
  width: 100% !important;
  min-width: 0 !important;
  padding: 10px 12px !important;
  border-radius: 12px !important;
  gap: 10px !important;
  min-height: 66px !important;
  height: 66px !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  transition: all 0.2s ease !important;
}

/* Facebook HUD Cards (1-4): Flat Pastel Blue Background & Outer Border (No Gradient) */
.hud-8col .hud-card.hud-fb,
.hud-8col .hud-card:nth-child(-n+4) {
  background: rgba(147, 197, 253, 0.14) !important;
  background-color: rgba(147, 197, 253, 0.14) !important;
  background-image: none !important;
  border: 1.2px solid rgba(147, 197, 253, 0.40) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}
.hud-8col .hud-card.hud-fb:hover,
.hud-8col .hud-card:nth-child(-n+4):hover {
  background: rgba(147, 197, 253, 0.22) !important;
  background-color: rgba(147, 197, 253, 0.22) !important;
  background-image: none !important;
  border-color: rgba(147, 197, 253, 0.70) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
}
.hud-8col .hud-card.hud-fb .hud-label,
.hud-8col .hud-card:nth-child(-n+4) .hud-label {
  color: #93c5fd !important;
}

/* LINE OA HUD Cards: Facebook Blue Theme */
.hud-card.hud-line,
.hud-8col .hud-card.hud-line,
.hud-8col .hud-card:nth-child(n+5),
#hudLineCards .hud-card {
  background: rgba(14, 24, 40, 0.62) !important;
  background-color: rgba(14, 24, 40, 0.62) !important;
  background-image: none !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}
.hud-card.hud-line:hover,
.hud-8col .hud-card.hud-line:hover,
.hud-8col .hud-card:nth-child(n+5):hover,
#hudLineCards .hud-card:hover {
  background: rgba(20, 35, 60, 0.75) !important;
  background-color: rgba(20, 35, 60, 0.75) !important;
  border-color: rgba(147, 197, 253, 0.5) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}
.hud-card.hud-line .hud-label,
.hud-8col .hud-card.hud-line .hud-label,
.hud-8col .hud-card:nth-child(n+5) .hud-label,
#hudLineCards .hud-label {
  color: #94a3b8 !important;
}
.hud-8col .hud-ic {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  border-radius: 9px !important;
  font-size: 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}
.hud-8col .hud-content {
  min-width: 0 !important;
  flex: 1 !important;
  overflow: hidden !important;
}
.hud-8col .hud-label {
  font-size: 10px !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin-bottom: 3px !important;
}
.hud-8col .hud-value {
  font-size: 12.5px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
@media (max-width: 1100px) {
  .hud-8col {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 600px) {
  .hud-8col {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
.workbench-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 330px !important;
  gap: 10px !important;
  align-items: stretch !important;
  width: 100% !important;
}
.workbench-main {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  min-width: 0 !important;
}
.workbench-side {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  min-width: 330px !important;
  width: 330px !important;
  height: 100% !important;
  position: static !important;
}
.fb-top-grid {
  display: grid;
  grid-template-columns: 460px 330px minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  align-items: stretch;
}
.line-top-grid {
  display: grid;
  grid-template-columns: 290px 290px minmax(310px, 1fr) 330px;
  gap: 12px;
  margin: 0;
  align-items: stretch;
}
.fb-top-grid > .card, .line-top-grid > .card {
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.card { padding: 22px; border-radius: 14px; backdrop-filter: none; box-shadow: var(--shadow-md); }
.card:hover { border-color: var(--stroke); box-shadow: var(--shadow-md); }
.card-title { font-size: 15px; font-weight: 600; gap: 8px; line-height: 1.65; }
.card-title > span:first-child { font-size: 14px; }
.card > .card-title { margin-bottom: 6px; }
.card > .card-sub { margin-bottom: 18px; }
.card-sub { font-size: 12px; line-height: 1.7; }
.card-header-row { gap: 14px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 18px; }
.input, textarea, select { border-color: var(--stroke); border-radius: 9px; font-size: 13px; padding: 11px 12px; }
.input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--studio-soft); }
label.field > span, .ctrl-label { font-size: 13px; font-weight: 500; }
input[type="datetime-local"] { min-width: 0; }
.hint { font-size: 12px; overflow-wrap: anywhere; }
.btn { border-radius: 9px; padding: 11px 14px; font-size: 13px; font-weight: 500; line-height: 1.6; min-height: 42px; }
.btn-primary, .btn-fb, .btn-indigo { background: var(--studio-primary); color: #fff; box-shadow: 0 2px 3px rgba(24, 64, 150, .12); }
.btn-line { background: var(--studio-green); color: #fff; box-shadow: 0 2px 3px rgba(12, 82, 48, .12); }
.btn-danger { background: #be3546; color: #fff; box-shadow: none; }
.btn-primary:hover, .btn-fb:hover, .btn-indigo:hover, .btn-line:hover, .btn-danger:hover {
  transform: none; box-shadow: none; filter: brightness(.93);
}
.btn-ghost { background: var(--card); color: var(--ink-2); border: 1px solid var(--stroke); box-shadow: none; }
.btn-ghost:hover { background: var(--card-inner); }
.btn-sm { font-size: 12px; padding: 8px 11px; min-height: 36px; }
.btn[disabled] { filter: none; opacity: .48; transform: none; box-shadow: none; }
.status-btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.status-btn-row .status-row { flex: 1 1 220px; min-width: 0; margin-bottom: 0; }
.status-btn-row .btn { flex: 0 0 auto; }
.status-row { font-size: 12px; font-weight: 500; padding: 10px 12px; }
.status-row .sdot { width: 6px; height: 6px; }
.status-row.ok .sdot { box-shadow: none; animation: none; }
.seg { border-radius: 10px; height: 44px; padding: 4px; }
.seg button { font-size: 11px; border-radius: 7px; }
.num-input { height: 44px; font-size: 17px; }
.ctrl-row-3 { grid-template-columns: minmax(0, 1.25fr) minmax(70px, .65fr) minmax(0, 1fr); gap: 10px; }
:root .panel-section .audience-stat { background: var(--studio-soft); border-color: var(--stroke); padding: 13px 16px; border-radius: 10px; margin-bottom: 14px; }
.reclist { grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); padding: 8px; border-radius: 10px; }
.reclist .empty { padding: 26px 12px; font-size: 11px; }
.rec-name-card:hover { transform: none; }
.check-row { font-size: 13px; align-items: flex-start; }
.check-row input { margin-top: 2px; }
.check-sub { font-size: 12px; }
.block { border-radius: 11px; border-color: var(--stroke); box-shadow: none; }
.block-head { background: var(--block-head-bg); padding: 10px 12px; }
.block-body { padding: 14px; }
.block-text-body textarea { font-size: 13px; line-height: 1.8; padding-right: 44px; }
.bctrl button { border-radius: 7px; min-width: 30px; min-height: 30px; }
.block-add { flex-wrap: wrap; gap: 7px; }
.block-add .btn { width: auto; }
.emoji-btn { box-shadow: none; }
:root .panel-section .tip-box { border: 1px solid rgba(147, 197, 253, 0.28); background: rgba(14, 24, 40, 0.62); color: #94a3b8; font-size: 11px; padding: 12px; align-items: flex-start; }
:root [data-panel="line"] .tip-box { color: #38bdf8 !important; background: rgba(59, 130, 246, 0.08) !important; border-color: rgba(59, 130, 246, 0.28) !important; }
.page-select-details, .line-guide { border-radius: 9px; }
.line-guide summary { font-size: 11px !important; line-height: 1.7 !important; background: rgba(59, 130, 246, 0.08) !important; color: #38bdf8 !important; }
.line-guide li { font-size: 11px; }
.uploadbox { padding: 28px 18px; background: var(--card-inner); border-color: var(--ink-3); font-size: 12px; line-height: 1.8; border-radius: 11px; }
.uploadbox:hover { background: rgba(59, 130, 246, 0.08); color: #38bdf8; border-color: #38bdf8; }
.phone-preview-card { padding: 18px; background: var(--card-inner); }
.phone-header-label { font-size: 10px; color: var(--ink-2); font-weight: 500; margin-bottom: 15px; line-height: 1.7; }
.phone { width: 100%; max-width: 300px; margin: 0 auto; border-radius: 24px; padding: 5px; background: #e5e9f0; border: 1px solid #d7dee8; box-shadow: 0 10px 25px rgba(21, 35, 59, .07); }
.phone::after { display: none; }
.screen { height: 420px; border-radius: 19px; color-scheme: light; }
.msgr-head { padding: 12px 10px; }
.msgr-head .pname { color: #253149; }
.msgr-head .pstat { color: #66758a; }
.chat .placeholder { color: #718097; font-size: 11px; line-height: 1.9; }
.line-chat .placeholder { color: #354b61; }
.bcast-live { font-size: 11px; }
.bcast-bar { height: 6px; border-radius: 8px; background: var(--stroke); }
.bcast-fill { background: var(--studio-primary); box-shadow: none; }
.bcast-now, .live-warn, .fetchmsg { font-size: 11px; overflow-wrap: anywhere; }
.metrics { gap: 8px; }
[data-panel="history"] > .card { max-width: none !important; }
[data-panel="history"] .hud-accent { font-size: 13px; }
#histList > .empty { min-height: 240px; display: grid; place-items: center; border: 1px dashed var(--stroke); border-radius: 10px; background: var(--card-inner); font-size: 13px; }
.hist-card { border-radius: 12px; background: var(--card); border-color: var(--stroke); box-shadow: none; }
.hist-summary { gap: 12px; flex-wrap: wrap; }
.hist-preview, .hist-fulltext { overflow-wrap: anywhere; }
.hist-body { border-top-color: var(--stroke); }
.hist-actions { flex-wrap: wrap; }
.support-wrap { max-width: none; }
.support-link { border-radius: 11px; box-shadow: none; background: var(--card); }
.support-link:hover { transform: none; }
.how-num { box-shadow: none; background: var(--studio-soft); color: var(--fb); }
.modal-overlay, #licenseModal { padding: 24px; background: rgba(12, 20, 35, .55); backdrop-filter: blur(6px); overflow-y: auto; }
.modal { max-height: calc(100dvh - 48px); overflow-y: auto; border-radius: 18px; padding: 28px; background: var(--card); box-shadow: var(--shadow-lg); }
:root #licenseModal .modal.license-modal-box { background: var(--card); border: 1px solid var(--stroke); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 28px; overflow-y: auto; }
#licenseModal .modal.license-modal-box::before { display: none; }
.modal-icon, #licenseModal .modal-icon { background: var(--studio-soft); border: 0; box-shadow: none; border-radius: 12px; width: 42px; height: 42px; font-size: 20px; }
#licenseModal .modal-head:hover .modal-icon, #licenseModal .modal-close:hover { transform: none; }
.modal-head { gap: 12px; }
.modal-head h3, #licenseModal .modal-head h3 { font-size: 17px; }
.modal-head p, #licenseModal .modal-head p { font-size: 11px; line-height: 1.7; }
.modal-summary { border-radius: 10px; }
.cs-v { min-width: 0; overflow-wrap: anywhere; }
.modal-actions .btn { font-size: 12px; }
:root #licenseModal #licenseBody > div > div:first-child { background: var(--card-inner) !important; border-color: var(--stroke) !important; box-shadow: none !important; border-radius: 12px !important; }
#licenseModal #licenseBody > div > div:first-child > div { flex-wrap: wrap; gap: 8px; padding: 12px 16px !important; }
#licenseModal #licenseBody code { max-width: 100%; white-space: normal; overflow-wrap: anywhere; letter-spacing: 0 !important; box-shadow: none !important; }
#licenseModal #licenseBody > div > div:last-child { flex-wrap: wrap; }
.btn-lic-renew { background: var(--studio-primary) !important; box-shadow: none !important; border-radius: 9px !important; }
.btn-lic-renew:hover { box-shadow: none !important; transform: none !important; }
.license-lock { overflow-y: auto; background: radial-gradient(ellipse at 50% 25%, var(--studio-soft), transparent 65%), var(--bg); }
.lock-card { position: relative; max-width: 440px; padding: 42px 36px 32px; border-radius: 20px; box-shadow: var(--shadow-lg); animation: none; }
.lock-card::before { content: "AVATAN STUDIO / BROADCAST WORKSPACE"; display: block; font-size: 8px; letter-spacing: 1.7px; color: var(--ink-3); margin-bottom: 25px; }
.lock-logo { width: 64px; height: 64px; border-radius: 16px; box-shadow: none; margin-bottom: 20px; }
.lock-card h2 { font-size: 27px; }
.lock-card > p { font-size: 12px; }
.lock-card .lock-field { border-radius: 9px; font-family: Consolas, monospace; font-size: 14px; }
.lock-card .btn { border-radius: 9px; font-size: 12px; }
.lock-buy { font-size: 12px; }
.toast-host { max-width: calc(100vw - 24px); }
.toast { border-radius: 11px; background: var(--elevated); box-shadow: var(--shadow-lg); font-size: 12px; overflow-wrap: anywhere; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
@media (min-width: 1650px) {
  .fb-top-grid { grid-template-columns: 460px 330px minmax(0, 1fr); align-items: stretch; }
  .line-top-grid { display: flex; justify-content: space-between; align-items: stretch; }
  .workbench-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1270px) {
  .main-workspace { padding: 26px 22px 48px; }
  .hud-grid, .panel-section .hud-grid, .panel-section[data-panel="fb"] > .hud-grid, .panel-section[data-panel="line"] > .hud-grid { grid-template-columns: repeat(2, 312px); width: fit-content; }
  .workbench-grid { grid-template-columns: minmax(0, 1fr); }
  .workbench-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 960px) {
  .app-layout { flex-direction: column; }
  .sidebar { position: relative; width: 100%; flex: none; height: auto; padding: 18px 22px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--stroke); }
  .sidebar-top { min-width: 0; }
  .brand { padding: 0 0 14px; margin-bottom: 12px; }
  .sidebar-nav { display: flex; flex-direction: row; flex-wrap: wrap; }
  .nav-section-title { display: none; }
  .sidebar .nav-item { width: auto; flex: 1; justify-content: center; padding: 11px; }
  .sidebar-bottom { margin-top: 14px; }
  .account-card { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px 12px; }
  .account-status-row { margin: 0; }
  .account-actions { margin: 0 0 0 auto; padding: 0; border: 0; }
  .account-sub { display: none; }
  .main-workspace { width: 100%; max-width: none; padding: 24px 22px 48px; }
}
@media (max-width: 640px) {
  .sidebar { padding: 16px; }
  .sidebar .nav-item { min-width: 0; gap: 6px; padding: 10px 6px; flex-direction: column; }
  .nav-label { font-size: 9px; text-align: center; }
  .brand-name { font-size: 17px; }
  .account-user { max-width: 150px; }
  .main-workspace { padding: 24px 14px 40px; }
  .workspace-heading { margin-bottom: 20px; }
  .workspace-heading h1 { font-size: 23px; }
  .workspace-heading p { font-size: 11px; }
  .workspace-channel { display: none; }
  .hud-grid, .panel-section .hud-grid, .panel-section[data-panel="fb"] > .hud-grid, .panel-section[data-panel="line"] > .hud-grid { grid-template-columns: 1fr; width: 100%; gap: 8px; margin-bottom: 18px; }
  .hud-card { width: 100%; padding: 13px 11px; flex-direction: column; align-items: flex-start; gap: 8px; }
  .hud-label { font-size: 9px; }
  .hud-value { font-size: 12px; }
  .workbench-side { display: flex; flex-direction: column; }
  .workbench-side > .card { width: 100%; }
  .fb-top-grid, .line-top-grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px 15px; }
  .card-title { font-size: 13px; }
  .ctrl-row-3 { grid-template-columns: minmax(0, 1fr); }
  .status-btn-row .status-row { flex-basis: 100%; white-space: normal; }
  .status-btn-row .btn { flex: 1; }
  .check-row { line-height: 1.8; }
  .modal-overlay, #licenseModal { padding: 12px; }
  .modal, :root #licenseModal .modal.license-modal-box { padding: 22px 16px; max-height: calc(100dvh - 24px); }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn-ghost { flex: auto; }
  .lock-card { padding: 32px 20px 26px; }
  .lock-card::before { font-size: 7px; letter-spacing: 1px; }
  .cs-row { padding: 12px; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.hidden,
[hidden],
.modal-overlay.hidden,
#licenseModal.hidden,
#confirmModal.hidden,
#licenseLock,
.license-lock {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
  z-index: -99999 !important;
}

.modal-overlay:not(.hidden) {
  display: grid !important;
  visibility: visible !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  z-index: 99999 !important;
}

/* --------------------------------------------------------------------------
   Premium dark studio direction
   Inspired by the supplied Vela references: quiet charcoal surfaces,
   restrained violet accent, and dense enterprise information hierarchy.
   -------------------------------------------------------------------------- */
:root:not([data-theme="light"]) {
  --bg: #080a0f;
  --sidebar-bg: #0b0d13;
  --card: #11141c;
  --card-inner: #151923;
  --field-bg: #0d1017;
  --seg-bg: #0d1017;
  --seg-active-bg: #211c3c;
  --block-head-bg: #151923;
  --elevated: #191d27;
  --topbar: #0c0f15;
  --ink: #f0eff6;
  --ink-2: #9296a8;
  --ink-3: #666b7d;
  --stroke: #242834;
  --stroke-2: #1b1f2a;
  --accent: #0084FF;
  --accent-purple: #38bdf8;
  --fb: #0084FF;
  --fb-deep: #0066d6;
  --fb-glow: rgba(0, 132, 255, .25);
  --studio-soft: rgba(0, 132, 255, 0.12);
  --studio-primary: #0084FF;
  --studio-line-soft: #133a2c;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.18);
  --shadow-md: 0 8px 24px rgba(0,0,0,.16);
  --shadow-lg: 0 28px 80px rgba(0,0,0,.42);
}
:root:not([data-theme="light"]) body {
  background: radial-gradient(900px 540px at 78% -12%, rgba(0, 132, 255, .08), transparent 65%), var(--bg);
}
:root:not([data-theme="light"]) .sidebar {
  border-right-color: #1b1e28;
  background: linear-gradient(180deg, #0d0f16 0%, #090b10 100%);
}
:root:not([data-theme="light"]) .brand {
  border-bottom-color: #1c202a;
}
:root:not([data-theme="light"]) .gradient-text { color: #38bdf8; }
:root:not([data-theme="light"]) .sidebar .nav-item.active {
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  border: 1px solid rgba(0, 132, 255, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
:root:not([data-theme="light"]) .sidebar .nav-item[data-tab="potogen_studio"].active {
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  border: 1px solid rgba(0, 132, 255, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
:root:not([data-theme="light"]) .sidebar .nav-item[data-tab="fb"].active {
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  border: 1px solid rgba(59, 130, 246, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
:root:not([data-theme="light"]) .sidebar .nav-item[data-tab="line"].active {
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  border: 1px solid rgba(59, 130, 246, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
:root:not([data-theme="light"]) .sidebar .nav-item[data-tab="ready_vault"].active {
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  border: 1px solid rgba(59, 130, 246, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
:root:not([data-theme="light"]) .sidebar .nav-item .nav-label,
:root:not([data-theme="light"]) .sidebar .nav-item.active .nav-label {
  color: #fff;
}
:root:not([data-theme="light"]) .account-card,
:root:not([data-theme="light"]) .phone-preview-card {
  background: #10131a;
  border-color: #242834;
}
:root:not([data-theme="light"]) .hud-card,
:root:not([data-theme="light"]) .card {
  background: linear-gradient(145deg, #12151d, #10131a);
  border-color: #242834;
}
:root:not([data-theme="light"]) .hud-card:hover,
:root:not([data-theme="light"]) .card:hover {
  border-color: #343044;
}
:root:not([data-theme="light"]) .hud-ic-fb,
:root:not([data-theme="light"]) .hud-ic-cyan,
:root:not([data-theme="light"]) .hud-ic-indigo {
  background: rgba(0, 132, 255, 0.14);
  color: #00C2FF;
  border: 1px solid rgba(0, 132, 255, 0.28);
}
:root:not([data-theme="light"]) .hud-ic-emerald { background: #123529; }
:root:not([data-theme="light"]) .hud-ic-amber { background: #332918; }
:root:not([data-theme="light"]) .hud-label { color: #7d8294; }
:root:not([data-theme="light"]) .hud-value { color: #ecebf2; }
:root:not([data-theme="light"]) .btn-primary,
:root:not([data-theme="light"]) .btn-fb,
:root:not([data-theme="light"]) .btn-indigo {
  background: linear-gradient(135deg, #0084FF 0%, #0066FF 100%);
  box-shadow: 0 4px 16px rgba(0, 132, 255, .32);
  color: #ffffff;
}
:root:not([data-theme="light"]) .btn-primary:hover,
:root:not([data-theme="light"]) .btn-fb:hover,
:root:not([data-theme="light"]) .btn-indigo:hover {
  background: linear-gradient(135deg, #0094FF 0%, #0077FF 100%);
  box-shadow: 0 6px 20px rgba(0, 132, 255, .45);
}
:root:not([data-theme="light"]) .status-row,
:root:not([data-theme="light"]) .reclist,
:root:not([data-theme="light"]) .input,
:root:not([data-theme="light"]) textarea,
:root:not([data-theme="light"]) select {
  background: #0d1017;
}
:root:not([data-theme="light"]) .seg { background: #0d1017; }
:root:not([data-theme="light"]) .seg button.active {
  background: rgba(0, 132, 255, 0.18);
  color: #60a5fa;
  border-color: rgba(0, 132, 255, 0.45);
}
:root:not([data-theme="light"]) .phone {
  max-width: 288px;
  padding: 7px;
  border: 1px solid #343746;
  background: linear-gradient(145deg,#2b2d38,#0b0c11 52%,#242632);
  box-shadow: 0 18px 42px rgba(0,0,0,.42), inset 0 0 0 1px rgba(255,255,255,.05);
}
:root:not([data-theme="light"]) .screen {
  height: 465px;
  background: #10131a;
  border: 1px solid #252a37;
}
:root:not([data-theme="light"]) .msgr-head,
:root:not([data-theme="light"]) .msgr-foot {
  background: #151923;
  border-color: #252a37;
  color: #e9e8ef;
}
:root:not([data-theme="light"]) .msgr-head .pname { color: #f0eff6; }
:root:not([data-theme="light"]) .msgr-head .pstat { color: #858a9c; }
:root:not([data-theme="light"]) .msgr-head .icons,
:root:not([data-theme="light"]) .msgr-head .back { color: #0084FF; }
:root:not([data-theme="light"]) .chat { background: #0d1017; }
:root:not([data-theme="light"]) .chat .placeholder { color: #686e81; }
:root:not([data-theme="light"]) .msgr-foot .pill { background: #242834; color: #9498a8; }
:root:not([data-theme="light"]) .line-chat { background: #193144; }
:root:not([data-theme="light"]) .line-chat .placeholder { color: #b3c4d5; }
:root:not([data-theme="light"]) .license-lock {
  background: radial-gradient(700px 420px at 50% 8%, rgba(0, 132, 255, .15), transparent 70%), #080a0f;
}
:root:not([data-theme="light"]) .lock-card {
  background: #11141c;
  border-color: #2a2d3a;
}
@media (max-width: 640px) {
  :root:not([data-theme="light"]) .screen { height: 430px; }
}

.panel-section[data-panel="fb"] { display: flex; flex-direction: column; }
.fb-workspace-heading {
  margin: 0; padding: 24px 18px; min-width: 0;
  width: 100%; justify-content: center; text-align: center;
}
.fb-workspace-heading > div { width: 100%; min-width: 0; }
.fb-workspace-heading h1 {
  font-size: clamp(28px, 2.6vw, 50px);
  line-height: 1.2; overflow-wrap: anywhere; text-wrap: balance;
}
.fb-workspace-heading .workspace-eyebrow {
  font-size: clamp(10px, .85vw, 13px); letter-spacing: 2.5px;
  margin-bottom: 12px;
}
.fb-workspace-heading p {
  font-size: clamp(12px, 1vw, 16px); margin-top: 12px;
  text-wrap: balance;
}
.fb-updates-row {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px; margin-top: 18px; min-width: 0;
}
.fb-updates-row > .card {
  min-width: 0; min-height: 180px; margin: 0;
}
.fb-updates-row > .fb-reserved-card {
  display: grid; place-items: center;
  background: radial-gradient(ellipse at center, rgba(139, 92, 246, .08), transparent 72%), var(--card);
}
.fb-coming-soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; min-width: 0; max-width: 100%; text-align: center;
  color: #bca6ed;
}
.fb-coming-soon-icon {
  display: grid; place-items: center; width: 46px; height: 46px;
  border: 1px solid rgba(167, 139, 250, .22); border-radius: 14px;
  background: rgba(139, 92, 246, .08);
}
.fb-coming-soon-icon svg { width: 30px; height: 30px; }
.fb-coming-soon h2 {
  margin: 0; max-width: 100%; overflow-wrap: anywhere;
  color: inherit; font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 800; line-height: 1.25; letter-spacing: .035em;
}
:root[data-theme="light"] .fb-coming-soon { color: #7052a6; }
.fb-news-heading { display: flex; align-items: center; gap: 12px; }
.fb-news-icon {
  display: grid; place-items: center; flex: 0 0 38px;
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--studio-soft); color: var(--accent-purple); font-size: 22px;
}
.fb-news-heading .workspace-eyebrow { margin-bottom: 3px; font-size: 9px; }
.fb-news-heading h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--ink); }
.fb-news-empty {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--stroke-2);
}
.fb-news-marker {
  flex: 0 0 6px; width: 6px; height: 6px; margin-top: 8px;
  border-radius: 50%; background: var(--ink-3);
}
.fb-news-empty p { margin: 0 0 3px; color: var(--ink-2); font-size: 13px; }
.fb-news-empty span { color: var(--ink-3); font-size: 12px; }
@media (max-width: 640px) {
  .fb-updates-row { grid-template-columns: minmax(0, 1fr); }
}
#sendControls .speed-row { margin-bottom: 16px; }

/* Desktop: Top HUD 4-columns full width, Workbench 2-columns (Card 1+2 on left level with Card 4 on right) */
@media (min-width: 1280px) {
  .panel-section { max-width: none; width: 100%; display: flex; flex-direction: column; gap: 18px; }
  .panel-section .hud-grid { grid-template-columns: repeat(4, 312px); width: fit-content; max-width: 100%; }
  .panel-section[data-panel="fb"] {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 18px;
  }
  .panel-section[data-panel="fb"] > .hud-grid {
    width: fit-content;
    max-width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 312px);
    margin-bottom: 0;
  }
  .panel-section[data-panel="fb"] .workbench-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 12px;
    align-items: stretch;
  }
  .panel-section[data-panel="fb"] .workbench-main {
    display: flex;
    flex-direction: column;
    gap: 14px !important;
    min-width: 0;
    height: 100%;
  }
  #fbSectionWrap {
    flex: 1.35 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  #lineSectionWrap {
    flex: 0.72 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    margin-top: 6px !important;
  }
  .panel-section[data-panel="fb"] .fb-top-grid,
  .fb-top-grid {
    display: grid !important;
    grid-template-columns: 460px 330px minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: stretch !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    flex: 1 1 auto !important;
    height: 100% !important;
  }
  .line-top-grid,
  .panel-section[data-panel="fb"] .line-top-grid,
  .panel-section[data-panel="line"] .line-top-grid {
    display: flex !important;
    justify-content: space-between !important;
    gap: 12px !important;
    align-items: stretch !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    flex: 1 1 auto !important;
    height: 100% !important;
    width: 100% !important;
  }
  .panel-section[data-panel="fb"] .fb-top-grid > .card {
    height: 100%;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background: rgba(12, 18, 28, 0.95) !important;
    border: 1px solid rgba(147, 197, 253, 0.22) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  }
  .panel-section[data-panel="line"] .line-top-grid > .card,
  #lineSectionWrap .card {
    height: 100%;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    background: rgba(14, 24, 18, 0.95) !important;
    border: 1px solid rgba(48, 85, 60, 0.35) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  }
  .panel-section[data-panel="line"] .line-top-grid > .card.line-card-composer,
  #lineSectionWrap .card.line-card-composer,
  #lineSectionWrap #lineCardComposer {
    flex-direction: column !important;
    display: flex !important;
    gap: 0 !important;
    align-items: stretch !important;
  }

  /* Card 1: Compact width & height (ลดความสูง ดันเนื้อหาขึ้น ไม่ย่อตัวหนังสือ) */
  .panel-section[data-panel="fb"] #fbCardSetup {
    padding: 12px 12px;
  }
  .panel-section[data-panel="fb"] #fbCardSetup .card-title {
    font-size: 13.5px;
    margin-bottom: 4px;
  }
  .panel-section[data-panel="fb"] #fbCardSetup .card-sub {
    font-size: 11px;
    line-height: 1.35;
    margin-bottom: 8px;
  }
  .panel-section[data-panel="fb"] #fbCardSetup .status-btn-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 6px;
  }
  .panel-section[data-panel="fb"] #fbCardSetup .status-btn-row .status-row {
    flex: 0 0 auto;
    height: 32px;
    min-height: 32px;
    padding: 4px 10px;
    margin: 0;
    box-sizing: border-box;
  }
  .panel-section[data-panel="fb"] #fbCardSetup .status-btn-row > div:last-child {
    display: flex;
    gap: 4px;
  }
  .panel-section[data-panel="fb"] #fbCardSetup .status-btn-row .btn {
    flex: 1;
    height: 30px;
    padding: 0 4px;
    font-size: 11.5px;
  }
  .panel-section[data-panel="fb"] #fbCardSetup .rich-page-trigger {
    padding: 6px 10px;
    background: rgba(15, 23, 42, 0.88);
  }
  .panel-section[data-panel="fb"] #fbCardSetup .rich-page-dropdown-menu,
  .panel-section[data-panel="fb"] #fbCardSetup .rich-page-box {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 9999;
    max-height: 200px;
  }
  .panel-section[data-panel="fb"] #fbCardSetup .rich-page-search-wrap {
    padding: 4px 8px;
  }
  .panel-section[data-panel="fb"] #fbCardSetup .rich-page-list {
    min-height: 50px;
    max-height: 140px;
    padding: 4px;
  }
  .panel-section[data-panel="fb"] #fbCardSetup .rich-page-item {
    padding: 4px 8px;
    gap: 8px;
  }
  .panel-section[data-panel="fb"] #fbCardSetup .page-select-details {
    margin-top: 6px;
  }
  .panel-section[data-panel="fb"] #fbCardSetup .page-select-details div {
    padding-top: 4px;
  }
  .panel-section[data-panel="fb"] #fbCardSetup .page-select-details .input {
    height: 28px;
    padding: 2px 8px;
    margin-bottom: 4px;
  }

  /* Card 2: Roomy width & compact height (ลดขนาดช่อง 2 ให้น้อยที่สุด ไม่ย่อตัวหนังสือ) */
  .panel-section[data-panel="fb"] #fbCardRecipients {
    padding: 12px 14px;
  }
  .panel-section[data-panel="fb"] #fbCardRecipients .card-title {
    margin-bottom: 4px;
  }
  .panel-section[data-panel="fb"] #fbCardRecipients .card-sub {
    margin-bottom: 8px;
  }
  .panel-section[data-panel="fb"] #fbCardRecipients .ctrl-label {
    margin-bottom: 3px;
  }
  .panel-section[data-panel="fb"] #fbCardRecipients .seg {
    margin-bottom: 6px;
  }
  .panel-section[data-panel="fb"] #fbCardRecipients .seg button {
    padding: 5px 10px;
    height: 32px;
  }
  .panel-section[data-panel="fb"] #fbCardRecipients .num-input {
    height: 34px;
  }
  .panel-section[data-panel="fb"] #fbCardRecipients #btnResume,
  .panel-section[data-panel="fb"] #fbCardRecipients #btnFetch,
  .panel-section[data-panel="fb"] #fbCardRecipients #btnStopFetch {
    height: 34px;
    padding: 0 12px;
  }
  .panel-section[data-panel="fb"] #fbCardRecipients .audience-stat {
    margin: 2px 0 6px;
    padding: 6px 12px;
  }
  .panel-section[data-panel="fb"] #fbCardRecipients .reclist {
    height: 110px;
    max-height: 110px;
    padding: 6px;
  }
  .panel-section[data-panel="fb"] #fbCardRecipients .empty-reclist-placeholder,
  .rec-empty,
  .empty-reclist-placeholder {
    display: none !important;
  }
  .panel-section[data-panel="fb"] #fbCardRecipients .rec-name-card {
    padding: 4px 8px;
  }

  /* Card 3: Shortened & Compact (โดย ช่อง 3 ลด สั้นลง ไม่ย่อตัวหนังสือ) */
  .panel-section[data-panel="fb"] #cardComposer {
    padding: 12px 14px;
  }
  .panel-section[data-panel="fb"] #cardComposer .card-header-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 6px;
    margin-bottom: 6px;
  }
  .panel-section[data-panel="fb"] #cardComposer .card-title {
    font-size: 13.5px;
    margin-bottom: 4px;
  }
  .panel-section[data-panel="fb"] #cardComposer .card-sub > div:first-child {
    font-size: 11px;
    line-height: 1.35;
  }
  .panel-section[data-panel="fb"] #cardComposer .card-sub > div:last-child {
    font-size: 10.5px;
    color: var(--ink-3);
    line-height: 1.3;
  }
  .panel-section[data-panel="fb"] #cardComposer .block-add {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-left: 0;
    width: 100%;
    margin-top: auto;
  }
  .panel-section[data-panel="fb"] #cardComposer .block-add .btn {
    font-size: 11px;
    height: 28px;
    min-height: 28px;
    padding: 0 6px;
    justify-content: center;
  }
  .panel-section[data-panel="fb"] #cardComposer #blocks,
  #cardComposer #blocks {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    gap: 8px !important;
    overflow-y: auto !important;
  }
  .panel-section[data-panel="fb"] #cardComposer .block,
  #cardComposer .block {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 140px !important;
    margin-bottom: 0 !important;
  }
  /* Single text block has no header to preserve maximum composer space */
  #lineBlocks > .block:only-child:not(.has-media) .block-head,
  #blocks > .block:only-child:not(.has-media) .block-head {
    display: none !important;
    padding: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    border: none !important;
    overflow: hidden !important;
  }
  /* Multiple blocks or media blocks show a sleek header with cancel/delete button */
  #lineBlocks > .block:not(:only-child) .block-head,
  #blocks > .block:not(:only-child) .block-head,
  .block.has-media .block-head,
  .block:has(.block-img) .block-head,
  .block:has(video) .block-head,
  .block:has(img) .block-head,
  .block-head.force-visible {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    height: 27px !important;
    min-height: 27px !important;
    padding: 2px 8px !important;
    margin: 0 0 2px 0 !important;
    background: rgba(15, 23, 42, 0.9) !important;
    border-bottom: 1px solid rgba(147, 197, 253, 0.18) !important;
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
    overflow: visible !important;
  }
  .block-head .bctrl,
  .block-head .block-ctrls {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
  }
  .block-head .bctrl button,
  .block-head .block-ctrls button {
    height: 21px !important;
    min-height: 21px !important;
    line-height: 1 !important;
    font-size: 10.5px !important;
    padding: 0 6px !important;
    border-radius: 5px !important;
    border: 1px solid rgba(147, 197, 253, 0.22) !important;
    background: rgba(30, 41, 59, 0.75) !important;
    color: #cbd5e1 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.15s ease !important;
  }
  .block-head .bctrl button:hover,
  .block-head .block-ctrls button:hover {
    background: rgba(59, 130, 246, 0.3) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
  }
  .block-head .bctrl button.del,
  .block-head .block-ctrls button.del {
    background: rgba(239, 68, 68, 0.18) !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    color: #f87171 !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    padding: 0 8px !important;
    cursor: pointer !important;
  }
  .block-head .bctrl button.del:hover,
  .block-head .block-ctrls button.del:hover {
    background: #ef4444 !important;
    border-color: #f87171 !important;
    color: #ffffff !important;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5) !important;
  }
  .panel-section[data-panel="fb"] #cardComposer .block-text-body,
  .panel-section[data-panel="fb"] #cardComposer .block-body,
  #cardComposer .block-text-body,
  #cardComposer .block-body {
    padding: 6px 8px !important;
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    position: relative !important;
  }
  .panel-section[data-panel="fb"] #cardComposer .block-text-body textarea,
  .panel-section[data-panel="fb"] #cardComposer .block-text-body .block-textarea,
  .panel-section[data-panel="fb"] #cardComposer .block-body textarea,
  .panel-section[data-panel="fb"] #cardComposer .block-textarea,
  #cardComposer .block-text-body textarea,
  #cardComposer .block-text-body .block-textarea,
  #cardComposer .block-body textarea,
  #cardComposer .block-textarea {
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100px !important;
    resize: vertical !important;
    box-sizing: border-box !important;
  }

  /* Workbench Side: Card 4 + Chat Preview */
  .panel-section[data-panel="fb"] .workbench-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    position: static;
  }
  .panel-section[data-panel="fb"] .workbench-side > .card {
    width: 100%;
    min-width: 0;
  }
  .panel-section[data-panel="fb"] .workbench-side > .card:first-child {
    padding: 14px 14px;
  }
  .panel-section[data-panel="fb"] .workbench-side > .card:first-child .card-title {
    font-size: 13.5px;
  }
  .panel-section[data-panel="fb"] .workbench-side > .card:first-child .launch-options-2col {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .panel-section[data-panel="fb"] .workbench-side > .card:first-child .btn-primary {
    width: 100%;
    height: 40px;
    font-size: 13px;
  }
  .panel-section[data-panel="fb"] .workbench-side > .chat-preview-box,
  .panel-section[data-panel="fb"] .workbench-side > .phone-preview-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    max-height: 520px;
  }
  .panel-section[data-panel="fb"] .chat-preview-box .chat,
  .panel-section[data-panel="fb"] .phone-preview-card .chat {
    flex: 1 1 auto;
    min-height: 120px;
    max-height: 440px;
  }
}

/* Tablet & Medium Screens: 901px - 1400px */
@media (max-width: 1400px) and (min-width: 901px) {
  .workbench-layout .fb-top-grid {
    grid-template-columns: 330px minmax(240px, 1fr) minmax(260px, 1.1fr) 290px !important;
    gap: 10px !important;
  }
}

/* Mobile Screens: <= 900px -> 1 column */
@media (max-width: 900px) {
  .panel-section[data-panel="fb"] .workbench-grid,
  .panel-section[data-panel="fb"] .fb-top-grid,
  .panel-section[data-panel="fb"] .workbench-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
}

/* LINE desktop: share the composer baseline and let the preview screen grow.
   Keep the existing stacked/tablet layout below the two-column breakpoint. */
@media (min-width: 1271px) {
  .panel-section[data-panel="line"] .workbench-grid { align-items: stretch; }
  .panel-section[data-panel="line"] .workbench-main > .card:last-child { flex: 1; }
  .panel-section[data-panel="line"] .workbench-side {
    align-self: stretch; min-height: 0;
  }
  .panel-section[data-panel="line"] .workbench-side > .card { flex: 1 1 auto; height: 100%; min-height: 0; display: flex; flex-direction: column; }
  .panel-section[data-panel="line"] .workbench-side > .phone-preview-card {
    flex: 1 1 auto; min-height: 0; position: relative; top: auto;
  }
  .panel-section[data-panel="line"] .phone-preview-card .phone {
    display: flex; flex-direction: column; flex: 1; min-height: 0;
  }
  :root .panel-section[data-panel="line"] .phone-preview-card .screen {
    flex: 1; height: auto; min-height: 465px;
  }
  .panel-section[data-panel="line"] .phone-preview-card .chat {
    flex-basis: 0; min-height: 0;
  }
  .panel-section[data-panel="line"] .phone-preview-card .msgr-head,
  .panel-section[data-panel="line"] .phone-preview-card .msgr-foot { flex-shrink: 0; }
}

/* License dialog: explicit semantic hooks, never infer actions from last-child. */
:root #licenseModal .modal.license-modal-box {
  width: min(620px, 100%);
  max-width: 620px;
  max-height: calc(100dvh - 48px);
  padding: 26px;
  overflow-y: auto;
  overflow-x: hidden;
}
:root #licenseModal .modal-head { gap: 14px; margin-bottom: 20px; padding-bottom: 20px; }
:root #licenseModal .modal-head > div:not(.modal-icon) { flex: 1; min-width: 0; }
:root #licenseModal .modal-icon,
:root #licenseModal .modal-close { flex-shrink: 0; }
:root #licenseModal #licenseBody .ava-license-content {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
:root #licenseModal #licenseBody .ava-license-content > .ava-license-card {
  padding: 0 !important;
  margin: 0 !important;
  min-width: 0;
  overflow: hidden !important;
}
:root #licenseModal #licenseBody .ava-license-card > .ava-license-row {
  display: grid !important;
  grid-template-columns: minmax(130px, .85fr) minmax(0, 1.5fr);
  gap: 12px !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 15px 18px !important;
  border-top: 0 !important;
  min-width: 0;
}
:root #licenseModal #licenseBody .ava-license-row > .ava-license-label {
  display: flex !important;
  gap: 8px !important;
  min-width: 0;
  font-size: 13px !important;
  line-height: 1.6;
}
:root #licenseModal #licenseBody .ava-license-row > .ava-license-value {
  display: block !important;
  justify-self: end;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  font-size: 13px !important;
  line-height: 1.65;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
}
:root #licenseModal #licenseBody .ava-license-row > code.ava-license-value {
  font-size: 12px !important;
  padding: 8px 10px !important;
}
:root #licenseModal #licenseBody .ava-license-content > .ava-license-actions {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  margin: 0 !important;
  padding: 18px 0 0 !important;
  border-top: 1px solid var(--stroke) !important;
}
:root #licenseModal #licenseBody .ava-license-actions > .btn-lic-renew,
:root #licenseModal #licenseBody .ava-license-actions > #btnLicCloseAction {
  position: static !important;
  inset: auto !important;
  float: none !important;
  flex: 0 1 auto;
  width: auto !important;
  height: auto !important;
  min-height: 44px;
  max-width: 100%;
  margin: 0 !important;
  padding: 10px 16px !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  text-align: center !important;
  transform: none !important;
}
:root #licenseModal #licenseBody .ava-license-actions > .btn-lic-renew {
  display: inline-flex !important;
  justify-content: center;
  gap: 8px !important;
}
:root #licenseModal .ava-renew-label { white-space: nowrap; }
:root #licenseModal .lic-row-icon,
:root #licenseModal .lic-pulse-dot { flex: 0 0 auto; }
:root #licenseModal #licenseBody .ava-license-row .ava-license-label > .lic-row-icon {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  box-shadow: none !important;
  font-size: 14px !important;
}
:root #licenseModal .lic-trust-footer { line-height: 1.7; margin-top: 18px; font-size: 11px; }
:root #licenseModal a:focus-visible,
:root #licenseModal button:focus-visible,
:root #licenseModal code:focus-visible { outline: 2px solid var(--studio-primary); outline-offset: 3px; }
@media (max-width: 540px) {
  :root #licenseModal { padding: 12px; }
  :root #licenseModal .modal.license-modal-box {
    padding: 20px 16px;
    max-height: calc(100dvh - 24px);
  }
  :root #licenseModal #licenseBody .ava-license-card > .ava-license-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px !important;
    padding: 13px 14px !important;
  }
  :root #licenseModal #licenseBody .ava-license-row > .ava-license-value {
    justify-self: start;
    text-align: left;
  }
  :root #licenseModal #licenseBody .ava-license-actions > .btn-lic-renew,
  :root #licenseModal #licenseBody .ava-license-actions > #btnLicCloseAction {
    flex: 1 0 100%;
    width: 100% !important;
  }
}


/* LINE Full Height Stretch */
@media (min-width: 1271px) {
  .panel-section[data-panel="line"] .workbench-grid { align-items: stretch; }
  .panel-section[data-panel="line"] .workbench-side { align-self: stretch; min-height: 0; display: flex; flex-direction: column; }
  .panel-section[data-panel="line"] .workbench-side > .card,
  .panel-section[data-panel="line"] .workbench-side > .chat-preview-box { flex: 1 1 auto; height: 100%; min-height: 0; display: flex; flex-direction: column; }
  .panel-section[data-panel="line"] .chat-preview-box .line-chat,
  .panel-section[data-panel="line"] .chat-preview-box .chat { flex: 1 1 auto; height: 100%; min-height: 250px; }
}

/* Studio AI (Potogen Studio) Seamless Layout - No Outer Frames or Double Boxes */
.panel-section[data-panel="potogen_studio"],
#potoShell,
#potoScroll,
#potoMainGrid {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Card 2 Feature Option Tabs (3 Tabs in 1 Row - Multi-Select & 29px Matching Height) */
.poto-option-tab {
  height: 29px;
  min-height: 29px;
  box-sizing: border-box;
  padding: 6px 4px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  transition: all 0.15s ease;
  text-align: center;
  user-select: none;
}

.poto-option-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.poto-option-tab.active,
.poto-option-tab:has(input:checked) {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6) !important;
  border-color: #60a5fa !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35) !important;
}

/* ================= REALTIME STATUS INSPECTOR HUD STYLES ================= */
@keyframes hudPopBounce {
  0% { transform: scale(0.93); border-color: rgba(59,130,246,0.9); box-shadow: 0 0 12px rgba(59,130,246,0.7); background: rgba(30,58,138,0.4); }
  50% { transform: scale(1.04); border-color: #60a5fa; box-shadow: 0 0 16px rgba(96,165,250,0.9); }
  100% { transform: scale(1); border-color: rgba(255,255,255,0.07); box-shadow: none; background: rgba(15,23,42,0.65); }
}

.hud-pill {
  cursor: pointer !important;
  user-select: none;
  transition: all 0.15s ease !important;
}

.hud-pill:hover {
  border-color: rgba(96, 165, 250, 0.7) !important;
  background: rgba(30, 58, 138, 0.35) !important;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
  transform: translateY(-1px);
}

.hud-pill:active {
  transform: scale(0.96) !important;
}

.hud-pill.pop-flash {
  animation: hudPopBounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* ================= LINE UNDER 8-BOX HUD & PREVIEW SWITCHER ================= */
.line-section-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.channel-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 2px;
  user-select: none;
}
.channel-section-header .channel-dot.line-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8 !important;
  box-shadow: none !important;
  flex-shrink: 0;
}
.channel-section-header .channel-title {
  font-size: 13px;
  font-weight: 700;
  color: #38bdf8 !important;
  letter-spacing: 0.6px;
  white-space: nowrap;
}
.channel-section-header .channel-line {
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.35), transparent) !important;
}

/* Chat Preview Switcher (Messenger <-> LINE OA) */
.chat-preview-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
}
.preview-switch-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2, #94a3b8);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}
.preview-switch-btn:hover {
  color: var(--ink, #e2e8f0);
  background: rgba(255, 255, 255, 0.05);
}
.preview-switch-btn.active[data-target="fb"] {
  background: rgba(0, 194, 255, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  box-shadow: 0 2px 8px rgba(0, 194, 255, 0.18);
}
.preview-switch-btn.active[data-target="line"] {
  background: rgba(0, 194, 255, 0.12) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
  box-shadow: 0 2px 8px rgba(0, 194, 255, 0.18) !important;
}
.preview-sw-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.preview-switch-btn.active .preview-sw-dot {
  transform: scale(1.25);
}
.preview-sw-dot.fb-dot {
  background: #00c2ff;
  box-shadow: 0 0 6px #00c2ff;
}
.preview-sw-dot.line-dot {
  background: #00c2ff !important;
  box-shadow: 0 0 6px #00c2ff !important;
}

/* Chat Preview Wrapper Layout */
.chat-preview-box {
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}
.preview-panel-view {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}
.preview-panel-view.hidden {
  display: none !important;
}
.preview-panel-view .msgr-head {
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}
.preview-panel-view .chat {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-height: 280px;
  box-sizing: border-box;
  overflow-y: auto;
}

/* =========================================================================
   1. MAIN WORKBENCH CONTAINER
   ========================================================================= */
.workbench-layout {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* =========================================================================
   2. UNIFIED FACEBOOK ZONE (Cards 1, 2, 3, 4 Natively Unified in Pastel Blue Surface)
   ========================================================================= */
.fb-section-wrap,
#fbSectionWrap {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  width: 100% !important;
  margin: 0 !important;
  position: relative !important;
  z-index: 2 !important;
}

.fb-top-grid {
  display: grid !important;
  grid-template-columns: 460px 330px minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: stretch !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#fbSectionWrap .card,
.fb-top-grid > .card {
  background: rgba(14, 24, 40, 0.62) !important;
  background-color: rgba(14, 24, 40, 0.62) !important;
  background-image: none !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  box-sizing: border-box !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 16px 18px !important;
}

#fbSectionWrap .card:not(#fbCard4),
.fb-top-grid > .card:not(#fbCard4) {
  height: 100% !important;
}

/* Card 4 inside .workbench-side: v 9 - Equal to Card 1 Box 1 in Dimensions & Typography */
#fbCard4,
.workbench-side > #fbCard4,
.workbench-side > .card:first-child {
  background: rgba(14, 24, 40, 0.62) !important;
  background-color: rgba(14, 24, 40, 0.62) !important;
  background-image: none !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 12px 14px !important;
  align-self: stretch !important;
  flex: 0 0 260px !important;
  height: 260px !important;
  min-height: 260px !important;
  max-height: 260px !important;
  width: 330px !important;
  min-width: 330px !important;
  max-width: 330px !important;
  margin-bottom: 0 !important;
}

#fbCard4 .card-title,
.workbench-side > .card:first-child .card-title {
  font-size: 13.5px !important;
  font-weight: 700 !important;
  color: var(--ink) !important;
  margin-top: 0 !important;
  margin-bottom: 6px !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
}

#fbCard4 .card-sub,
.workbench-side > .card:first-child .card-sub {
  font-size: 11px !important;
  line-height: 1.3 !important;
  margin-bottom: 4px !important;
  color: var(--ink-2) !important;
}

#fbCard4 #sendControls,
.workbench-side > .card:first-child #sendControls {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  flex: 1 1 auto !important;
  gap: 8px !important;
  margin-top: 2px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#fbCard4 .speed-row,
.workbench-side > .card:first-child .speed-row {
  margin-bottom: 2px !important;
}

#fbCard4 .ctrl-label,
.workbench-side > .card:first-child .ctrl-label {
  font-size: 11.5px !important;
  margin-bottom: 5px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  display: block !important;
}

#fbCard4 #speedSelect,
.workbench-side > .card:first-child #speedSelect {
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 7px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

#fbCard4 #speedHint,
.workbench-side > .card:first-child #speedHint {
  font-size: 10px !important;
  margin-top: 5px !important;
  margin-bottom: 0 !important;
  line-height: 1.35 !important;
  color: #94a3b8 !important;
}

#fbCard4 .launch-options-2col,
.workbench-side > .card:first-child .launch-options-2col,
.launch-options-2col {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  margin: 4px 0 !important;
}

#fbCard4 .check-row,
.workbench-side > .card:first-child .check-row,
.check-row {
  font-size: 11px !important;
  font-weight: 500 !important;
  gap: 6px !important;
  display: flex !important;
  align-items: center !important;
  color: var(--ink) !important;
  white-space: nowrap !important;
}

#fbCard4 .check-row input[type="checkbox"],
.workbench-side > .card:first-child .check-row input[type="checkbox"] {
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
}

#fbCard4 .clear-sent-row,
.workbench-side > .card:first-child .clear-sent-row {
  margin-top: 2px !important;
  margin-bottom: 2px !important;
}

#fbCard4 .clear-sent-row a,
#fbCard4 #clearSent,
.workbench-side > .card:first-child #clearSent {
  font-size: 11px !important;
  line-height: 1.25 !important;
  color: var(--ink-2) !important;
}

#fbCard4 #btnSend,
.workbench-side > .card:first-child #btnSend {
  width: 100% !important;
  height: 36px !important;
  min-height: 36px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  margin-top: 8px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Audience stat in Facebook Card 2 */
:root .panel-section .audience-stat,
.panel-section[data-panel="fb"] #fbCardRecipients .audience-stat {
  background: rgba(0, 132, 255, 0.18) !important;
  border: 1px solid rgba(0, 132, 255, 0.35) !important;
  color: #38bdf8 !important;
  border-radius: 10px !important;
}
.audience-stat b {
  color: #00C2FF !important;
}
.audience-stat span {
  color: #93c5fd !important;
}

/* =========================================================================
   3. UNIFIED 8-SLOT HUD STRIP (Compact Sleek Floating HUD Bar)
   ========================================================================= */
.hud-8-row,
#hudUnified8 {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 0 -6px 0 !important; /* ยืดขึ้นมาชิดติดเส้น 8 ช่อง */
  padding: 0 !important;
  box-sizing: border-box !important;
}

.hud-group {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 6px !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

/* First 4 slots: Pastel Blue Facebook (Outer frame removed) */
.hud-fb-surface,
#hudFbCards {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

#hudFbCards .hud-card {
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.25) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  padding: 4px 8px !important;
  min-width: 0 !important;
  width: 100% !important;
  gap: 8px !important;
  min-height: 0 !important;
  height: auto !important;
}
#hudFbCards .hud-label {
  color: #93c5fd !important;
  font-size: 9.5px !important;
  line-height: 1.15 !important;
  margin-bottom: 1px !important;
}
#hudFbCards .hud-value {
  color: #e2e8f0 !important;
  font-size: 11.5px !important;
  line-height: 1.2 !important;
}
#hudFbCards .hud-value.hud-accent {
  color: #60a5fa !important;
}

/* Last slots: Matte Sage Green LINE (Outer frame removed) */
.hud-line-surface,
#hudLineCards {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr)) !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

#hudLineCards .hud-card,
.line-top-grid .hud-card,
.line-top-grid .card .hud-card,
.line-section-wrap .hud-card,
.line-section-wrap .card .hud-card,
.card .hud-card,
.line-card-composer .hud-card {
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  padding: 6px 10px !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  gap: 8px !important;
  min-height: 0 !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  overflow: hidden !important;
}
.line-top-grid .hud-card .hud-content,
.line-section-wrap .hud-card .hud-content,
.card .hud-card .hud-content {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
}
#hudLineCards .hud-label,
.line-top-grid .hud-label,
.line-section-wrap .hud-label,
.card .hud-card .hud-label,
.line-card-composer .hud-label {
  color: #94a3b8 !important;
  font-size: 9.5px !important;
  line-height: 1.15 !important;
  margin-bottom: 1px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#hudLineCards .hud-value,
.line-top-grid .hud-value,
.line-section-wrap .hud-value,
.card .hud-card .hud-value,
.line-card-composer .hud-value {
  color: #e2e8f0 !important;
  font-size: 11.5px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#hudLineCards .hud-value.hud-accent,
#hudLineCards .text-emerald,
.line-top-grid .text-emerald,
.line-card-composer .text-emerald {
  color: #38bdf8 !important;
}

.line-top-grid > .card {
  min-width: 0 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
.line-top-grid > .card .hud-card {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.line-header-hud-slots {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-shrink: 0 !important;
}

.line-header-hud-slots .hud-card {
  width: auto !important;
}

.line-card-composer .card-header-row {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  flex-wrap: nowrap !important;
  margin-bottom: 10px !important;
  padding-bottom: 8px !important;
}

/* Compact HUD Elements across slots */
#hudUnified8 .hud-ic,
.line-top-grid .hud-ic,
.line-card-composer .hud-ic {
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#hudUnified8 .hud-content,
.line-top-grid .hud-content,
.line-card-composer .hud-content {
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
}

#hudUnified8 .hud-content.hud-content-row,
.line-top-grid .hud-content.hud-content-row,
.line-card-composer .hud-content.hud-content-row {
  flex-direction: row !important;
  align-items: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
}
.line-card-composer .hud-card-compact {
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
}
.line-card-composer .hud-card-compact .hud-label,
.line-card-composer .hud-card-compact .hud-value {
  margin: 0 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}


/* =========================================================================
   4. UNIFIED LINE ZONE (Connected Matte Sage Green Surface - Non-Glowing!)
   ========================================================================= */
.line-section-wrap,
#lineSectionWrap {
  margin-top: 35px !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
}

.line-top-grid {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: stretch !important;
  gap: 12px !important;
  width: 100% !important;
  flex: 1 1 auto !important;
  box-sizing: border-box !important;
}

#lineSectionWrap .card,
.line-top-grid > .card {
  background: rgba(14, 24, 40, 0.62) !important;
  background-color: rgba(14, 24, 40, 0.62) !important;
  background-image: none !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  padding: 8px 10px !important;
  overflow: hidden !important;
}

.line-setup-dual-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 9px !important;
  margin-top: auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.line-setup-dual-grid .sub-card-box,
#lineCardSetup,
#lineCardTarget {
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  border-radius: 10px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 6px !important;
  padding: 7px 9px !important;
  margin: 0 !important;
}

#lineStatusRow {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
  background: rgba(16, 185, 129, 0.18) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.38) !important;
  width: fit-content !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}
#lineStatusRow .sdot {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  background: #10b981 !important;
  box-shadow: 0 0 6px #10b981 !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}
#lineStatusRow .stext {
  color: #34d399 !important;
  font-weight: 700 !important;
  font-size: 11px !important;
  letter-spacing: 0.2px !important;
}

.line-card-composer,
#lineCardComposer {
  width: 576px !important;
  max-width: 576px !important;
  min-width: 0 !important;
  height: 568px !important;
  flex: 0 0 576px !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 4px !important;
  box-sizing: border-box !important;
  padding: 8px 10px !important;
  overflow: hidden !important;
}

.line-card-composer > div:first-child,
#lineCardComposer > div:first-child {
  margin: 0 0 4px 0 !important;
  flex-shrink: 0 !important;
}

#lineCardComposer .hud-card {
  height: 38px !important;
  min-height: 38px !important;
  max-height: 38px !important;
  padding: 3px 10px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  border-radius: 9px !important;
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

#lineCardComposer .hud-card .hud-ic {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  border-radius: 7px !important;
  background: #0c2b45 !important;
  border: 1.5px solid #0284c7 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 12px !important;
  flex-shrink: 0 !important;
}

#lineCardGallery {
  width: 270px !important;
  min-width: 270px !important;
  max-width: 270px !important;
  height: 400px !important;
  min-height: 400px !important;
  max-height: 400px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  padding: 6px 8px !important;
  overflow: hidden !important;
  margin: 0 !important;
}

#lineBlocks,
#blocks {
  flex: 1 1 auto !important;
  min-height: 120px !important;
  max-height: 220px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  margin: 0 !important;
  padding: 2px 4px 2px 0 !important;
  scrollbar-width: thin !important;
  scrollbar-color: #0284c7 rgba(10, 15, 29, 0.75) !important;
  scroll-behavior: smooth !important;
}

#lineBlocks::-webkit-scrollbar,
#blocks::-webkit-scrollbar {
  width: 6px !important;
  display: block !important;
}

#lineBlocks::-webkit-scrollbar-track,
#blocks::-webkit-scrollbar-track {
  background: rgba(10, 15, 29, 0.7) !important;
  border-radius: 4px !important;
}

#lineBlocks::-webkit-scrollbar-thumb,
#blocks::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #0284c7, #38bdf8) !important;
  border-radius: 4px !important;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.4) !important;
}

#lineBlocks::-webkit-scrollbar-thumb:hover,
#blocks::-webkit-scrollbar-thumb:hover {
  background: #38bdf8 !important;
}

#lineBlocks .block:only-child,
#lineBlocks .line-block:only-child,
#blocks .block:only-child {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  height: 100% !important;
}

#lineBlocks .block:not(:only-child),
#lineBlocks .line-block:not(:only-child),
#blocks .block:not(:only-child) {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  height: auto !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 0 4px 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border: 1px solid rgba(147, 197, 253, 0.22) !important;
  border-radius: 8px !important;
  background: rgba(10, 15, 29, 0.65) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2) !important;
}

#lineBlocks .block-body,
#blocks .block-text-body,
#blocks .block-body {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 4px 6px !important;
}

#lineBlocks .block:only-child .block-body textarea,
#blocks .block:only-child textarea {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 130px !important;
  box-sizing: border-box !important;
}

#lineBlocks .block:not(:only-child) .block-body textarea,
#blocks .block:not(:only-child) textarea {
  width: 100% !important;
  height: 72px !important;
  min-height: 60px !important;
  box-sizing: border-box !important;
  resize: vertical !important;
}

/* Multi-Block Position Switcher Button & Badges */
.btn-pos-switch {
  height: 20px !important;
  padding: 0 6px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  border-radius: 5px !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  background: rgba(14, 165, 233, 0.15) !important;
  color: #38bdf8 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 3px !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
}
.btn-pos-switch:hover {
  background: rgba(14, 165, 233, 0.35) !important;
  color: #ffffff !important;
  border-color: #38bdf8 !important;
}
.pos-badge {
  font-size: 9.5px !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
  white-space: nowrap !important;
}

.line-card-composer .block-add {
  margin-top: 4px !important;
  margin-bottom: 6px !important;
  padding-top: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 4px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

.line-card-composer .block-add button {
  padding: 0 2px !important;
  font-size: 10.5px !important;
  height: 26px !important;
  justify-content: center !important;
  white-space: nowrap !important;
}

.line-setup-dual-grid {
  margin-top: 0 !important;
  flex-shrink: 0 !important;
}


#lineSectionWrap .card-title,
.line-top-grid .card-title {
  color: #38bdf8 !important;
  text-shadow: none !important;
}
#lineSectionWrap .card-sub {
  color: #94a3b8 !important;
}

.btn-line,
#lineBroadcast,
#lineConnect {
  background: linear-gradient(135deg, #1877f2 0%, #0056b3 100%) !important;
  border: 1px solid rgba(96, 165, 250, 0.4) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(24, 119, 242, 0.35) !important;
  transition: all 0.15s ease-in-out !important;
}
.btn-line:hover,
#lineBroadcast:hover,
#lineConnect:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  border-color: rgba(147, 197, 253, 0.6) !important;
  box-shadow: 0 6px 20px rgba(24, 119, 242, 0.5) !important;
}

/* =========================================================================
   5. WORKBENCH BOTTOM GRID & RIGHT COLUMN (Chat Live Preview)
   ========================================================================= */
#workbenchBottomGrid,
.workbench-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 330px !important;
  gap: 10px !important;
  align-items: stretch !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#workbenchSide,
.workbench-side {
  display: flex !important;
  flex-direction: column !important;
  flex: 0 0 auto !important;
  width: 330px;
  max-width: 100%;
  box-sizing: border-box !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Chat Live Preview: Stretches down flush with LINE and History */
#unifiedChatPreview {
  background: #0b0f19 !important;
  background-color: #0b0f19 !important;
  background-image: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  outline: none !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  padding: 8px 10px !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: 1 1 auto !important;
}

/* Chat Live Preview: LINE OA (Blue Facebook Theme) */
#lineChatPreviewCard,
#lineWorkbenchSide #lineChatPreviewCard {
  background: linear-gradient(165deg, rgba(16, 26, 46, 0.95), rgba(10, 16, 30, 0.98)) !important;
  background-color: #0b1120 !important;
  background-image: linear-gradient(165deg, rgba(16, 26, 46, 0.95), rgba(10, 16, 30, 0.98)) !important;
  border: 1px solid rgba(59, 130, 246, 0.35) !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), 0 0 15px rgba(59, 130, 246, 0.15) !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
  padding: 8px 10px !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: 1 1 auto !important;
}

#lineChatPreviewCard .line-chat,
#lineOaPhChat {
  background: rgba(4, 8, 18, 0.9) !important;
  border: 1px solid rgba(59, 130, 246, 0.25) !important;
}

/* LINE OA Gallery Showcase Card - Blue Facebook Theme */
#lineGalleryShowcaseCard {
  background: linear-gradient(165deg, rgba(16, 26, 46, 0.9), rgba(10, 16, 30, 0.95)) !important;
  background-color: #0b1120 !important;
  background-image: linear-gradient(165deg, rgba(16, 26, 46, 0.9), rgba(10, 16, 30, 0.95)) !important;
  border: 1px solid rgba(59, 130, 246, 0.25) !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

#lineGalleryGrid {
  display: grid !important;
  grid-template-columns: repeat(5, 1fr) !important;
  grid-template-rows: repeat(2, 1fr) !important;
  gap: 6px !important;
}
.chat-preview-box .preview-panel-view {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}
.chat-preview-box .chat,
.chat-preview-box .line-chat {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 180px !important;
  overflow-y: auto !important;
}

/* Ensure Card 1 buttons never overflow under any circumstances */
#fbCardSetup,
#fbSectionWrap #fbCardSetup {
  overflow: hidden !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
}

.status-btn-row {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.status-action-btns {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.status-btn-row .btn,
.status-action-btns .btn {
  width: 100% !important;
  height: 34px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
}

/* AI Photo Gallery Card in Facebook Top Grid */
#fbCardGallery,
.card-ai-gallery {
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 14px 16px !important;
  min-height: 0 !important;
  height: 100% !important;
}

#fbCardComposer {
  height: 100% !important;
}

/* =========================================================================
   COLUMN 4: AI Photo Gallery (Top) + Card 4 Broadcast Launch (Bottom)
   ========================================================================= */
.fb-top-col4 {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  height: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

#fbCardGallery {
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 8px 10px !important;
  flex: 0 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
}

#composerPotoGalleryGrid {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  align-items: start !important;
}

#fbCardGallery .composer-poto-card,
#composerPotoGalleryGrid > div {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
  max-height: 95px !important;
  min-height: 0 !important;
  flex-shrink: 0 !important;
  align-self: start !important;
}

#fbCard4 {
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 8px 12px !important;
  flex: 0 0 auto !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
}

.workbench-side {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 8px !important;
  flex: 1 1 0 !important;
  width: auto !important;
  min-width: 260px !important;
  max-width: none !important;
  box-sizing: border-box !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

#unifiedChatPreview {
  margin-top: auto !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: 1 1 auto !important;
  box-sizing: border-box !important;
}


/* Card 1 Facebook: Flexible Width within 3-column Grid */
#fbCardSetup {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* Card 3 Facebook Composer: Flexible Width within 3-column Grid */
#cardComposer {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

/* LINE & FB Composer Header HUDs: Exact 34px Matching Height, Padding & Typography */
#lineCardComposer .hud-card.hud-line,
#cardComposer .hud-card.hud-fb {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  padding: 2px 6px !important;
  border-radius: 9px !important;
  box-sizing: border-box !important;
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  display: flex !important;
  align-items: center !important;
}

#lineCardComposer .hud-card.hud-line .hud-ic,
#cardComposer .hud-card.hud-fb .hud-ic,
#lineCardComposer .hud-ic,
#cardComposer .hud-ic {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  font-size: 11px !important;
  border-radius: 50% !important;
  background: #0c2b45 !important;
  border: 1.5px solid #0284c7 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

#lineCardComposer #linePhNameHud,
#cardComposer #hudPageName {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#lineCardComposer .hud-card.hud-line .hud-label,
#cardComposer .hud-card.hud-fb .hud-label {
  font-size: 8.5px !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
  white-space: nowrap !important;
  margin: 0 !important;
}

#lineCardComposer #lineFollowersHud,
#lineCardComposer #lineQuotaHud,
#cardComposer #hudRecCount {
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: #38bdf8 !important;
  white-space: nowrap !important;
}

/* Card 1 Facebook Dual Boxes (แยกออกมาคนละกล่อง) */
#fbCardSetup {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  box-sizing: border-box !important;
}

.fb-sub-box {
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  box-sizing: border-box !important;
  width: 100% !important;
}


/* === v 11: Card 1 Slim Connect Buttons + Card 3 Block-Head Hidden + Card 4 Button Pulled Up === */
#fbCardPageSelect .status-btn-row {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-top: 4px !important;
}
#fbCardPageSelect .status-action-btns {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
#fbCardPageSelect .status-btn-row .btn,
#fbCardPageSelect .status-action-btns .btn,
#btnConnect,
#btnLoadPages {
  width: 100% !important;
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
}
#fbCardPageSelect #connStatus {
  height: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  padding: 1px 8px !important;
  font-size: 10.5px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

#cardComposer #blocks > .block:only-child:not(.has-media) .block-head {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  overflow: hidden !important;
}

#fbCard4 #sendControls,
.workbench-side > .card:first-child #sendControls {
  justify-content: flex-start !important;
  gap: 8px !important;
}

#fbCard4 #btnSend,
.workbench-side > .card:first-child #btnSend {
  margin-top: 8px !important;
}

#lineInfo:empty {
  display: none !important;
}

#lineConnect,
#lineBroadcast {
  height: 26px !important;
  min-height: 26px !important;
  max-height: 26px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin-top: auto !important;
  margin-bottom: 0 !important;
}

#lineCardComposer .block-add button {
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  padding: 0 6px !important;
  font-size: 11px !important;
  border-radius: 9px !important;
}



/* Card Composer Block Textarea v13 Faint Styling */
.panel-section[data-panel="fb"] #cardComposer .block-text-body textarea,
.panel-section[data-panel="fb"] #cardComposer .block-text-body .block-textarea,
.panel-section[data-panel="fb"] #cardComposer .block-body textarea,
.panel-section[data-panel="fb"] #cardComposer .block-textarea,
#cardComposer .block-text-body textarea,
#cardComposer .block-text-body .block-textarea,
#cardComposer .block-body textarea,
#cardComposer .block-textarea {
  color: var(--ink-2, #94a3b8) !important;
  font-size: 11.5px !important;
  line-height: 1.45 !important;
}

#cardComposer .block-textarea::placeholder,
#cardComposer textarea::placeholder {
  color: var(--ink-2, #94a3b8) !important;
  opacity: 0.8 !important;
}

#fbCardRecipients #fbCardAdvanced {
  background: rgba(15, 23, 42, 0.6) !important;
  border: 1px solid rgba(147, 197, 253, 0.2) !important;
  border-radius: 10px !important;
  padding: 8px 10px !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  margin: 6px 0 8px 0 !important;
  width: 100% !important;
}

/* ==========================================================================
   v 13: ADVANCED TO BEHIND CARD 2 & COMPOSER FLUSH UP WITH FAINT TIP TEXT
   - #cardComposer textarea takes faint combined tip + placeholder text
   - Textarea and action buttons shifted flush to top
   - #fbCardAdvanced placed in #workbenchSide (behind Card 2)
   ========================================================================== */
#cardComposer .block-textarea {
  color: #94a3b8 !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
  height: 342px !important;
  min-height: 342px !important;
  max-height: 342px !important;
  padding: 10px 12px !important;
  box-sizing: border-box !important;
}

#cardComposer .block-textarea::placeholder {
  color: #94a3b8 !important;
  opacity: 0.7 !important;
}

#workbenchSide #fbCardAdvanced {
  width: 330px !important;
  min-width: 330px !important;
  max-width: 330px !important;
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  box-sizing: border-box !important;
  margin: 0 0 8px 0 !important;
  flex-shrink: 0 !important;
}

#workbenchSide {
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 8px !important;
}


/* ==========================================================================
   v 15: ADVANCED SETTINGS IN CARD 2 HEADER (HORIZONTALLY BESIDE / BEHIND TITLE)
   - #fbCardRecHeader flex container:
     Left: card-title + card-sub
     Right: #fbCardAdvanced placed horizontally beside/behind title (NO DROPPING DOWN)
   - No sub-card background/border: takes only elements (icon, label, inputs)
   - Perfect 483px bottom alignment across top 3 cards
   ========================================================================== */
#fbCardRecipients {
  height: 475px;
  min-height: 80px;
  max-height: none;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 10px 12px !important;
  overflow: hidden !important;
}

#fbCardRecHeader {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 8px !important;
  margin-bottom: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  flex-wrap: nowrap !important;
}

#fbCardRecipients #fbCardAdvanced {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  flex: 1 !important;
  min-width: 0 !important;
  align-items: flex-end !important;
  box-sizing: border-box !important;
}

#fbCardRecipients #fbCardAdvanced .fb-adv-inputs-row {
  display: flex !important;
  gap: 5px !important;
  width: 100% !important;
  justify-content: flex-end !important;
}

#fbCardRecipients #fbCardAdvanced input {
  height: 24px !important;
  min-height: 24px !important;
  font-size: 10.5px !important;
  box-sizing: border-box !important;
  background: rgba(15, 23, 42, 0.8) !important;
  border: 1px solid rgba(147, 197, 253, 0.25) !important;
  border-radius: 6px !important;
  color: #e2e8f0 !important;
  padding: 0 6px !important;
}

#fbCardRecipients #fbCardAdvanced input#pageId {
  flex: 1 1 75px !important;
  max-width: 110px !important;
  min-width: 60px !important;
}

#fbCardRecipients #fbCardAdvanced input#pageToken {
  flex: 1.4 1 95px !important;
  max-width: 160px !important;
  min-width: 75px !important;
}

#fbCardRecipients #recWrap {
  background: rgba(10, 15, 29, 0.72) !important;
  border: 1px solid rgba(147, 197, 253, 0.22) !important;
  border-radius: 10px !important;
  padding: 6px !important;
  box-sizing: border-box !important;
  min-height: 210px !important;
  height: auto !important;
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
}

#fbCardRecipients #recList {
  width: 100% !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 4px !important;
  box-sizing: border-box !important;
}

#fbCardRecipients .empty-reclist-placeholder {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100% !important;
  min-height: 170px !important;
  color: #64748b !important;
  gap: 6px !important;
  user-select: none !important;
  margin: auto !important;
}

/* ==========================================================================
   v 23: TOP ROW 4 CARDS UNIFIED FULL-WIDTH ENGINE
   - Card 1 (#lineCardComposer): flex: 1.15 1 0, equal to Card 2 (20% reduction preserved)
   - Card 2 (#cardComposer): flex: 1.15 1 0, equal to Card 1
   - Card 3 (#fbCardSetup): flex: 0 0 310px (width 310px)
   - Card 4 (#fbCardRecipients): flex: 1 1 0 (stretches into empty space on right, 100% visible, zero cut-off, no scrollbar!)
   ========================================================================== */

#fbSectionWrap,
.fb-section-wrap {
  width: 100% !important;
  margin-top: 0px !important;
  margin-bottom: 0px !important;
  box-sizing: border-box !important;
}

.fb-top-grid,
#fbTopGrid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

#dbStudioCloneGrid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#fbTopGrid > .card,
#fbTopGrid > .workbench-side,
#dbStudioCloneGrid > .card,
#dbStudioCloneGrid > .workbench-side {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  position: relative !important;
}

/* Chrome, Safari, Edge: Hide scrollbar bar completely */
.fb-top-grid::-webkit-scrollbar,
#fbTopGrid::-webkit-scrollbar,
.workbench-main::-webkit-scrollbar,
#workbenchMain::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Card 1: รูปแรก - LINE OA Composer (#lineCardComposer) */
#lineCardComposer,
.fb-top-grid > #lineCardComposer {
  flex: none !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 475px;
  min-height: 80px;
  max-height: none;
  margin: 0 !important;
  padding: 12px 10px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  overflow: hidden !important;
}

/* Card 2: รูปที่ 2 - Facebook Composer (#cardComposer) */
#cardComposer,
.fb-top-grid > #cardComposer {
  flex: none !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 475px;
  min-height: 80px;
  max-height: none;
  margin: 0 !important;
  padding: 12px 10px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  overflow: hidden !important;
}

/* Card 3: 1. เลือกเพจ Facebook ที่จะส่ง (#fbCardSetup) */
#fbCardSetup,
.fb-top-grid > #fbCardSetup {
  flex: none !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 475px;
  min-height: 80px;
  max-height: none;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 8px !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
}

/* Card 4: 2. ดึงรายชื่อลูกค้าใน Inbox (#fbCardRecipients) */
#fbCardRecipients,
.fb-top-grid > #fbCardRecipients {
  flex: none !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: 475px;
  min-height: 80px;
  max-height: none;
  margin: 0 !important;
  padding: 10px 10px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(8px) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  overflow: hidden !important;
}

/* Card 1 HUD Polish (3 Capsules, 34px height matching Card 3) */
#lineCardComposer .hud-card {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  border-radius: 9px !important;
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
  padding: 2px 5px !important;
}
#lineCardComposer .hud-ic {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  border-radius: 6px !important;
  background: #0c2b45 !important;
  border: 1.5px solid #0284c7 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  flex-shrink: 0 !important;
}
#lineCardComposer #linePhNameHud {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
#lineCardComposer .hud-label {
  font-size: 8.5px !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
  white-space: nowrap !important;
  margin: 0 !important;
}
#lineCardComposer .hud-value {
  font-size: 11px !important;
  font-weight: 700 !important;
  color: #38bdf8 !important;
  white-space: nowrap !important;
}

/* Token Area Scrollbar fix */
#lineToken {
  overflow-y: hidden !important;
  resize: none !important;
}

/* Card Composer bottom buttons polish for 460px */
#cardComposer .block-add {
  display: flex !important;
  gap: 4px !important;
  width: 100% !important;
}
#cardComposer .block-add .btn {
  flex: 1 1 0 !important;
  padding: 0 4px !important;
  font-size: 10.5px !important;
  white-space: nowrap !important;
  justify-content: center !important;
}


/* v 24: Compact Fetch Buttons (▶ ดึงต่อ, 🔄 ดึงใหม่, ⏹ หยุดดึง) ย่อเล็กลงเท่าปุ่มอื่นๆ */
#fbCardRecipients .fetch-action-btns {
  display: flex !important;
  gap: 5px !important;
  align-items: center !important;
}

#fbCardRecipients #btnFetch,
#fbCardRecipients #btnFetchNew,
#fbCardRecipients #btnStopFetch {
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 7px !important;
  white-space: nowrap !important;
}

#fbCardRecipients #btnStopFetch {
  background: rgba(239, 68, 68, 0.22) !important;
  border: 1px solid rgba(239, 68, 68, 0.55) !important;
  color: #fca5a5 !important;
}

#fbCardRecipients #btnStopFetch:hover {
  background: rgba(239, 68, 68, 0.35) !important;
  border-color: #ef4444 !important;
  color: #ffffff !important;
}

/* ==========================================================================
   v 25: Card 3 (#fbCardSetup) Sub-Box 2 (#fbCard4) Perfect Containment & Polish
   - Fixes #btnSend overflowing out of the bottom border
   - 100% width match with #fbCardSetup (no horizontal protrusion)
   - Perfectly balanced flex layout with clean internal padding
   ========================================================================== */
#fbCard4,
.workbench-side > #fbCard4,
.fb-top-grid #fbCard4,
#fbSectionWrap #fbCard4 {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: 1 1 auto !important;
  padding: 8px 10px !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#fbCard4 #sendControls,
.workbench-side > .card:first-child #sendControls,
.fb-top-grid #fbCard4 #sendControls,
#fbSectionWrap #fbCard4 #sendControls {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#fbCard4 .speed-row,
.workbench-side > .card:first-child .speed-row {
  margin: 0 !important;
}

#fbCard4 .ctrl-label,
.workbench-side > .card:first-child .ctrl-label {
  font-size: 11.5px !important;
  margin-bottom: 5px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  display: block !important;
}

#fbCard4 #speedSelect,
.workbench-side > .card:first-child #speedSelect {
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 2px 8px !important;
  border-radius: 7px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

#fbCard4 #speedHint,
.workbench-side > .card:first-child #speedHint {
  font-size: 10px !important;
  margin-top: 5px !important;
  margin-bottom: 0 !important;
  line-height: 1.35 !important;
  color: #94a3b8 !important;
}

#fbCard4 .launch-options-2col,
.workbench-side > .card:first-child .launch-options-2col,
.launch-options-2col {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  margin: 2px 0 !important;
}

#fbCard4 .check-row,
.workbench-side > .card:first-child .check-row,
.check-row {
  font-size: 10.5px !important;
  font-weight: 500 !important;
  gap: 6px !important;
  line-height: 1.25 !important;
  margin: 0 !important;
}

#fbCard4 .check-row input[type="checkbox"],
.workbench-side > .card:first-child .check-row input[type="checkbox"] {
  width: 13px !important;
  height: 13px !important;
  margin: 0 !important;
}

#fbCard4 .clear-sent-row,
.workbench-side > .card:first-child .clear-sent-row {
  margin: 2px 0 !important;
  line-height: 1.2 !important;
}

#fbCard4 .clear-sent-row a,
#fbCard4 #clearSent,
.workbench-side > .card:first-child #clearSent {
  font-size: 10.5px !important;
  line-height: 1.2 !important;
}

#fbCard4 #btnSend,
.workbench-side > .card:first-child #btnSend,
.fb-top-grid #fbCard4 #btnSend,
#fbSectionWrap #fbCard4 #btnSend {
  width: 100% !important;
  height: 34px !important;
  min-height: 34px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
}

/* Recipient Item Checkbox & Add All Button Styling */
#btnAddAllRec {
  background: linear-gradient(135deg, rgba(0,132,255,0.22), rgba(2,132,199,0.28)) !important;
  border: 1px solid rgba(56,189,248,0.5) !important;
  color: #38bdf8 !important;
  border-radius: 6px !important;
  font-weight: 700 !important;
  transition: all 0.2s ease !important;
}
#btnAddAllRec:hover {
  background: linear-gradient(135deg, rgba(0,132,255,0.38), rgba(2,132,199,0.48)) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(56,189,248,0.3) !important;
}
#recList .rec-name-card {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  padding: 5px 8px !important;
  background: rgba(14,24,40,0.7) !important;
  border: 1px solid rgba(147,197,253,0.25) !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
}
#recList .rec-name-card:hover {
  background: rgba(30,58,138,0.35) !important;
  border-color: rgba(56,189,248,0.45) !important;
}
#recList .rec-name-card.excluded {
  opacity: 0.42 !important;
  background: rgba(10,16,30,0.4) !important;
  border-color: rgba(255,255,255,0.08) !important;
}
#recList .rec-idx {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #38bdf8 !important;
  background: rgba(56,189,248,0.15) !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  font-variant-numeric: tabular-nums !important;
  flex-shrink: 0 !important;
}
#recList .rec-name-text {
  font-size: 11.5px !important;
  font-weight: 600 !important;
  color: #f1f5f9 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  margin: 0 2px !important;
}
#recList .rec-chk {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  cursor: pointer !important;
  accent-color: #0084ff !important;
  margin: 0 2px 0 0 !important;
  flex-shrink: 0 !important;
}
#recList .rec-status-dot {
  width: 6px !important;
  height: 6px !important;
  min-width: 6px !important;
  border-radius: 50% !important;
  background: #10b981 !important;
  box-shadow: 0 0 6px #10b981 !important;
  flex-shrink: 0 !important;
}
#recList .rec-actions-grp {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  flex-shrink: 0 !important;
}
#recList .btn-rec-junk {
  background: transparent !important;
  border: none !important;
  color: #ef4444 !important;
  font-size: 11px !important;
  cursor: pointer !important;
  padding: 1px 3px !important;
  border-radius: 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
  opacity: 0.7 !important;
}
#recList .btn-rec-junk:hover {
  opacity: 1 !important;
  background: rgba(239, 68, 68, 0.2) !important;
  transform: scale(1.15) !important;
}
#recList .rec-name-card.excluded .rec-status-dot {
  background: #64748b !important;
  box-shadow: none !important;
}

/* ========================================================================== */
/* 🟢 LINE OA RECIPIENTS & AUDIENCE LIST STYLES                              */
/* ========================================================================== */
#lineRecList .rec-name-card {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 6px !important;
  padding: 5px 8px !important;
  background: rgba(14,24,40,0.72) !important;
  border: 1px solid rgba(6,199,85,0.28) !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
}
#lineRecList .rec-name-card:hover {
  background: rgba(6,78,59,0.35) !important;
  border-color: rgba(52,211,153,0.5) !important;
}
#lineRecList .rec-name-card.excluded {
  opacity: 0.42 !important;
  background: rgba(10,16,30,0.4) !important;
  border-color: rgba(255,255,255,0.08) !important;
}
#lineRecList .rec-idx {
  font-size: 10px !important;
  font-weight: 700 !important;
  color: #34d399 !important;
  background: rgba(6,199,85,0.18) !important;
  padding: 1px 5px !important;
  border-radius: 4px !important;
  font-variant-numeric: tabular-nums !important;
  flex-shrink: 0 !important;
}
#lineRecList .rec-line-chk {
  width: 15px !important;
  height: 15px !important;
  min-width: 15px !important;
  cursor: pointer !important;
  accent-color: #06c755 !important;
  margin: 0 !important;
  flex-shrink: 0 !important;
}
#lineRecList .rec-status-dot {
  width: 6px !important;
  height: 6px !important;
  min-width: 6px !important;
  border-radius: 50% !important;
  background: #10b981 !important;
  box-shadow: 0 0 6px #10b981 !important;
  flex-shrink: 0 !important;
}
#lineRecList .rec-name-card.excluded .rec-status-dot {
  background: #64748b !important;
  box-shadow: none !important;
}
#lineRecList .btn-line-rec-junk {
  background: transparent !important;
  border: none !important;
  color: #ef4444 !important;
  font-size: 11px !important;
  cursor: pointer !important;
  padding: 1px 3px !important;
  border-radius: 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
  opacity: 0.75 !important;
}
#lineRecList .btn-line-rec-junk:hover {
  opacity: 1 !important;
  background: rgba(239, 68, 68, 0.2) !important;
  transform: scale(1.15) !important;
}
#btnLineAddAllRec:hover {
  background: linear-gradient(135deg, rgba(6,199,85,0.38), rgba(5,150,105,0.48)) !important;
  border-color: #34d399 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(52,211,153,0.3) !important;
}




/* Green status pill styling for Facebook connection status */
#fbCardPageSelect #connStatus,
#fbCardPageSelect #connStatus.ok,
#fbCardPageSelect #connStatus.off,
#fbCardPageSelect #connStatus.ready {
  background: rgba(16, 185, 129, 0.16) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.38) !important;
  border-radius: 6px !important;
  height: 22px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  padding: 1px 8px !important;
  font-size: 10px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
}
#fbCardPageSelect #connStatus .sdot,
#fbCardPageSelect #connStatus.ok .sdot,
#fbCardPageSelect #connStatus.off .sdot {
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: #10b981 !important;
  box-shadow: 0 0 6px #10b981 !important;
  flex-shrink: 0 !important;
  display: inline-block !important;
}
#fbCardPageSelect #connStatus .stext,
#fbCardPageSelect #connStatus.ok .stext,
#fbCardPageSelect #connStatus.off .stext {
  font-size: 10px !important;
  color: #34d399 !important;
  font-weight: 600 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#workbenchGrid, .workbench-grid { margin-top: -11px !important; padding-top: 0px !important; }


/* ===== SIDEBAR TOP ALIGNMENT & DEDICATED VISIBLE SCROLLBAR ===== */
.sidebar {
  justify-content: flex-start !important;
  gap: 8px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(56, 189, 248, 0.6) rgba(15, 23, 42, 0.8) !important;
}
.sidebar-footer {
  margin-top: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
.sidebar::-webkit-scrollbar {
  width: 7px !important;
  display: block !important;
}
.sidebar::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.8) !important;
  border-radius: 4px !important;
}
.sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #38bdf8, #2563eb) !important;
  border-radius: 4px !important;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5) !important;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: #60a5fa !important;
}


/* ==========================================================================
   v29: COMPOSER HEADER HUDS (FB & LINE 100% IDENTICAL SYMMETRY & EQUAL SIZE)
   ========================================================================== */
.fb-composer-hud-strip,
.line-composer-hud-strip {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-bottom: 2px !important;
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  flex-shrink: 0 !important;
}

.fb-composer-hud-strip .hud-card,
.line-composer-hud-strip .hud-card {
  height: 34px !important;
  min-height: 34px !important;
  max-height: 34px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  border-radius: 9px !important;
  background: rgba(14, 24, 40, 0.62) !important;
  border: 1px solid rgba(147, 197, 253, 0.28) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
  margin: 0 !important;
}

.fb-composer-hud-strip .hud-card:first-child,
.line-composer-hud-strip .hud-card:first-child {
  flex: 1 1 auto !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
  padding: 2px 10px !important;
  gap: 6px !important;
  justify-content: flex-start !important;
}

.fb-composer-hud-strip .hud-card:not(:first-child),
.line-composer-hud-strip .hud-card:not(:first-child) {
  flex: 0 0 auto !important;
  width: 108px !important;
  min-width: 108px !important;
  max-width: 108px !important;
  padding: 2px 8px !important;
  gap: 5px !important;
  justify-content: center !important;
}

.fb-composer-hud-strip .hud-ic,
.line-composer-hud-strip .hud-ic {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  border-radius: 50% !important;
  background: #0c2b45 !important;
  border: 1.5px solid #0284c7 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  flex-shrink: 0 !important;
}

.fb-composer-hud-strip .hud-content,
.line-composer-hud-strip .hud-content {
  min-width: 0 !important;
  overflow: hidden !important;
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  text-align: left !important;
}

.fb-composer-hud-strip #hudPageName,
.line-composer-hud-strip #linePhNameHud {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: block !important;
  text-align: left !important;
}

.fb-composer-hud-strip .hud-label,
.line-composer-hud-strip .hud-label {
  font-size: 10px !important;
  font-weight: 600 !important;
  color: #94a3b8 !important;
  white-space: nowrap !important;
  margin: 0 !important;
  line-height: 1 !important;
}

.fb-composer-hud-strip .hud-value.hud-accent,
.line-composer-hud-strip .hud-value.hud-accent {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  white-space: nowrap !important;
  line-height: 1 !important;
}

/* 10 Small Images Gallery Grid (5 columns x 2 rows) */
#dbGalleryGrid, #potoGalleryGrid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  margin-top: 2px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}


.fb-composer-hud-strip .hud-content,
.line-composer-hud-strip .hud-content,
.fb-composer-hud-strip .hud-card:first-child .hud-content,
.line-composer-hud-strip .hud-card:first-child .hud-content {
  min-width: 0 !important;
  overflow: hidden !important;
  flex: 1 1 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
}

/* ==========================================================================
   STUDIO LAYOUT: RESTORE ALL MENUS IN COL 1 & FULL VERTICAL SIMULATOR STRETCH
   - Col 1: Return all career buttons, prompt chips, font chips, color palette,
            aspect ratios. Hide ONLY the header text titles per user command.
   - Simulator (Col 3 & Dashboard): Expand chat feed & image box down 100%,
     pinning the bottom messenger strip & action button to the bottom border,
     completely eliminating all empty black space.
   ========================================================================== */

/* Col 1 Container, Top Wrap & Cards - Zero Void Autofit */
#potoColLeft {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
}

#potoColLeftTopWrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

#potoCareerPresetsCard,
#potoTemplatePresetsCard,
#potoCardFontStyle,
#potoCardAspectRatio {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Hide ONLY legacy header text/labels, KEEP all menu buttons & chips fully visible */
#potoCareerPresetsCard > div:first-child:not(#potoCareerChipList):not(.card-drag-handle),
#potoTemplatePresetsCard > div:first-child:not(#potoPromptTpls):not(.card-drag-handle),
#potoCardFontStyle > label:first-of-type,
#potoCardAspectRatio > label:first-of-type {
  display: none !important;
}

#potoColLeftBottomCard {
  flex: 0 0 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
  height: auto !important;
  overflow: visible !important;
}

#potoColLeftBottomCard .textarea-wrap {
  height: 60px !important;
  min-height: 60px !important;
  max-height: 60px !important;
  flex: 0 0 60px !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

#potoColLeftBottomCard #potoPromptInput {
  flex: 1 1 auto !important;
  min-height: 28px !important;
  height: 28px !important;
  max-height: 28px !important;
  resize: none !important;
  box-sizing: border-box !important;
}

#potoFloatingGenBar {
  margin-top: auto !important;
  flex-shrink: 0 !important;
  height: 38px !important;
  min-height: 38px !important;
}

#potoCareerPresetsCard {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  box-shadow: none !important;
}

/* Hide ONLY the header text row, KEEP all menu buttons & chips fully visible */
#potoCareerPresetsCard > div:first-child:not(#potoCareerChipList):not(.card-drag-handle) {
  display: none !important;
}

#potoCardFontStyle {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  box-shadow: none !important;
}

/* Hide ONLY the header label text, KEEP all font chips & palettes fully visible */
#potoCardFontStyle > label:first-of-type {
  display: none !important;
}

#potoColLeftBottomCard {
  flex: 1 1 auto !important;
  min-height: 502px !important;
  max-height: 502px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  gap: 6px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
  height: 502px !important;
}

#potoColLeftBottomCard .textarea-wrap {
  flex: 1 1 auto !important;
  min-height: 90px !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

#potoColLeftBottomCard #potoPromptInput {
  flex: 1 1 auto !important;
  min-height: 55px !important;
  height: 100% !important;
  resize: none !important;
  box-sizing: border-box !important;
}

#potoFloatingGenBar {
  margin-top: auto !important;
  flex-shrink: 0 !important;
  height: 38px !important;
  min-height: 38px !important;
}

/* 4 AI Studio Cards: Showcase (450px) and Bottom Row Cards (480px) */
#potoCardShowcase {
  height: 480px !important;
  min-height: 480px !important;
  max-height: 480px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#potoUpscaleDockedCard,
#potoCardGallery {
  height: 420px !important;
  min-height: 420px !important;
  max-height: 420px !important;
  flex: 0 0 420px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#potoEmptyOriginalSlotCard {
  height: 380px !important;
  min-height: 380px !important;
  max-height: 380px !important;
  flex: 0 0 380px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  margin-top: auto !important;
}

#potoDockedChatCard {
  height: 520px !important;
  min-height: 520px !important;
  max-height: 520px !important;
  flex: 0 0 520px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* ==========================================================================
   SIMULATOR: TRUE 100% FULL VERTICAL STRETCH ("ยืดลงไปให้สุด")
   Expands chat bubbles and image container so button sits at very bottom edge
   ========================================================================== */
#dbEmptyOriginalSlotCard,
#potoEmptyOriginalSlotCard {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  height: 380px !important;
  min-height: 380px !important;
  max-height: 380px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  margin-top: auto !important;
}

#dbPostMockupWrap,
#potoPostMockupWrap {
  flex: 1 1 auto !important;
  height: calc(100% - 46px) !important;
  min-height: 0 !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#dbFbMockupView,
#dbLineMockupView,
#potoFbMockupView,
#potoLineMockupView {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#dbFbChatStream,
#dbLineChatStream,
#potoFbChatStream,
#potoLineChatStream {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

#dbFbMsgColumn,
#potoFbMsgColumn {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 0 !important;
}

#dbSimImgBox,
#dbLineImgWrap,
#potoSimImgBox {
  flex: 1 1 auto !important;
  min-height: 160px !important;
  max-height: none !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  width: 100% !important;
  overflow: hidden !important;
}

#dbSimImgBox > div:not([style*="display: none"]):not([style*="display:none"]):not(.is-hidden):not(.hidden),
#dbLineImgWrap > div:not([style*="display: none"]):not([style*="display:none"]):not(.is-hidden):not(.hidden),
#potoSimImgBox > div:not([style*="display: none"]):not([style*="display:none"]):not(.is-hidden):not(.hidden) {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 160px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
}

#potoSimImgEmpty.is-hidden,
#potoSimImgEmpty.hidden,
#potoSimImgEmpty[style*="display: none"],
#potoSimImgEmpty[style*="display:none"],
#dbSimImgEmpty.is-hidden,
#dbSimImgEmpty.hidden,
#dbSimImgEmpty[style*="display: none"],
#dbSimImgEmpty[style*="display:none"],
#dbLineImgEmpty.is-hidden,
#dbLineImgEmpty.hidden,
#dbLineImgEmpty[style*="display: none"],
#dbLineImgEmpty[style*="display:none"] {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: none !important;
}

#potoSimImg {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

#potoSimImg.hidden,
#potoSimImg.is-hidden,
#potoSimImg[style*="display: none"],
#potoSimImg[style*="display:none"] {
  display: none !important;
}

#dbEmptyOriginalSlotCard .messenger-bottom-bar,
#dbEmptyOriginalSlotCard > div:first-child > div:first-child > div:last-child,
#potoSimActionBar {
  margin-top: auto !important;
  flex-shrink: 0 !important;
}

#dbBtnSimBroadcastNow,
#potoBtnSimBroadcastNow {
  margin-top: auto !important;
  flex-shrink: 0 !important;
  width: 100% !important;
  height: 38px !important;
  min-height: 38px !important;
  box-sizing: border-box !important;
}

/* Safety Net: Hide any rogue ripped/custom cards that duplicate career presets */
.custom-created-card:has(#potoCareerChipList),
[id^="rippedCard_"]:has(#potoCareerChipList),
.custom-created-card:has(#potoPromptTpls),
[id^="rippedCard_"]:has(#potoPromptTpls) {
  display: none !important;
}

#potoCareerPresetsCard {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}

#potoCardFontStyle {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
}




/* ==========================================================================
   AI STUDIO THEME: RICH CYBER BLUE & GLASSMORPHISM (RESTORE ORIGINAL PALETTE)
   Replaces dull browser-default gray (107, 107, 107) with vibrant gradients & glass
   ========================================================================== */

/* Career Buttons (6 Grid) */
.poto-career-btn {
  height: 27px !important;
  min-height: 27px !important;
  box-sizing: border-box !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  background: rgba(15, 23, 42, 0.82) !important;
  border: none !important;
  color: #cbd5e1 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 5px !important;
  white-space: nowrap !important;
  box-shadow: none !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
}

.poto-career-btn:hover {
  background: rgba(30, 41, 59, 0.95) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.poto-career-btn.active {
  background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* Template Chips & Font Style Chips & Aspect Ratio Chips */
.template-chip {
  height: 25px !important;
  min-height: 25px !important;
  box-sizing: border-box !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
  background: rgba(15, 23, 42, 0.75) !important;
  border: none !important;
  color: #94a3b8 !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  user-select: none !important;
  box-shadow: none !important;
}

.template-chip:hover {
  background: rgba(30, 41, 59, 0.92) !important;
  border: none !important;
  color: #f1f5f9 !important;
  box-shadow: none !important;
}

.template-chip.active {
  background: linear-gradient(135deg, #1e40af, #2563eb) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* Studio Tone Input */
#potoToneInput {
  background: rgba(10, 16, 30, 0.85) !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  color: #f1f5f9 !important;
  border-radius: 6px !important;
  padding: 3px 8px !important;
  font-size: 10.5px !important;
  box-sizing: border-box !important;
  height: 24px !important;
}

/* Card 0 & Card 1 Premium Background */
#potoCareerPresetsCard,
#potoCardFontStyle {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}



/* ==========================================================================
   AI STUDIO: EQUAL 2-COLUMN BALANCED BUTTON GRIDS ("เรียงแบบนี้ทำให้เท่าๆกัน")
   All 4 button groups (Career, Templates, Fonts, Aspect Ratios) strictly 50%/50% 
   matching dimensions, equal height 28px, centered text, equal gaps
   ========================================================================== */

#potoCareerChipList,
#potoPromptTpls,
#potoFontStyleList,
#potoAspectRatioList {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 5px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* ==========================================================================
   v17: Dropdown Select Styling for 4 Studio Cards (#17, #17-B, #18, #18-B)
   ========================================================================== */
.poto-dropdown-select {
  width: 100% !important;
  height: 33px !important;
  min-height: 33px !important;
  max-height: 33px !important;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(10, 16, 30, 0.98)) !important;
  border: 1px solid rgba(59, 130, 246, 0.38) !important;
  border-radius: 8px !important;
  color: #f1f5f9 !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  padding: 0 28px 0 10px !important;
  outline: none !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
  transition: all 0.18s ease !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 12px 12px !important;
}

.poto-dropdown-select:hover {
  border-color: #60a5fa !important;
  background: linear-gradient(180deg, rgba(20, 30, 55, 0.96), rgba(13, 20, 38, 0.99)) !important;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35) !important;
}

.poto-dropdown-select:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.35), 0 3px 12px rgba(37, 99, 235, 0.4) !important;
}

.poto-dropdown-select option {
  background: #0b1120 !important;
  color: #f1f5f9 !important;
  padding: 8px 10px !important;
  font-size: 12px !important;
}

/* Identical sizing and layout for both .poto-career-btn and .template-chip (ขยายช่องเล็กและข้อความให้เต็ม) */
.poto-career-btn,
.template-chip {
  width: 100% !important;
  height: 31px !important;
  min-height: 31px !important;
  max-height: 31px !important;
  padding: 0 6px !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  gap: 5px !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  letter-spacing: -0.2px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: all 0.15s ease !important;
  
  /* Inactive: Deep Navy Glass */
  background: rgba(15, 23, 42, 0.82) !important;
  border: none !important;
  color: #cbd5e1 !important;
  box-shadow: none !important;
}

.poto-career-btn:hover,
.template-chip:hover {
  background: rgba(30, 41, 59, 0.95) !important;
  border: none !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

.poto-career-btn.active,
.template-chip.active {
  background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
  border: none !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* Equal Cards padding & styling - Clean Seamless inside Unified Card */
#potoCareerPresetsCard,
#potoTemplatePresetsCard,
#potoCardFontStyle,
#potoCardAspectRatio {
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}



/* Color Palette (#potoColorPalette) and Tone Input */
#potoColorPalette {
  display: flex !important;
}
#potoToneInput {
  display: inline-block !important;
}

/* Studio Column 1: Flexible height auto-fit without empty space */
#potoColLeft {
  min-height: 0 !important;
  height: fit-content !important;
  max-height: none !important;
  align-self: flex-start !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

#potoColLeftTopWrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

#potoColLeftBottomCard {
  min-height: 430px !important;
  height: auto !important;
  max-height: none !important;
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  overflow: visible !important;
  box-sizing: border-box !important;
  margin-top: 0 !important;
}

#potoFloatingGenBar {
  flex-shrink: 0 !important;
  min-height: 38px !important;
  height: 38px !important;
  margin-top: auto !important;
}

#potoColLeftBottomCard .textarea-wrap {
  height: auto !important;
  min-height: 50px !important;
  flex: 1 1 auto !important;
  box-sizing: border-box !important;
}

/* Card 19 Dual Panel: ชิดกันทุกช่อง ไร้รอยโหว่ */
#potoColLeftBottomCard #potoCard19DualPanel {
  flex: none !important;
  min-height: 0 !important;
  height: auto !important;
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 6px !important;
  align-items: start !important;
  box-sizing: border-box !important;
}

#potoSidebarAttachCard,
#potoSidebarPersonaCard {
  position: static !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  height: auto !important;
  min-height: 0 !important;
  justify-content: flex-start !important;
  gap: 4px !important;
}

/* ป้องกัน drag handle ในโหมดจัดวางไม่ให้โดนดึงยืดเด็ดขาด */
.card-drag-handle {
  height: 23px !important;
  min-height: 23px !important;
  max-height: 23px !important;
  box-sizing: border-box !important;
}

/* Studio Standard Cards: #20 Comparison (450px), #20-B Gallery & #21 Upscale (480px) */
#potoCardShowcase {
  height: 480px !important;
  min-height: 480px !important;
  max-height: 480px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.poto-compare-slot-btn:hover {
  background: rgba(59, 130, 246, 0.15) !important;
  border-color: rgba(147, 197, 253, 0.7) !important;
  color: #fff !important;
}

#potoCardGallery,
#potoUpscaleDockedCard {
  height: 420px !important;
  min-height: 420px !important;
  max-height: 420px !important;
  flex: 0 0 420px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#potoEmptyOriginalSlotCard {
  height: 380px !important;
  min-height: 380px !important;
  max-height: 380px !important;
  flex: 0 0 380px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  margin-top: auto !important;
}

/* ==========================================================================
   VERSION v21: COLLAPSIBLE DROPDOWN BOX SELECTORS & RESPONSIVE CHAT / PROMPT
   ========================================================================== */
/* 1. 4 Studio Dropdown + Box Selector Cards (#17, #17-B, #18, #18-B) - Seamless Inner Rows */
.poto-dropdown-box-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  flex-shrink: 0 !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
}

.poto-dropdown-trigger {
  width: 100% !important;
  height: 33px !important;
  min-height: 33px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 10px !important;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(10, 16, 30, 0.98)) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  color: #f1f5f9 !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition: all 0.18s ease !important;
  box-shadow: none !important;
}

.poto-dropdown-trigger:hover {
  border-color: rgba(255, 255, 255, 0.15) !important;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98)) !important;
  box-shadow: none !important;
}

.poto-dropdown-trigger.poto-trigger-open {
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
}

.poto-dropdown-drawer {
  width: 100% !important;
  box-sizing: border-box !important;
  margin-top: 4px !important;
  animation: potoDrawerFadeIn 0.18s ease-out;
}

@keyframes potoDrawerFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.poto-dropdown-drawer .poto-career-btn,
.poto-dropdown-drawer .template-chip {
  min-height: 28px !important;
  font-size: 10.5px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* 2. Card 19 Prompt Textarea: ยืดเต็มพื้นที่การ์ดเสมอ และหดตามการ์ด */
#potoColLeftBottomCard {
  min-height: 300px !important;
}

#potoColLeftBottomCard #potoPromptWrap {
  flex: 1 1 0 !important;
  height: 100% !important;
  min-height: 55px !important;
  max-height: none !important;
  background: rgba(6, 9, 16, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  display: flex !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

#potoColLeftBottomCard #potoPromptInput {
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 36px !important;
  max-height: none !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #fff !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
  resize: none !important;
  box-sizing: border-box !important;
  padding: 2px 0 !important;
}

/* 3. Card 22 Docked Live Chat Card: Flexible Stretch & Shrink with feed expanding */
#potoDockedChatCard {
  height: 480px !important;
  min-height: 480px !important;
  max-height: 480px !important;
  flex: 0 0 480px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#potoDockedChatFeed {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  background: rgba(6, 9, 16, 0.92) !important;
  border: 1px solid rgba(59, 130, 246, 0.28) !important;
  border-radius: 8px !important;
  overflow-y: auto !important;
}

#potoChatInput {
  background: rgba(6, 9, 16, 0.92) !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

/* ==========================================================================
   VERSION v22: DUAL PANEL DROPDOWNS & COLUMN 2 SINGLE BUTTON SWITCHER
   ========================================================================== */
#potoCardGallery[style*="display: none"],
#potoUpscaleDockedCard[style*="display: none"] {
  display: none !important;
}

#potoBtnToggleCol2:hover,
#potoBtnToggleCol2Back:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.5) !important;
}

#potoSidebarAttachCard,
#potoSidebarPersonaCard {
  transition: all 0.2s ease !important;
}

/* ==========================================================================
   VERSION v23: ALIGNED COLUMN 2 SINGLE BUTTON SWITCHER & FULL-BOX CARD 21
   - Position and dimensions of #potoBtnToggleCol2 and #potoBtnToggleCol2Back
     are locked 1:1 so toggling keeps the button in the exact same coordinates.
   - #potoUpscaleDockedCard expands to fill 100% of the 450px card seamlessly.
   ========================================================================== */
#potoBtnToggleCol2,
#potoBtnToggleCol2Back {
  width: 172px !important;
  height: 22px !important;
  min-width: 172px !important;
  max-width: 172px !important;
  min-height: 22px !important;
  max-height: 22px !important;
  box-sizing: border-box !important;
}

/* ==========================================================================
   VERSION v24: COLUMN 2 DUAL TAB SWITCHER (ภาพ / ขยาย)
   - "เอามันมาเรียงต่อกัน และ ไม่ชิดกับใคร ใน แท๊บ เปลี่ยนประโยค เป็น ภาพ กับ ขยาย อย่างล่ะคำ"
   - Standalone segmented tab group placed in the exact center of Col 2 headers
   - Identical coordinates and dimensions across Card #20-B and Card #21
   ========================================================================== */
.poto-col2-tab-group {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  display: inline-flex !important;
  align-items: center !important;
  background: #0f172a !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  border-radius: 6px !important;
  padding: 2px !important;
  gap: 4px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  z-index: 2 !important;
}

.poto-col2-tab-btn {
  height: 20px !important;
  min-width: 84px !important;
  padding: 0 18px !important;
  border-radius: 4px !important;
  border: 1px solid transparent !important;
  background: #0f172a !important;
  color: #94a3b8 !important;
  font-size: 11.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  white-space: nowrap !important;
  user-select: none !important;
  box-sizing: border-box !important;
}

.poto-col2-tab-btn:hover {
  color: #f1f5f9 !important;
  background: rgba(255, 255, 255, 0.08) !important;
}

.poto-col2-tab-btn.active[data-col2-view="gallery"] {
  background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
  border: 1px solid rgba(147, 197, 253, 0.5) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.4) !important;
}

.poto-col2-tab-btn.active[data-col2-view="upscale"] {
  background: linear-gradient(135deg, #7c3aed, #2563eb) !important;
  border: 1px solid rgba(196, 181, 253, 0.5) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 4px rgba(124, 58, 237, 0.35) !important;
}

.poto-col2-tab-btn.active[data-col2-view="fb"] {
  background: linear-gradient(135deg, #1877f2, #2563eb) !important;
  border: 1px solid rgba(147, 197, 253, 0.5) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 5px rgba(24, 119, 242, 0.4) !important;
}

.poto-col2-tab-btn.active[data-col2-view="line"] {
  background: linear-gradient(135deg, #059669, #06c755) !important;
  border: 1px solid rgba(167, 243, 208, 0.5) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 5px rgba(6, 199, 85, 0.4) !important;
}

/* ลบปุ่ม [✂️ แยก] และปุ่มซูม [🎯 พอดีจอ (100%)] [100%] บนแถบเปรียบเทียบ ตามคำสั่งผู้ใช้ ("เอาออกให้หมด") */
.btn-snip-original,
.btn-snip-4k,
.btn-snip-compare,
#potoCompareToolbar .btn-snip-compare,
.btn-snip-subpart.btn-snip-compare,
#potoCardGallery .btn-snip-gallery,
#potoCompareToolbar .btn-studio-zoom-fit,
#potoCompareToolbar .btn-studio-zoom-100 {
  display: none !important;
  pointer-events: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* v28 rules removed in v30 for Unified 3-Card Platform Switcher */





/* ==========================================================================
   v29: Unified Facebook & LINE OA Composer (Card 3+4) & Recipients (Card 1+2)
   Centered Tab Switcher & Clean Platform Transitions
   ========================================================================== */
.platform-tab-header {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-bottom: 4px !important;
  flex-shrink: 0 !important;
}

.platform-tab-group {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(15, 23, 42, 0.88) !important;
  border: 1px solid rgba(59, 130, 246, 0.32) !important;
  border-radius: 7px !important;
  padding: 2px !important;
  gap: 3px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
  box-sizing: border-box !important;
}

.platform-tab-btn {
  height: 22px !important;
  min-width: 88px !important;
  padding: 0 12px !important;
  border-radius: 5px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #94a3b8 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
}

.platform-tab-btn:hover {
  color: #f8fafc !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.platform-tab-btn.active[data-platform="fb"] {
  border: 1px solid rgba(147, 197, 253, 0.5) !important;
  background: linear-gradient(135deg, #1877f2, #2563eb) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 5px rgba(24, 119, 242, 0.4) !important;
}

.platform-tab-btn.active[data-platform="line"] {
  border: 1px solid rgba(167, 243, 208, 0.5) !important;
  background: linear-gradient(135deg, #059669, #06c755) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 5px rgba(6, 199, 85, 0.4) !important;
}

.platform-tab-btn:not(.active) {
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
  font-weight: 600 !important;
}

.unified-composer-panel,
.unified-recipients-panel {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 0 !important;
  box-sizing: border-box !important;
}

.unified-composer-panel.active,
.unified-recipients-panel.active {
  display: flex !important;
}

.unified-composer-panel:not(.active),
.unified-recipients-panel:not(.active) {
  display: none !important;
}

/* Card Recipients Contexts: Dashboard grid vs Studio Card 20-B */
#dbStudioCloneGrid > #fbCardRecipients {
  height: 530.2px !important;
  background: #0b0f19 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 8px 10px 10px 10px !important;
}

/* Card #20-B Mode 0: Recipients Mode (ภาพที่ 1 ใน Card #20-B) */
#studio_recipientsModeWrap {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
  position: relative !important;
}

#studio_recipientsModeWrap #fbCardRecipients {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: 1 1 0 !important;
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

#studio_recipientsModeWrap #fbCardRecipients > .platform-tab-header {
  display: none !important;
}

#studio_recipientsModeWrap .rec-box-wrap {
  flex: 1 1 0 !important;
  min-height: 100px !important;
  max-height: none !important;
  height: auto !important;
  overflow-y: auto !important;
}


/* v29: Inner view overrides inside unified cards */
#cardComposer #lineCardComposer,
#cardComposer #fbComposerWrap,
#cardComposer .unified-composer-panel {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: 1 1 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

#fbCardRecipients #lineCardRecipients,
#fbCardRecipients #fbRecipientsWrap,
#fbCardRecipients .unified-recipients-panel {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: 1 1 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

#cardComposer #lineCardComposer.active,
#cardComposer #fbComposerWrap.active,
#cardComposer .unified-composer-panel.active {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#cardComposer #lineCardComposer:not(.active),
#cardComposer #fbComposerWrap:not(.active),
#cardComposer .unified-composer-panel:not(.active) {
  display: none !important;
}

#fbCardRecipients #lineCardRecipients.active,
#fbCardRecipients #fbRecipientsWrap.active,
#fbCardRecipients .unified-recipients-panel.active {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#fbCardRecipients #lineCardRecipients:not(.active),
#fbCardRecipients #fbRecipientsWrap:not(.active),
#fbCardRecipients .unified-recipients-panel:not(.active) {
  display: none !important;
}

/* ==========================================================================
   v31: Unified Preview Mode Switcher ([ 💬 ตัวอย่างแชท ] [ 📱 จำลองโพสต์ ])
   ========================================================================== */
.preview-mode-header {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-bottom: 6px !important;
  flex-shrink: 0 !important;
}

.preview-mode-group {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(10, 16, 30, 0.85) !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
  border-radius: 7px !important;
  padding: 2px !important;
  gap: 3px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
  box-sizing: border-box !important;
}

.preview-mode-btn {
  height: 21px !important;
  min-width: 92px !important;
  padding: 0 10px !important;
  border-radius: 5px !important;
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #94a3b8 !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
}

.preview-mode-btn:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.preview-mode-btn.active {
  border: 1px solid rgba(147, 197, 253, 0.5) !important;
  background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 1px 6px rgba(24, 119, 242, 0.4) !important;
}

#unifiedChatPreviewModeWrap,
#unifiedPostSimulatorModeWrap {
  width: 100% !important;
  box-sizing: border-box !important;
}

/* ==========================================================================
   COLUMN 1: UNIFIED SINGLE CARD (v34 / v53)
   รวมฟอร์มสั่งงาน 5 ช่อง (Career, Templates, Fonts, Aspect, Prompt & Gen) เป็นล็อกเดียวกัน
   ========================================================================== */
#potoColLeft.card {
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  justify-content: flex-start !important;
  min-height: 0 !important;
  height: fit-content !important;
  max-height: none !important;
  align-self: flex-start !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  background: #0b0f19 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  padding: 8px 8px !important;
  box-shadow: none !important;
  outline: none !important;
}

#potoColLeft #potoColLeftTopWrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

#potoColLeftBottomCard {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 5px !important;
  box-sizing: border-box !important;
  overflow: visible !important;
  flex: 1 1 auto !important;
  justify-content: flex-start !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  box-shadow: none !important;
}

#potoColLeft #potoCareerPresetsCard,
#potoColLeft #potoTemplatePresetsCard,
#potoColLeft #potoCardFontStyle,
#potoColLeft #potoCardAspectRatio,
#potoColLeft #potoCard19DualDropdown,
#potoColLeft .poto-dropdown-box-card {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  width: 100% !important;
}

/* ==========================================================================
   VERSION v54: ELIMINATE ALL NEON BORDERS & GLOWS IN COLUMN 1 (เอาแสงนีออนออกจากกรอบ)
   Neutral Dark Glass / Borderless / Zero Cyan Halo
   ========================================================================== */
#potoColLeft,
#potoColLeft.card,
#potoColLeft:hover,
#potoColLeft.card:hover {
  background: #0b0f19 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  outline: none !important;
}

#potoColLeft * {
  box-shadow: none !important;
  text-shadow: none !important;
}

#potoColLeft .poto-dropdown-trigger {
  background: #111726 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

#potoColLeft .poto-dropdown-trigger:hover,
#potoColLeft .poto-dropdown-trigger.poto-trigger-open {
  background: #172033 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: none !important;
}

#potoColLeft .poto-dropdown-box-card,
#potoColLeft #potoCareerPresetsCard,
#potoColLeft #potoTemplatePresetsCard,
#potoColLeft #potoCardFontStyle,
#potoColLeft #potoCardAspectRatio,
#potoColLeft #potoCard19DualDropdown {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

#potoColLeft .poto-career-btn,
#potoColLeft .template-chip {
  border: none !important;
  box-shadow: none !important;
  background: rgba(255, 255, 255, 0.05) !important;
}

#potoColLeft .poto-career-btn:hover,
#potoColLeft .template-chip:hover {
  border: none !important;
  background: rgba(255, 255, 255, 0.1) !important;
  box-shadow: none !important;
}

#potoColLeft .poto-career-btn.active,
#potoColLeft .template-chip.active {
  border: none !important;
  background: linear-gradient(135deg, #1d4ed8, #2563eb) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

#potoColLeft #potoPromptWrap {
  background: #0d121f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

#potoColLeft #potoSidebarAttachCard,
#potoColLeft #potoCard19BrandCard {
  background: #0d121f !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: none !important;
}

#potoColLeft #potoFloatingGenBar button,
#potoColLeft #potoBtnStartBot,
#potoColLeft #potoBtnHeaderGenGemini {
  border: none !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

/* ==========================================================================
   GLOBAL ZERO-NEON & NO-SHINY-BACKGROUND PROTOCOL (v55)
   (ปิดแสงนีออนพื้นหลัง และ กรอบอีก 2 อันภาพแรก: cardComposer & fbCardRecipients)
   ========================================================================== */
/* 1. ปิดแสงสะท้อนนีออน/วงกลมแสงพื้นหลังทั้งหมด */
.glow-bg,
.glow-circle,
.glow-1,
.glow-2,
.glow-3 {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* 2. พื้นหลังแอปทึบเรียบหรู ไม่สะท้อนแสง Gradient ฟุ้ง */
html,
body,
#app,
.app-container,
.main-content {
  background: #070B19 !important;
  background-color: #070B19 !important;
  background-image: none !important;
}

/* 3. กรอบอีก 2 อันในภาพแรก (Composer & Recipients) ไร้แสงนีออน */
#cardComposer,
#cardComposer.card,
#cardComposer:hover,
#cardComposer.card:hover,
#fbCardRecipients,
#fbCardRecipients.card,
#fbCardRecipients:hover,
#fbCardRecipients.card:hover,
#lineCardComposer,
#lineCardComposer.card,
#lineCardRecipients,
#lineCardRecipients.card,
.line-card-composer-proxy,
.line-card-recipients-proxy,
.unified-card-composer,
.unified-card-recipients {
  background: #0b0f19 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  outline: none !important;
}

#cardComposer *,
#fbCardRecipients *,
#lineCardComposer *,
#lineCardRecipients * {
  box-shadow: none !important;
  text-shadow: none !important;
}

/* 4. ปิดแสงนีออนและการฟุ้งรอบการ์ดทุกใบในระบบ */
.card,
.card:hover,
#potoColRight,
#potoCardShowcase,
#potoCardGallery,
#fbTopGrid > .card,
#dbStudioCloneGrid > .card {
  outline: none !important;
  box-shadow: none !important;
}

#potoCardShowcase,
#potoCardGallery,
#potoDockedChatCard,
#potoEmptyOriginalSlotCard {
  background: #0b0f19 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
  outline: none !important;
}

.card:hover,
#potoColRight:hover,
#potoCardShowcase:hover,
#potoCardGallery:hover {
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
}

/* ==========================================================================
   SIDEBAR NAVIGATION: เหลือเฉพาะเมนู STUDIO เท่านั้น (ซ่อน Facebook & LINE OA)
   ========================================================================== */
#navBtnFb,
#navBtnLine,
.sidebar-nav [data-tab="fb"],
.sidebar-nav [data-tab="line"],
.sidebar-nav #navBtnFb,
.sidebar-nav #navBtnLine {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}



/* ==========================================================================
   UNIFIED MASTER DECK: 4-COLUMN SEAMLESS KEYPAD & DYNAMIC SPOTLIGHT HIGHLIGHT
   ========================================================================== */
#potoColLeftTopWrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
}

#potoTopCategoryNav {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 2px !important;
  background: rgba(15, 23, 42, 0.95) !important;
  padding: 2px !important;
  border-radius: 6px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-sizing: border-box !important;
  width: 100% !important;
}

#potoTopCategoryNav .cat-btn {
  height: 28px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 4px !important;
  color: #94a3b8 !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  padding: 0 !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
}

#potoTopCategoryNav .cat-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f1f5f9 !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

#potoTopCategoryNav .cat-btn.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border: 1px solid #60a5fa !important;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.6) !important;
}

#potoMasterGridBody {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  width: 100% !important;
  background: rgba(14, 22, 40, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 8px !important;
  padding: 2px !important;
  box-sizing: border-box !important;
}

.section-row1,
.section-row2,
.section-row3,
.section-row4 {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 2px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.chip-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 4px !important;
  padding: 0 6px !important;
  font-size: 10.5px !important;
  font-weight: 500 !important;
  height: 31px !important;
  border-radius: 4px !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  color: #cbd5e1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
}

.chip-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
}

/* ========================================================= */
/* กฎเหล็ก: อันที่เลือกไว้แล้ว (SELECTED) ต้องสว่าง 100% เสมอ! */
/* ========================================================= */
.chip-btn.active,
.chip-btn.selected-item,
.chk-card.selected-item {
  background: #2563eb !important;
  border: 1.5px solid #60a5fa !important;
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.6) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  opacity: 1 !important;
  filter: none !important;
}

/* โซนของหมวดที่กำลังถูกเลือกด้านบน (HIGHLIGHTED GROUP): สว่างและมีกรอบสปอตไลต์ */
.chip-btn.group-highlight,
.chk-card.group-highlight {
  background: rgba(59, 130, 246, 0.15) !important;
  border: 1.5px solid #60a5fa !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.35) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  opacity: 1 !important;
  filter: none !important;
}

/* หากเป็นทั้ง group-highlight และ selected ให้ใช้ active สีน้ำเงินเข้มเรืองแสงสูงสุด */
.chip-btn.group-highlight.active,
.chip-btn.group-highlight.selected-item,
.chk-card.group-highlight.selected-item {
  background: #2563eb !important;
  border: 1.5px solid #93c5fd !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.8) !important;
  color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
}

/* เฉพาะตัวที่ไม่ได้เลือก และอยู่นอกหมวดที่กำลังโฟกัส เท่านั้นที่จะดรอปแสงลง */
.dimmed-unselected {
  opacity: 0.35 !important;
  filter: grayscale(30%) !important;
}

.chk-card {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  background: rgba(255, 255, 255, 0.035) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  border-radius: 4px !important;
  padding: 0 6px !important;
  height: 31px !important;
  color: #cbd5e1 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.chk-card:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

.chk-card input[type="checkbox"] {
  cursor: pointer !important;
  accent-color: #3b82f6 !important;
  margin: 0 !important;
}

.chk-card.selected-item {
  background: rgba(37, 99, 235, 0.25) !important;
  border: 1.5px solid #60a5fa !important;
  color: #ffffff !important;
  opacity: 1 !important;
  filter: none !important;
}

.inp-card,
.inp-card.group-highlight,
.inp-card.selected-item {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  background: #0b0f19 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 6px !important;
  padding: 0 8px !important;
  height: 42px !important;
  color: #94a3b8 !important;
  white-space: nowrap !important;
  transition: all 0.15s ease !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  outline: none !important;
}

.inp-card:focus-within {
  border-color: rgba(59, 130, 246, 0.5) !important;
  background: #0f172a !important;
  box-shadow: none !important;
}

.inp-card span {
  flex-shrink: 0 !important;
  color: #94a3b8 !important;
  font-size: 10.5px !important;
}

.inp-card input {
  flex: 1 !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #ffffff !important;
  font-size: 10.5px !important;
  width: 100% !important;
  min-width: 0 !important;
}

.inp-card input::placeholder {
  color: #64748b !important;
  font-size: 10px !important;
}


/* Guarantee stubs are completely hidden */
#potoColLeft #potoCareerDropdownTrigger,
#potoColLeft #potoFontDropdownTrigger,
#potoColLeft #potoTemplateDropdownTrigger,
#potoColLeft #potoAspectDropdownTrigger,
#potoColLeft #potoCareerChipList,
#potoColLeft #potoFontStyleList,
#potoColLeft #potoPromptTpls,
#potoColLeft #potoAspectRatioList,
#potoColLeft #potoColLeftDualPanelDrawer {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  width: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  pointer-events: none !important;
}

#potoColLeftTopWrap {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

#potoColLeft #potoTopCategoryNav,
#potoTopCategoryNav {
  display: grid !important;
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 2px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  position: relative !important;
  left: 0 !important;
  top: 0 !important;
  margin: 0 !important;
}

#potoColLeft #potoMasterGridBody,
#potoMasterGridBody {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  width: 100% !important;
  position: relative !important;
  left: 0 !important;
  top: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

#potoColLeft .section-row1,
#potoColLeft .section-row2,
#potoColLeft .section-row3,
#potoColLeft .section-row4,
.section-row1,
.section-row2,
.section-row3,
.section-row4 {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 2px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}


/* Card 20-B Sub-HUD Strip (Equal 50/50 2-Column Split for FB & LINE) */
.col2-subhud-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  margin: 0 0 2px 0 !important;
}

.col2-subhud-box {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 28px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 0 8px !important;
  border-radius: 7px !important;
  overflow: hidden !important;
}

/* ==========================================================================
   PERMANENT FROZEN LAYOUT: STUDIO 2-COLUMN 4-OUTER-CARDS STRICT LOCK
   Left Column: Card #22 (480px) + Card #23 (396px) = 886px total
   Right Column: Card #20 (480px) + Card #20-B (396px) = 886px total
   STRICT PROHIBITION: Never stretch, shrink, expand or alter bounds on any button click
   ========================================================================== */
#potoMainGrid {
  display: grid !important;
  grid-template-columns: minmax(420px, 0.95fr) minmax(650px, 1.35fr) !important;
  gap: 14px !important;
  align-items: start !important;
  min-width: 1120px !important;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

#potoColRight {
  grid-column: 1 !important;
  order: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  height: 910px !important;
  min-height: 910px !important;
  max-height: 910px !important;
  flex: 0 0 910px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#potoColCenter {
  grid-column: 2 !important;
  order: 2 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  height: 910px !important;
  min-height: 910px !important;
  max-height: 910px !important;
  flex: 0 0 910px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* Col 1 Top Card #22: Taller (520px) */
#potoDockedChatCard {
  height: 520px !important;
  min-height: 520px !important;
  max-height: 520px !important;
  flex: 0 0 520px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* Col 1 Bottom Card #23: Shorter (380px) */
#potoEmptyOriginalSlotCard {
  height: 380px !important;
  min-height: 380px !important;
  max-height: 380px !important;
  flex: 0 0 380px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
}

/* Col 2 Top Card #20: Shorter (480px) */
#potoCardShowcase {
  height: 480px !important;
  min-height: 480px !important;
  max-height: 480px !important;
  flex: 0 0 480px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* Col 2 Bottom Card #20-B: Taller (420px) */
#potoCardGallery,
#potoUpscaleDockedCard {
  height: 420px !important;
  min-height: 420px !important;
  max-height: 420px !important;
  flex: 0 0 420px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

/* Card #20 Inner Panels: Setup and Showcase fill full available height (438px) */
#potoSetupBox,
#potoShowcaseBox {
  height: 438px !important;
  min-height: 438px !important;
  max-height: 438px !important;
  flex: 1 1 438px !important;
  box-sizing: border-box !important;
}

#potoColLeftTopWrap {
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
}

#potoMasterGridBody {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  box-sizing: border-box !important;
}

#potoRow1CareerFont .chip-btn,
#potoRow2TplAspect .chip-btn,
#potoRow3Special .chk-card,
#potoRow4MainLine1 .inp-card,
#potoRow4MainLine2 .inp-card {
  height: 44px !important;
  min-height: 44px !important;
}

/* ==========================================================================
   BOTTOM ACTION BUTTONS: EQUALIZED HEIGHT (36px) & RADIUS (8px) ACROSS BOTTOM CARDS
   Covers Card #23 (Save Broadcast) & Card #20-B (FB & LINE OA Actions)
   ========================================================================== */
#studio_potoBtnSimBroadcastNow,
#col2FbBtnSend,
#col2FbBtnLoadPages,
#col2FbBtnConnect,
#col2LineBtnConnect,
#col2LineBtnBroadcast {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ==========================================================================
   CARD #20-B: EXPANDABLE SPEED & DELIVERY OPTIONS DROPDOWN
   ========================================================================== */
.speed-pill-trigger {
  user-select: none;
  font-family: inherit;
  outline: none;
}
.speed-pill-trigger:hover {
  background: rgba(30, 58, 138, 0.4) !important;
  border-color: rgba(59, 130, 246, 0.6) !important;
}
.speed-pill-trigger.active {
  background: rgba(30, 58, 138, 0.5) !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3) !important;
}
.speed-pill-trigger.active #fbSpeedChevron,
.speed-pill-trigger.active #lineSpeedChevron {
  transform: rotate(180deg);
}

.speed-dropdown-panel {
  animation: speedPanelSlideDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes speedPanelSlideDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.speed-opt-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #e2e8f0 !important;
}

.speed-opt-btn.active {
  background: rgba(37, 99, 235, 0.32) !important;
  border-color: #3b82f6 !important;
  color: #93c5fd !important;
}

.speed-opt-btn.line-speed-btn.active {
  background: rgba(16, 185, 129, 0.28) !important;
  border-color: #10b981 !important;
  color: #6ee7b7 !important;
}



