:root {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --accent: #22c55e;
  --danger: #ef4444;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #1f2937, var(--bg));
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px;
}

h1 {
  margin: 0;
  letter-spacing: 0.3px;
}

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

.card {
  background: color-mix(in srgb, var(--card) 88%, black);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px;
  margin-top: 16px;
}

label {
  display: block;
  margin-bottom: 8px;
  margin-top: 8px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-row input {
  width: auto;
  margin: 0;
}

.checkbox-row label {
  margin: 0;
  display: inline;
}

input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0b1220;
  color: var(--text);
}

select {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #0b1220;
  color: var(--text);
}

.row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.status-card {
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px;
  background: #0b1220;
}

.status-label {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-value {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.status-value[data-level="ok"] {
  color: var(--accent);
}

.status-value[data-level="warn"] {
  color: #f59e0b;
}

.status-value[data-level="error"] {
  color: var(--danger);
}

.status-note {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.progress-track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #0f172a;
  overflow: hidden;
  margin-top: 8px;
}

.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width 180ms ease;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  margin: 8px 0 6px;
}

.data-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
  background: #0b1220;
  border: 1px solid #334155;
  border-radius: 10px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid #1f2937;
}

.data-table th {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 11px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid #334155;
  font-size: 12px;
  text-transform: lowercase;
}

.status-pill-sent {
  border-color: #16a34a;
  color: #bbf7d0;
  background: color-mix(in srgb, #16a34a 20%, transparent);
}

.status-pill-failed {
  border-color: #ef4444;
  color: #fecaca;
  background: color-mix(in srgb, #ef4444 20%, transparent);
}

.status-pill-skipped {
  border-color: #f59e0b;
  color: #fde68a;
  background: color-mix(in srgb, #f59e0b 18%, transparent);
}

.status-pill-open {
  border-color: #f59e0b;
  color: #fde68a;
  background: color-mix(in srgb, #f59e0b 18%, transparent);
}

.status-pill-resolved {
  border-color: #16a34a;
  color: #bbf7d0;
  background: color-mix(in srgb, #16a34a 20%, transparent);
}

.status-pill-approved {
  border-color: #16a34a;
  color: #bbf7d0;
  background: color-mix(in srgb, #16a34a 20%, transparent);
}

.status-pill-draft {
  border-color: #3b82f6;
  color: #bfdbfe;
  background: color-mix(in srgb, #3b82f6 20%, transparent);
}

.status-pill-archived {
  border-color: #64748b;
  color: #cbd5e1;
  background: color-mix(in srgb, #64748b 22%, transparent);
}

.chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #334155;
  border-radius: 999px;
  font-size: 12px;
  color: #cbd5e1;
  background: #0b1220;
}

.metric-chip-empty {
  color: var(--muted);
}

.advanced-group-health-row {
  margin-top: 8px;
}

.advanced-group-action-row {
  margin-top: 4px;
}

#refreshSuggestedGroupBtn {
  min-width: 320px;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #334155;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  background: #0b1220;
}

.button-link:hover {
  border-color: var(--accent);
}

.primary-path-link {
  border-color: #3b82f6;
  background: color-mix(in srgb, #3b82f6 24%, #0b1220);
  color: #dbeafe;
}

.group-health-chip {
  text-decoration: none;
}

.group-health-chip[data-loading='1'] {
  opacity: 0.75;
  border-style: dashed;
  cursor: progress;
  pointer-events: none;
}

.group-health-chip[data-level='ok'] {
  border-color: #22c55e;
  color: #86efac;
  background: color-mix(in srgb, #22c55e 20%, transparent);
}

.group-health-chip[data-level='warn'] {
  border-color: #f59e0b;
  color: #fde68a;
  background: color-mix(in srgb, #f59e0b 20%, transparent);
}

.group-health-chip[data-level='error'] {
  border-color: #ef4444;
  color: #fca5a5;
  background: color-mix(in srgb, #ef4444 20%, transparent);
}

.workflow-list {
  margin-top: 0;
  margin-bottom: 12px;
  padding-left: 20px;
  line-height: 1.5;
}

.goal-map-focus {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.goal-map-focus-item {
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px;
  background: #0b1220;
}

.goal-map-focus-item h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.goal-map-focus-item p {
  margin: 0;
}

.publish-checklist {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #0b1220;
}

.checklist-title {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.checklist-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.queue-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}

.check-item {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #334155;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}

.check-item[data-done="true"] {
  color: #bbf7d0;
  border-color: #16a34a;
  background: color-mix(in srgb, #16a34a 20%, transparent);
}

.final-launch-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 10px;
}

.final-launch-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #0b1220;
}

.final-launch-item input {
  margin-top: 3px;
}

.final-launch-item span {
  color: #cbd5e1;
  line-height: 1.45;
}

.final-launch-item[data-done="true"] {
  border-color: #16a34a;
  background: color-mix(in srgb, #16a34a 18%, #0b1220);
}

.final-launch-item[data-done="true"] span {
  color: #bbf7d0;
}

.jump-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.jump-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #334155;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
}

.jump-links a:hover {
  border-color: var(--accent);
}

.jump-links .advanced-link {
  display: none;
}

body.show-advanced-panels .jump-links .advanced-link {
  display: inline-flex;
}

.token-status {
  margin-bottom: 0;
}

.operator-summary {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #0b1220;
  color: #cbd5e1;
  line-height: 1.4;
}

.issued-key-panel {
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px dashed #334155;
  border-radius: 10px;
  background: #0b1220;
}

.issue-receipt-grid {
  margin-top: 8px;
}

.issue-receipt-grid .status-value {
  font-size: 16px;
  line-height: 1.25;
  word-break: break-word;
}

.issue-receipt-grid #issueReceiptIssuedAtValue {
  font-size: 14px;
}

#issueResultDetails {
  margin-top: 10px;
}

#issueResultDetails > summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
}

#issueResultDetails pre {
  margin-top: 8px;
}

#issuedKey {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  font-size: 12px;
}

#copyIssuedKeyBtn {
  min-width: 116px;
}

.licenses-filter-row {
  margin-top: 8px;
}

#licensesEmailFilter {
  min-width: 240px;
}

#licensesPlanFilter {
  min-width: 140px;
}

.license-key-hint {
  font-size: 12px;
  color: #cbd5e1;
}

.license-copy-btn {
  min-width: 64px;
  padding: 4px 8px;
  font-size: 12px;
}

.content-result-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
}

.publish-lane {
  margin-top: 8px;
}

.publish-lane button {
  min-width: 190px;
}

.wizard-row {
  margin: 8px 0 10px;
}

.wizard-primary {
  min-width: 320px;
  background: linear-gradient(90deg, #2563eb, #4f46e5);
  border-color: #1d4ed8;
  color: #eef2ff;
}

.wizard-primary[data-mode='posted'] {
  background: linear-gradient(90deg, #b45309, #f59e0b);
  border-color: #92400e;
  color: #111827;
}

.wizard-primary[data-mode='next'] {
  background: linear-gradient(90deg, #15803d, #16a34a);
  border-color: #166534;
}

.wizard-primary[data-mode='locked'] {
  background: linear-gradient(90deg, #334155, #475569);
  border-color: #475569;
  color: #e2e8f0;
}

.wizard-primary:hover {
  border-color: #60a5fa;
}

.wizard-hint {
  margin: 8px 0 0;
}

.wizard-mode-row {
  margin-top: 8px;
}

.next-action-box {
  margin: 8px 0 10px;
  padding: 10px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #0b1220;
}

.next-action-label {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.next-action-text {
  margin: 6px 0 0;
  font-size: 14px;
  color: #e2e8f0;
}

.queue-snapshot-box {
  margin: 8px 0 10px;
  padding: 10px;
  border: 1px solid #334155;
  border-radius: 10px;
  background: #0b1220;
}

.posted-url-row {
  margin: 10px 0 0;
}

.posted-url-row label {
  display: block;
  margin-bottom: 6px;
}

.lane-note {
  margin: 8px 0 0;
}

#contentResultSummary {
  display: inline-block;
  line-height: 1.4;
}

.mini-heading {
  margin: 12px 0 6px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.advanced-details {
  margin-top: 12px;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 8px 10px;
  background: #0b1220;
}

.advanced-details > summary {
  cursor: pointer;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 8px;
}

#dailyQueueDiagnosticsDetails {
  margin-top: 10px;
}

.advanced-toggle-row {
  margin-top: 10px;
}

.recommended-action-box {
  margin-top: 8px;
}

.recommended-action-box .wizard-hint {
  margin: 6px 0 0;
}

.cheat-sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.cheat-sheet-item {
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 10px;
  background: #0a1428;
}

.cheat-sheet-item .sub {
  margin: 4px 0 0;
}

.cheat-sheet-title {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #bfdbfe;
}

.cheat-sheet-flow {
  margin-top: 8px;
  margin-bottom: 10px;
}

.admin-dialog {
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 0;
  max-width: 520px;
  width: calc(100% - 32px);
  background: #0b1220;
  color: #e5e7eb;
}

.admin-dialog::backdrop {
  background: rgba(2, 6, 23, 0.72);
}

.admin-dialog-card {
  margin: 0;
  padding: 16px;
}

.admin-dialog-card h3 {
  margin-top: 0;
}

#refreshStatus {
  margin: 8px 0 0;
}

#refreshStatus[data-level='error'] {
  color: #fca5a5;
}

#globalActionStatus {
  margin: 6px 0 0;
}

#globalActionStatus[data-level='success'] {
  color: #86efac;
}

#globalActionStatus[data-level='warn'] {
  color: #fde68a;
}

#globalActionStatus[data-level='error'] {
  color: #fca5a5;
}

.operator-health-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
}

.operator-health-value[data-level='ok'] {
  color: #86efac;
}

.operator-health-value[data-level='warn'] {
  color: #fde68a;
}

.operator-health-value[data-level='error'] {
  color: #fca5a5;
}

#toggleAdvancedBtn {
  min-width: 220px;
}

#toggleAdvancedGroupsBtn {
  min-width: 220px;
}

#toggleFocusModeBtn {
  min-width: 220px;
}

#toggleRawJsonBtn {
  min-width: 220px;
}

#openAdvancedWorkspaceBtn {
  min-width: 320px;
}

.raw-json-mode-status {
  margin: 8px 0 0;
}

.raw-json {
  display: none;
}

body.show-raw-json .raw-json {
  display: block;
}

.advanced-card {
  display: none;
}

body.show-advanced-panels .advanced-card {
  display: block;
}

body.token-missing .page > :is(section.card, details.card):not(:first-of-type):not(#adminAccessCard) {
  display: none;
}

body.token-missing .token-required-inline {
  display: none;
}

body.token-missing #adminAccessCard {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}

body:not(.show-full-admin) .focus-hide {
  display: none;
}

body.show-full-admin .focus-only {
  display: none;
}

body:not(.show-full-admin) :is(#advancedGroupHealthRow, #advancedGroupHealthHint, .advanced-group-action-row, .jump-links) {
  display: none;
}

.advanced-group {
  margin-top: 16px;
}

.advanced-group > summary {
  cursor: pointer;
  font-weight: 700;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.advanced-group[open] > summary {
  margin-bottom: 12px;
}

.advanced-group-body > .card {
  margin-top: 12px;
  background: color-mix(in srgb, var(--card) 82%, #020617 18%);
}

.advanced-group-body > .card:first-child {
  margin-top: 0;
}

button {
  border: 1px solid #334155;
  background: #0b1220;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}

button:hover {
  border-color: var(--accent);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  border-color: #334155;
}

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

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.35;
}

a {
  color: #93c5fd;
}
