:root {
  color-scheme: light;
  --font-sans: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  --font-size-body: 14px;
  --font-size-note: 12px;
  --font-weight-regular: 400;
  --font-weight-medium: 600;
  --font-weight-bold: 700;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --line: #d8dee6;
  --muted: #667085;
  --text: #111827;
  --blue: #2563eb;
  --blue-soft: #eef4ff;
  --red: #dc2626;
  --red-soft: #fff1f2;
  --green: #059669;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 216, 117, 0.18), transparent 30%),
    linear-gradient(180deg, #f7f8fb 0%, #eef2f7 100%);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: 1.5;
  font-synthesis: none;
}

button,
input,
select,
textarea {
  font-family: var(--font-sans);
  font-size: var(--font-size-body);
  line-height: 1.45;
}

button {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  height: 38px;
  padding: 0 14px;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

button:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  min-height: 100vh;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
}

.topbar,
.panel,
.review-queue,
.summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(280px, max-content) minmax(360px, 1fr) auto auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.25;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
  font-weight: var(--font-weight-bold);
}

.topbar p,
.panel-header span {
  color: var(--muted);
  font-size: 13px;
}

.workflow-summary {
  margin-top: 4px;
  max-width: 760px;
}

.workflow-summary.ready {
  color: var(--ok);
}

.workflow-summary.warning {
  color: #b45309;
}

.root-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.account-panel {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dbe5f3;
  border-radius: 8px;
  background: #f8fbff;
}

.account-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.account-panel-head strong {
  font-size: 13px;
  white-space: nowrap;
}

.account-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.root-picker input {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  min-width: 0;
}

.path-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  min-width: 0;
}

.path-picker-button {
  min-width: 56px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font-weight: 700;
  cursor: pointer;
}

.path-picker-button:hover {
  background: #f8fafc;
}

.tabs {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}

.tab {
  height: 34px;
  font-weight: 700;
}

.tab.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.page {
  display: none;
  min-height: 0;
}

.page.active {
  display: block;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 1.45fr) minmax(260px, 0.85fr) minmax(320px, 1fr);
  gap: 14px;
  min-height: 0;
}

.production-review {
  margin-top: 14px;
}

.review-toolbar span {
  color: var(--muted);
  font-size: 12px;
}

.review-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.review-engine-select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.review-scope-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 2px 10px;
}

.review-scope-filters label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.review-scope-filters select,
.review-scope-filters input {
  height: 36px;
  min-width: 136px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

.review-queue {
  display: none;
  max-height: 620px;
  overflow: auto;
  padding: 8px;
}

.review-queue.visible {
  display: block;
}

.review-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 4px 2px 10px;
  border-bottom: 1px solid #edf0f4;
  margin-bottom: 10px;
}

.review-toolbar > div:first-child {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 8px;
}

.review-toolbar strong {
  font-size: 14px;
}

.review-items {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.review-item {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
}

.review-item:hover,
.review-item:focus-visible {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.10);
  outline: none;
  transform: translateY(-1px);
}

.review-item.selected {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18), 0 10px 24px rgba(15, 23, 42, 0.10);
}

.review-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f8fafc;
  overflow: hidden;
  display: grid;
  place-items: center;
}

button.review-thumb {
  cursor: zoom-in;
}

.review-thumb-zoom span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  color: #fff;
  background: rgba(15, 23, 42, 0.70);
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.review-thumb-zoom span::before {
  content: "🔍";
  margin-right: 4px;
}

.review-thumb-zoom:hover span,
.review-thumb-zoom:focus-visible span {
  opacity: 1;
  transform: translateY(0);
}

.review-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.review-thumb.missing {
  color: var(--muted);
  font-size: 12px;
}

.review-regenerate-select {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 8px;
  border-top: 1px solid #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  background: #fff;
  cursor: pointer;
}

.review-regenerate-select input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.review-body {
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: space-between;
  min-height: 0;
  padding: 8px;
}

.review-item.approved {
  border-color: #86efac;
  background: #f0fdf4;
}

.review-item.needs_regeneration,
.review-item.revision_requested {
  border-color: #fda4af;
  background: #fff1f2;
}

.review-item.selected,
.review-item.selected.needs_regeneration,
.review-item.selected.revision_requested,
.review-item.selected.approved {
  border-color: #2563eb;
  background: #eff6ff;
}

.review-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.review-main strong,
.review-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-main span {
  color: var(--muted);
  font-size: 12px;
}

.review-card-meta,
.review-card-foot {
  min-width: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-card-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.review-card-state {
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 22px;
  overflow: hidden;
}

.review-status-pill,
.review-issue-count {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.review-issue-count {
  color: #c2410c;
  background: #fff7ed;
}

.review-quality-summary {
  min-height: 16px;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-visible-info {
  display: grid;
  gap: 2px;
  padding: 5px 0;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.review-visible-info span {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 4px;
  color: #475569;
  font-size: 12px;
  line-height: 1.25;
  word-break: break-word;
}

.review-visible-info b {
  color: #94a3b8;
  font-weight: 600;
}

.review-details {
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  padding-top: 4px;
}

.review-details summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  list-style: none;
}

.review-details summary::-webkit-details-marker {
  display: none;
}

.review-details summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 4px;
  transition: transform 0.12s ease;
}

.review-details[open] summary::before {
  transform: rotate(90deg);
}

.review-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  margin: 5px 0;
}

.review-detail-grid span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.review-issue-panel {
  display: grid;
  gap: 5px;
}

.review-issue-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 5px;
  align-items: center;
}

.review-issue-toolbar select {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
  color: var(--text);
  background: #fff;
  font: inherit;
  font-size: 12px;
}

.review-issue-toolbar button {
  height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 12px;
}

.review-issue-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 24px;
  align-items: center;
}

.review-issue-chips.empty {
  color: var(--muted);
  font-size: 12px;
}

.review-issue-chips button {
  min-height: 24px;
  height: auto;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  white-space: normal;
  text-align: left;
}

.review-mark-issues {
  min-height: 30px;
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}

.review-note-input {
  width: 100%;
  min-height: 32px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 7px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text);
  background: #fff;
}

.review-buttons button,
.review-preview {
  height: 25px;
  padding: 0 7px;
  font-size: 12px;
  border-radius: 6px;
}

.review-status-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(42px, 1fr));
  gap: 6px;
  justify-content: start;
  align-items: stretch;
}

.review-status-actions button {
  height: 30px;
  width: 100%;
  min-width: 0;
  white-space: nowrap;
  line-height: 1;
}

.review-icon-button {
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
}

.review-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.review-page-actions {
  display: flex;
  gap: 8px;
}

.review-page-actions button {
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
}

.review-buttons .quality-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.review-buttons .review-pass,
.review-status-actions .review-pass {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
  font-weight: 600;
}

.review-buttons .reject-regenerate,
.review-status-actions .reject-regenerate {
  border-color: #f97316;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 600;
}

.review-buttons .danger-link,
.review-status-actions .danger-link {
  color: var(--red);
  border-color: #fecdd3;
  background: #fff1f2;
}

.review-actions .danger-link {
  color: var(--red);
  border-color: #fecdd3;
  background: #fff;
}

.review-preview.disabled {
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  min-width: 46px;
}

.panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.panel-header {
  min-height: 50px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.imagegen-hero {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(420px, 1.15fr);
  gap: 14px;
  align-items: center;
  padding: 18px 16px;
  background: #ecfdf5;
  border-bottom: 1px solid #86efac;
}

.imagegen-hero h2 {
  color: #14532d;
  font-size: 20px;
}

.imagegen-hero p {
  margin-top: 4px;
  color: #166534;
  font-size: 13px;
  line-height: 1.5;
}

.imagegen-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
}

.imagegen-controls input,
.imagegen-controls select {
  height: 38px;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 0 12px;
  background: #ffffff;
}

.imagegen-controls select {
  min-width: 176px;
  font-weight: 700;
  color: #14532d;
}

.output-link {
  align-self: center;
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.output-link:hover {
  text-decoration: underline;
}

.imagegen-action-row {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.imagegen-progress {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.imagegen-progress-head,
.imagegen-progress-stats {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #14532d;
  font-size: 13px;
}

.imagegen-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dcfce7;
}

#imagegenProgressFill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #2563eb;
  transition: width 180ms ease;
}

.imagegen-progress-eta {
  color: #4b5563;
  font-size: 12px;
}

.production-next-step {
  grid-column: 1 / -1;
  padding: 9px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.4;
}

.inline-status {
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}

.workflow-hint {
  padding: 9px 12px;
  background: #f0f9ff;
  border-bottom: 1px solid #bae6fd;
  color: #075985;
  font-size: 12px;
  line-height: 1.5;
}

.ghost {
  background: #f8fafc;
}

.primary-ghost {
  background: #ecfdf5;
  border-color: #86efac;
  color: #166534;
}

@media (max-width: 980px) {
  .imagegen-hero,
  .imagegen-controls {
    grid-template-columns: 1fr;
  }
}

.product-list,
.asset-grid,
.scene-list,
.manager-grid {
  overflow: auto;
  padding: 12px;
}

.selection-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.selection-line {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.selection-line div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.selection-line > div > span {
  color: var(--muted);
  font-size: 12px;
}

.selection-line > div > strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-line .selected-summary {
  display: block;
  overflow: hidden;
  white-space: normal;
}

.selection-line .selected-summary.empty {
  color: var(--muted);
  display: block;
}

.selected-thumb-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  align-items: start;
  gap: 4px 6px;
  min-width: 0;
  max-width: 100%;
  max-height: 78px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.selected-thumb {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.selected-thumb img,
.selected-thumb-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #e1e6ee;
  background: #f4f6f8;
  object-fit: cover;
}

.selected-thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.selected-thumb em {
  min-width: 0;
  color: var(--ink);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-content: start;
  gap: 8px;
  max-height: min(430px, 52vh);
  border-top: 1px solid #edf0f4;
}

.empty {
  color: var(--muted);
  display: grid;
  place-items: center;
}

.product-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  height: 184px;
  overflow: auto;
  min-width: 0;
}

.product-card.warning {
  border-color: #fda4af;
  background: var(--red-soft);
}

.product-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.product-title strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.badge {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--green);
  background: #ecfdf5;
  white-space: nowrap;
}

.badge.warning {
  color: var(--red);
  background: #ffe4e6;
}

.source-mode {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.recognition-error {
  margin: 0 0 10px;
  color: var(--red);
  font-size: 12px;
}

.view-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.product-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  align-items: start;
}

.view-tile {
  min-width: 0;
}

.view-thumb {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.view-thumb img,
.asset-thumb,
.scene-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.missing-thumb {
  border: 1px dashed var(--red);
  color: var(--red);
  background: #fff7f8;
  font-size: 12px;
}

.view-label {
  display: grid;
  gap: 1px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.view-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manual-mapping {
  margin-top: 8px;
}

.mapping-details {
  border: 1px solid #e8edf5;
  border-radius: 10px;
  padding: 8px;
  background: rgba(248, 250, 252, 0.84);
}

.mapping-details summary {
  width: max-content;
  cursor: pointer;
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  list-style-position: inside;
  line-height: 22px;
  user-select: none;
}

.mapping-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.mapping-header strong {
  min-width: 0;
  overflow: hidden;
  color: #111827;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-header button {
  height: 30px;
  padding: 0 10px;
  border-color: #cbd5e1;
  background: #fff;
  color: #1f2937;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.mapping-pair {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #e8edf5;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.mapping-pair h4 {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}

.mapping-pair label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}

.mapping-pair label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mapping-pair select {
  width: 100%;
  min-width: 0;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 8px;
  font-size: 12px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
}

.model-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  text-align: center;
  height: auto;
  min-width: 0;
  position: relative;
}

.model-card.selected,
.scene-card.selected {
  border: 2px solid var(--blue);
  background: var(--blue-soft);
}

.model-card.legacy {
  border-style: dashed;
}

.model-avatar {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  margin: 0 auto 6px;
}

.model-avatar .asset-thumb {
  object-fit: cover;
  object-position: center 22%;
}

.model-name,
.scene-name {
  font-weight: 700;
  font-size: 13px;
  word-break: break-word;
}

.model-status {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.model-card.legacy .model-status {
  color: #b45309;
  font-weight: 700;
}

.scene-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
}

.scene-card {
  height: auto;
  min-height: 118px;
  display: grid;
  grid-template-rows: auto minmax(32px, auto);
  gap: 6px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  text-align: center;
  position: relative;
  min-width: 0;
}

.model-card .checkmark,
.scene-card .checkmark {
  position: absolute;
  right: 7px;
  top: 7px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.model-card.selected .checkmark,
.scene-card.selected .checkmark {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.scene-image {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  margin: 0 auto;
}

.scene-card .scene-thumb {
  object-fit: cover;
}

.picker-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.36);
}

.picker-dialog.hidden {
  display: none;
}

.picker-card {
  width: min(1080px, 96vw);
  max-height: min(780px, 90vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

.picker-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.picker-card header div:first-child {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.picker-card header strong {
  font-size: 16px;
}

.picker-card header span {
  color: var(--muted);
  font-size: 13px;
}

.picker-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.picker-grid {
  max-height: 100%;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

@media (max-width: 760px) {
  .selection-panel {
    grid-template-columns: 1fr;
  }

  .picker-card header {
    align-items: stretch;
    flex-direction: column;
  }
}

.manager-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.72fr) minmax(420px, 1.28fr);
  gap: 14px;
  min-height: 0;
}

.manager-layout-single {
  grid-template-columns: minmax(0, 1fr);
}

.preset-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  align-content: start;
}

.preset-form input,
.preset-form select,
.preset-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

.preset-form textarea {
  min-height: 76px;
  resize: vertical;
}

.preset-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.scene-admin-access-fields {
  display: contents;
}

.scene-admin-access-fields[hidden] {
  display: none;
}

.scene-upload-access-hint {
  margin: 0;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 9px 10px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 13px;
  line-height: 1.6;
}

.preset-form input[type="file"] {
  padding: 7px;
}

.pose-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pose-upload-grid label:last-child {
  grid-column: 1 / -1;
}

.form-status {
  min-height: 34px;
  display: flex;
  align-items: center;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  padding: 7px 10px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 13px;
  font-weight: 700;
}

.form-status.busy {
  color: #92400e;
  border-color: #fde68a;
  background: #fffbeb;
}

.form-status.success {
  color: #047857;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.form-status.error {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.manager-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
}

.scene-groups {
  display: grid;
  gap: 18px;
  padding: 12px;
  overflow: auto;
}

.scene-preset-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.scene-preset-group + .scene-preset-group {
  padding-top: 18px;
  border-top: 2px solid var(--line);
}

.scene-preset-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.scene-preset-group > header div {
  display: grid;
  gap: 3px;
}

.scene-preset-group > header h3 {
  margin: 0;
  font-size: 17px;
}

.scene-preset-group > header span,
.scene-preset-group > header > strong {
  color: var(--muted);
  font-size: 12px;
}

.scene-preset-group .manager-grid {
  overflow: visible;
  padding: 0;
}

.scene-group-empty {
  grid-column: 1 / -1;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.manager-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  min-width: 0;
}

.manager-thumb {
  width: 82px;
  height: 82px;
  padding: 0;
  overflow: hidden;
}

.manager-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.manager-main {
  min-width: 0;
  display: grid;
  gap: 3px;
  align-content: start;
}

.manager-main strong,
.manager-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-main span {
  color: var(--muted);
  font-size: 12px;
}

.manager-main textarea {
  width: 100%;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  resize: vertical;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  background: #fff;
}

.manager-actions {
  margin-top: 4px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.manager-actions button {
  height: 28px;
  font-size: 12px;
  padding: 0 9px;
}

.checkmark {
  color: var(--blue);
  font-weight: 600;
  position: absolute;
  top: 5px;
  right: 7px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  min-width: 18px;
}

.production-workbench {
  grid-template-columns: minmax(640px, 1.45fr) minmax(260px, 0.72fr) minmax(300px, 0.86fr);
  align-items: start;
}

.production-cockpit {
  grid-template-rows: auto auto auto auto 1fr;
}

.production-cockpit .imagegen-hero {
  grid-template-columns: minmax(220px, 0.62fr) minmax(460px, 1.38fr);
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.production-cockpit .imagegen-hero h2 {
  color: var(--text);
  font-size: 18px;
}

.production-cockpit .imagegen-hero p {
  color: var(--muted);
}

.production-cockpit .imagegen-controls input,
.production-cockpit .imagegen-controls select {
  border-color: var(--line);
}

.action-primary.needs-input {
  background: #f59e0b;
  border-color: #d97706;
  color: #111827;
}

.needs-attention {
  outline: 2px solid #f59e0b;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16);
}

.production-cockpit .imagegen-progress {
  border-color: var(--line);
  background: #f8fafc;
}

.production-cockpit .imagegen-progress-head,
.production-cockpit .imagegen-progress-stats {
  color: var(--text);
}

.task-board {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.task-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.task-board-header div {
  display: grid;
  gap: 2px;
}

.task-board-header strong {
  font-size: 14px;
}

.task-board-header span {
  color: var(--muted);
  font-size: 12px;
}

.task-history {
  display: grid;
  gap: 4px;
  max-height: 168px;
  overflow: auto;
}

.task-row {
  height: 34px;
  display: grid;
  grid-template-columns: 78px 58px 82px minmax(110px, 1fr) 54px 54px 54px 88px;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #f8fafc;
  color: var(--text);
  font-size: 12px;
  text-align: left;
}

.task-row.active {
  border-color: #60a5fa;
  background: #eff6ff;
}

.task-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-id-cell {
  min-width: 0;
}

.task-id-copy,
.task-id-detail {
  width: 100%;
  min-width: 0;
  height: 26px;
  justify-content: flex-start;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.task-engine {
  color: #0369a1;
  font-weight: 700;
}

.task-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
  min-width: 0;
  overflow: visible;
  justify-content: flex-start;
}

.task-actions button {
  height: 24px;
  min-width: 0;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
}

.task-actions .task-rerun-button {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.task-actions .task-stop-button {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #92400e;
  font-weight: 700;
}

.task-download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid #86efac;
  border-radius: 6px;
  color: #047857;
  background: #f0fdf4;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
}

.task-download-pending {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  color: #94a3b8;
  background: #f8fafc;
  font-size: 12px;
  white-space: nowrap;
  flex: 0 0 auto;
}

.task-close-feedback {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.35;
}

.task-close-feedback strong {
  font-size: 13px;
}

.task-close-feedback span {
  color: #475569;
}

.selection-summary {
  padding: 8px 12px;
  color: #475467;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.product-list {
  display: block;
  max-height: min(520px, 58vh);
  overflow: auto;
  padding: 0;
}

.product-table {
  display: grid;
  min-width: 620px;
}

.product-row {
  display: grid;
  grid-template-columns: 52px minmax(170px, 1.1fr) minmax(210px, 1.15fr) minmax(128px, 0.7fr) 82px;
  gap: 10px;
  align-items: center;
  min-height: 82px;
  padding: 8px 10px;
  border-bottom: 1px solid #edf0f4;
  background: #fff;
}

.product-row-head {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #f8fafc;
}

.product-row.warning {
  background: #fff7f8;
}

.product-check {
  display: grid;
  place-items: center;
}

.product-check input {
  width: 16px;
  height: 16px;
}

.product-row .product-title {
  margin: 0;
  min-width: 0;
}

.product-row .product-title strong {
  max-width: none;
}

.product-row .product-strip {
  grid-template-columns: repeat(3, 56px);
}

.product-row .manual-mapping {
  margin: 0;
}

.product-row .mapping-details {
  border-top: 0;
  padding-top: 0;
}

.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}

.danger {
  border-color: var(--red);
  color: var(--red);
}

.progress-track {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.summary {
  display: none;
  white-space: pre-wrap;
  padding: 9px 10px;
  color: #1f2937;
  max-height: 96px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.45;
  background: #fff;
  border: 1px solid #dbeafe;
  border-radius: 8px;
}

.summary.visible {
  display: block;
  grid-column: 1 / -1;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.72);
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 32px;
  z-index: 20;
}

.lightbox.hidden {
  display: none;
}

.task-dialog {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.35);
}

.task-dialog.hidden {
  display: none;
}

.task-dialog-card {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.ark-key-card {
  width: min(560px, 100%);
}

.review-issue-dialog-card {
  width: min(1080px, calc(100vw - 40px));
  height: min(720px, calc(100vh - 40px));
  max-height: calc(100vh - 48px);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
}

.review-issue-dialog-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.review-issue-dialog-body {
  display: grid;
  grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.review-issue-dialog-body img {
  width: 100%;
  max-height: min(350px, calc(100vh - 300px));
  object-fit: contain;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
}

.review-issue-dialog-body > section {
  min-height: 0;
}

.review-issue-dialog-info {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 8px;
}

.review-issue-dialog-info span {
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  color: #334155;
  font-size: 12px;
  line-height: 1.3;
  word-break: break-word;
  background: #f8fafc;
}

.review-issue-dialog-info b {
  color: #64748b;
  font-size: 12px;
}

.review-issue-dialog-body textarea {
  width: 100%;
  min-height: 62px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 9px 10px;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.4;
}

.review-issue-dialog-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.review-issue-dialog-options fieldset {
  display: grid;
  gap: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
}

.review-issue-dialog-options legend {
  padding: 0 4px;
  color: #334155;
  font-weight: 700;
}

.review-issue-dialog-card > .form-status {
  margin-top: 0;
}

.review-issue-dialog-card > .task-dialog-actions {
  position: sticky;
  bottom: 0;
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.review-issue-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.review-issue-checkbox-grid label {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border: 1px solid #dbe3ef;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 500;
}

#reviewDialogApprove {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}

#reviewDialogRegenerate {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 600;
}

.ark-key-field {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
}

.ark-key-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
  color: #0f172a;
  background: #fff;
}

.ark-key-field input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.22);
  border-color: #2563eb;
}

.task-dialog-card strong {
  font-size: 18px;
  color: #0f172a;
}

.task-dialog-card p {
  color: #475569;
  line-height: 1.5;
}

.task-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.task-detail-card {
  width: min(860px, calc(100vw - 32px));
  max-height: calc(100vh - 44px);
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.generation-confirm-card {
  width: min(660px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.generation-confirm-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.generation-confirm-head div {
  display: grid;
  gap: 5px;
}

.generation-confirm-head span {
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.generation-confirm-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.generation-confirm-row {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #dbe3f0;
  border-radius: 10px;
  background: #f8fafc;
}

.generation-confirm-row span {
  color: #64748b;
  font-size: 12px;
}

.generation-confirm-row strong {
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.45;
}

.generation-confirm-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8 !important;
  font-size: 13px;
}

@media (max-width: 640px) {
  .generation-confirm-body {
    grid-template-columns: 1fr;
  }
}

.task-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.task-detail-body {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

.task-detail-status {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.task-detail-status b {
  font-size: 15px;
}

.task-detail-status span {
  color: var(--text);
  line-height: 1.5;
}

.task-detail-status small {
  color: var(--muted);
  line-height: 1.5;
}

.task-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.task-detail-grid div,
.task-detail-lists div {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-width: 0;
}

.task-detail-grid span,
.task-detail-lists span,
.task-detail-issues header span {
  color: var(--muted);
  font-size: 12px;
}

.task-detail-grid b {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-detail-lists {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 6px;
}

.task-detail-lists p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.task-detail-issues {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.task-detail-issues header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: #f8fafc;
}

.task-detail-issues ul {
  display: grid;
  max-height: 220px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.task-detail-issues li {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 56px;
  gap: 8px;
  padding: 7px 10px;
  border-top: 1px solid #eef2f7;
  color: var(--text);
  font-size: 12px;
}

.task-detail-issues li span,
.task-detail-issues li em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-detail-issues li em {
  grid-column: 1 / -1;
  color: #dc2626;
  font-style: normal;
}

.lightbox img {
  max-width: min(1100px, 92vw);
  max-height: 78vh;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
}

.lightbox strong {
  color: #fff;
}

#closeLightbox {
  position: absolute;
  top: 18px;
  right: 18px;
}

@media (max-width: 1100px) {
  .topbar,
  .workspace,
  .manager-layout,
  .review-toolbar {
    grid-template-columns: 1fr;
  }

  .review-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .review-items {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .review-buttons {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .product-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .manager-grid {
    grid-template-columns: 1fr;
  }

  .mapping-grid,
  .mapping-pair {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .app-shell {
    padding: 8px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-queue {
    width: 100%;
    max-width: calc(100vw - 16px);
  }

  .task-table {
    min-width: 0;
    overflow-x: auto;
  }

  .review-items {
    grid-template-columns: 1fr;
  }
}

/* Screenshot-aligned production cockpit */
.app-shell {
  padding: 0;
  gap: 0;
  background: transparent;
}

.topbar {
  grid-template-columns: minmax(240px, 0.55fr) minmax(420px, 1fr) minmax(320px, 0.72fr);
  grid-template-areas:
    "brand picker account"
    "status picker account";
  gap: 8px 16px;
  border-radius: 0;
  border-width: 0 0 1px;
  padding: 12px 22px 14px;
  min-height: 92px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.account-panel {
  grid-area: account;
  justify-self: stretch;
  align-self: start;
}

.brand-lockup {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.76);
  color: var(--text);
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.10);
}

.brand-mark::before {
  content: none;
}

.brand-mark img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
}

.brand-mark img[src=""],
.brand-mark img:not([src]) {
  display: none;
}

.brand-lockup h1 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0;
}

.workflow-summary {
  display: none;
}

.root-picker {
  grid-area: picker;
  grid-template-columns: auto minmax(260px, 1fr) auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
}

.root-picker label {
  color: #1f2937;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.root-picker input {
  height: 36px;
  background: rgba(255, 255, 255, 0.94);
  border-color: #ccd5e1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.root-picker .path-control input {
  width: 100%;
}

.system-status {
  grid-area: status;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 380px;
  justify-self: start;
  padding: 6px 10px;
  border: 1px solid #d8dee6;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: #374151;
  font-size: 13px;
}

.key-config-button {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.key-config-button:hover {
  background: #dbeafe;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "account"
      "status"
      "picker";
  }

  .root-picker {
    grid-template-columns: 1fr;
  }

  .root-picker label {
    margin-top: 4px;
  }

  .system-status {
    justify-self: start;
    max-width: 100%;
  }
}

.system-status #configSummary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #16a34a;
  flex: 0 0 auto;
}



.auth-panel {
  display: grid;
  gap: 8px;
  align-items: start;
  padding: 0;
  border: 0;
  background: transparent;
}

.auth-form {
  display: grid;
  grid-template-columns: minmax(86px, 1fr) minmax(86px, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.auth-form strong {
  font-size: 13px;
  white-space: nowrap;
}

.auth-form input {
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.auth-form button {
  height: 34px;
  border-radius: 8px;
}

.auth-status,
.billing-status {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  min-width: 0;
}

.auth-panel.signed-in .auth-form {
  display: none;
}

.admin-only:not(.visible-admin) {
  display: none !important;
}

.tabs {
  display: flex;
  border-radius: 0;
  border-width: 0 0 1px;
  overflow-x: auto;
  padding: 8px 14px;
}

.billing-layout {
  padding: 12px 14px 24px;
}

.billing-panel {
  min-height: 340px;
}

.billing-admin-forms {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.billing-admin-form {
  display: grid;
  grid-template-columns: auto repeat(3, minmax(100px, 1fr)) auto;
  gap: 8px;
  align-items: center;
}

.billing-admin-form:first-child {
  grid-template-columns: auto minmax(140px, 1fr) auto;
}

.billing-admin-form strong {
  font-size: 13px;
  white-space: nowrap;
}

.billing-admin-form input {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.plan-table,
.admin-table {
  display: grid;
  gap: 0;
  padding: 12px;
  overflow-x: auto;
}

.plan-table .table-row,
.admin-table .table-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) minmax(90px, 0.7fr) minmax(90px, 0.7fr) minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 560px;
  padding: 10px 12px;
  border-bottom: 1px solid #edf0f4;
  font-size: 13px;
}

.plan-table .table-row {
  grid-template-columns: minmax(70px, 0.5fr) minmax(140px, 1.2fr) minmax(90px, 0.7fr) minmax(90px, 0.7fr) minmax(120px, 1fr);
  min-width: 660px;
}

.admin-table .table-row {
  grid-template-columns: minmax(150px, 1.2fr) minmax(110px, 0.9fr) minmax(90px, 0.7fr) minmax(90px, 0.7fr) minmax(130px, 1fr) minmax(88px, 0.5fr);
  min-width: 800px;
}

.report-table .table-row {
  grid-template-columns: minmax(90px, 0.7fr) repeat(5, minmax(78px, 0.6fr));
}

.report-detail-table .table-row {
  grid-template-columns: minmax(80px, 0.5fr) minmax(140px, 1.2fr) minmax(90px, 0.7fr) minmax(110px, 0.8fr) minmax(110px, 0.8fr) minmax(70px, 0.5fr) minmax(90px, 0.7fr);
  min-width: 780px;
}

.ledger-table .table-row {
  grid-template-columns: minmax(120px, 0.9fr) minmax(70px, 0.5fr) minmax(90px, 0.7fr) minmax(180px, 1.4fr);
  min-width: 560px;
}

.report-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.report-actions input {
  min-height: 36px;
  border: 1px solid #d6dde8;
  border-radius: 8px;
  padding: 0 10px;
}

.plan-table .table-head,
.admin-table .table-head {
  border-radius: 8px;
  border-bottom: 0;
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
}

.production-shell {
  min-height: calc(100vh - 116px);
  display: grid;
  grid-template-columns: 326px minmax(0, 1fr);
  gap: 14px;
  padding: 12px 14px 24px;
  align-items: start;
}

.product-sidebar,
.main-workbench,
.selection-overview,
.action-strip,
.progress-card,
.task-board,
.review-queue {
  background: #fff;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
}

.product-sidebar {
  position: sticky;
  top: 104px;
  height: calc(100vh - 126px);
  min-height: 520px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto auto auto 1fr;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.06);
}

.product-upload-panel {
  display: grid;
  gap: 10px;
  padding: 14px 12px 12px;
  border-bottom: 1px solid #e5eaf1;
  background: #f8fafc;
}

.product-upload-panel h2 {
  margin-top: 2px;
  font-size: 17px;
}

.product-upload-panel p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.panel-kicker {
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
}

.upload-status {
  min-height: 32px;
  padding: 8px 10px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  line-height: 1.35;
}

.upload-status.success {
  border-color: #bbf7d0;
  color: #047857;
  background: #f0fdf4;
}

.upload-status.error {
  border-color: #fecdd3;
  color: #be123c;
  background: #fff1f2;
}

.sidebar-header,
.product-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
}

.sidebar-header {
  justify-content: space-between;
  flex-wrap: wrap;
}

.select-current-page {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
}

.select-current-page input {
  width: 16px;
  height: 16px;
}

.upload-product-button {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
}

.product-upload-actions {
  display: grid;
  gap: 8px;
}

.upload-delete-button {
  width: 100%;
  height: 34px;
  font-size: 13px;
  font-weight: 600;
}

.product-tabs,
.review-filter-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 12px 10px;
}

.product-tabs button,
.review-filter-row button {
  height: 36px;
  border-radius: 0;
  border-color: #e5e7eb;
  color: #374151;
  background: #fff;
  font-size: 13px;
}

.product-tabs button:first-child,
.review-filter-row button:first-child {
  border-radius: 7px 0 0 7px;
}

.product-tabs button:last-child,
.review-filter-row button:last-child {
  border-radius: 0 7px 7px 0;
}

.product-tabs .active,
.review-filter-row .active {
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
  font-weight: 600;
}

.product-search-row input {
  min-width: 0;
  flex: 1;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 10px;
}

.icon-button {
  width: 36px;
  padding: 0;
}

.selection-summary {
  background: #f8fafc;
  border-top: 1px solid #edf0f4;
}

.product-list {
  max-height: none;
  overflow: auto;
  border-top: 1px solid #edf0f4;
  padding: 0;
  background: #fff;
}

.product-queue {
  display: grid;
}

.product-queue-item {
  grid-template-columns: 12px 18px 72px minmax(0, 1fr);
  column-gap: 8px;
  row-gap: 8px;
  min-height: 112px;
  padding: 10px 12px;
  align-items: center;
}

.product-queue-item .queue-thumb {
  width: 72px;
  height: 72px;
}

.product-card-main {
  min-width: 0;
  align-self: stretch;
  justify-content: center;
}

.product-card-main strong {
  display: block;
  white-space: normal;
  line-height: 1.25;
  font-size: 14px;
}

.product-card-subtitle {
  white-space: normal;
  line-height: 1.2;
  max-height: 32px;
  overflow: hidden;
}

.product-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.product-card-actions {
  grid-column: 3 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, auto);
  gap: 8px;
  align-items: center;
}

.product-recognition-badge {
  justify-self: start;
}

.product-delete-button {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
}

.expand-caret {
  color: #6b7280;
  font-size: 12px;
}

.queue-thumb {
  width: 54px;
  height: 54px;
  padding: 0;
  overflow: hidden;
  border-radius: 9px;
  background: #f8fafc;
}

.queue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue-thumb-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 4px;
  color: #64748b;
  text-align: center;
}

.queue-thumb-placeholder strong {
  display: block;
  font-size: 18px;
  line-height: 1;
}

.queue-thumb-placeholder small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.15;
}

.queue-status-count {
  color: #374151;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.product-queue-item .badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  max-width: 78px;
  overflow: hidden;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-queue-item > div:nth-of-type(1),
.product-queue-item > div:nth-of-type(2),
.product-title,
.product-title > div {
  min-width: 0;
}

.product-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.product-title strong,
.product-title .source-mode,
.product-queue-item > div:nth-of-type(2) .source-mode {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-title strong {
  font-size: 14px;
  line-height: 20px;
}

.product-title .source-mode,
.product-queue-item > div:nth-of-type(2) .source-mode {
  color: #64748b;
  font-size: 12px;
  line-height: 18px;
}

.product-queue-item > div:nth-of-type(2) {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.product-queue-item .manual-mapping,
.product-queue-item .recognition-error {
  grid-column: 1 / -1;
  min-width: 0;
}

.product-queue-item .mapping-details {
  border: 1px solid #e8edf5;
  border-radius: 10px;
  padding: 8px;
}

.main-workbench {
  border: 0;
  background: transparent;
  display: grid;
  grid-template-rows: auto;
  gap: 12px;
  min-height: 0;
  overflow: visible;
}

.selection-overview {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1.15fr 1fr 1.1fr;
  min-height: 118px;
  overflow: hidden;
}

.overview-card {
  display: grid;
  grid-template-rows: 20px 34px 20px;
  align-content: center;
  gap: 6px;
  padding: 18px 22px;
  border-right: 1px solid #e5e7eb;
}

.overview-card:last-child {
  border-right: 0;
}

.overview-card span {
  color: #4b5563;
  font-size: 13px;
  line-height: 20px;
}

.overview-card strong {
  font-size: 17px;
  line-height: 34px;
  white-space: nowrap;
}

.overview-card em {
  color: #6b7280;
  font-size: 12px;
  font-style: normal;
  line-height: 20px;
  min-height: 20px;
}

.compact-pickers {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.compact-pickers details {
  background: #fff;
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
}

.compact-pickers summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  color: #111827;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px solid #edf0f4;
}

.compact-pickers summary button {
  height: 26px;
  padding: 0 9px;
  font-size: 12px;
}

.summary-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.manager-entry {
  border-color: #bfdbfe;
  color: #1d4ed8;
  background: #eff6ff;
  font-weight: 700;
}

.compact-pickers .asset-grid,
.compact-pickers .scene-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, 132px);
  grid-auto-rows: 150px;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
  min-height: 326px;
  max-height: 326px;
  align-content: start;
  justify-content: start;
}

.compact-pickers .model-card,
.compact-pickers .scene-card {
  width: 100%;
  height: 150px;
  display: grid;
  grid-template-rows: 78px minmax(34px, auto) 18px;
  align-content: start;
  justify-items: center;
  gap: 5px;
  padding: 8px;
  overflow: hidden;
  box-sizing: border-box;
}

.compact-pickers .model-avatar,
.compact-pickers .scene-image {
  width: 78px;
  height: 78px;
  margin: 0;
}

.compact-pickers .model-name,
.compact-pickers .scene-name {
  display: -webkit-box;
  line-height: 17px;
  max-height: 34px;
  overflow: hidden;
  text-align: center;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.compact-pickers .model-status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 18px;
  min-width: 72px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f1f5f9;
  line-height: 18px;
  white-space: nowrap;
  box-sizing: border-box;
}

.compact-pickers .model-card.legacy .model-status {
  background: #fff7ed;
}

.compact-pickers .checkmark {
  position: absolute;
  top: 8px;
  right: 8px;
}

.action-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 0;
  background: transparent;
}

.action-strip select {
  height: 44px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 0 12px;
  color: #1d4ed8;
  font-weight: 600;
}

.action-primary {
  height: 62px;
  min-width: 180px;
  font-size: 15px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.18);
}

.progress-card {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.task-progress-summary {
  grid-template-columns: minmax(300px, 0.72fr) minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  margin-bottom: 8px;
  border: 1px solid #edf0f4;
  border-radius: 8px;
  background: #f8fafc;
}

.task-progress-summary .imagegen-progress {
  padding: 8px;
}

.task-progress-summary .production-next-step {
  padding: 8px;
}

.progress-card .inline-status {
  grid-column: 1 / -1;
  border: 0;
  padding: 0;
}

.task-board {
  padding: 12px;
}

.task-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 0;
  min-width: 0;
}

.section-title-row strong {
  font-size: 15px;
}

.section-title-row span {
  color: var(--muted);
  font-size: 12px;
}

.task-board-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
}

.task-search-field {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.task-search-field input {
  width: 188px;
  height: 32px;
  border: 1px solid #d6def0;
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  color: #0f172a;
}

.task-search-field input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.16);
  border-color: #93b4ff;
}

.task-search-empty {
  grid-column: 1 / -1;
  padding: 24px;
  color: #64748b;
  text-align: center;
  background: #fff;
}

.task-board-actions button {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 13px;
}

.task-history {
  max-height: 430px;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.task-table {
  display: grid;
  min-width: 1200px;
  border: 1px solid #edf0f4;
  border-radius: 7px;
  overflow: visible;
}

.task-row {
  grid-template-columns: 118px minmax(180px, 1fr) 86px 60px 60px 84px 72px 120px 150px 350px;
  min-height: 54px;
  height: auto;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid #edf0f4;
  background: #fff;
}

.task-row-head {
  color: #6b7280;
  font-weight: 700;
  background: #f9fafb;
}

.task-progress-cell {
  display: grid;
  gap: 4px;
}

.task-review-cell {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.task-time-cell {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.task-time-cell b {
  font-weight: 600;
}

.task-time-cell small {
  color: var(--muted);
}

.task-review-cell b,
.task-review-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-review-cell b {
  font-weight: 600;
}

.task-review-cell small {
  color: var(--muted);
  font-size: 12px;
}

.task-progress-cell b {
  font-weight: 500;
}

.task-progress-cell i {
  display: block;
  height: 4px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.task-progress-cell em {
  display: block;
  height: 100%;
  background: #16a34a;
}

.ok-text {
  color: #16a34a;
}

.progress-text {
  color: #2563eb;
}

.muted-text {
  color: var(--muted);
}

.warning-text {
  color: #b45309;
}

.error-text {
  color: #dc2626;
}

.directory-picker-card {
  width: min(760px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  gap: 10px;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto auto;
  overflow: hidden;
}

.directory-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--os-line);
}

.directory-picker-head strong {
  display: block;
  color: var(--os-text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
}

.directory-picker-head .ghost {
  height: 32px;
  padding: 0 12px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
}

.directory-path-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}

.directory-picker-help {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.directory-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 6px 8px;
  overflow-x: auto;
  border: 1px solid #e5eaf2;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
}

.directory-breadcrumb button {
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.directory-up-button {
  justify-self: start;
}

.directory-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 82px;
  overflow: auto;
}

.directory-shortcuts button,
.directory-entry,
.directory-up {
  border: 1px solid var(--line);
  background: #fff;
  color: #111827;
  border-radius: 8px;
  cursor: pointer;
}

.directory-shortcuts button {
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
}

.directory-list {
  display: grid;
  gap: 6px;
  min-height: 0;
  max-height: none;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
}

.directory-entry,
.directory-up {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  text-align: left;
  font-size: 14px;
  font-weight: 400;
}

.directory-entry span,
.directory-up span {
  color: var(--os-muted);
  font-size: 12px;
  font-weight: 500;
}

.directory-entry small {
  display: block;
  color: var(--os-text);
  font-size: 14px;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory-picker-card .directory-path-row input {
  font-size: 14px;
  font-weight: 400;
}

.directory-picker-card .directory-path-row button,
.directory-picker-card .directory-up-button,
.directory-picker-card .task-dialog-actions button {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 500;
}

.directory-picker-card .task-dialog-actions .primary {
  font-weight: 600;
}

.asset-empty-state {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  min-height: 150px;
  align-content: center;
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
}

.asset-empty-state strong {
  color: #111827;
  font-size: 15px;
}

.asset-empty-state code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
}

.review-queue {
  display: block;
  min-height: 720px;
  max-height: none;
  overflow: visible;
  padding: 12px;
}

.review-filter-row {
  display: flex;
  padding: 0 0 12px;
}

.review-filter-row button {
  min-width: 88px;
}

.review-items {
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.review-item {
  grid-template-columns: 1fr;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.review-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border: 0;
  border-radius: 0;
}

.review-body {
  padding: 7px;
  min-height: 0;
}

.review-buttons {
  display: flex;
}

.review-status-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(42px, 1fr));
  gap: 6px;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
    grid-template-areas:
      "brand account"
      "picker picker"
      "status status";
  }

  .root-picker {
    grid-template-columns: 1fr;
  }

  .system-status {
    justify-content: flex-start;
  }

  .production-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .product-sidebar {
    position: static;
    height: auto;
    min-height: 360px;
  }

  .review-queue {
    min-height: 560px;
    overflow-x: auto;
  }

  .review-items {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .selection-overview,
  .compact-pickers,
  .progress-card {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    grid-template-columns: 1fr;
  }

  .auth-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }
}

@media (max-width: 700px) {
  .topbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "account"
      "picker"
      "status";
  }

  .system-status {
    flex-wrap: wrap;
    border-radius: 12px;
  }

  .tabs {
    padding: 8px;
  }

  .tab {
    flex: 0 0 auto;
  }

  .auth-panel {
    padding: 8px;
  }

  .auth-form {
    grid-template-columns: 1fr;
  }

  .auth-form strong,
  .auth-form button {
    width: 100%;
  }

  .billing-layout {
    padding: 8px;
  }

  .plan-table,
  .admin-table {
    padding: 8px;
  }

  .billing-admin-form,
  .billing-admin-form:first-child {
    grid-template-columns: 1fr;
  }

  .review-issue-dialog-body {
    grid-template-columns: 1fr;
  }

  .review-issue-dialog-info,
  .review-issue-checkbox-grid {
    grid-template-columns: 1fr;
  }

  .review-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-status-actions {
    grid-template-columns: 1fr;
  }

  .review-status-actions .danger-link {
    grid-column: auto;
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "account"
      "picker"
      "status";
  }
}

/* Blue-pink enterprise workbench theme */
:root {
  --brand-blue: #3264ff;
  --brand-pink: #ff6fb7;
  --brand-lilac: #8c6cff;
  --brand-cyan: #22c7f3;
  --surface-glass: rgba(255, 255, 255, 0.78);
  --surface-glass-strong: rgba(255, 255, 255, 0.92);
  --line: #d8e1f3;
  --muted: #66718a;
  --text: #182033;
  --blue: var(--brand-blue);
  --blue-soft: #eef3ff;
}

body {
  background:
    radial-gradient(circle at 16% 12%, rgba(255, 111, 183, 0.28), transparent 28%),
    radial-gradient(circle at 84% 10%, rgba(50, 100, 255, 0.24), transparent 30%),
    linear-gradient(135deg, rgba(50, 100, 255, 0.12), rgba(255, 111, 183, 0.10) 42%, #f7f9ff 100%);
}

.app-shell {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), rgba(248, 250, 255, 0.86)),
    transparent;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 118px;
  padding: 18px 28px 18px;
  border-color: rgba(129, 145, 190, 0.24);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.90), rgba(246, 240, 255, 0.82));
  box-shadow: 0 14px 40px rgba(44, 65, 128, 0.12);
}

.topbar::after {
  content: "";
  position: absolute;
  inset: auto 28px 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-lilac), var(--brand-pink));
  opacity: 0.72;
}

.brand-lockup h1 {
  color: #17203a;
  font-size: 18px;
  letter-spacing: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: 0 14px 28px rgba(50, 100, 255, 0.20);
}

.root-picker {
  padding: 10px;
  border: 1px solid rgba(99, 116, 172, 0.18);
  border-radius: 12px;
  background: var(--surface-glass);
  box-shadow: 0 12px 30px rgba(46, 60, 110, 0.08);
}

.root-picker label,
.account-panel-head strong {
  color: #25304d;
}

.root-picker input,
.auth-form input,
.product-search-row input,
.report-actions input,
.billing-admin-form input,
.directory-path-row input {
  border-color: #cfd9f2;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.80);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.blue-pink-focus-ring {
  outline: 0;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(50, 100, 255, 0.16), 0 0 0 6px rgba(255, 111, 183, 0.10);
}

.account-panel {
  border: 1px solid rgba(111, 130, 201, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(246, 241, 255, 0.82)),
    var(--surface-glass);
  box-shadow: 0 18px 42px rgba(36, 56, 120, 0.14);
}



.status-dot {
  background: linear-gradient(135deg, #16d28f, var(--brand-cyan));
  box-shadow: 0 0 0 4px rgba(34, 199, 243, 0.12);
}

.tabs {
  gap: 10px;
  padding: 12px 20px;
  border-color: rgba(129, 145, 190, 0.20);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
}

.tab {
  height: 40px;
  border-radius: 10px;
  border-color: rgba(129, 145, 190, 0.28);
  background: rgba(255, 255, 255, 0.72);
  color: #27324f;
}

.tab.active {
  border-color: rgba(50, 100, 255, 0.46);
  background: linear-gradient(135deg, rgba(50, 100, 255, 0.14), rgba(255, 111, 183, 0.12));
  color: #214fe0;
  box-shadow: 0 10px 22px rgba(50, 100, 255, 0.12);
}

.production-shell {
  position: relative;
  gap: 18px;
  padding: 18px 20px 30px;
}

.production-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 74% 8%, rgba(255, 111, 183, 0.16), transparent 24%),
    radial-gradient(circle at 30% 36%, rgba(50, 100, 255, 0.12), transparent 30%);
}

.product-sidebar,
.selection-overview,
.selection-line,
.task-board,
.review-queue,
.billing-panel,
.panel {
  position: relative;
  border-color: rgba(135, 151, 199, 0.26);
  border-radius: 14px;
  background: var(--surface-glass-strong);
  box-shadow: 0 18px 48px rgba(49, 65, 118, 0.10);
}

.product-sidebar {
  top: 126px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 255, 0.90)),
    var(--surface-glass-strong);
}

.selection-overview {
  min-height: 138px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 255, 0.88));
}

.overview-card {
  position: relative;
  border-right-color: rgba(112, 130, 190, 0.18);
}

.overview-card::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 12px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(50, 100, 255, 0.78), rgba(255, 111, 183, 0.66));
  opacity: 0.34;
}

.overview-card span,
.section-title-row span,
.selection-line > div > span {
  color: #687493;
}

.overview-card strong {
  color: #121a32;
  font-size: 20px;
  font-weight: 600;
}

.product-tabs .active,
.review-filter-row .active {
  color: #214fe0;
  background: linear-gradient(135deg, rgba(50, 100, 255, 0.14), rgba(255, 111, 183, 0.12));
  border-color: rgba(50, 100, 255, 0.34);
}

.queue-thumb,
.view-thumb,
.selected-thumb img,
.selected-thumb-placeholder {
  border-color: rgba(130, 147, 198, 0.34);
  background: linear-gradient(135deg, #f8fbff, #fff3fa);
}

.action-strip {
  padding: 12px 16px;
}

.action-strip select {
  height: 48px;
  border-color: rgba(50, 100, 255, 0.32);
  border-radius: 12px;
  background: #fff;
  color: #214fe0;
}

.action-primary,
.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-lilac) 58%, var(--brand-pink));
  color: #fff;
  box-shadow: 0 14px 30px rgba(50, 100, 255, 0.24);
}

.action-primary:hover:not(:disabled),
.primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2556ee, #7d5ef0 58%, #f060aa);
  box-shadow: 0 18px 38px rgba(50, 100, 255, 0.30);
}

.ghost,
.path-picker-button,
.task-board-actions button {
  border-color: rgba(129, 145, 190, 0.28);
  background: rgba(255, 255, 255, 0.74);
  color: #263556;
}

.task-progress-summary {
  border-color: rgba(50, 100, 255, 0.18);
  background: linear-gradient(135deg, rgba(50, 100, 255, 0.08), rgba(255, 111, 183, 0.08));
}

.imagegen-progress {
  border-color: rgba(34, 199, 243, 0.28);
  background: rgba(255, 255, 255, 0.82);
}

.imagegen-progress-track {
  background: rgba(50, 100, 255, 0.10);
}

#imagegenProgressFill {
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-pink));
}

.production-next-step {
  border-color: rgba(50, 100, 255, 0.20);
  background: rgba(238, 243, 255, 0.78);
  color: #253f99;
}

.admin-table .table-head,
.plan-table .table-head {
  background: linear-gradient(135deg, rgba(50, 100, 255, 0.08), rgba(255, 111, 183, 0.08));
  color: #32405f;
}

.asset-empty-state {
  border-color: rgba(255, 111, 183, 0.34);
  background: linear-gradient(135deg, rgba(255, 111, 183, 0.08), rgba(50, 100, 255, 0.08));
}

.directory-picker-card,
.task-dialog-card {
  border: 1px solid rgba(129, 145, 190, 0.22);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(246, 241, 255, 0.94));
  box-shadow: 0 28px 70px rgba(32, 44, 90, 0.24);
}

.app-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(115deg, rgba(50, 100, 255, 0.10), transparent 34%),
    radial-gradient(circle at 92% 14%, rgba(255, 111, 183, 0.20), transparent 22%),
    radial-gradient(circle at 8% 82%, rgba(34, 199, 243, 0.14), transparent 24%);
}

.topbar {
  align-items: stretch;
  border: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(238, 244, 255, 0.82)),
    linear-gradient(90deg, rgba(50, 100, 255, 0.12), rgba(255, 111, 183, 0.10));
}

.topbar > * {
  position: relative;
}

.topbar .status-pill {
  border-color: rgba(255, 111, 183, 0.28);
  background: rgba(255, 255, 255, 0.68);
  color: #3151b4;
}

.key-config-button,
.path-picker-button,
.ghost {
  font-weight: 600;
}

.key-config-button {
  border-color: rgba(50, 100, 255, 0.26);
  background: linear-gradient(135deg, rgba(50, 100, 255, 0.10), rgba(255, 111, 183, 0.08));
  color: #2751d8;
}

.billing-layout {
  gap: 18px;
  padding: 18px 20px 28px;
  background:
    linear-gradient(135deg, rgba(50, 100, 255, 0.08), rgba(255, 111, 183, 0.08)),
    rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(129, 145, 190, 0.18);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.billing-panel {
  overflow: hidden;
  border: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 255, 0.91)),
    var(--surface-glass-strong);
}

.billing-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-lilac), var(--brand-pink));
  opacity: 0.62;
}

.billing-panel .panel-header {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(129, 145, 190, 0.14);
}

.billing-panel h2 {
  color: #16213d;
  font-size: 18px;
  font-weight: 600;
}

.billing-admin-forms {
  align-items: stretch;
  gap: 12px;
}

.billing-admin-form,
.billing-admin-form:first-child {
  min-height: 74px;
  padding: 12px;
  border: 1px solid rgba(129, 145, 190, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(243, 247, 255, 0.82)),
    rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 26px rgba(50, 64, 118, 0.07);
}

.billing-admin-form strong {
  color: #233257;
  font-weight: 600;
}

.billing-admin-form .primary,
.report-actions .primary,
.billing-panel .primary {
  min-width: 126px;
}

.billing-status {
  display: inline-flex;
  width: fit-content;
  min-height: 30px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid rgba(50, 100, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #4a5b7d;
}

.admin-table,
.plan-table {
  overflow: hidden;
  border: 1px solid rgba(129, 145, 190, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
}

.admin-table .table-row,
.plan-table .table-row {
  border-color: rgba(129, 145, 190, 0.13);
}

.admin-table .table-row:not(.table-head):hover,
.plan-table .table-row:not(.table-head):hover {
  background: linear-gradient(90deg, rgba(50, 100, 255, 0.05), rgba(255, 111, 183, 0.04));
}

.admin-table button,
.plan-table button {
  height: 34px;
  border-radius: 9px;
  color: #2c3e6c;
}

.admin-table .table-head,
.plan-table .table-head {
  border-bottom: 1px solid rgba(129, 145, 190, 0.16);
  background:
    linear-gradient(135deg, rgba(50, 100, 255, 0.12), rgba(255, 111, 183, 0.10)),
    rgba(255, 255, 255, 0.9);
  color: #263556;
  font-weight: 600;
}

.report-actions {
  padding: 10px;
  border: 1px solid rgba(129, 145, 190, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.workspace,
.production-review {
  position: relative;
  z-index: 1;
}

.product-sidebar::before,
.task-board::before,
.selection-line::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  border-radius: 14px 14px 0 0;
  background: linear-gradient(90deg, rgba(50, 100, 255, 0.60), rgba(255, 111, 183, 0.48));
}

/* Warm graphite OS direction selected from Product Design option 2. */
:root {
  --os-bg: #f7f6f3;
  --os-sidebar: #f2f1ee;
  --os-surface: #ffffff;
  --os-surface-muted: #faf9f7;
  --os-line: #e1ded8;
  --os-line-strong: #d6d2ca;
  --os-text: #1f2937;
  --os-muted: #667085;
  --os-primary: #334155;
  --os-action: #2f6fed;
  --os-action-dark: #245bd0;
  --os-rose: #d977a6;
  --os-success: #16835f;
}

body {
  background: var(--os-bg);
  color: var(--os-text);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  padding: 0;
  background: var(--os-bg);
}

.app-shell::before {
  display: none;
}

.tabs {
  grid-column: 2;
  grid-row: 1;
  position: static;
  height: auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--os-line);
  border-radius: 999px;
  background: var(--os-surface-muted);
  box-shadow: none;
}

.tabs::before {
  display: none;
}

.tab {
  justify-content: center;
  width: auto;
  height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #475467;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  box-shadow: none;
}

.tab:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.72);
  color: var(--os-text);
}

.tab.active {
  border: 0;
  background: var(--os-surface);
  color: var(--os-action);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.topbar {
  grid-column: 1;
  grid-row: 1;
  position: sticky;
  top: 0;
  z-index: 15;
  display: grid;
  grid-template-columns: minmax(280px, max-content) minmax(360px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 22px;
  border: 0;
  border-bottom: 1px solid var(--os-line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.topbar::after,
.brand-lockup::after {
  display: none;
}

.brand-lockup {
  gap: 12px;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.brand-lockup h1 {
  color: var(--os-text);
  font-size: 16px;
  font-weight: 600;
}

.workflow-summary,
.topbar p,
.panel-header span {
  color: var(--os-muted);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  box-shadow: none;
}

.system-status {
  justify-self: end;
}

.account-panel {
  min-width: 360px;
  border: 1px solid var(--os-line);
  border-radius: 10px;
  background: var(--os-surface-muted);
  box-shadow: none;
}



.page {
  grid-column: 1;
  grid-row: 2;
  padding: 18px 22px 28px;
  background: var(--os-bg);
}

.production-shell {
  display: grid;
  grid-template-columns: 318px minmax(0, 1fr);
  gap: 16px;
  padding: 0;
}

.production-shell::before {
  display: none;
}

.product-sidebar,
.selection-overview,
.selection-line,
.task-board,
.review-queue,
.billing-panel,
.panel {
  border: 1px solid var(--os-line);
  border-radius: 8px;
  background: var(--os-surface);
  box-shadow: none;
}

.product-sidebar {
  position: sticky;
  top: 94px;
  align-self: start;
  max-height: calc(100vh - 116px);
  overflow: hidden;
}

.product-sidebar::before,
.task-board::before,
.selection-line::before,
.billing-panel::before {
  display: none;
}

.main-workbench {
  min-width: 0;
}

.selection-overview {
  min-height: auto;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  background: var(--os-surface);
}

.overview-card {
  padding: 18px 16px;
  border-right: 1px solid var(--os-line);
}

.overview-card::before {
  display: none;
}

.overview-card:last-child {
  border-right: 0;
}

.overview-card strong {
  color: var(--os-text);
}

.overview-card span,
.overview-card em,
.section-title-row span,
.selection-line > div > span {
  color: var(--os-muted);
}

.selection-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.selection-line {
  min-height: 74px;
  padding: 14px 16px;
}

.action-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
  padding: 0;
}

.output-view-options {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--os-line);
  border-radius: 8px;
  background: var(--os-surface);
}

.output-view-options legend {
  padding: 0 4px;
  color: var(--os-muted);
  font-size: 12px;
}

.output-view-options label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--os-text);
  font-size: 13px;
  font-weight: 600;
}

.output-view-options input {
  accent-color: var(--os-action);
}

button,
.ghost,
.path-picker-button,
.task-board-actions button {
  border-color: var(--os-line);
  border-radius: 8px;
  background: var(--os-surface);
  color: var(--os-primary);
  box-shadow: none;
}

button:hover:not(:disabled),
.ghost:hover:not(:disabled) {
  border-color: var(--os-line-strong);
  background: #fafafa;
}

.primary,
.action-primary {
  border-color: var(--os-action);
  background: var(--os-action);
  color: #fff;
  box-shadow: none;
}

.primary:hover:not(:disabled),
.action-primary:hover:not(:disabled) {
  border-color: var(--os-action-dark);
  background: var(--os-action-dark);
  box-shadow: none;
}

.key-config-button {
  border-color: var(--os-line);
  background: var(--os-surface);
  color: var(--os-primary);
}

.product-tabs .active,
.review-filter-row .active {
  border-color: rgba(47, 111, 237, 0.28);
  background: #eef4ff;
  color: var(--os-action);
}

.queue-item.selected,
.scene-card.selected,
.model-card.selected {
  border-color: rgba(47, 111, 237, 0.42);
  background: #f5f8ff;
}

.task-progress-summary,
.imagegen-progress,
.production-next-step {
  border-color: var(--os-line);
  background: var(--os-surface-muted);
  color: var(--os-text);
}

#imagegenProgressFill {
  background: var(--os-action);
}

.billing-layout {
  gap: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.billing-panel {
  overflow: hidden;
  background: var(--os-surface);
}

.billing-panel .panel-header {
  padding: 16px;
  border-bottom: 1px solid var(--os-line);
}

.billing-panel h2 {
  color: var(--os-text);
}

.info-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 1px;
  background: var(--os-line);
}

.info-admin-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.info-metrics article {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: var(--os-surface);
}

.info-metrics span {
  color: var(--os-muted);
  font-size: 13px;
}

.info-metrics strong {
  color: var(--os-text);
  font-size: 22px;
}

.admin-table,
.plan-table {
  border-color: var(--os-line);
  border-radius: 8px;
  background: var(--os-surface);
}

.admin-table .table-head,
.plan-table .table-head {
  background: var(--os-surface-muted);
  color: var(--os-primary);
}

.admin-table .table-row,
.plan-table .table-row {
  border-color: var(--os-line);
}

.admin-table .table-row:not(.table-head):hover,
.plan-table .table-row:not(.table-head):hover {
  background: #fafafa;
}

.billing-status {
  border-color: var(--os-line);
  background: var(--os-surface-muted);
  color: var(--os-muted);
}

#adminBillingPage > .billing-layout {
  gap: 12px;
}

#adminBillingPage .billing-panel:first-child {
  min-height: 0;
}

#adminBillingPage .billing-panel:first-child .panel-header {
  padding: 12px 16px;
}

#adminBillingPage .billing-panel:first-child #adminCurrentPrice {
  display: inline-flex;
  align-items: center;
  width: auto;
  margin: 12px 16px 0;
  padding: 8px 12px;
  border: 1px solid var(--os-line);
  border-radius: 999px;
  background: #fff;
  color: var(--os-text);
  font-weight: 500;
}

#adminBillingPage .billing-panel:first-child #adminBillingActionStatus {
  margin-top: 8px;
  padding: 8px 16px 12px;
  border-top: 0;
  background: transparent;
}

.admin-billing-dialog-card {
  width: min(620px, calc(100vw - 40px));
}

.billing-admin-forms.compact {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.billing-admin-forms.compact .billing-admin-form {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--os-line);
  border-radius: 10px;
  background: var(--os-surface-muted);
}

.billing-admin-forms.compact .billing-admin-form strong {
  color: var(--os-text);
  font-size: 14px;
  font-weight: 600;
}

.billing-admin-forms.compact .billing-admin-form input {
  min-width: 0;
  height: 36px;
}

.billing-admin-forms.compact .billing-admin-form:first-child input {
  grid-column: 2 / 4;
}

.billing-admin-forms.compact .billing-admin-form button {
  height: 36px;
  white-space: nowrap;
}

.admin-billing-dialog-card .form-status {
  margin-top: 2px;
}

.directory-settings-card {
  width: min(760px, calc(100vw - 40px));
}

.directory-settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--os-line);
}

.directory-settings-head strong {
  display: block;
  color: var(--os-text);
  font-size: 18px;
}

.directory-settings-head p {
  margin-top: 4px;
  color: var(--os-muted);
}

.directory-setting-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.directory-setting-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--os-line);
  border-radius: 12px;
  background: var(--os-surface-muted);
}

.directory-setting-row strong {
  display: block;
  color: var(--os-text);
  font-size: 15px;
}

.directory-setting-row span {
  display: block;
  margin-top: 4px;
  color: var(--os-muted);
  font-size: 13px;
  line-height: 1.45;
}

.directory-settings-note {
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.06);
  color: #315071;
  font-size: 13px;
}

.directory-settings-card .task-dialog-actions,
.directory-picker-card .task-dialog-actions {
  justify-content: flex-end;
  margin-top: 16px;
}

.directory-picker-card,
.task-dialog-card {
  border-color: var(--os-line);
  border-radius: 10px;
  background: var(--os-surface);
  box-shadow: 0 18px 46px rgba(31, 41, 55, 0.18);
}

#planManagementPage .billing-status {
  display: block;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 12px 16px;
  border: 0;
  border-top: 1px solid var(--os-line);
  border-radius: 0;
  background: var(--os-surface);
}

#planManagementPage .plan-table:empty,
#planManagementPage .ledger-table:empty {
  display: none;
}

#planManagementPage .billing-panel {
  min-height: 0;
}

/* Compact OS topbar refinement */
.topbar {
  grid-template-columns: minmax(280px, max-content) minmax(360px, 1fr) auto auto;
  min-height: 64px;
  padding: 10px 18px;
  gap: 12px;
  align-items: center;
}

.brand-lockup {
  grid-column: 1;
  grid-row: 1;
  grid-area: auto;
  align-self: center;
  min-width: 0;
}

.brand-lockup h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-summary {
  display: none;
}

.system-status {
  grid-column: 3;
  grid-row: 1;
  grid-area: auto;
  display: inline-flex;
  align-items: center;
  align-self: center;
  justify-self: end;
  gap: 8px;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--os-line);
  border-radius: 999px;
  background: var(--os-surface);
}

.system-status span {
  max-width: 120px;
  overflow: hidden;
  padding-left: 10px;
  color: var(--os-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-config-button {
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.account-panel {
  grid-column: 4;
  grid-row: 1;
  grid-area: auto;
  display: inline-flex;
  align-items: center;
  align-self: center;
  justify-self: end;
  gap: 10px;
  min-width: 0;
  max-width: min(640px, 42vw);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.account-panel.signed-in {
  display: inline-flex;
}

.account-panel-head {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  white-space: nowrap;
}

.account-panel-head strong {
  color: var(--os-text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  box-shadow: none;
}



.auth-panel {
  min-width: 0;
}

.auth-panel.signed-in {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.account-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.account-toolbar button {
  height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.auth-status {
  order: -1;
  max-width: 150px;
  overflow: hidden;
  color: var(--os-muted);
  font-size: 12px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-form input {
  width: 132px;
  height: 32px;
}

.auth-form button {
  height: 32px;
  padding: 0 12px;
}

.queue-thumb .thumb-error {
  display: none;
}

.queue-thumb.is-missing-thumb .thumb-error {
  display: grid;
}

.main-workbench > .review-queue {
  margin-top: 0;
  max-height: none;
  overflow: visible;
  padding: 14px;
  scroll-margin-top: 88px;
}

.main-workbench > .review-queue .review-toolbar {
  padding: 0 0 12px;
}

.main-workbench > .review-queue.review-queue-highlight {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.directory-picker-card button {
  font-weight: 500;
}

.directory-picker-card .primary {
  font-weight: 600;
}

.directory-picker-card .directory-entry,
.directory-picker-card .directory-up {
  font-size: 14px;
  font-weight: 400;
}

.directory-picker-card .directory-entry span,
.directory-picker-card .directory-up span {
  color: var(--os-muted);
  font-size: 12px;
  font-weight: 500;
}

.directory-picker-card .directory-entry small,
.directory-picker-card .directory-up small {
  color: var(--os-text);
  font-size: 14px;
  font-weight: 400;
}

.info-dialog-card {
  width: min(1120px, calc(100vw - 36px));
  max-height: calc(100vh - 40px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
}

.info-dialog-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  overflow-x: auto;
}

.info-dialog-tabs button {
  height: 34px;
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.info-dialog-tabs button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.info-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.info-summary-grid article {
  display: grid;
  grid-template-columns: minmax(46px, 0.55fr) minmax(0, 1fr);
  gap: 8px;
  min-height: 72px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.info-summary-grid span,
.info-filter-row input {
  color: var(--muted);
}

.info-summary-grid strong {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.info-summary-grid strong span {
  color: var(--text);
  white-space: nowrap;
}

.info-dialog-panel {
  display: none;
  min-height: 0;
  overflow: auto;
}

.info-dialog-panel.active {
  display: grid;
  gap: 8px;
}

.info-filter-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.info-filter-row input {
  height: 38px;
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
}

.info-filter-row select {
  height: 38px;
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}

.info-daily-filter-row {
  justify-content: space-between;
}

.info-range-group,
.info-quick-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.info-range-group span {
  color: var(--muted);
  font-size: 13px;
}

.info-quick-range button {
  height: 34px;
  border-radius: 8px;
  font-weight: 600;
}

.info-daily-table .table-row {
  grid-template-columns:
    minmax(100px, 0.85fr)
    minmax(110px, 0.9fr)
    repeat(6, minmax(92px, 0.65fr));
  min-width: 860px;
}

.info-task-table .table-row {
  grid-template-columns:
    minmax(110px, 0.8fr)
    minmax(132px, 0.9fr)
    minmax(150px, 1.1fr)
    minmax(150px, 1fr)
    minmax(110px, 0.8fr)
    minmax(110px, 0.8fr)
    repeat(6, minmax(78px, 0.55fr));
  min-width: 1200px;
}

#adminAccountsTable.admin-table {
  padding: 6px;
}

#adminAccountsTable .table-row {
  grid-template-columns: minmax(120px, 1.15fr) repeat(3, minmax(72px, 0.55fr)) minmax(70px, 0.55fr) minmax(150px, 1fr);
  min-width: 680px;
  min-height: 34px;
  padding: 6px 10px;
  gap: 8px;
}

.account-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.account-row-actions button {
  height: 28px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
}

.info-account-form {
  max-width: 440px;
}

.info-dialog-note {
  color: var(--muted);
  font-size: 13px;
}

@media (max-height: 760px) {
  .directory-picker-card {
    height: calc(100vh - 32px);
  }

  .directory-shortcuts {
    max-height: 46px;
  }

  .review-issue-dialog-card {
    height: calc(100vh - 32px);
  }

  .review-issue-dialog-body img {
    max-height: 280px;
  }
}

/* Login gate */
.workspace-shell[hidden] {
  display: none;
}

.workspace-shell:not([hidden]) {
  display: contents;
}

.app-shell.logged-out {
  min-height: 100vh;
  padding: 0;
  display: block;
  background:
    linear-gradient(135deg, rgba(71, 102, 255, 0.08), transparent 28%),
    linear-gradient(315deg, rgba(34, 199, 243, 0.1), transparent 30%),
    #f8fbff;
}

.workbench-handoff-pending .login-gate {
  display: none;
}

.app-shell.logged-in {
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
}

.login-gate {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 48px 20px;
  color: #111827;
}

.login-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.72;
}

.login-backdrop span {
  position: absolute;
  display: block;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.48);
  filter: blur(8px);
}

.login-backdrop-left span:nth-child(1) {
  left: 44px;
  top: 88px;
  width: 120px;
  height: 68px;
}

.login-backdrop-left span:nth-child(2) {
  left: 146px;
  top: 220px;
  width: 190px;
  height: 132px;
}

.login-backdrop-left span:nth-child(3) {
  left: 78px;
  bottom: 210px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: rgba(103, 116, 255, 0.14);
}

.login-backdrop-right span:nth-child(1) {
  right: 120px;
  top: 148px;
  width: 270px;
  height: 116px;
}

.login-backdrop-right span:nth-child(2) {
  right: 72px;
  top: 315px;
  width: 360px;
  height: 170px;
}

.login-backdrop-right span:nth-child(3) {
  right: 250px;
  bottom: 176px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 111, 183, 0.16);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
  display: grid;
  justify-items: center;
  gap: 24px;
  padding: 12px 0;
  text-align: center;
}

.login-brand-mark {
  width: clamp(132px, 15vw, 210px);
  height: clamp(132px, 15vw, 210px);
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(15, 23, 42, 0.16));
}

.login-title-group {
  display: grid;
  gap: 10px;
}

.login-title-group h1 {
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0;
  color: #111827;
  white-space: nowrap;
}

.login-title-group h1::first-letter {
  color: #111827;
}

.login-title-group p {
  color: #7a86a0;
  font-size: 16px;
  font-weight: 400;
}

.login-form {
  width: min(100%, 470px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
}

.login-form label {
  display: grid;
  gap: 8px;
  text-align: left;
}

.login-form label span {
  color: #24304a;
  font-size: 14px;
  font-weight: 600;
}

.login-form input {
  width: 100%;
  height: 58px;
  border: 1px solid #cdd6e6;
  border-radius: 10px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.9);
  color: #111827;
  font-size: 14px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

.login-form input:focus {
  outline: none;
  border-color: #3264ff;
  box-shadow: 0 0 0 4px rgba(50, 100, 255, 0.13);
}

.login-form button {
  width: 100%;
  height: 58px;
  margin-top: 4px;
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

.login-status {
  min-height: 22px;
  color: #e64873;
  font-size: 14px;
  font-weight: 700;
}

.login-permission-note {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  width: min(calc(100vw - 32px), 640px);
  color: #7a86a0;
  font-size: 14px;
  font-weight: 600;
}

.app-shell.logged-in .login-gate {
  display: none;
}

.app-shell.auth-checking .login-gate,
.app-shell.auth-checking .workspace-shell {
  display: none;
}

@media (max-width: 720px) {
  .login-gate {
    align-items: start;
    padding: 48px 18px 86px;
  }

  .login-backdrop {
    opacity: 0.42;
  }

  .login-card {
    gap: 20px;
  }

  .login-title-group h1 {
    font-size: clamp(26px, 8.4vw, 34px);
    white-space: normal;
  }

  .login-title-group p {
    font-size: 15px;
  }

  .login-form input,
  .login-form button {
    height: 52px;
  }
}

/* 2026-07 production layout polish: keep current layout, fix header presence, compact generation bar, and real button affordance. */
:root {
  --pc-bg: #f7f8ff;
  --pc-panel: rgba(255, 255, 255, 0.92);
  --pc-line: #e4e8f5;
  --pc-text: #223047;
  --pc-muted: #6b7890;
  --pc-blue: #3264ff;
  --pc-violet: #9b7bff;
  --pc-pink: #ff7eb6;
  --pc-cyan: #35c9df;
  --pc-green: #13a464;
  --pc-red: #ef476f;
  --pc-shadow: 0 18px 45px rgba(73, 86, 135, 0.12);
}

body {
  background:
    linear-gradient(135deg, rgba(255, 126, 182, 0.10), transparent 30%),
    linear-gradient(155deg, transparent 0 58%, rgba(53, 201, 223, 0.12) 58% 78%, transparent 78% 100%),
    linear-gradient(180deg, #fffafe 0%, #f4fbff 46%, var(--pc-bg) 100%);
  color: var(--pc-text);
}

.topbar {
  min-height: 104px;
  grid-template-columns: minmax(310px, 0.9fr) minmax(520px, 1.4fr) minmax(190px, auto) minmax(300px, auto);
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(228, 232, 245, 0.96);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(250, 246, 255, 0.90)),
    linear-gradient(90deg, rgba(255, 126, 182, 0.16), rgba(155, 123, 255, 0.12), rgba(53, 201, 223, 0.12));
  box-shadow: 0 14px 36px rgba(73, 86, 135, 0.12);
}

.topbar::after {
  display: block;
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pc-pink), var(--pc-violet), var(--pc-cyan));
}

.brand-lockup {
  gap: 14px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  box-shadow: 0 15px 30px rgba(155, 123, 255, 0.22);
}

.brand-lockup h1 {
  color: #121a3f;
  font-size: 21px;
  font-weight: 700;
}

.tabs {
  height: 48px;
  padding: 6px;
  border: 1px solid rgba(228, 232, 245, 0.98);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.tab {
  height: 36px;
  min-width: 86px;
  padding: 0 16px;
  border-radius: 999px;
  color: #40506d;
  font-size: 14px;
  font-weight: 600;
}

.tab.active {
  color: var(--pc-blue);
  background: #fff;
  box-shadow: 0 8px 20px rgba(73, 86, 135, 0.10);
}

.system-status {
  height: 42px;
  padding: 5px 6px 5px 14px;
  border-color: var(--pc-line);
  background: rgba(255, 255, 255, 0.74);
}

.account-panel {
  max-width: none;
}

.production-shell {
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 22px 30px;
}

.product-sidebar,
.selection-overview,
.generation-command-bar,
.task-board,
.review-queue {
  border: 1px solid var(--pc-line);
  border-radius: 10px;
  background: var(--pc-panel);
  box-shadow: var(--pc-shadow);
}

.product-sidebar {
  top: 126px;
  max-height: calc(100vh - 150px);
}

.product-upload-panel {
  background:
    linear-gradient(135deg, rgba(255, 126, 182, 0.08), rgba(53, 201, 223, 0.08)),
    #fbfcff;
}

.upload-product-button,
.primary,
.action-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--pc-blue), var(--pc-violet) 56%, var(--pc-pink));
  box-shadow: 0 12px 24px rgba(155, 123, 255, 0.23);
}

.upload-product-button:hover:not(:disabled),
.primary:hover:not(:disabled),
.action-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #2458ef, #8567f4 56%, #f064ab);
}

.selection-overview {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  min-height: 86px;
}

.overview-card {
  grid-template-rows: 18px 28px 18px;
  gap: 4px;
  padding: 14px 18px;
}

.overview-card strong {
  font-size: 18px;
  line-height: 28px;
}

.generation-command-bar {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(230px, 1fr) minmax(150px, 0.55fr) minmax(250px, 0.75fr) 128px;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
}

.generation-command-bar .generation-field {
  min-height: 52px;
}

.generation-command-bar .generation-count-field {
  grid-column: 1 / 3;
  grid-row: 2;
  min-height: 42px;
}

.generation-command-bar .generation-select-field,
.generation-command-bar .generation-view-field,
.generation-command-bar .action-primary {
  grid-row: 2;
}

.generation-command-bar .generation-field:nth-of-type(2) {
  grid-column: 1 / 3;
  grid-row: 1;
}

.generation-command-bar .generation-field:nth-of-type(3) {
  grid-column: 3 / 6;
  grid-row: 1;
}

.generation-command-bar .selection-line,
.generation-select-field,
.generation-view-field {
  min-height: 42px;
  border: 1px solid var(--pc-line);
  border-radius: 9px;
  background: #fff;
}

.generation-command-bar .selection-line {
  grid-template-columns: minmax(0, 1fr) 82px;
  padding: 8px 12px;
  box-shadow: none;
}

.generation-command-bar .selection-line::before {
  display: none;
}

.generation-command-bar .selection-line > div > span,
.generation-select-field span,
.generation-view-field legend {
  color: var(--pc-muted);
  font-size: 12px;
  font-weight: 600;
}

.generation-command-bar .selection-line > div > strong {
  font-size: 13px;
}

.generation-command-bar .selected-thumb-strip {
  max-height: 34px;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  overflow: hidden;
}

.generation-command-bar .selected-thumb {
  grid-template-columns: 24px minmax(0, 1fr);
}

.generation-command-bar .selected-thumb img,
.generation-command-bar .selected-thumb-placeholder {
  width: 24px;
  height: 24px;
}

.generation-command-bar button.ghost {
  align-self: center;
  width: 78px;
  height: 34px;
  padding: 0 8px;
  font-size: 12px;
  white-space: nowrap;
}

.generation-select-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 10px;
}

.generation-select-field select {
  width: 100%;
  height: 28px;
  min-width: 0;
  border: 0;
  padding: 0;
  color: var(--pc-text);
  background: transparent;
  font-weight: 600;
}

.generation-view-field {
  display: flex;
  align-items: center;
  gap: 9px;
  height: auto;
  margin: 0;
  min-height: 42px;
  padding: 6px 10px;
}

.generation-view-field legend {
  padding: 0 5px;
}

.generation-view-field label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.generation-view-field input {
  accent-color: var(--pc-blue);
}

.generation-command-bar .action-primary {
  width: 100%;
  height: 42px;
  min-width: 0;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  border-color: transparent;
  background: linear-gradient(135deg, #6f5cf6, #c663f2 52%, #ff73b5);
  color: #fff;
  box-shadow: 0 10px 22px rgba(198, 99, 242, 0.24);
}

.task-board-head,
.review-toolbar {
  align-items: center;
}

.task-board-actions button,
.review-actions button,
.review-actions select,
.task-actions button,
.task-download-button,
.task-download-pending {
  height: 32px;
  border-radius: 8px;
  white-space: nowrap;
}

.task-board-actions button {
  min-width: 92px;
  font-weight: 600;
}

.task-table {
  min-width: 1260px;
}

.task-row {
  grid-template-columns: 116px minmax(170px, 1fr) 86px 58px 58px 78px 70px 118px 150px minmax(380px, 0.95fr);
  gap: 10px;
  padding: 8px 10px;
}

.task-row-head {
  min-height: 42px;
}

.task-actions {
  display: grid;
  grid-template-columns: repeat(7, minmax(48px, auto));
  justify-content: start;
  gap: 6px;
}

.task-actions button,
.task-download-button,
.task-download-pending {
  min-width: 48px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 600;
}

.task-actions [data-task-view],
.task-actions [data-task-refresh],
.task-actions [data-task-import] {
  border-color: #d6def0;
  background: #fff;
}

.task-actions [data-task-view]:hover,
.task-actions [data-task-refresh]:hover,
.task-actions [data-task-import]:hover {
  color: var(--pc-blue);
  border-color: #bfcfff;
  background: #f5f7ff;
}

.review-actions {
  gap: 8px;
}

.review-actions button,
.review-engine-select {
  min-width: 86px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
}

.review-actions #regenerateButton {
  min-width: 150px;
}

.review-actions #downloadApprovedReviewButton {
  min-width: 156px;
}

.review-actions #deleteAllReviewButton {
  min-width: 116px;
}

.review-items {
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 12px;
}

.review-item {
  border-radius: 10px;
}

.review-thumb {
  aspect-ratio: 1 / 1;
  background: #f8faff;
}

.review-body {
  min-height: 178px;
  padding: 9px;
}

.review-main strong {
  font-size: 14px;
  line-height: 20px;
}

.review-card-meta,
.review-card-foot,
.review-main span {
  font-size: 12px;
  line-height: 16px;
}

.review-status-actions {
  grid-template-columns: repeat(3, minmax(44px, 1fr));
  gap: 6px;
}

.review-status-actions button {
  height: 32px;
  font-size: 12px;
  border-radius: 8px;
}

.review-status-actions .review-pass {
  background: var(--pc-green);
  border-color: var(--pc-green);
}

.review-status-actions .danger-link {
  color: var(--pc-red);
}

@media (max-width: 1280px) {
  .topbar {
    grid-template-columns: minmax(260px, 1fr);
  }

  .tabs,
  .system-status,
  .account-panel {
    grid-column: 1;
    justify-self: stretch;
  }

  .generation-command-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .generation-command-bar .action-primary {
    grid-column: 1 / -1;
  }
}

.product-tabs {
  grid-template-columns: repeat(3, minmax(92px, 1fr));
}

.product-tabs button {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generation-count-field {
  min-height: 42px;
  border: 1px solid var(--pc-line, var(--line));
  border-radius: 9px;
  background: #fff;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, auto));
  gap: 8px;
  align-content: center;
  align-items: center;
  padding: 5px 10px;
  overflow: hidden;
}

.generation-count-field div {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
}

.generation-count-field span,
.generation-count-field em {
  display: block;
  color: var(--pc-muted, var(--muted));
  font-size: 12px;
  font-weight: 600;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generation-count-field strong {
  display: block;
  color: var(--pc-text, var(--text));
  font-size: 12px;
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generation-count-field em {
  font-style: normal;
  grid-column: 1 / -1;
  line-height: 1;
}

.compact-hidden-metric {
  display: none;
}

.task-summary-hidden {
  display: none !important;
}

.action-primary.needs-input,
.generation-command-bar .action-primary.needs-input {
  border-color: transparent;
  background: linear-gradient(135deg, #7a5cff, #ca67ef 54%, #ff78b6);
  color: #fff;
  box-shadow: 0 10px 22px rgba(202, 103, 239, 0.24);
}

.generation-command-bar .action-primary:hover:not(:disabled),
.generation-command-bar .action-primary.needs-input:hover:not(:disabled) {
  background: linear-gradient(135deg, #624bf1, #b956e2 54%, #f05fa7);
}

.task-table {
  min-width: 1120px;
}

.task-row {
  grid-template-columns: 116px minmax(160px, 1fr) 82px 52px 52px 72px 66px 112px 142px minmax(220px, 260px);
}

.task-actions {
  grid-template-columns: repeat(6, minmax(42px, 1fr));
  justify-content: stretch;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}

.task-actions button,
.task-download-pending {
  min-width: 0;
  width: 100%;
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1280px) {
  .generation-command-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .generation-command-bar .action-primary {
    grid-column: 1 / -1;
    height: 46px;
  }
}

@media (max-width: 700px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .workspace-shell,
  .topbar,
  .page,
  .production-shell,
  .product-sidebar,
  .main-workbench,
  .task-board,
  .review-queue,
  .manager-layout,
  .panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "status"
      "picker"
      "account";
    padding: 10px;
    gap: 10px;
  }

  .brand-lockup,
  .system-status,
  .tabs,
  .account-panel {
    min-width: 0;
    width: 100%;
  }

  .brand-lockup h1 {
    font-size: 18px;
  }

  .tabs {
    grid-column: auto;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tabs .tab {
    flex: 0 0 auto;
  }

  .production-shell,
  .manager-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .product-sidebar {
    position: static;
    top: auto;
    max-height: none;
  }

  .product-upload-panel,
  .mobile-bulk-only {
    display: none !important;
  }

  .sidebar-header,
  .product-tabs,
  .product-search-row,
  .task-board-head,
  .review-toolbar,
  .review-scope-filters,
  .review-filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .product-tabs,
  .review-filter-row,
  .task-board-actions,
  .review-actions,
  .review-status-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }

  .product-search-row,
  .generation-command-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .generation-command-bar {
    padding: 10px;
  }

  .generation-command-bar .selection-line {
    grid-template-columns: minmax(0, 1fr);
  }

  .generation-command-bar button.ghost,
  .generation-command-bar .action-primary,
  .review-actions button,
  .task-board-actions button,
  .review-scope-filters label,
  .review-scope-filters input,
  .review-scope-filters select,
  .review-scope-filters button {
    width: 100%;
    min-width: 0;
  }

  .product-list {
    grid-template-columns: minmax(0, 1fr);
    max-height: none;
  }

  .task-history {
    max-height: none;
    overflow: visible;
  }

  .task-table {
    min-width: 0;
    border: 0;
    display: grid;
    gap: 10px;
    overflow: visible;
  }

  .task-row-head {
    display: none;
  }

  .task-row:not(.task-row-head) {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-height: 0;
    padding: 36px 12px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
  }

  .task-row:not(.task-row-head)::before {
    content: "生图任务";
    position: absolute;
    top: 10px;
    left: 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
  }

  .task-row:not(.task-row-head) > span,
  .task-row:not(.task-row-head) > div {
    min-width: 0;
  }

  .task-row:not(.task-row-head) .task-time-cell,
  .task-row:not(.task-row-head) .task-progress-cell,
  .task-row:not(.task-row-head) .task-review-cell,
  .task-row:not(.task-row-head) .task-actions {
    grid-column: 1 / -1;
  }

  .task-row:not(.task-row-head) .task-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .task-row:not(.task-row-head) [data-task-delete] {
    display: none;
  }

  .review-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .review-thumb {
    aspect-ratio: 1 / 1;
  }

  .review-status-actions .danger-link,
  .review-regenerate-select {
    display: none;
  }

  .review-status-actions button {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
  }

  .admin-table,
  .plan-table,
  .info-task-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal,
  .dialog,
  .review-dialog {
    max-width: calc(100vw - 20px);
  }
}

@media (max-width: 430px) {
  .review-items {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-row:not(.task-row-head) {
    grid-template-columns: minmax(0, 1fr);
  }

  .review-status-actions button {
    flex-basis: 100%;
  }
}

/* 2026-07-16 消耗管理：异常优先成本驾驶舱 */
.consumption-page {
  padding: 0;
  background: #f7f8fc;
  align-items: stretch;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  z-index: 60;
}

.consumption-page .consumption-shell {
  width: 100vw;
  max-width: none;
  min-height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  background: #f7f8fc;
  box-shadow: none;
  overflow: visible;
}

.consumption-nav {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 14px;
  background: #fff;
  border-right: 1px solid #e7eaf3;
  display: flex;
  flex-direction: column;
}

.consumption-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 27px;
}

.consumption-brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.consumption-brand span { display: grid; gap: 2px; color: #1e2947; }
.consumption-brand strong { font-size: 14px; letter-spacing: .02em; }
.consumption-brand small { color: #7a839c; font-size: 12px; }

.consumption-nav nav { display: grid; gap: 6px; }
.consumption-nav nav button {
  width: 100%;
  min-height: 43px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #59637c;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
}
.consumption-nav nav button:hover { background: #f4f5fb; color: #3545d6; }
.consumption-nav nav button.active { background: #eef0ff; color: #4052e7; }
.consumption-nav-note { margin-top: auto; padding: 14px 10px; color: #9098ab; font-size: 12px; line-height: 1.7; }

.consumption-main {
  width: 100%;
  min-width: 0;
  padding: 22px 28px 36px;
  overflow: visible;
}

.consumption-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.consumption-title-line { display: flex; align-items: center; gap: 13px; }
.consumption-title-line > strong { color: #17223e; font-size: 28px; line-height: 1.25; }
.consumption-title-line > span { color: #68738e; font-size: 13px; }
.consumption-header p { margin: 6px 0 0; color: #8690a6; font-size: 13px; }
.consumption-header-actions { display: flex; align-items: center; gap: 10px; }
.consumption-range-tabs { display: flex; border: 1px solid #e0e4ef; border-radius: 10px; background: #fff; overflow: hidden; }
.consumption-range-tabs button {
  min-width: 64px;
  height: 40px;
  padding: 0 15px;
  border: 0;
  border-right: 1px solid #e9ebf2;
  border-radius: 0;
  background: #fff;
  color: #525d76;
}
.consumption-range-tabs button:last-child { border-right: 0; }
.consumption-range-tabs button.active { background: #5056e9; color: #fff; }
.consumption-header-actions > .ghost { height: 40px; background: #fff; }

.consumption-custom-range {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin: -7px 0 14px;
}
.consumption-page .hidden { display: none !important; }
.consumption-custom-range input { min-height: 38px; }

.consumption-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
  padding: 20px 8px;
  border: 1px solid #e4e7f0;
  border-radius: 12px;
  background: #fff;
}
.consumption-kpis article { min-width: 0; padding: 2px 22px; border-right: 1px solid #e9ebf2; display: grid; gap: 7px; }
.consumption-kpis article:last-child { border-right: 0; }
.consumption-kpis span { color: #707b93; font-size: 13px; }
.consumption-kpis strong { color: #2d3a5c; font-size: 30px; font-variant-numeric: tabular-nums; }
.consumption-kpis small { color: #9aa2b4; font-size: 12px; }
.consumption-kpis .risk strong { color: #f06b2c; }
.consumption-kpis .historical strong { color: #6773a4; }

.consumption-focus-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(310px, .8fr); gap: 14px; margin-bottom: 14px; }
.consumption-surface { border: 1px solid #e4e7f0; border-radius: 12px; background: #fff; }
.consumption-surface > header { min-height: 55px; padding: 0 18px; border-bottom: 1px solid #eceef4; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.consumption-surface > header > div { display: flex; align-items: baseline; gap: 9px; }
.consumption-surface > header strong { color: #26324f; font-size: 15px; }
.consumption-surface > header span, .consumption-surface > header small { color: #8a93a8; font-size: 12px; }
.consumption-surface > header em { color: #f05b55; font-size: 12px; font-style: normal; }
.trend-legend span { position: relative; padding-left: 11px; }
.trend-legend span::before { content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 6px; border-radius: 2px; background: #5965ee; transform: translateY(-50%); }
.trend-legend .risk::before { background: #f47b35; }
.trend-legend .historical::before { background: #aab1c7; }

.cost-trend-chart { height: 226px; padding: 24px 18px 17px; display: flex; align-items: stretch; gap: 7px; }
.trend-day { min-width: 0; flex: 1; display: grid; grid-template-rows: minmax(0, 1fr) 20px; gap: 7px; text-align: center; }
.trend-day > span { color: #8b94a7; font-size: 12px; }
.trend-bars { min-height: 0; border-bottom: 1px solid #e8eaf1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.trend-bars i { width: 7px; min-height: 0; border-radius: 3px 3px 0 0; background: #5965ee; }
.trend-bars i.risk { background: #f47b35; }
.trend-bars i.historical { background: #aab1c7; }

.cost-risk-tasks { min-height: 226px; padding: 10px 12px; display: grid; align-content: start; gap: 8px; }
.risk-task-row { min-height: 70px; padding: 12px 13px; border: 1px solid #f4d2cc; border-radius: 9px; background: #fff8f6; display: flex; justify-content: space-between; align-items: center; text-align: left; }
.risk-task-row span { display: grid; gap: 5px; }
.risk-task-row span:last-child { text-align: right; }
.risk-task-row strong { color: #303b58; font-size: 14px; }
.risk-task-row span:last-child strong { color: #ed5b37; }
.risk-task-row small { color: #9299aa; font-size: 12px; }

/* 2026-07-17 模特只读、原图名称和任务按钮清晰化 */
.manager-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.model-readonly-card {
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center;
  min-height: 106px;
  padding: 9px;
}

.model-readonly-card .manager-thumb {
  width: 88px;
  height: 88px;
}

.model-readonly-card .manager-main {
  gap: 7px;
}

.model-readonly-card .manager-main strong {
  font-size: 15px;
}

.model-readonly-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.model-readonly-status span {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  color: #475569;
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 600;
}

.product-card-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  justify-items: stretch;
  gap: 6px;
  width: 100%;
}

.product-card-main > * {
  grid-column: 1;
}

.product-card-main strong {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.product-card-main .product-card-meta {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.task-table {
  min-width: 1320px;
}

.task-row {
  grid-template-columns: 116px minmax(170px, 1fr) 86px 58px 58px 78px 76px 128px 150px minmax(380px, auto);
}

.task-actions {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: visible;
}

.task-actions button,
.task-download-pending {
  width: auto;
  min-width: max-content;
  padding: 0 11px;
  overflow: visible;
  text-overflow: clip;
}

@media (max-width: 700px) {
  .product-queue-item {
    grid-template-columns: 12px 22px 72px minmax(0, 1fr);
  }

  .product-card-main strong {
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .model-readonly-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .model-readonly-card .manager-thumb {
    width: 76px;
    height: 76px;
  }
}
.cost-empty { width: 100%; min-height: 88px; display: grid; place-items: center; color: #929aac; font-size: 13px; }
.cost-empty.success { color: #379667; }

.people-cost-panel, .cost-call-panel { margin-bottom: 14px; overflow: hidden; }
.people-cost-panel .billing-status { padding: 7px 18px 0; min-height: 27px; color: #8c94a6; font-size: 12px; }
.cost-people-table { width: 100%; overflow-x: auto; }
.cost-table-row {
  min-width: 1020px;
  min-height: 49px;
  padding: 0 18px;
  border-top: 1px solid #eff0f5;
  display: grid;
  grid-template-columns: 1.05fr 1.45fr 1.4fr 1fr .85fr .75fr .9fr .8fr;
  align-items: center;
  gap: 12px;
  color: #4c5771;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.cost-table-head { min-height: 38px; background: #f8f9fc; color: #737d94; font-size: 12px; font-weight: 700; }
.person-cell { display: flex; align-items: center; gap: 9px; color: #26324e; }
.person-cell b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #f0edff; color: #5b55c9; font-weight: 700; }
.warning-progress { display: flex; align-items: center; gap: 8px; }
.warning-progress > i { width: 100%; height: 8px; border-radius: 9px; background: #eceef4; overflow: hidden; }
.warning-progress > i b { display: block; height: 100%; border-radius: inherit; background: #56b877; }
.warning-progress em { min-width: 34px; color: #707990; font-size: 12px; font-style: normal; }
.risk-value { color: #ed682e; }
.cost-status { padding: 4px 8px; border: 0; border-radius: 6px; background: #eff9f2; color: #34905e; font-size: 12px; white-space: nowrap; }
.cost-status.near { background: #fff3e9; color: #e67328; }
.cost-status.alert { background: #fff0ee; color: #e45549; }
.cost-status.historical { background: #eff1fa; color: #66729f; }
.cost-status.muted { background: #f1f2f5; color: #798196; }
.text-button { padding: 3px 0; border: 0; background: transparent; color: #4e5be3; font-size: 12px; }

.cost-call-table { width: 100%; overflow-x: auto; }
.cost-call-row {
  min-width: 1180px;
  min-height: 55px;
  padding: 0 18px;
  border-top: 1px solid #eff0f5;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1.5fr 1.5fr 1.05fr .75fr .75fr .75fr;
  align-items: center;
  gap: 12px;
  color: #515c75;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.cost-call-row.uncertain { background: #fffaf7; }
.cost-call-row span { min-width: 0; overflow-wrap: anywhere; }
.cost-call-row span:has(small) { display: grid; gap: 4px; }
.cost-call-row strong { color: #35405c; font-size: 12px; }
.cost-call-row small { color: #949bad; font-size: 12px; }
.cost-call-panel label { color: #6e7890; font-size: 12px; }
.consumption-main > .info-dialog-note { padding: 0 3px; color: #9299aa; font-size: 12px; }

.consumption-page .info-dialog-panel:not(.active) { display: none; }
.consumption-page .info-dialog-panel[data-info-panel="tasks"],
.consumption-page .info-dialog-panel[data-info-panel="accounts"],
.consumption-page .info-dialog-panel[data-info-panel="newAccount"] { margin-top: 12px; padding: 18px; border: 1px solid #e4e7f0; border-radius: 12px; background: #fff; }

@media (max-width: 1100px) {
  .consumption-page .consumption-shell { grid-template-columns: 170px minmax(0, 1fr); }
  .consumption-main { padding: 20px 18px 30px; }
  .consumption-header { flex-direction: column; }
  .consumption-focus-grid { grid-template-columns: minmax(0, 1fr); }
  .consumption-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .consumption-kpis article:nth-child(2) { border-right: 0; }
  .consumption-kpis article:nth-child(-n+2) { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid #e9ebf2; }
}
