:root {
  --surface-info: #f0f4ff; --surface-danger: #fff3f0; --focus: #7299ec;
  --background: #f5f7fb; --surface: #fff; --surface-muted: #edf1f5;
  --border: #e3e9f0; --text-primary: #192339; --text-secondary: #596b82;
  --accent: #344eb4; --accent-hover: #253b93; --sidebar: #111d35;
  --success: #12654e; --warning: #785b1c; --danger: #a13931; --info: #3159a0;
  --radius: 14px; --radius-control: 9px; --shadow: 0 4px 18px rgba(21, 42, 78, .035);
  --space-1: .25rem; --space-2: .5rem; --space-3: 1rem; --space-4: 1.5rem; --space-5: 2rem;
  --ink: var(--text-primary); --muted: var(--text-secondary); --line: var(--border); --canvas: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, "Segoe UI", system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid #7299ec !important; outline-offset: 2px; }
.skip-link { position: absolute; top: -60px; left: 12px; z-index: 1000; padding: 10px; background: #fff; }
.skip-link:focus { top: 10px; }
.app-shell { min-height: 100vh; display: flex; }
.app-sidebar { width: 236px; flex: 0 0 236px; background: var(--sidebar); color: #d5def0; display: flex; flex-direction: column; padding: 28px 14px 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; font-weight: 750; font-size: 16px; line-height: 1.1; letter-spacing: -.03em; padding: 2px 12px 32px; }
.brand:hover { color: #fff; }
.brand small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .2em; color: #a6b5d0; margin-top: 5px; font-weight: 600; }
.brand-mark { display: grid; place-items: center; flex: 0 0 36px; height: 36px; border-radius: 10px; background: #e9efff; color: #1d347a; font-size: 20px; font-weight: 800; letter-spacing: -.08em; }
.brand-mark span { color: #728df0; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-group-label { color: #8393ad; font-size: 10px; font-weight: 750; text-transform: uppercase; letter-spacing: .17em; margin: 20px 12px 8px; }
.side-nav a { color: #c2cde1; padding: 9px 12px; border-radius: 9px; font-size: 13px; font-weight: 550; }
.side-nav a:hover, .side-nav a:focus-visible { color: #fff; background: #233352; }
.side-nav a[aria-current="page"] { color: #fff; background: #344b80; box-shadow: inset 3px 0 0 #9cb3ff; }
.sidebar-footer { color: #788ba9; font-size: 11px; margin: auto 12px 0; padding-top: 28px; }
.sidebar-footer span { padding: 0 3px; }
.app-main { flex: 1; min-width: 0; }
.app-topbar { height: 70px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 3vw, 48px); }
.topbar-label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.topbar-user { font-size: 13px; font-weight: 600; color: var(--ink); padding: 7px 12px; max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
.topbar-user small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .12em; }
.shell-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }
.shell-breadcrumb a { color: var(--ink); font-weight: 700; }
.public-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 32px 18px; background: radial-gradient(ellipse at top, var(--surface-info), var(--background) 65%); }
.public-brand { display: flex; align-items: center; gap: 12px; font-weight: 750; font-size: 19px; }
.public-brand small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }
.login-panel { width: min(100%, 440px); }
.login-panel .card-body { padding: 32px; }
.login-panel .errorlist { color: var(--danger); padding-left: 18px; font-size: 13px; }
.public-footer { color: var(--muted); font-size: 12px; text-align: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.form-panel select { text-overflow: ellipsis; }
.table tbody tr:hover td { background: var(--background); }
.publication-media { max-width: 400px; margin: 0 auto; }
.operational-strip .metric-card { min-height: 0; padding: 16px 20px; box-shadow: none; }
.operational-strip .metric-value { font-size: 26px; }
.operational-strip .metric-label { margin-bottom: 10px; }
.side-nav:has(a[aria-current="page"]) { --nav-active: #9cb3ff; }
.app-topbar { position: sticky; top: 0; z-index: 25; }
.public-shell .login-panel { box-shadow: 0 18px 55px rgba(21, 42, 78, .07); border-radius: var(--radius); }
@media (max-width: 600px) { .detail-grid { grid-template-columns: 1fr; } .page-actions { justify-content: flex-start; } .table-responsive { overscroll-behavior-x: contain; } }
@media (max-width: 790px) { .shell-breadcrumb { margin: 0 auto 0 10px; } .shell-breadcrumb a, .shell-breadcrumb > span:first-of-type { display: none; } }
@media (max-width: 420px) { .shell-breadcrumb { font-size: 11px; } .topbar-user { max-width: 110px; padding: 4px; } }
.topbar-session { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.topbar-session form { margin: 0; }
.app-content { width: min(100%, 1500px); margin: 0 auto; padding: 32px clamp(20px, 3vw, 48px) 64px; }
.dashboard-message { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; transition: opacity .2s ease; }
.dashboard-message span { min-width: 0; overflow-wrap: anywhere; }
.dashboard-message .btn-close { flex: 0 0 auto; }
.dashboard-message.is-dismissing { opacity: 0; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.page-header h1 { font-weight: 750; letter-spacing: -.035em; margin: 0; font-size: clamp(24px, 2.6vw, 33px); }
.page-kicker { display: block; font-size: 11px; text-transform: uppercase; font-weight: 750; letter-spacing: .16em; color: var(--accent); margin-bottom: 7px; }
.page-subtitle { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.card, .panel, .table-panel, .filter-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.card { overflow: hidden; }
.card-body { padding: 23px; }
.panel { padding: 24px; }
.panel + .panel { margin-top: 18px; }
.panel-title { font-size: 16px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 34px 0 15px; }
.section-heading h2 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.section-heading a { font-size: 13px; font-weight: 650; }
.metric-card { padding: 21px 23px; min-height: 128px; }
.metric-label { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 17px; }
.metric-value { display: block; font-size: 34px; line-height: 1; letter-spacing: -.05em; font-weight: 750; }
.metric-value.analytics-rate { font-size: 24px; letter-spacing: -.03em; }
.analytics-bars { display: grid; gap: 12px; margin-bottom: 14px; }
.analytics-bar-row { display: grid; grid-template-columns: minmax(120px, 220px) 1fr 75px; gap: 12px; align-items: center; font-size: 12px; }
.analytics-bar-track { height: 10px; overflow: hidden; border-radius: 99px; background: #e9edf4; }
.analytics-bar-fill { display: block; height: 100%; border-radius: inherit; background: #536dcc; }
.analytics-bar-row strong { text-align: right; }
.metric-value.analytics-rate { font-size: 24px; letter-spacing: -.03em; }
.metric-note { color: var(--muted); font-size: 12px; margin-top: 9px; display: block; }
.metric-card.attention { border-color: #f1c3bb; background: #fffaf8; }
.metric-card.attention .metric-value { color: #a13c30; }
.table-panel { overflow: hidden; }
.table-panel .table-responsive { margin: 0; }
.table { margin: 0; font-size: 13px; vertical-align: middle; }
.table th { color: #697a91; background: #f9fbfd; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 750; white-space: nowrap; border-bottom: 1px solid var(--line); padding: 13px 17px; }
.table td { padding: 16px 17px; border-color: #edf1f5; color: #33435c; }
.table tr:last-child td { border-bottom: 0; }
.table a { font-weight: 650; }
.table .primary-cell { color: var(--ink); font-weight: 650; }
.table .secondary-line { display: block; font-size: 11px; font-weight: 400; color: var(--muted); margin-top: 3px; }
.empty-state { padding: 44px 25px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--ink); margin-bottom: 5px; }
.filter-panel { padding: 16px; margin-bottom: 18px; }
.filter-panel .row { align-items: end; }
.form-panel { max-width: 850px; }
.form-panel p { margin-bottom: 17px; }
.form-panel label, .card form label { display: block; font-size: 12px; color: #51627c; font-weight: 650; margin-bottom: 6px; }
.form-panel input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .form-panel textarea, .form-panel select, .card form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), .card form textarea, .card form select { display: block; width: 100%; min-height: 39px; border: 1px solid #d7e0ea; border-radius: 9px; padding: 8px 10px; background: #fff; color: var(--ink); }
.form-panel textarea, .card form textarea { min-height: 100px; }
.form-panel .helptext { display: block; font-size: 11px; color: var(--muted); margin-top: 5px; }
.form-panel .errorlist { color: var(--danger); font-size: 12px; padding-left: 18px; }
.form-label { font-size: 12px; color: #51627c; font-weight: 650; margin-bottom: 6px; }
.form-control, .form-select { border-color: #d7e0ea; border-radius: 9px; min-height: 39px; }
.form-control:focus, .form-select:focus { border-color: #7e98d8; box-shadow: 0 0 0 .2rem rgba(68, 94, 180, .15); }
.btn { border-radius: 9px; font-weight: 650; font-size: 13px; padding: 9px 14px; }
.btn-sm { padding: 6px 10px; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline-primary { color: var(--accent); border-color: #b6c3e9; }
.btn-outline-primary:hover { background: var(--accent); border-color: var(--accent); }
.status-badge { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 11px; font-weight: 750; letter-spacing: .015em; padding: 5px 9px; border-radius: 6px; color: #51627c; background: #edf1f5; }
.status-badge[data-status="APPROVED"], .status-badge[data-status="PUBLISHED"], .status-badge[data-status="COMPLETED"], .status-badge[data-status="CONNECTED"], .status-badge[data-status="ONLINE"] { color: var(--success); background: #e3f5ed; }
.status-badge[data-status="IN_REVIEW"], .status-badge[data-status="READY"], .status-badge[data-status="CLAIMED"], .status-badge[data-status="PROCESSING"], .status-badge[data-status="RUNNING"], .status-badge[data-status="PUBLISHING"] { color: var(--info); background: #e9f1ff; }
.status-badge[data-status="SCHEDULED"], .status-badge[data-status="PENDING"] { color: var(--warning); background: #fcf2d8; }
.status-badge[data-status="FAILED"], .status-badge[data-status="REJECTED"], .status-badge[data-status="ERROR"], .status-badge[data-status="EXPIRED"] { color: var(--danger); background: #fdeae7; }
.status-badge[data-status="OUTCOME_UNKNOWN"] { color: #812e22; background: #ffd5c9; border: 1px solid #df8b77; }
.status-badge[data-status="DRAFT"], .status-badge[data-status="CANCELLED"], .status-badge[data-status="REVOKED"], .status-badge[data-status="OFFLINE"] { color: #58677d; background: #e9edf2; }
.status-badge[data-status="EXPIRING"] { color: #865c13; background: #fff0cb; }
.notice-critical { border-left: 4px solid #bf4939; background: #fff3f0; border-radius: 9px; padding: 16px 18px; color: #733329; }
.notice-info { border-left: 4px solid #627cd2; background: #f0f4ff; border-radius: 9px; padding: 16px 18px; color: #304474; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px 25px; }
.detail-grid dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.detail-grid dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.body-copy { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.editorial-candidate { gap: 0; }
.editorial-candidate-selected { border-color: #7d9acb; background: #f7faff; box-shadow: 0 0 0 2px rgba(52, 78, 180, .12); }
.editorial-score { color: #42536d; font-size: 12px; font-weight: 700; white-space: nowrap; }
.editorial-hook { font-size: 16px; font-weight: 600; }
.editorial-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: end; }
.editorial-actions form:last-child { flex: 1 1 100%; }
.editorial-actions .form-select { flex: 1 1 160px; width: auto; }
.editorial-disclosure, .editorial-technical { overflow-wrap: anywhere; }
.editorial-disclosure { border-top: 1px solid var(--line); padding-top: 12px; }
.editorial-disclosure summary, .editorial-technical > summary { color: var(--accent); cursor: pointer; font-size: 13px; font-weight: 700; }
.editorial-disclosure[open] summary, .editorial-technical[open] > summary { margin-bottom: 4px; }
.break-anywhere { overflow-wrap: anywhere; }
.preview-image { max-width: 92px; max-height: 112px; border-radius: 8px; object-fit: cover; }
.pagination-wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 18px 0; font-size: 12px; color: var(--muted); }
.mobile-navigation { display: none; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: reduce) { .dashboard-message { transition: none; } }
@media (max-width: 1050px) { .app-sidebar { width: 210px; flex-basis: 210px; } .app-content { padding-left: 22px; padding-right: 22px; } }
@media (max-width: 790px) {
  .app-sidebar { display: none; }
  .app-topbar { height: 62px; padding: 0 18px; }
  .mobile-navigation { display: block; position: relative; }
  .mobile-navigation summary { list-style: none; cursor: pointer; color: var(--ink); font-weight: 700; padding: 8px 10px; border-radius: 8px; }
  .mobile-navigation summary::-webkit-details-marker { display: none; }
  .mobile-navigation-panel { position: absolute; z-index: 20; top: 42px; left: 0; width: min(285px, calc(100vw - 36px)); max-height: calc(100vh - 75px); overflow-y: auto; padding: 12px; background: var(--sidebar); border-radius: 12px; box-shadow: 0 16px 35px rgba(10, 20, 42, .28); }
  .topbar-label { margin-right: auto; margin-left: 15px; }
  .app-content { padding: 24px 18px 48px; }
}
@media (max-width: 600px) {
  .analytics-bar-row { grid-template-columns: 100px 1fr 62px; }
  .editorial-actions { display: grid; grid-template-columns: 1fr; }
  .editorial-actions form, .editorial-actions .btn { width: 100%; }
  .page-header { flex-direction: column; }
  .page-actions { width: 100%; justify-content: flex-start; }
  .page-actions .btn { flex: 1 1 auto; }
  .topbar-label { display: none; }
  .detail-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 105px; padding: 17px; }
  .metric-value { font-size: 28px; }
  .table { min-width: 760px; }
  .table th:first-child, .table td:first-child { min-width: 180px; }
  .topbar-session { max-width: 70%; }
  .topbar-user { max-width: calc(100% - 58px); white-space: nowrap; }
}

/* Content hub: real links, keyboard focus and horizontal overflow on mobile. */
.hub-tabs { display: flex; gap: .35rem; overflow-x: auto; padding: .3rem; border-bottom: 1px solid var(--border, #dfe3e8); }
.hub-tabs a { flex: 0 0 auto; padding: .7rem 1rem; border-radius: .4rem; text-decoration: none; }
.hub-tabs a[aria-current="page"] { background: #e9eef7; color: #243b63; font-weight: 700; text-decoration: underline; text-underline-offset: .35rem; }
.hub-tabs a:focus-visible { outline: 3px solid #4361aa; outline-offset: 2px; }
.hub-breadcrumb, .hub-asset { overflow-wrap: anywhere; min-width: 0; }
.area-help { color: var(--text-secondary); max-width: 80ch; line-height: 1.6; margin-bottom: var(--space-4); }
.next-step { border-left: 4px solid var(--accent); }
.summary-links { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-4); }
.action-link { font-weight: 650; padding: var(--space-2) 0; }
.entity-link { color: var(--text-primary); font-weight: 650; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: .2em; }
.technical-link { font-family: ui-monospace, monospace; font-size: .8rem; color: var(--text-secondary); overflow-wrap: anywhere; }
.hub-breadcrumb { font-size: .8rem; color: var(--text-secondary); }
.hub-breadcrumb a { color: inherit; text-decoration: underline; text-underline-offset: .2em; }
.technical-details { background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius-control); padding: var(--space-3); color: var(--text-secondary); overflow-wrap: anywhere; font-size: .85rem; }
.technical-details summary { cursor: pointer; font-family: inherit; font-weight: 650; color: var(--text-primary); }
.technical-details[open] summary { margin-bottom: var(--space-3); }
.technical-details dd { font-family: ui-monospace, monospace; }
.btn { min-height: 40px; padding: .55rem .9rem; border-radius: var(--radius-control); display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); }
.btn-sm { min-height: 34px; padding: .35rem .65rem; }
.btn-ghost { color: var(--accent); background: transparent; border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--accent-hover); background: var(--surface-muted); }
.btn-secondary { background: var(--surface-muted); color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); color: var(--text-primary); border-color: var(--border); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; }
.side-nav a { min-height: 40px; display: flex; align-items: center; }
.nav-group-label { color: #a6b5d0; }
.palette-swatch { display: inline-block; width: 2.5rem; height: 1rem; border: 1px solid #8794a5; border-radius: .3rem; vertical-align: middle; }
.swatch-cool { background: linear-gradient(90deg, #171a21, #2b3544); }
.swatch-warm { background: linear-gradient(90deg, #1c1a20, #382e34); }
.swatch-neutral { background: linear-gradient(90deg, #191e23, #30383f); }
.swatch-blue { background: linear-gradient(90deg, #18202a, #293c4e); }
.swatch-earth { background: linear-gradient(90deg, #28251f, #403a2f); }
.swatch-mono { background: linear-gradient(90deg, #1d1d1d, #3b3b3b); }
.swatch-light { background: linear-gradient(90deg, #e5e1d8, #f4f1eb); }
.swatch-unknown { background: var(--surface-muted); }
.analytics-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.analytics-summary .metric-value { font-size: 1.5rem; line-height: 1.35; letter-spacing: -.02em; }
.analytics-summary > section { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 1100px) { .analytics-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .analytics-summary { grid-template-columns: 1fr; } .section-heading { flex-wrap: wrap; } }
/* Compact Content overview: three / two / one columns. */
.overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.overview-card { display: flex; flex-direction: column; min-width: 0; }
.overview-card .action-link { margin-top: auto; }
.overview-next { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.overview-next .btn { flex-shrink: 0; }
@media (max-width: 1199px) { .overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .overview-grid { grid-template-columns: 1fr; } .overview-next { align-items: stretch; flex-direction: column; } }

/* File resolution never determines dashboard preview dimensions. */
:root {
  --media-preview-portrait-width: 320px;
  --media-preview-feed-width: 480px;
  --media-preview-max-height: min(640px, 80vh);
  --media-preview-thumbnail-height: 300px;
}
.media-preview {
  --preview-ratio: 1;
  --preview-width: var(--media-preview-feed-width);
  display: grid; width: min(100%, var(--preview-width), calc(var(--media-preview-max-height) * var(--preview-ratio)));
  aspect-ratio: var(--preview-ratio); min-width: 0; overflow: hidden;
  background: var(--surface-muted); border-radius: var(--radius-control);
}
.media-preview--portrait { --preview-ratio: .5625; --preview-width: var(--media-preview-portrait-width); }
.media-preview--feed { --preview-ratio: .8; }
.media-preview__image, .media-preview__video {
  display: block; width: 100%; height: 100%; min-width: 0; min-height: 0;
  max-height: var(--media-preview-max-height); object-fit: contain;
}
.media-preview--thumbnail {
  width: min(100%, var(--media-preview-portrait-width));
  height: min(var(--media-preview-thumbnail-height), 60vh);
  aspect-ratio: auto; margin-inline: auto;
}
.media-preview--thumbnail > * { max-height: min(var(--media-preview-thumbnail-height), 60vh); }
.media-preview--job { margin-inline: auto; }
.job-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.job-detail-info, .job-detail-preview { min-width: 0; overflow-wrap: anywhere; }
.job-detail-preview { padding: var(--space-3); }
[data-private-preview] [hidden] { display: none !important; }
@media (min-width: 1280px) {
  .job-detail-layout { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
}
