/* KG Portal V11.2 R11.6 · AI Production Board */
.pb116 {
  --pb-bg: #0d0e0f;
  --pb-panel: #141618;
  --pb-panel-2: #191c1f;
  --pb-line: rgba(255, 255, 255, 0.12);
  --pb-line-strong: rgba(255, 255, 255, 0.24);
  --pb-text: #f4f1e9;
  --pb-muted: #a9adb1;
  --pb-accent: #d9ff43;
  --pb-accent-ink: #111400;
  --pb-danger: #ff746c;
  --pb-warning: #f4c15d;
  --pb-success: #76d4a3;
  color: var(--pb-text);
  min-height: 100%;
  padding: clamp(22px, 3vw, 46px);
  background:
    radial-gradient(circle at 96% 2%, rgba(217, 255, 67, 0.07), transparent 25rem),
    var(--pb-bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="light"] .pb116,
[data-kg-theme="light"] .pb116,
body.light .pb116 {
  --pb-bg: #f4f1e9;
  --pb-panel: #ffffff;
  --pb-panel-2: #ece8de;
  --pb-line: rgba(20, 22, 24, 0.15);
  --pb-line-strong: rgba(20, 22, 24, 0.28);
  --pb-text: #151718;
  --pb-muted: #595f64;
  --pb-accent: #3c5600;
  --pb-accent-ink: #ffffff;
  --pb-danger: #a92b24;
  --pb-warning: #795200;
  --pb-success: #17613e;
  background:
    radial-gradient(circle at 96% 2%, rgba(91, 126, 0, 0.11), transparent 25rem),
    var(--pb-bg);
}

.pb116 *, .pb116 *::before, .pb116 *::after { box-sizing: border-box; }
.pb116 button, .pb116 textarea { font: inherit; }
.pb116 button { color: inherit; }
.pb116 h1, .pb116 h2, .pb116 p { margin: 0; }
.pb116 a { color: inherit; }

.pbEyebrow {
  display: block;
  margin-bottom: 12px;
  color: var(--pb-accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.17em;
  line-height: 1.35;
}

.pbHero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  padding: clamp(22px, 4vw, 56px) 0 clamp(26px, 4vw, 52px);
  border-bottom: 1px solid var(--pb-line-strong);
}

.pbHeroCopy { max-width: 900px; }
.pbHero h1 {
  max-width: 880px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 7vw, 94px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.91;
}
.pbHero h1 em { color: var(--pb-accent); font-weight: 400; }
.pbHeroCopy > p {
  max-width: 700px;
  margin-top: 28px;
  color: var(--pb-muted);
  font-size: clamp(15px, 1.5vw, 19px);
  line-height: 1.65;
}
.pbHeroMark {
  width: 116px;
  height: 116px;
  display: grid;
  place-content: center;
  border: 1px solid var(--pb-line-strong);
  border-radius: 50%;
  text-align: center;
}
.pbHeroMark span { display: block; font: 600 31px/1 Georgia, serif; }
.pbHeroMark b { display: block; color: var(--pb-accent); font-size: 11px; letter-spacing: 0.22em; }

.pbComposer {
  margin-top: 34px;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--pb-line-strong);
  background: var(--pb-panel);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.18);
}
.pbComposerHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.pbComposerHead h2 { font: 400 clamp(24px, 3vw, 38px)/1.1 Georgia, serif; }
.pbMode { display: inline-flex; border: 1px solid var(--pb-line-strong); padding: 3px; }
.pbMode button {
  border: 0;
  background: transparent;
  padding: 9px 14px;
  color: var(--pb-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
}
.pbMode button.active { background: var(--pb-text); color: var(--pb-bg); }
.pbMode button:disabled { cursor: wait; opacity: 0.55; }

.pbTitleInput { display: block; margin-top: 25px; }
.pbTitleInput > span { display: block; margin-bottom: 9px; color: var(--pb-muted); font-size: 12px; font-weight: 730; }
.pbTitleInput textarea {
  width: 100%;
  resize: vertical;
  min-height: 132px;
  padding: 20px 22px;
  border: 1px solid var(--pb-line-strong);
  border-radius: 0;
  outline: none;
  background: var(--pb-bg);
  color: var(--pb-text);
  font: 400 clamp(20px, 2.4vw, 31px)/1.36 Georgia, serif;
}
.pbTitleInput textarea::placeholder { color: color-mix(in srgb, var(--pb-muted) 62%, transparent); }
.pbTitleInput textarea:focus { border-color: var(--pb-accent); box-shadow: inset 4px 0 var(--pb-accent); }
.pbTitleInput small { display: block; margin-top: 8px; color: var(--pb-muted); font-size: 11px; text-align: right; }

.pbComposerAction {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
}
.pbComposerAction > div { display: grid; gap: 4px; color: var(--pb-muted); font-size: 12px; }
.pbComposerAction > div b { color: var(--pb-text); }
.pbComposerAction > button,
.pbResultActions button {
  border: 1px solid var(--pb-line-strong);
  background: transparent;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 820;
}
.pbComposerAction > button {
  min-width: 235px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 18px;
}
.pbComposerAction button[data-primary="true"],
.pbResultActions button[data-primary="true"] { border-color: var(--pb-accent); background: var(--pb-accent); color: var(--pb-accent-ink); }
.pbComposerAction button:disabled { cursor: not-allowed; opacity: 0.46; }
.pbComposerAction button:not(:disabled):hover,
.pbResultActions button:hover { transform: translateY(-1px); }

.pbProcessRail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-left: 1px solid var(--pb-line);
  margin: 32px 0;
}
.pbProcessStep {
  min-height: 94px;
  display: flex;
  gap: 14px;
  padding: 18px;
  border-top: 1px solid var(--pb-line);
  border-right: 1px solid var(--pb-line);
  border-bottom: 1px solid var(--pb-line);
}
.pbProcessStep > span { color: var(--pb-accent); font: 400 18px/1 Georgia, serif; }
.pbProcessStep div { display: grid; align-content: start; gap: 6px; }
.pbProcessStep b { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.pbProcessStep small { color: var(--pb-muted); font-size: 11px; line-height: 1.45; }

.pbProcessing, .pbError {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 26px 0;
  padding: 18px 20px;
  border: 1px solid var(--pb-line-strong);
  background: var(--pb-panel);
}
.pbProcessing b { display: block; margin-bottom: 5px; }
.pbProcessing p { color: var(--pb-muted); font-size: 13px; line-height: 1.55; }
.pbSpinner { width: 22px; height: 22px; border: 2px solid var(--pb-line-strong); border-top-color: var(--pb-accent); border-radius: 50%; animation: pbSpin 0.9s linear infinite; }
@keyframes pbSpin { to { transform: rotate(360deg); } }
.pbError { border-color: color-mix(in srgb, var(--pb-danger) 60%, transparent); color: var(--pb-danger); }
.pbError > span { display: grid; place-content: center; flex: 0 0 24px; height: 24px; border: 1px solid currentColor; border-radius: 50%; font-weight: 900; }
.pbError p { line-height: 1.55; }

.pbPreflight {
  margin: 30px 0;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--pb-line-strong);
  background: var(--pb-panel);
}
.pbPreflight.ready { border-left: 5px solid var(--pb-success); }
.pbPreflight.blocked { border-left: 5px solid var(--pb-warning); }
.pbPreflight > header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.pbPreflight h2 { font: 400 clamp(23px, 3vw, 36px)/1.12 Georgia, serif; }
.pbStateBadge { border: 1px solid currentColor; padding: 7px 9px; color: var(--pb-warning); font-size: 10px; font-weight: 850; letter-spacing: 0.1em; white-space: nowrap; }
.pbPreflight.ready .pbStateBadge { color: var(--pb-success); }
.pbCoverageGrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 24px; border-top: 1px solid var(--pb-line); border-left: 1px solid var(--pb-line); }
.pbCoverageGrid > div { display: grid; gap: 4px; padding: 16px; border-right: 1px solid var(--pb-line); border-bottom: 1px solid var(--pb-line); }
.pbCoverageGrid b { font: 400 29px/1 Georgia, serif; }
.pbCoverageGrid span { color: var(--pb-muted); font-size: 11px; }
.pbBlockerList { display: grid; gap: 10px; margin-top: 20px; }
.pbBlockerList article { display: flex; gap: 13px; padding: 15px; background: color-mix(in srgb, var(--pb-warning) 8%, transparent); border: 1px solid color-mix(in srgb, var(--pb-warning) 32%, transparent); }
.pbBlockerList article > span { color: var(--pb-warning); font-weight: 900; }
.pbBlockerList b { font-size: 13px; }
.pbBlockerList p { margin-top: 5px; color: var(--pb-muted); font-size: 12px; line-height: 1.5; }
.pbWarnings { margin: 16px 0 0; padding-left: 20px; color: var(--pb-muted); font-size: 12px; line-height: 1.55; }

.pbResult { margin-top: 42px; border-top: 5px solid var(--pb-accent); scroll-margin-top: 20px; }
.pbResultHeader { display: flex; justify-content: space-between; gap: 24px; padding: 28px 0 22px; align-items: flex-end; }
.pbResultHeader h2 { max-width: 850px; font: 400 clamp(30px, 4.5vw, 56px)/1.03 Georgia, serif; }
.pbResultActions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.pbHookCard { padding: clamp(22px, 3vw, 36px); background: var(--pb-accent); color: var(--pb-accent-ink); }
.pbHookCard > span { display: block; font-size: 10px; font-weight: 900; letter-spacing: 0.14em; }
.pbHookCard blockquote { max-width: 1000px; margin: 16px 0; font: 400 clamp(24px, 3.5vw, 46px)/1.15 Georgia, serif; letter-spacing: -0.025em; }
.pbHookCard small { display: block; opacity: 0.76; font-size: 11px; line-height: 1.5; }

.pbSessionStrip { display: grid; grid-template-columns: 1.2fr repeat(4, 1fr); border-left: 1px solid var(--pb-line-strong); }
.pbSessionStrip > div { min-width: 0; display: grid; gap: 7px; padding: 17px; border-right: 1px solid var(--pb-line-strong); border-bottom: 1px solid var(--pb-line-strong); }
.pbSessionStrip span, .pbAnalysis span { color: var(--pb-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.pbSessionStrip b { overflow-wrap: anywhere; font-size: 12px; }
.pbAnalysis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-left: 1px solid var(--pb-line); }
.pbAnalysis > div { padding: 18px; border-right: 1px solid var(--pb-line); border-bottom: 1px solid var(--pb-line); }
.pbAnalysis p { margin-top: 8px; color: var(--pb-muted); font-size: 12px; line-height: 1.55; }

.pbTableWrap { overflow: auto; border: 1px solid var(--pb-line-strong); border-top: 0; }
.pbTable { width: 100%; min-width: 1420px; border-collapse: collapse; table-layout: fixed; }
.pbTable th { position: sticky; top: 0; z-index: 2; padding: 12px 10px; border-right: 1px solid var(--pb-line); border-bottom: 1px solid var(--pb-line-strong); background: var(--pb-panel-2); color: var(--pb-muted); text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: 0.08em; }
.pbTable th:nth-child(1) { width: 54px; }
.pbTable th:nth-child(2) { width: 98px; }
.pbTable th:nth-child(3) { width: 112px; }
.pbTable th:nth-child(4) { width: 178px; }
.pbTable th:nth-child(5) { width: 102px; }
.pbTable th:nth-child(6) { width: 124px; }
.pbTable th:nth-child(7) { width: 230px; }
.pbTable th:nth-child(8) { width: 290px; }
.pbTable th:nth-child(9) { width: 190px; }
.pbTable td { padding: 12px 10px; border-right: 1px solid var(--pb-line); border-bottom: 1px solid var(--pb-line); vertical-align: top; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.pbTable tr:last-child td { border-bottom: 0; }
.pbTable tr:hover td { background: color-mix(in srgb, var(--pb-accent) 3.5%, transparent); }
.pbTable td > b, .pbTable td > small, .pbTable td > code, .pbTable td > a, .pbTable td > span { display: block; }
.pbTable td > code { margin-bottom: 6px; color: var(--pb-accent); font-size: 9px; }
.pbTable td > small { margin-top: 5px; color: var(--pb-muted); }
.pbTable td > a { margin-top: 8px; color: var(--pb-accent); font-weight: 780; text-decoration: none; }
.pbOrder { color: var(--pb-muted); font: 400 17px/1 Georgia, serif; }
.pbSegment { display: inline-block !important; padding: 5px 6px; border: 1px solid var(--pb-line-strong); font-size: 9px; font-weight: 820; text-transform: uppercase; }
.pbSegment.main { color: var(--pb-accent); }
.pbSegment.cool_down { color: var(--pb-success); }
.pbGif, .pbGifEmpty { width: 90px; height: 90px; border: 1px solid var(--pb-line); background: var(--pb-panel-2); object-fit: cover; }
.pbGifEmpty { display: grid; place-content: center; padding: 8px; color: var(--pb-muted); text-align: center; font-size: 9px; }
.pbGifEmpty.loading { animation: pbPulse 1.1s ease-in-out infinite alternate; }
@keyframes pbPulse { to { opacity: 0.48; } }
.pbTags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.pbTags span { padding: 3px 5px; border: 1px solid var(--pb-line); color: var(--pb-muted); font-size: 8px; }
.pbOriginal { color: var(--pb-muted); }
.pbRewrite { color: var(--pb-text); font-size: 12px; }
.pbSafety { display: block; margin-top: 9px; color: var(--pb-warning); }

.pbResultFooter { display: grid; grid-template-columns: 1fr 0.45fr; border-left: 1px solid var(--pb-line-strong); }
.pbResultFooter > div { padding: 18px; border-right: 1px solid var(--pb-line-strong); border-bottom: 1px solid var(--pb-line-strong); }
.pbResultFooter b { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.pbResultFooter p { margin-top: 7px; color: var(--pb-muted); font-size: 12px; line-height: 1.55; }

.pbEmpty { position: relative; min-height: 280px; display: grid; align-content: center; margin-top: 36px; padding: 36px; border: 1px solid var(--pb-line); overflow: hidden; }
.pbEmptyGrid { position: absolute; inset: 0; opacity: 0.24; background-image: linear-gradient(var(--pb-line) 1px, transparent 1px), linear-gradient(90deg, var(--pb-line) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(90deg, transparent, #000); }
.pbEmpty > *:not(.pbEmptyGrid) { position: relative; max-width: 560px; }
.pbEmpty > span { color: var(--pb-accent); font: 400 14px/1 Georgia, serif; }
.pbEmpty h2 { margin-top: 10px; font: 400 clamp(32px, 4vw, 51px)/1 Georgia, serif; }
.pbEmpty p { margin-top: 17px; color: var(--pb-muted); line-height: 1.6; }

@media (max-width: 980px) {
  .pbHeroMark { display: none; }
  .pbProcessRail, .pbCoverageGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pbSessionStrip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pbAnalysis { grid-template-columns: 1fr; }
  .pbResultHeader { align-items: flex-start; flex-direction: column; }
  .pbResultActions { justify-content: flex-start; }
}

@media (max-width: 680px) {
  .pb116 { padding: 18px 14px 30px; }
  .pbHero { padding-top: 16px; }
  .pbHero h1 { font-size: clamp(40px, 14vw, 60px); }
  .pbComposerHead, .pbComposerAction, .pbPreflight > header { flex-direction: column; align-items: stretch; }
  .pbMode { align-self: flex-start; }
  .pbComposerAction > button { width: 100%; }
  .pbProcessRail, .pbCoverageGrid, .pbSessionStrip, .pbResultFooter { grid-template-columns: 1fr; }
  .pbProcessStep { min-height: 78px; }
  .pbHookCard blockquote { font-size: 25px; }
  .pbTable, .pbTable tbody, .pbTable tr, .pbTable td { display: block; width: 100%; min-width: 0; }
  .pbTable thead { display: none; }
  .pbTable tr { border-bottom: 4px solid var(--pb-bg); }
  .pbTable td { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 12px; min-height: 42px; border-right: 0; }
  .pbTable td::before { content: attr(data-label); color: var(--pb-muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
  .pbGif, .pbGifEmpty { width: 120px; height: 120px; }
}

@media print {
  .sidebar, .mobileTopBar, .globalBackButton, .pbHeroMark, .pbComposer, .pbProcessRail, .pbProcessing, .pbPreflight, .pbResultActions, .themeToggle { display: none !important; }
  .mainContent { margin: 0 !important; padding: 0 !important; }
  .pb116 { --pb-bg: #fff; --pb-panel: #fff; --pb-panel-2: #f0f0f0; --pb-line: #d2d2d2; --pb-line-strong: #999; --pb-text: #111; --pb-muted: #444; --pb-accent: #315000; --pb-accent-ink: #fff; padding: 10px; background: #fff; color: #111; }
  .pbHero { padding: 6px 0 18px; }
  .pbHero h1 { font-size: 40px; }
  .pbHeroCopy > p { font-size: 12px; }
  .pbResult { margin-top: 16px; }
  .pbResultHeader h2 { font-size: 28px; }
  .pbHookCard { print-color-adjust: exact; }
  .pbTableWrap { overflow: visible; }
  .pbTable { min-width: 100%; font-size: 8px; }
  .pbTable th, .pbTable td { padding: 5px; }
  .pbGif, .pbGifEmpty { width: 54px; height: 54px; }
  a { text-decoration: none !important; }
}
