:root {
  color-scheme: dark;
  --bg: #101110;
  --surface: #181a17;
  --raised: #20231e;
  --line: #32362e;
  --text: #f1f3ea;
  --muted: #a4ac9b;
  --lime: #d4ef78;
  --lime-ink: #25300c;
  --danger: #ffb2a2;
  --radius: 14px;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
a {
  color: var(--lime);
  text-underline-offset: 3px;
}
a:hover {
  text-decoration: underline;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  letter-spacing: -1px;
  line-height: 1.2;
}
h2 {
  font-size: 19px;
  letter-spacing: -0.4px;
}
h3 {
  font-size: 15px;
}
p {
  color: var(--muted);
}
small,
.hint {
  font-size: 12px;
  color: var(--muted);
}
.skip-link {
  position: fixed;
  top: -80px;
  left: 15px;
  padding: 12px;
  background: var(--lime);
  color: var(--lime-ink);
  z-index: 100;
}
.skip-link:focus {
  top: 8px;
}
.startup {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  gap: 20px;
  text-align: center;
}
.wordmark {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -1px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 3px;
  background: var(--lime);
  transform: rotate(-12deg);
}
.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  gap: 30px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: #11130fee;
  position: sticky;
  top: 0;
  z-index: 15;
  backdrop-filter: blur(16px);
}
.company {
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 1px solid var(--line);
  padding-left: 28px;
  min-width: 0;
}
.company label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.company select {
  background: transparent;
  border: 0;
  font-weight: 650;
  padding: 4px 25px 4px 0;
  max-width: 240px;
  min-height: 30px;
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  height: 32px;
  width: 32px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  background: var(--raised);
  color: var(--lime);
  border: 1px solid var(--line);
  font-weight: 700;
}
.private-label {
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 3px 10px;
  color: var(--muted);
}
.workspacebar {
  display: flex;
  gap: 20px;
  align-items: center;
  padding: 22px 32px 0;
}
.product-picker {
  display: flex;
  gap: 8px;
  align-items: center;
}
.product-picker select {
  min-width: 210px;
}
.tabs {
  display: flex;
  gap: 6px;
  margin-left: auto;
  overflow: auto;
}
.tab {
  border: 0;
  background: transparent;
  padding: 13px 17px;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.tab.active {
  color: var(--lime);
  border-bottom-color: var(--lime);
}
main.workspace {
  padding: 28px 32px 40px;
  max-width: 1800px;
  margin: auto;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}
.eyebrow {
  color: var(--lime);
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 8px;
}
.page-heading p {
  margin-top: 8px;
  max-width: 750px;
}
.heading-actions,
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.split {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 25px;
  align-items: start;
}
.panel {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 22px;
}
.control-panel {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 22px;
}
.panel-section {
  display: grid;
  gap: 14px;
}
.panel-section + .panel-section {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.section-number {
  border: 1px solid #485039;
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--lime);
  font-size: 10px;
  font-weight: 700;
}
.field {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.field > span,
.field > label {
  font-size: 12px;
  font-weight: 550;
  color: #c8cec0;
}
input:not([type="checkbox"]):not([type="range"]),
select,
textarea {
  width: 100%;
  border: 1px solid #3b4035;
  background: #121510;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 42px;
}
input::placeholder,
textarea::placeholder {
  color: #777f6f;
}
textarea {
  resize: vertical;
  min-height: 95px;
}
input[type="checkbox"] {
  accent-color: var(--lime);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
input[type="range"] {
  accent-color: var(--lime);
  width: 100%;
}
.btn {
  border: 1px solid var(--line);
  background: var(--raised);
  border-radius: 8px;
  padding: 10px 15px;
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  text-decoration: none;
}
.btn:hover:not(:disabled) {
  background: #2d3226;
  border-color: #586147;
  text-decoration: none;
}
.btn.primary {
  background: var(--lime);
  color: var(--lime-ink);
  border-color: var(--lime);
}
.btn.primary:hover:not(:disabled) {
  background: #e0ff8a;
}
.btn.ghost {
  background: transparent;
}
.btn.danger {
  color: var(--danger);
}
.btn.compact {
  padding: 6px 10px;
  min-height: 33px;
}
.full {
  width: 100%;
}
.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 8px 0;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.segments {
  display: flex;
  gap: 4px;
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 9px;
}
.segment {
  background: none;
  border: none;
  color: var(--muted);
  padding: 7px 13px;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
}
.segment.active {
  background: #313829;
  color: var(--lime);
}
.count {
  font-size: 11px;
  background: #151a10;
  padding: 2px 6px;
  border-radius: 5px;
  margin-left: 6px;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 16px;
}
.media-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
}
.media-card.selected {
  border-color: var(--lime);
  box-shadow: 0 0 0 1px var(--lime);
}
.media-stage {
  aspect-ratio: 3/4;
  position: relative;
  background: #080a07;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.media-stage video,
.media-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  min-height: 0;
}
.media-stage video {
  max-height: 420px;
}
.media-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 4px 7px;
  background: #13160ee8;
  backdrop-filter: blur(8px);
  border-radius: 5px;
  font-size: 10px;
  color: #e7eadf;
  pointer-events: none;
}
.media-check {
  position: absolute;
  right: 9px;
  top: 9px;
  background: #171c12dd;
  border-radius: 5px;
  padding: 4px;
  display: flex;
  align-items: center;
  z-index: 1;
}
.media-info {
  padding: 12px;
  display: grid;
  gap: 8px;
}
.media-name {
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.media-info .row {
  gap: 6px;
}
.media-info .btn {
  flex: 1;
}
.empty {
  border: 1px dashed #3f4835;
  border-radius: var(--radius);
  min-height: 340px;
  padding: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  gap: 14px;
  background: radial-gradient(ellipse at 50% 10%, #20271b55, transparent 65%);
}
.empty-icon {
  height: 58px;
  width: 58px;
  background: #252d1b;
  border: 1px solid #455331;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--lime);
  font-size: 28px;
  margin-bottom: 5px;
}
.empty p {
  max-width: 400px;
  font-size: 13px;
}
.notice {
  border: 1px solid #4c5135;
  background: #242719;
  color: #d6dcb9;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 12px;
}
.error {
  border: 1px solid #704537;
  background: #2c1e19;
  color: var(--danger);
  padding: 13px 16px;
  border-radius: 9px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.notifications {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(560px, calc(100% - 30px));
  pointer-events: none;
}
.toast {
  padding: 14px 18px;
  background: #e0f5b7;
  color: #202813;
  border-radius: 9px;
  box-shadow: 0 10px 40px #0007;
  margin-top: 8px;
  font-size: 13px;
}
.toast.error {
  background: #47281f;
  color: #ffcdc0;
}
.mini-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  max-height: 270px;
  overflow: auto;
}
.reference {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #10140c;
  cursor: pointer;
}
.reference img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.reference input {
  position: absolute;
  top: 4px;
  left: 4px;
}
.reference:has(input:checked) {
  border-color: var(--lime);
  box-shadow: inset 0 0 0 2px var(--lime);
}
details > summary {
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
details[open] > summary {
  margin-bottom: 14px;
}
.stack {
  display: grid;
  gap: 16px;
}
.scripts-layout {
  display: grid;
  grid-template-columns: 230px minmax(280px, 1fr) minmax(250px, 0.75fr);
  gap: 20px;
  align-items: start;
}
.script-list {
  display: grid;
  gap: 8px;
}
.script-item {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 9px;
  color: var(--text);
  display: grid;
  gap: 4px;
}
.script-item.active {
  border-color: var(--lime);
  background: #252c1c;
}
.script-copy {
  min-height: 280px;
  line-height: 1.7;
}
.voice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.speech-player {
  width: 100%;
  height: 42px;
}
.caption-preview {
  aspect-ratio: 9/12;
  max-height: 340px;
  display: grid;
  align-items: center;
  justify-items: center;
  background: radial-gradient(ellipse at 50% 30%, #303b23, #0a0d08 85%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  overflow: hidden;
}
.caption-preview p {
  color: white;
  font-size: clamp(17px, 2vw, 25px);
  font-weight: 800;
  text-shadow: 0 2px 5px #000;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.caption-list {
  display: grid;
  gap: 10px;
  max-height: 400px;
  overflow: auto;
}
.caption-row {
  display: grid;
  grid-template-columns: 72px 72px 1fr auto;
  gap: 7px;
  align-items: start;
}
.caption-row input {
  padding: 8px !important;
  min-height: 35px !important;
}
.caption-row textarea {
  min-height: 58px;
  padding: 8px;
}
.batch-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 25px;
  align-items: start;
}
.script-choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.script-choice span {
  display: grid;
  gap: 4px;
}
.total {
  font-size: 44px;
  font-weight: 650;
  letter-spacing: -2px;
  color: var(--lime);
  line-height: 1.1;
}
.total small {
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 400;
}
.job {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 20px;
  display: grid;
  gap: 14px;
}
.job-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.job-title {
  display: grid;
  gap: 3px;
}
.status {
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  color: var(--muted);
}
.status.complete,
.status.completed,
.status.connected,
.status.kept {
  color: var(--lime);
  border-color: #46562e;
  background: #252f1a;
}
.status.failed,
.status.error,
.status.unknown {
  color: var(--danger);
  border-color: #664337;
  background: #322019;
}
progress {
  appearance: none;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #30362a;
}
progress::-webkit-progress-bar {
  background: #30362a;
}
progress::-webkit-progress-value {
  background: var(--lime);
  border-radius: 6px;
}
progress::-moz-progress-bar {
  background: var(--lime);
}
.job-outputs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.job-outputs video {
  width: 100%;
  aspect-ratio: 9/16;
  background: #090b07;
  border-radius: 7px;
  max-height: 290px;
}
.job-outputs .media-stage {
  aspect-ratio: 9/16;
}
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
.settings-grid .panel {
  display: grid;
  gap: 18px;
}
.connection {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.member {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.member .status {
  margin-left: auto;
}
.member-info {
  display: grid;
  overflow-wrap: anywhere;
  min-width: 0;
}
.secret-output {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: all;
  padding: 14px;
  border: 1px solid #4b5a31;
  background: #18210e;
  border-radius: 8px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.auth-wrap {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
.auth-story {
  padding: 10vw 8vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 30%, #344125 0%, #141810 65%);
  border-right: 1px solid var(--line);
}
.auth-story h1 {
  font-size: clamp(34px, 4vw, 62px);
  letter-spacing: -2px;
  margin: 65px 0 22px;
  max-width: 530px;
}
.auth-story h1 span {
  color: var(--lime);
}
.auth-story p {
  max-width: 390px;
}
.auth-box {
  padding: 50px;
  display: flex;
  justify-content: center;
  flex-direction: column;
  max-width: 500px;
  width: 100%;
  margin: auto;
  gap: 25px;
}
.auth-box form {
  display: grid;
  gap: 18px;
}
.auth-box .wordmark {
  display: none;
}
.auth-footer {
  font-size: 11px;
  margin-top: 45px;
}
.modal {
  background: var(--surface);
  color: var(--text);
  border: 1px solid #48513c;
  border-radius: 18px;
  padding: 0;
  max-width: 650px;
  width: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  box-shadow: 0 30px 100px #0009;
}
.modal::backdrop {
  background: #080b06c9;
  backdrop-filter: blur(7px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.modal-body {
  padding: 24px;
  display: grid;
  gap: 18px;
  overflow: auto;
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}
.qa-modal {
  max-width: 900px;
  height: calc(100dvh - 32px);
  overflow: hidden;
}
.qa-layout {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.qa-stage {
  min-height: 0;
  background: #050704;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 12px;
}
.qa-stage video,
.qa-stage img {
  height: 100%;
  width: 100%;
  min-height: 0;
  object-fit: contain;
}
.qa-footer {
  padding: 15px 24px 20px;
  display: grid;
  gap: 12px;
  background: var(--surface);
}
.qa-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}
.qa-actions .btn {
  min-height: 48px;
}
.qa-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}
.busy {
  opacity: 0.6;
  pointer-events: none;
}
.loading {
  padding: 60px;
  text-align: center;
  color: var(--muted);
}
.loading::before {
  content: "";
  display: block;
  width: 25px;
  height: 25px;
  border: 2px solid var(--line);
  border-top-color: var(--lime);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
[hidden] {
  display: none !important;
}
@media (min-width: 1450px) {
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  }
}
@media (max-width: 1100px) {
  .topbar {
    padding: 0 20px;
    gap: 20px;
  }
  .workspacebar {
    padding: 18px 20px 0;
    flex-wrap: wrap;
    gap: 12px;
  }
  .tabs {
    margin-left: 0;
    width: 100%;
  }
  .workspacebar .product-picker {
    width: 100%;
  }
  main.workspace {
    padding: 24px 20px;
  }
  .scripts-layout {
    grid-template-columns: 200px 1fr;
  }
  .scripts-layout > .speech-column {
    grid-column: 2;
  }
  .split {
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 18px;
  }
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  .company {
    padding-left: 18px;
  }
  .private-label {
    display: none;
  }
}
@media (max-width: 760px) {
  .topbar {
    height: 70px;
    padding: 0 14px;
    gap: 15px;
  }
  .topbar > .wordmark {
    font-size: 17px;
  }
  .company {
    padding-left: 13px;
    gap: 0;
    flex: 1;
  }
  .company > div {
    min-width: 0;
    width: 100%;
  }
  .company select {
    font-size: 12px;
    max-width: 100%;
    padding-right: 18px;
  }
  .company label {
    font-size: 9px;
  }
  .top-actions {
    gap: 7px;
  }
  .top-actions > .btn {
    font-size: 0;
    padding: 8px;
  }
  .top-actions > .btn::after {
    content: "Exit";
    font-size: 11px;
  }
  .avatar {
    display: none;
  }
  .workspacebar {
    padding: 14px 14px 0;
  }
  .product-picker {
    display: grid !important;
    grid-template-columns: 1fr auto auto;
  }
  .product-picker select {
    min-width: 0;
  }
  .tabs {
    gap: 0;
  }
  .tab {
    padding: 11px 12px;
    font-size: 12px;
  }
  main.workspace {
    padding: 23px 14px;
  }
  .page-heading {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
  }
  .page-heading h1 {
    font-size: 24px;
  }
  .page-heading p {
    font-size: 12px;
  }
  .split,
  .batch-layout {
    grid-template-columns: 1fr;
  }
  .control-panel {
    position: static;
    padding: 18px;
  }
  .media-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .media-info {
    padding: 10px;
  }
  .media-name {
    font-size: 11px;
  }
  .media-info .btn {
    font-size: 11px;
    padding: 7px;
  }
  .media-stage {
    aspect-ratio: 3/4;
  }
  .panel {
    padding: 18px;
  }
  .mini-picker {
    grid-template-columns: repeat(5, 1fr);
    max-height: 170px;
  }
  .empty {
    min-height: 270px;
    padding: 25px;
  }
  .scripts-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .scripts-layout > .speech-column {
    grid-column: auto;
  }
  .script-list {
    display: flex;
    overflow: auto;
    padding-bottom: 5px;
  }
  .script-item {
    min-width: 150px;
    max-width: 220px;
  }
  .script-copy {
    min-height: 240px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .auth-wrap {
    display: block;
  }
  .auth-story {
    display: none;
  }
  .auth-box {
    min-height: 100dvh;
    padding: 30px;
  }
  .auth-box .wordmark {
    display: flex;
    margin-bottom: 25px;
  }
  .caption-row {
    grid-template-columns: 64px 64px 1fr auto;
  }
  .caption-preview {
    max-height: 270px;
    aspect-ratio: auto;
    min-height: 220px;
  }
  .modal {
    max-height: calc(100dvh - 16px);
    width: calc(100% - 16px);
  }
  .modal-head {
    padding: 15px;
  }
  .modal-body {
    padding: 18px;
  }
  .qa-modal {
    height: calc(100dvh - 16px);
  }
  .qa-footer {
    padding: 12px 14px max(14px, env(safe-area-inset-bottom));
    gap: 8px;
  }
  .qa-meta {
    font-size: 11px;
  }
  .qa-actions {
    gap: 8px;
  }
  .qa-stage {
    padding: 0;
  }
  .qa-stage video {
    max-height: 100%;
  }
  .job {
    padding: 15px;
  }
  .toolbar .segments {
    width: 100%;
  }
  .segment {
    flex: 1;
    padding: 7px 9px;
  }
  .notifications {
    bottom: max(16px, env(safe-area-inset-bottom));
  }
  .auth-footer {
    margin-top: 15px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

.site-legal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.site-legal-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
}
.site-legal-footer a {
  color: var(--muted);
  text-underline-offset: 3px;
}
.site-legal-footer a:hover,
.site-legal-footer a[aria-current="page"] {
  color: var(--lime);
}

/* Brand and company team management */
.auth-wrap { grid-template-columns: 1.1fr 1fr; background: #101110; }
.auth-story { background: #101110; padding: 32px 6vw 44px; align-items: center; text-align: center; }
.auth-logo { display: block; width: min(100%, 420px); height: auto; }
.auth-story h1 { margin: 16px 0; font-size: clamp(28px, 2.6vw, 40px); letter-spacing: -1.4px; }
.auth-story p { margin: 0; }
.auth-story .auth-footer { margin-top: 26px; }
.auth-logo-mobile { display: none; }
.invitation-context { padding: 16px; border: 1px solid var(--line); border-radius: 10px; overflow-wrap: anywhere; display: grid; gap: 6px; }
.invitation-context small { color: var(--muted); }
.team-panel h3 { margin-top: 24px; }
.team-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.team-row .member-info { min-width: 160px; flex: 1; overflow-wrap: anywhere; }
.team-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.team-controls .field { gap: 4px; }
.team-controls .field > span { font-size: 11px; }
.team-controls select { min-width: 130px; }
.team-panel .secret-output { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .auth-logo-mobile { display: block; width: 200px; height: auto; align-self: center; }
  .auth-box { min-height: auto; gap: 22px; padding: 24px 26px 38px; }
  .auth-box .auth-footer { margin-top: 8px; }
}

.auth-logo, .auth-logo-mobile {
  mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 5%, #000 95%, transparent);
  mask-composite: intersect;
}

/* Company reporting stays separate from the product generation workflow. */
.report-company-scope {
  color: var(--muted);
  font-size: 12px;
}
.reports,
.report-content,
.report-messages {
  display: grid;
  gap: 22px;
  min-width: 0;
}
.report-messages:empty {
  display: none;
}
.report-controls,
.report-overview,
.report-inventory,
.report-drilldown {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.report-filter-summary {
  display: none;
}
.report-controls:not([open]) > :not(summary) {
  display: none;
}
.report-filter-current {
  display: grid;
  gap: 5px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.report-filter-current strong {
  font-size: 13px;
}
.report-filter-current small {
  font-weight: 400;
}
.report-filter-toggle {
  flex: 0 0 auto;
  color: var(--lime);
  font-size: 11px;
}
.report-filter-grid {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.8fr 1fr;
  gap: 14px;
}
.report-filter-grid > .field:last-child {
  grid-column: 1 / -1;
}
.report-date-range {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.report-date-hint {
  flex-basis: 100%;
}
.report-scope-label {
  font-size: 12px;
  color: var(--text);
  overflow-wrap: anywhere;
}
.report-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.report-pagination p {
  flex: 1;
  min-width: 180px;
}
.report-date-range .field {
  flex: 1;
  min-width: 160px;
  max-width: 260px;
}
.report-filter-error {
  color: var(--danger);
}
.report-sync {
  margin-top: -10px;
}
.report-section-heading,
.report-bucket-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.report-section-heading > div {
  flex: 1;
  min-width: 180px;
}
.report-section-heading .field {
  flex: 0 1 220px;
}
.report-section-heading h2 + p {
  margin-top: 4px;
}
.report-badge {
  display: inline-block;
  width: fit-content;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  padding: 4px 8px;
  border: 1px solid #5c513a;
  border-radius: 6px;
  background: #28241c;
  color: #e4d2a8;
}
.report-badge.complete {
  color: #cfdfab;
  border-color: #48573c;
  background: #20271c;
}
.report-coverage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  padding: 0 2px;
  font-size: 12px;
  color: var(--muted);
}
.report-coverage-summary strong {
  color: var(--text);
}
.report-bucket {
  display: grid;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  min-width: 0;
}
.report-bucket-heading .hint {
  flex: 1;
  min-width: 160px;
  overflow-wrap: anywhere;
}
.report-metrics,
.report-inventory-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
}
.report-metric,
.report-inventory-grid > div {
  min-width: 0;
}
.report-metrics dt,
.report-inventory-grid dt,
.report-facts dt {
  color: var(--muted);
  font-size: 12px;
}
.report-metrics dd {
  margin: 5px 0 0;
  font-size: clamp(19px, 1.8vw, 29px);
  font-weight: 650;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.report-no-metrics {
  padding: 22px 0;
  color: var(--muted);
}
.report-contribution {
  display: grid;
  gap: 16px;
}
.report-contribution-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.report-contribution-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  min-width: 0;
}
.report-contribution-card.generated {
  border-color: #64733c;
}
.report-contribution-card > .btn {
  margin-top: auto;
}
.report-contribution-card .report-bucket-heading .hint {
  min-width: 0;
  width: 100%;
  flex-basis: 100%;
  font-size: 10px;
}
.report-metrics.compact {
  grid-template-columns: 1fr;
  gap: 8px;
}
.report-metrics.compact .report-metric {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
}
.report-metrics.compact dd {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0;
  text-align: right;
}
.report-inventory-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.report-inventory-grid dd {
  margin: 8px 0 0;
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.report-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.report-breadcrumbs .btn {
  white-space: normal;
  text-align: left;
  overflow-wrap: anywhere;
  justify-content: start;
}
.report-breadcrumbs [aria-current] {
  color: var(--lime);
}
.report-table-wrap {
  overflow-x: auto;
}
.report-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 12px;
}
.report-table-caption {
  text-align: left;
  color: var(--muted);
  padding: 0 0 16px;
  font-size: 11px;
}
.report-table th,
.report-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.report-table thead th {
  text-align: right;
  font-size: 10px;
  color: var(--muted);
}
.report-table thead th:first-child,
.report-table .report-group-name {
  text-align: left;
  width: 34%;
}
.report-table td {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.report-group-name {
  font-weight: 400;
  overflow-wrap: anywhere;
}
.report-group-link {
  color: var(--lime);
  justify-content: start;
  padding: 0;
  min-height: 32px;
  text-align: left;
  border: 0;
  font-size: 14px;
}
.report-group-name > strong {
  display: block;
  padding: 5px 0;
}
.report-row-context {
  margin: 7px 0;
  font-size: 10px;
}
.report-script-views {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.report-variant-evidence,
.report-family-wordings {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.report-family-wordings {
  margin-top: 12px;
}
.report-family-wordings ul {
  display: grid;
  gap: 12px;
  padding-left: 18px;
}
.report-family-wordings .report-group-link {
  font-size: 12px;
  white-space: normal;
}
.report-script-text {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
}
.report-group-name .report-script-text {
  margin-top: 10px;
}
.report-script-text pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
  color: var(--text);
  margin-bottom: 0;
}
.report-ad-detail {
  padding: 20px;
  border: 1px solid #64733c;
  background: #1d2217;
  border-radius: 10px;
  display: grid;
  gap: 16px;
  min-width: 0;
}
.report-ad-detail .report-metrics.compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.report-ad-detail .report-metric {
  display: block !important;
}
.report-ad-detail .report-metrics dd {
  text-align: left;
}
.report-account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 18px 0;
}
.report-account {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.report-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}
.report-facts > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1fr);
  gap: 12px;
}
.report-facts dd {
  margin: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.report-connection-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.report-connection-accounts {
  display: grid;
  gap: 12px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.report-connection-accounts li > span {
  display: block;
}
.report-connection-setup,
.report-management {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.report-managed-account {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 16px 0;
}
.report-managed-account + .report-managed-account {
  border-top: 1px solid var(--line);
}
.report-management > p,
.report-family-link > p {
  margin-bottom: 16px;
}
.report-management-fields,
.report-link-fields {
  display: grid;
  gap: 14px;
  min-width: 0;
  border: 0;
  margin: 0;
  padding: 0;
}
.report-link-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.report-script-choices,
.report-link-fields > .btn {
  grid-column: 1 / -1;
}
.report-script-choices {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.report-script-choices legend {
  color: var(--muted);
  font-size: 12px;
  padding: 0 6px;
}
.report-script-choice,
.report-confirmation {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  font-size: 12px;
  cursor: pointer;
}
.report-script-choice input,
.report-confirmation input {
  flex: 0 0 auto;
  margin: 3px 0;
}
.report-script-choice > span {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.report-management-history {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  min-width: 0;
}
.report-management-history h4 {
  margin: 4px 0 0;
  font-size: 12px;
}
.report-history-list {
  display: grid;
  gap: 14px;
  margin: 0;
  padding-left: 20px;
  font-size: 12px;
}
.report-history-list li > p,
.report-history-list blockquote {
  margin-top: 5px;
}
.report-history-list blockquote {
  margin-left: 0;
  margin-right: 0;
  padding-left: 12px;
  border-left: 2px solid var(--line);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.report-management-form {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  margin-bottom: 14px;
}
.report-management-earlier {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}
@media (max-width: 1100px) {
  .report-filter-grid,
  .report-contribution-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .reports,
  .report-content {
    gap: 18px;
  }
  .reports .panel {
    padding: 16px;
  }
  .report-link-fields {
    grid-template-columns: 1fr;
  }
  .report-script-views .btn {
    flex: 1 1 100%;
    white-space: normal;
  }
  .report-management .btn {
    width: 100%;
    white-space: normal;
  }
  .report-family-link > summary,
  .report-management > summary {
    min-height: 32px;
  }
  .report-controls > .report-filter-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    list-style: none;
    margin: 0;
  }
  .report-filter-summary::-webkit-details-marker {
    display: none;
  }
  .report-filter-grid {
    gap: 12px;
  }
  .report-filter-grid > .field:nth-child(-n + 2) {
    grid-column: 1 / -1;
  }
  .report-contribution-grid,
  .report-account-grid {
    grid-template-columns: 1fr;
  }
  .report-metrics,
  .report-ad-detail .report-metrics.compact,
  .report-inventory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .report-metrics dd {
    font-size: 23px;
  }
  .report-contribution-card .report-metrics dd {
    font-size: 15px;
  }
  .report-table,
  .report-table tbody {
    display: block;
    min-width: 0;
  }
  .report-table-caption {
    display: block;
  }
  .report-table thead {
    display: none;
  }
  .report-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
  }
  .report-table .report-group-name {
    display: block;
    grid-column: 1 / -1;
    width: auto;
  }
  .report-table td {
    display: block;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
    font-size: 14px;
  }
  .report-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
    color: var(--muted);
  }
  .report-table th,
  .report-table td {
    padding: 12px;
  }
  .report-facts > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
/* Keep bulk decisions available while browsing long image and clip lists. */
.bulk-review {
  position: sticky;
  top: 90px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel, #171917);
}
.bulk-review > [role="status"] { flex-basis: 100%; }
.bulk-review > [role="status"]:empty { display: none; }
.bulk-review .row { flex-wrap: wrap; }

/* Compact reporting: four visible periods, independent totals, contextual tools. */
body:has(.cockpit) {
  color-scheme: light;
  --bg: #f7f8f4;
  --surface: #ffffff;
  --raised: #f1f3eb;
  --line: #cbd1c2;
  --text: #22291d;
  --muted: #525d49;
  --lime: #496020;
  --lime-ink: #25300c;
  --danger: #982e23;
  background: var(--bg);
  color: var(--text);
}
body:has(.cockpit) .topbar { background: #ffffff; color: var(--text); }
body:has(.cockpit) :is(.topbar, .workspacebar) :is(select, .btn) { color: var(--text); background: var(--surface); border-color: var(--line); }
body:has(.cockpit) :is(.topbar, .workspacebar) .btn:hover:not(:disabled) { color: var(--text); background: #e7ebdc; }
.cockpit {
  --cockpit-lime: #496020;
  --cockpit-soft: #e9efd4;
  color: var(--text);
  background: var(--bg);
  display: grid;
  gap: 14px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.cockpit [hidden] { display: none !important; }
.cockpit h1 { width: fit-content; max-width: 100%; margin: 0; font-size: 24px; font-weight: 500; letter-spacing: -.02em; }
.cockpit h2 { font-size: 18px; font-weight: 500; }
.cockpit h3 { font-size: 15px; font-weight: 500; }
.cockpit p { margin: 0; color: var(--text); }
.cockpit .hint, .cockpit .field > :is(span, label) { color: var(--muted); font-size: 14px; }
.cockpit .panel { min-width: 0; padding: 18px; color: var(--text); background: var(--surface); }
.cockpit .row { flex-wrap: wrap; }
.cockpit .btn, .cockpit a { white-space: normal; }
.cockpit .btn { min-height: 36px; color: var(--text); background: var(--surface); border-color: var(--line); font-size: 14px; }
.cockpit .btn:hover:not(:disabled) { color: var(--text); background: #e7ebdc; border-color: #7a8963; }
.cockpit .btn.primary { background: var(--cockpit-soft); color: #34451a; border-color: #7a8963; }
.cockpit .btn.primary:hover:not(:disabled) { background: #dce7bf; color: #34451a; }
.cockpit .btn.danger { color: var(--danger); }
.cockpit .btn:disabled { opacity: 1; color: #626958; background: #f1f3eb; }
.cockpit :is(input:not([type="checkbox"]), select, textarea) { background: var(--surface); color: var(--text); border-color: #929c85; }
.cockpit :is(input, textarea)::placeholder { color: #626958; }
.cockpit :is(a, button, input, textarea, select, summary):focus-visible { outline: 2px solid var(--cockpit-lime); outline-offset: 3px; }
.cockpit summary { color: var(--text); font-size: 14px; cursor: pointer; }
.cockpit .report-badge { background: #f1f3eb; color: #465638; border-color: #929c85; }
.cockpit .report-badge.complete { background: var(--cockpit-soft); color: #34451a; border-color: #7a8963; }
.cockpit .error { color: #982e23; background: #fff2ee; border-color: #bb8679; }
.cockpit-heading, .cockpit-controls, .cockpit-breadcrumbs, .cockpit-freshness {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  min-width: 0;
}
.cockpit-heading { justify-content: space-between; align-items: flex-end; }
.cockpit-heading > div:first-child { min-width: 0; flex: 1 1 220px; }
.cockpit-heading .hint { margin-top: 5px; }
.cockpit-controls { align-items: end; }
.cockpit-controls .field { gap: 4px; margin: 0; }
.cockpit-controls .field > span { font-size: 13px; color: var(--muted); }
.cockpit-controls select { min-height: 36px; padding: 6px 8px; background: var(--surface); color: var(--text); font-size: 14px; }
.cockpit-breadcrumbs { font-size: 14px; }
.cockpit-breadcrumbs > * + *::before { content: "/"; color: var(--muted); margin-right: 12px; }
.cockpit-crumb { color: var(--muted); text-decoration: none; }
.cockpit-crumb:hover { color: var(--cockpit-lime); }
.cockpit-content, .cockpit-saved, .cockpit-events, .cockpit-windows, .cockpit-form, .cockpit-binding {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.cockpit-grid-controls, .cockpit-campaign-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; min-width: 0; }
.cockpit-grid-controls { justify-content: space-between; }
.cockpit-campaign-filters { flex: 1 1 380px; }
.cockpit-freshness { align-self: end; min-height: 36px; }
.cockpit-actions { position: relative; }
.cockpit-actions > summary { padding: 8px 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); min-height: 36px; }
.cockpit-actions[open] > summary { margin-bottom: 0; }
.cockpit-action-list { position: absolute; z-index: 10; right: 0; top: calc(100% + 8px); width: min(360px, 80vw); padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 28px #22291d26; display: grid; gap: 14px; }
.cockpit-action { display: grid; gap: 5px; }
.cockpit-action .btn { justify-self: start; }
.cockpit-entity-status { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.cockpit-report-summary, .cockpit-trend, .cockpit-recent-changes, .cockpit-change-day { display: grid; min-width: 0; gap: 12px; }
.cockpit-report-summary:empty { display: none; }
.cockpit-trend, .cockpit-recent-changes { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 4px; }
.cockpit-trend svg { display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; overflow: visible; font: 13px system-ui, sans-serif; fill: var(--muted); }
.cockpit-trend .cockpit-chart-mobile { display: none; }
.cockpit-axis-title { font-weight: 600; fill: var(--text); }
.cockpit-chart-grid { stroke: #cbd1c2; stroke-width: 1; }
.cockpit-chart-target { stroke: #5b436f; stroke-width: 1; stroke-dasharray: 4 4; }
.cockpit-spend-bar { fill: #829954; }
.cockpit-roas-line { stroke: #49316a; stroke-width: 3; fill: none; }
.cockpit-roas-point { fill: #49316a; stroke: #fff; stroke-width: 2; }
.cockpit-chart-day:focus-visible { outline: 2px solid #49316a; outline-offset: 5px; }
.cockpit-chart-day:is(:hover, :focus-visible) .cockpit-spend-bar { fill: #496020; }
.cockpit-chart-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; }
.cockpit-spend-key::before { content: ""; display: inline-block; height: 10px; width: 14px; background: #829954; margin-right: 6px; }
.cockpit-roas-key::before { content: ""; display: inline-block; width: 20px; border-top: 3px solid #49316a; vertical-align: middle; margin-right: 6px; }
.cockpit-chart-values { min-height: 1.5em; font-variant-numeric: tabular-nums; }
.cockpit-daily-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.cockpit-daily-table :is(th, td) { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.cockpit-daily-table :is(th, td):first-child { text-align: left; }
.cockpit .cockpit-recent-changes .cockpit-controls { width: auto; }
.cockpit .cockpit-recent-changes .field { flex: 0 1 230px; }
.cockpit .cockpit-recent-changes > .report-section-heading { margin: 0; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.cockpit .cockpit-recent-changes > .report-section-heading h2 { margin: 0; }
.cockpit-changes-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.cockpit .cockpit-events { gap: 8px; }
.cockpit-changes-scroll { max-height: 390px; max-height: min(390px, 55vh); overflow: auto; min-width: 0; border: 1px solid var(--line); border-radius: 6px; scrollbar-gutter: stable; }
.cockpit-changes-scroll:focus-visible { outline: 2px solid var(--cockpit-lime); outline-offset: 2px; }
.cockpit .cockpit-changes-table { width: 100%; min-width: 780px; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 1.35; color: var(--text); background: var(--surface); }
.cockpit .cockpit-changes-table :is(th, td) { padding: 7px 10px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.cockpit .cockpit-changes-table th { position: sticky; top: 0; z-index: 1; background: var(--raised); color: var(--muted); font-size: 13px; font-weight: 600; }
.cockpit-changes-table th:nth-child(1) { width: 155px; }
.cockpit-changes-table th:nth-child(2) { width: 31%; }
.cockpit-changes-table th:nth-child(4) { width: 160px; }
.cockpit-changes-table th:nth-child(5) { width: 96px; }
.cockpit-changes-table tbody tr:nth-child(even) { background: #f3f5ee; }
.cockpit-changes-table tbody tr:hover { background: #e7ebdc; }
.cockpit-change-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap !important; }
.cockpit-change-when { white-space: nowrap; font-variant-numeric: tabular-nums; }
.cockpit .cockpit-changes-table .hint { font-size: 12px; }
.cockpit .cockpit-changes-table .btn { min-height: 32px; padding: 5px 9px; white-space: nowrap; }
.cockpit .cockpit-event-dialog { width: min(620px, calc(100vw - 32px)); max-height: 85vh; padding: 20px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface); overflow: auto; }
.cockpit-event-dialog::backdrop { background: #17200e66; }
.cockpit .cockpit-event-dialog .cockpit-event { border: 0; padding: 0; }
.cockpit .cockpit-event-dialog .report-section-heading { margin-bottom: 16px; }
@media (pointer: coarse) { .cockpit .cockpit-changes-table .btn { min-height: 44px; } }
@media (max-width: 760px) {
  .cockpit .cockpit-recent-changes > .report-section-heading { display: grid; }
  .cockpit .cockpit-recent-changes .cockpit-controls { width: 100%; flex-wrap: nowrap; }
  .cockpit .cockpit-recent-changes .field { flex: 1 1 230px; }
}
.cockpit > [role="status"]:empty { display: none; }
.cockpit-table-section { position: relative; min-width: 0; max-height: min(70vh, 760px); overflow: auto; overscroll-behavior: contain; }
.cockpit-context-label { font-size: 12px !important; color: var(--muted); margin: 6px 0; }
.cockpit .cockpit-table { width: 100%; min-width: 960px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--text); background: var(--surface); }
.cockpit .cockpit-table tr { color: var(--text); background: var(--surface); }
.cockpit .cockpit-table th, .cockpit .cockpit-table td { color: var(--text); background: inherit; text-align: right; padding: 14px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cockpit .cockpit-table thead th { color: var(--muted); background: #f1f3eb; font-size: 14px; font-weight: 500; padding: 10px; }
.cockpit .cockpit-table th:first-child { width: 20%; text-align: left; font-weight: 500; }
.cockpit .cockpit-table.cockpit-nested th:first-child { width: 26%; }
.cockpit .cockpit-table thead .cockpit-sort-target { color: #34451a; border-bottom-color: #7a8963; }
.cockpit .cockpit-table .cockpit-total { color: #263317; background: var(--cockpit-soft); }
.cockpit .cockpit-table .cockpit-total > * { color: #263317; background: var(--cockpit-soft); border-bottom: 2px solid #aebc8e; }
.cockpit .cockpit-table .cockpit-item:nth-child(odd) { color: var(--text); background: #f3f5ee; }
.cockpit .cockpit-table .cockpit-item:hover { color: var(--text); background: #e7ebdc; }
.cockpit .cockpit-table thead th { position: sticky; top: 0; z-index: 3; height: 44px; box-sizing: border-box; }
.cockpit .cockpit-table th:first-child { position: sticky; left: 0; z-index: 2; }
.cockpit .cockpit-table thead th:first-child { z-index: 4; }
.cockpit .cockpit-table .cockpit-total > * { position: sticky; top: 44px; z-index: 1; }
.cockpit .cockpit-table .cockpit-total th:first-child { z-index: 2; }
.cockpit .cockpit-entity-link { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; color: #263317; font-size: 16px; line-height: 1.45; text-decoration: none; font-weight: 550; }
.cockpit .cockpit-entity-link:hover { color: #344c14; text-decoration: underline; }
.cockpit .cockpit-entity-link span { color: var(--muted); }
.cockpit .cockpit-entity-status { display: inline-block; margin: 3px 8px 0 0; font-size: 12px; color: #525d49; }
.cockpit .delivery-active { color: #086334; }
.cockpit .delivery-disabled { color: #982e23; }
.cockpit .cockpit-table .cockpit-budget { width: 11%; }
.cockpit-mobile-budget { display: none; }
.cockpit-note-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.cockpit-note-fields .field { min-width: 0; }
.cockpit-note-dialog { width: min(660px, calc(100vw - 32px)); }
.cockpit-cell-metrics { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 3px 8px; }
.cockpit .cockpit-pair { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 4px 10px; color: #22291d; font-size: 18px; font-weight: 550; }
.cockpit .cockpit-pair > span { color: #22291d; }
.cockpit-roas { display: inline-flex; align-items: center; white-space: nowrap; gap: 2px; }
.cockpit .cockpit-sales { flex-basis: 100%; color: #525d49; font-size: 14px; white-space: nowrap; }
.cockpit-mobile-label { display: none; }
.cockpit .cockpit-unavailable { color: var(--muted); font-size: 18px; }
.cockpit-cell-detail { display: inline-block; margin-left: 6px; font-size: 14px; color: var(--muted); }
.cockpit-delta { display: inline-block; font-size: 22px; font-weight: 800; }
.cockpit .cockpit-delta.up, .cockpit .cockpit-delta.up > summary { color: #086334; }
.cockpit .cockpit-delta.down, .cockpit .cockpit-delta.down > summary { color: #af201b; }
.cockpit-delta > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 28px; cursor: pointer; font-size: 22px; font-weight: 800; line-height: 1; }
.cockpit-delta > summary::-webkit-details-marker { display: none; }
.cockpit-popover { position: absolute; right: 0; z-index: 5; width: min(360px, 100%); padding: 14px; background: var(--surface); color: var(--text); border: 1px solid #929c85; border-radius: 8px; box-shadow: 0 8px 28px #22291d26; text-align: left; font-size: 14px; font-weight: 400; line-height: 1.5; white-space: normal; }
.cockpit-secondary { min-width: 0; border-top: 1px solid var(--line); padding-top: 12px; color: var(--text); background: var(--bg); font-size: 14px; }
.cockpit-secondary > summary { color: var(--muted); cursor: pointer; }
.cockpit-secondary[open] > summary { margin-bottom: 14px; color: var(--text); }
.cockpit-secondary > :not(summary) + * { margin-top: 12px; }
.cockpit-account-detail { display: grid; gap: 6px; }
.cockpit-title-link { color: var(--text); font-size: 15px; font-weight: 500; }
.cockpit-title-link:hover { color: var(--cockpit-lime); }
.cockpit-period { display: grid; gap: 8px; min-width: 0; }
.cockpit-period h3 { margin: 0; }
.cockpit-daily, .cockpit-saved-grid, .cockpit-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-width: 0; }
.cockpit-daily > .cockpit-period, .cockpit-saved-card, .cockpit-event { border: 1px solid var(--line); border-radius: 8px; padding: 14px; min-width: 0; }
.cockpit-saved-card, .cockpit-event { display: grid; gap: 8px; }
.cockpit-saved-card.pinned { border-color: #596840; }
.cockpit-comparison { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cockpit-metrics { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); gap: 10px; margin: 6px 0; }
.cockpit-metrics > div { min-width: 0; }
.cockpit-metrics dt { color: var(--muted); font-size: 12px; }
.cockpit-metrics dd { margin: 0; font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.cockpit .cockpit-warning { color: #7b451a; font-size: 14px; }
.cockpit-evidence pre { max-width: 100%; max-height: 360px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; padding: 12px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.cockpit-event blockquote { border-left: 2px solid var(--cockpit-lime); padding-left: 12px; margin: 4px 0; }
.cockpit-editor { border-color: var(--cockpit-lime); scroll-margin-top: 20px; }
.cockpit-editor > h2 { margin-bottom: 16px; }
.cockpit-form input:not([type="checkbox"]), .cockpit-form select, .cockpit-form textarea, .cockpit select { width: 100%; min-width: 0; max-width: 100%; }
.cockpit-fields, .cockpit-checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; min-width: 0; }
.cockpit-checks { border: 1px solid var(--line); padding: 16px; border-radius: 8px; }
.cockpit-checks .field, .cockpit-form .field:has(input[type="checkbox"]) { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 10px; }
.cockpit-selector-list, .cockpit-deliveries, .cockpit-scope-members { display: grid; gap: 10px; min-width: 0; }
.cockpit-selector { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.cockpit-selector > span { min-width: 0; }
.cockpit-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 1100px) {
  .cockpit-comparison { grid-template-columns: minmax(0, 1fr); }
  .cockpit-fields, .cockpit-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .cockpit h1 { font-size: 22px; }
  .cockpit .panel { padding: 14px; }
  .cockpit-controls { width: 100%; }
  .cockpit-controls .field:first-child { flex: 1 1 160px; }
  .cockpit-controls .field { min-width: 0; }
  .cockpit .cockpit-table { width: calc(400% - 384px); min-width: 0; }
  .cockpit .cockpit-table th:first-child, .cockpit .cockpit-table.cockpit-nested th:first-child { width: 128px; }
  .cockpit .cockpit-table .cockpit-budget { display: none; }
  .cockpit-mobile-budget { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; font-weight: 400; }
  .cockpit-note-fields { grid-template-columns: minmax(0, 1fr); }
  .cockpit-fields, .cockpit-checks, .cockpit-daily, .cockpit-saved-grid { grid-template-columns: minmax(0, 1fr); }
  .cockpit .report-section-heading { align-items: flex-start; }
  .cockpit-grid-controls > .cockpit-controls { flex: 1 1 100%; }
  .cockpit-trend .cockpit-chart-desktop { display: none; }
  .cockpit-trend .cockpit-chart-mobile { display: block; max-width: 420px; font-size: 16px; }
  .cockpit-chart-values { min-height: 3em; }
  .cockpit-action-list { position: static; width: min(360px, 80vw); margin-top: 8px; box-shadow: none; }
  .cockpit .report-badge { max-width: 100%; white-space: normal; }
}
@media (pointer: coarse) {
  .cockpit .btn, .cockpit select, .cockpit-entity-link, .cockpit-secondary > summary { min-height: 44px; }
  .cockpit-entity-link { display: inline-flex; align-items: center; }
  .cockpit-delta > summary { min-width: 24px; min-height: 34px; }
}

/* App-owned reporting chat stays mounted when the report or workspace shell changes. */
.kid-grok-panel {
  color-scheme: light;
  --text: #22291d;
  --muted: #59634f;
  --surface: #fff;
  --line: #cbd1c2;
  position: fixed;
  z-index: 80;
  inset: 0 0 0 auto;
  width: var(--chat-width, 410px);
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  color: var(--text);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 28px #22291d1a;
  font-size: 14px;
  line-height: 1.5;
  overflow: auto;
}
.kid-grok-panel[hidden], .kid-grok-panel [hidden] { display: none !important; }
body.kid-grok-open #app { margin-right: var(--chat-width, 410px); }
.kid-grok-panel :is(h2, h3, p) { margin: 0; color: inherit; }
.kid-grok-panel h2 { font-size: 21px; font-weight: 550; }
.kid-grok-panel h3 { font-size: 14px; font-weight: 650; }
.kid-grok-panel .kid-grok-muted { color: var(--muted); font-size: 12px; }
.kid-grok-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 16px 12px; }
.kid-grok-context { display: grid; gap: 5px; padding: 0 16px 12px; }
.kid-grok-scope { font-weight: 600; overflow-wrap: anywhere; }
.kid-grok-history { padding: 8px 16px; background: #f7f8f4; border-block: 1px solid var(--line); }
.kid-grok-history summary { cursor: pointer; min-height: 28px; }
.kid-grok-history-content { display: grid; gap: 7px; padding-block: 8px; }
.kid-grok-row { display: flex; flex-wrap: wrap; gap: 8px; }
.kid-grok-panel .btn { min-height: 36px; padding: 7px 10px; color: var(--text); background: #fff; border-color: #929c85; white-space: normal; font-size: 13px; }
.kid-grok-panel .btn:hover:not(:disabled) { background: #e7ebdc; color: var(--text); border-color: #7a8963; }
.kid-grok-panel .btn.primary { background: #e9efd4; color: #34451a; border-color: #7a8963; }
.kid-grok-panel .btn:disabled { background: #f1f3eb; color: #626958; opacity: 1; }
.kid-grok-panel :is(textarea, select, input) { width: 100%; max-width: 100%; min-width: 0; background: #fff; color: var(--text); border: 1px solid #929c85; font-size: 14px; }
.kid-grok-panel :is(select, input) { min-height: 36px; }
.kid-grok-panel textarea { resize: vertical; min-height: 76px; max-height: 25dvh; }
.kid-grok-panel textarea::placeholder { color: #626958; }
.kid-grok-panel :is(button, input, select, textarea, summary, a, [tabindex]):focus-visible { outline: 2px solid #496020; outline-offset: 2px; }
.kid-grok-transcript { flex: 1 0 130px; min-height: 130px; overflow-y: auto; overscroll-behavior: contain; padding: 16px; }
.kid-grok-turn { display: grid; gap: 8px; padding-block: 16px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.kid-grok-turn:first-child { padding-top: 0; }
.kid-grok-turn h3:not(:first-child) { margin-top: 8px; }
.kid-grok-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.kid-grok-answer { min-width: 0; max-width: 78ch; font-size: 15px; line-height: 1.6; }
.kid-grok-answer > * + * { margin-top: 12px !important; }
.kid-grok-answer p { white-space: pre-line; }
.kid-grok-answer :is(ul, ol) { padding-left: 24px; margin-block: 8px; }
.kid-grok-answer li + li { margin-top: 5px; }
.kid-grok-answer a { color: #315b94; text-decoration: underline; overflow-wrap: anywhere; }
.kid-grok-answer h4 { font-size: 16px; margin: 0; }
.kid-grok-answer pre { overflow-x: auto; padding: 10px; background: #f1f3eb; }
.kid-grok-answer code { font-size: .92em; }
.kid-grok-table-scroll { overflow-x: auto; max-width: 100%; }
.kid-grok-answer table { width: 100%; min-width: 440px; border-collapse: collapse; font-size: 14px; }
.kid-grok-answer :is(th, td) { padding: 7px 10px; border-bottom: 1px solid #cbd1c2; text-align: left; }
.kid-grok-answer th { background: #f1f3eb; }
.kid-grok-answer :is(th, td):not(:first-child) { white-space: nowrap; }
.kid-grok-panel .kid-grok-context p:empty { display: none; }
.kid-grok-panel > .kid-grok-muted:empty { display: none; }
.kid-grok-frozen { color: var(--muted); font-size: 12px; }
.kid-grok-frozen summary { cursor: pointer; }
.kid-grok-panel .kid-grok-notice { color: #982e23; background: #fff2ee; border: 1px solid #bb8679; border-radius: 6px; padding: 10px; overflow-wrap: anywhere; }
.kid-grok-panel > .kid-grok-notice { margin: 10px 16px 0; }
.kid-grok-panel > .kid-grok-muted { padding: 4px 16px; }
.kid-grok-empty { color: var(--muted); }
.kid-grok-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px; }
.kid-grok-composer { display: grid; gap: 8px; padding: 12px 16px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.kid-grok-operator-content { display: grid; gap: 12px; max-height: min(30dvh, 300px); overflow-y: auto; overscroll-behavior: contain; padding-block: 8px; }
.kid-grok-operator-section { display: grid; gap: 7px; min-width: 0; }
.kid-grok-operator-section + .kid-grok-operator-section { border-top: 1px solid var(--line); padding-top: 10px; }
.kid-grok-operator-outcome { display: grid; gap: 5px; font-size: 13px; overflow-wrap: anywhere; }
.kid-grok-operator-outcome:empty, .kid-grok-operator-content > p:empty { display: none; }
.kid-grok-ticket { user-select: all; overflow-wrap: anywhere; }
.kid-grok-receipts { max-height: 180px; overflow: auto; }
.kid-grok-receipts table { width: 100%; border-collapse: collapse; font-size: 13px; }
.kid-grok-receipts :is(th, td) { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; overflow-wrap: anywhere; }
.kid-grok-receipts thead { position: sticky; top: 0; background: #f7f8f4; }
.kid-grok-receipts thead th { white-space: nowrap; }
.kid-grok-receipts a { color: #315b94; text-decoration: underline; }
.kid-grok-review-media, .kid-grok-review-links { display: grid; gap: 5px; }
.kid-grok-review-files summary { cursor: pointer; white-space: nowrap; }
.kid-grok-review-links { max-height: 140px; overflow-y: auto; padding-block: 5px; }
.kid-grok-followup-meaning p { max-height: 80px; overflow-y: auto; }
.kid-grok-panel:has(.kid-grok-operator[open]) .kid-grok-suggestions { display: none; }
@media (min-width: 761px) {
  .kid-grok-transcript { flex: 1 1 130px; }
  .kid-grok-panel > :not(.kid-grok-transcript) { flex-shrink: 0; }
}
@media (min-width: 1600px) {
  body.kid-grok-open { --chat-width: clamp(460px, calc(100vw - 1400px), 1050px); }
  body.kid-grok-open main.workspace { max-width: none; margin: 0; }
  .kid-grok-transcript { padding-inline: 24px; }
}
@media (max-width: 1100px) and (min-width: 761px) {
  .kid-grok-panel { width: 360px; }
  body.kid-grok-open #app { margin-right: 360px; }
  body.kid-grok-open .cockpit-controls { width: 100%; }
}
@media (max-width: 760px) {
  body.kid-grok-open #app { margin-right: 0; }
  body.kid-grok-mobile-open { overflow: hidden; }
  .kid-grok-panel { inset: 0; width: 100%; border: 0; }
.kid-grok-panel :is(.btn, select, input) { min-height: 44px; }
.kid-grok-panel :is(textarea, select, input) { font-size: 16px; }
  .kid-grok-header { padding-top: max(12px, env(safe-area-inset-top)); }
  .kid-grok-history { padding-block: 8px; }
  .kid-grok-operator-content { max-height: 24dvh; }
  .kid-grok-transcript { flex: 1 1 130px; }
  .kid-grok-panel > :not(.kid-grok-transcript) { flex-shrink: 0; }
}
