:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17211b;
  background: #f4f5f1;
  --ink: #17211b;
  --muted: #657069;
  --line: #d8ddd7;
  --soft: #f4f7f3;
  --primary: #1f6541;
  --primary-soft: #e8f3eb;
  --danger: #9b3329;
  --warning: #8a5a12;
  --warning-soft: #fff7e7;
}

.creator-body { background: #f5f2eb; color: #1f2b25; }
.creator-workspace { min-height: 100vh; }
.creator-header { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 18px 32px; background: rgba(255,255,255,.96); border-bottom: 1px solid #d8d3c8; }
.creator-nav { display: flex; gap: 8px; }
.creator-nav button.active { background: #244b3c; color: white; }
.creator-account-actions { justify-self: end; display: flex; gap: 8px; }
.creator-main { width: min(1080px, calc(100% - 40px)); margin: 36px auto 80px; }
.creator-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 28px 0; }
.creator-choice { min-height: 190px; padding: 28px; text-align: left; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; background: #fff; color: #1f2b25; border: 1px solid #d8d3c8; border-radius: 18px; }
.creator-choice:hover { border-color: #3f735e; box-shadow: 0 14px 34px rgba(31,43,37,.1); }
.creator-choice strong { font-size: 1.55rem; }
.creator-form-panel { max-width: 820px; margin: 0 auto; }
.creator-guidance { grid-column: 1 / -1; padding: 16px 18px; border-radius: 12px; background: #eef2ed; }
.creator-sticky-actions { position: sticky; bottom: 16px; grid-column: 1 / -1; padding: 14px; background: rgba(255,255,255,.96); border: 1px solid #d8d3c8; border-radius: 14px; }
.creator-manage-filters { display: flex; gap: 12px; align-items: end; margin: 20px 0; }
.creator-submission-list { display: grid; gap: 14px; }
.creator-submission-card { display: grid; grid-template-columns: 72px 1fr auto; align-items: center; gap: 18px; padding: 18px; background: white; border: 1px solid #d8d3c8; border-radius: 14px; }
.creator-submission-visual { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 12px; background: #dfe9e2; color: #244b3c; font-size: 1.4rem; font-weight: 700; }
@media (max-width: 760px) {
  .creator-header { grid-template-columns: 1fr auto; padding: 14px 18px; }
  .creator-nav { grid-row: 2; grid-column: 1 / -1; }
  .creator-choice-grid { grid-template-columns: 1fr; }
  .creator-submission-card { grid-template-columns: 52px 1fr; }
  .creator-submission-card > button { grid-column: 1 / -1; }
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, .button { min-height: 40px; border: 1px solid var(--primary); border-radius: 9px; padding: 9px 14px; color: #fff; background: var(--primary); font-weight: 700; cursor: pointer; }
button:hover { filter: brightness(.97); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #82b99a; outline-offset: 2px; }
button:disabled { opacity: .48; cursor: not-allowed; }
.button.secondary { color: #24533a; background: var(--primary-soft); }
.button.quiet { border-color: #bdc7c0; color: #405048; background: #fff; }
.button.danger { border-color: var(--danger); background: var(--danger); }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(1.65rem, 3vw, 2.2rem); }
h2 { margin-bottom: 6px; font-size: 1.55rem; }
h3 { margin-bottom: 6px; }
.muted, .field-help { color: var(--muted); }
.eyebrow { margin-bottom: 5px; color: #397050; font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
[hidden] { display: none !important; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top left, #e3efe6, #f4f5f1 55%); }
.login-card { width: min(440px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 18px 50px rgb(25 55 36 / 10%); }
.stack { display: grid; gap: 9px; }

.workspace { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 18px; color: #eef8f1; background: #183e2a; }
.brand { padding: 0 12px 26px; }
.brand .eyebrow { color: #9ecbb0; }
.brand strong { font-size: 1.2rem; }
.primary-nav { display: grid; gap: 7px; }
.primary-nav button { display: grid; gap: 2px; justify-items: start; border-color: transparent; color: #dcebe1; background: transparent; text-align: left; }
.primary-nav button small { color: #9eb7a6; font-weight: 500; }
.primary-nav button.active { border-color: #5b8b6c; color: #fff; background: #28583c; }
.sidebar-note { margin: auto 10px 0; color: #a9c0b0; font-size: .82rem; line-height: 1.55; }
.workspace-main { min-width: 0; }
.topbar { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px clamp(24px, 4vw, 54px); border-bottom: 1px solid var(--line); background: rgb(255 255 255 / 88%); }
.account-menu { display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: .9rem; }
.notice { margin: 18px clamp(24px, 4vw, 54px) 0; padding: 12px 15px; border: 1px solid #b7c5bb; border-radius: 10px; background: #fff; }
.notice[data-kind="error"] { border-color: #d9a39e; color: #86251d; background: #fff4f2; }
.notice[data-kind="success"] { border-color: #8ab99b; color: #235c36; background: #effaf2; }
.notice[data-kind="info"] { border-color: #b7c5bb; color: #405048; background: #f8faf8; }
.page-area { width: min(1220px, calc(100% - 48px)); margin: 24px auto 70px; }
.page-actions, .section-heading, .person-title-row, .status-line, .metrics, .form-actions, .button-row, .preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-actions { margin-bottom: 18px; }
.panel { margin-top: 18px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 5px 20px rgb(32 52 40 / 4%); }
.toolbar { display: grid; grid-template-columns: auto minmax(240px, 1fr) auto 180px; gap: 10px; align-items: center; margin-bottom: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
label { display: block; margin: 12px 0 6px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 42px; border: 1px solid #b8c2bb; border-radius: 8px; padding: 9px 11px; color: var(--ink); background: #fff; }
textarea { min-height: 105px; resize: vertical; }
textarea.long-copy { min-height: 180px; }
fieldset { min-width: 0; margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; }
legend { padding: 0 8px; font-size: 1rem; font-weight: 800; }
legend small, .tabs small { color: var(--muted); font-weight: 500; }
.form-grid.compact { display: grid; grid-template-columns: minmax(130px, auto) minmax(220px, 1fr); gap: 7px 14px; align-items: center; }
.form-grid.compact label { margin: 0; }
.form-grid.compact .field-help, .form-grid.compact .form-actions { grid-column: 2; }
.bilingual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 20px; }
.entity-list, .content-list { display: grid; gap: 10px; }
.entity-card, .content-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 22px; padding: 17px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.entity-card.focused { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(48, 107, 73, .15); }
.entity-card h3, .content-card h4 { margin-bottom: 4px; }
.card-meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .86rem; }
.card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; min-height: 27px; padding: 4px 9px; border: 1px solid #9fb5a5; border-radius: 999px; color: #31543e; background: #eef6f0; font-size: .78rem; font-weight: 750; }
.badge.warning { border-color: #d9b66e; color: #72470a; background: var(--warning-soft); }
.badge.readonly { border-color: #b9adb9; color: #5e4a5e; background: #f7f1f7; }
.person-header { margin-bottom: 18px; }
.person-title-row { margin: 14px 0 18px; }
.tabs { display: flex; gap: 5px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs button { min-width: max-content; border: 0; border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; color: #526159; background: transparent; }
.tabs button.active { border-bottom-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.slot-grid, .media-binding-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.slot-card, .media-binding-grid > section { padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.media-placeholder { aspect-ratio: 16 / 9; display: grid; place-items: center; margin-bottom: 14px; border-radius: 10px; color: #52715d; background: linear-gradient(145deg, #dfece3, #eef5f0); font-weight: 800; }
.media-placeholder:not(.portal) { width: 130px; aspect-ratio: 1; }
.media-placeholder img, .media-placeholder video, .content-thumbnail-preview img, .content-thumbnail-preview video { width: 100%; height: 100%; max-height: 260px; object-fit: contain; border-radius: 9px; }
.content-thumbnail-preview { min-height: 150px; display: grid; place-items: center; margin-bottom: 12px; border: 1px dashed #b8c2bb; border-radius: 10px; color: var(--muted); background: #fff; overflow: hidden; }
.file-name { margin-bottom: 7px; font-weight: 800; overflow-wrap: anywhere; }
.status-copy { margin: 5px 0; color: #526159; }
.callout { margin: 15px 0; padding: 14px 16px; border: 1px solid #b9c8be; border-radius: 10px; background: #f7faf7; }
.callout.warning { border-color: #d9b66e; color: #704708; background: var(--warning-soft); }
.callout.critical { border-color: #d79d96; color: #7e281f; background: #fff2f0; }
.callout.neutral { color: #46544d; background: #f0f4f1; }
.editor-drawer { margin-top: 20px; padding: 22px; border: 2px solid #9cbaa6; border-radius: 14px; background: #fbfdfb; }
.check-label { display: flex; align-items: center; gap: 9px; }
.check-label input { width: 20px; min-height: 20px; }
.split-view { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(420px, 1.2fr); gap: 20px; align-items: start; }
.inspection-preview { min-height: 220px; display: grid; place-items: center; gap: 10px; margin: 16px 0; padding: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #111; }
.inspection-preview img, .inspection-preview video { display: block; width: 100%; max-height: 480px; object-fit: contain; }
.inspection-preview .muted { margin: 0; color: #d4ddd7; }
.inspection-preview a { color: #c8f2d5; }
.review-content-context { display: grid; gap: 12px; }
.review-content-card { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--soft); }
.review-content-card .status-copy { grid-column: 1 / -1; }
.character-count { float: right; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.media-filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.media-filter-field { min-width: 0; }
.media-filter-field label { margin: 0 0 6px; }
.media-filter-field select { min-width: 0; }
.media-status-guide { margin: 0 0 12px; color: var(--muted); }
.media-status-guide summary { cursor: pointer; font-weight: 750; }
.media-status-guide dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 12px; margin: 9px 0 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); font-size: .84rem; }
.media-status-guide dt { font-weight: 800; }
.media-status-guide dd { margin: 0; }
.media-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overflow-y: visible; overscroll-behavior-inline: contain; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.media-table { width: 100%; min-width: 900px; table-layout: fixed; border-collapse: collapse; font-size: .78rem; }
.media-table th, .media-table td { min-width: 0; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }
.media-table th { color: #405048; background: var(--soft); text-align: left; }
.media-table tbody tr:last-child td { border-bottom: 0; }
.media-table tbody tr.focused { background: #eff8f1; }
.media-table th:first-child, .media-table td:first-child { width: 9%; }
.media-table th:nth-child(2), .media-table td:nth-child(2) { width: 21%; }
.media-table th:nth-child(3), .media-table td:nth-child(3) { width: 12%; }
.media-table th:nth-child(4), .media-table td:nth-child(4) { width: 9%; }
.media-table th:last-child, .media-table td:last-child { width: 11%; }
.media-thumb-cell img { display: block; width: 100%; max-height: 72px; object-fit: cover; border-radius: 7px; }
.media-thumb-cell small { display: block; margin-top: 5px; color: var(--muted); }
.media-primary { display: block; line-height: 1.3; }
.media-secondary { color: var(--muted); font-size: .75rem; }
.status-badge { display: inline-flex; align-items: center; max-width: 100%; min-height: 24px; padding: 3px 7px; border: 1px solid #b4c5b9; border-radius: 999px; color: #31543e; background: #f0f6f1; font-size: .72rem; font-weight: 750; line-height: 1.2; white-space: nowrap; }
.media-action-bar { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.media-action-bar .button, .media-row-details > summary { min-height: 30px; padding: 5px 7px; font-size: .72rem; }
.media-row-details { position: relative; }
.media-row-details > summary { display: inline-flex; align-items: center; cursor: pointer; border: 1px solid #a9b8ad; border-radius: 7px; background: #fff; font-weight: 750; list-style: none; }
.media-row-details > summary::-webkit-details-marker { display: none; }
.media-detail-popover { position: absolute; z-index: 5; right: 0; width: min(420px, 78vw); padding: 12px; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgb(30 45 35 / 18%); color: var(--ink); background: #fff; white-space: normal; }
.media-detail-popover p, .media-detail-popover ul { margin: 0 0 8px; }
.media-detail-popover .technical { margin-top: 8px; }
.media-upload-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.upload-task-card { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #f9fbf9; }
.upload-task-card h4, .upload-task-card p { overflow-wrap: anywhere; }
.technical { margin-top: 18px; padding: 12px 14px; border: 1px dashed #bfc8c1; border-radius: 9px; color: #58645d; background: #f8faf8; }
.technical summary { cursor: pointer; font-weight: 750; }
.technical dl { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 12px; margin-bottom: 0; font-size: .85rem; }
.technical dd { margin: 0; overflow-wrap: anywhere; }
.preview-surface { min-height: 300px; margin: 18px 0; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.preview-content { padding: 13px 0; border-top: 1px solid var(--line); }
.preview-content:first-of-type { border-top: 0; }
.publication-status-grid, .publication-processing-list { display: grid; gap: 12px; }
.publication-status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.publication-status-card, .processing-content-card, .processing-lane-card, .candidate-summary {
  min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--soft);
}
.publication-status-card h4, .processing-content-card h4, .processing-lane-card h5 { margin: 0 0 8px; }
.processing-lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.processing-lane-card[data-tone="idle"] { border-left: 4px solid #9aa59d; }
.processing-lane-card[data-tone="running"] { border-left: 4px solid #4e82b7; background: #f1f7fd; }
.processing-lane-card[data-tone="ready"] { border-left: 4px solid var(--primary); background: #f1f8f3; }
.processing-lane-card[data-tone="warning"] { border-left: 4px solid #d0a341; background: var(--warning-soft); }
.processing-lane-card[data-tone="failed"] { border-left: 4px solid #b8493d; background: #fff2f0; }
.processing-grid { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 12px; margin: 0; font-size: .84rem; }
.processing-grid dt { color: var(--muted); font-weight: 750; }
.processing-grid dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.processing-spinner { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border: 2px solid #b8cee2; border-top-color: #3e79ae; border-radius: 50%; animation: processing-spin .9s linear infinite; }
.candidate-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.candidate-summary ul { margin-bottom: 0; padding-left: 20px; }
@keyframes processing-spin { to { transform: rotate(360deg); } }
.field-error { color: #922c23; font-weight: 700; }
.recovery { margin: 14px 0; padding: 13px; border-radius: 9px; color: #374d67; background: #eef4ff; }
.upload-progress { margin: 18px 0; }
progress { width: 100%; height: 17px; margin: 12px 0; accent-color: #2b8a57; }
.metrics { color: var(--muted); font-variant-numeric: tabular-nums; }
.crop-dialog { width: min(920px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 16px; color: var(--ink); background: #fff; box-shadow: 0 24px 70px rgb(10 30 18 / 30%); }
.crop-dialog::backdrop { background: rgb(10 24 16 / 68%); }
.crop-dialog-shell { padding: clamp(18px, 3vw, 28px); overflow: auto; }
.crop-canvas { display: block; width: 100%; height: auto; max-height: 58vh; margin: 16px 0; border: 1px solid var(--line); border-radius: 11px; background: repeating-conic-gradient(#e4e8e4 0 25%, #fff 0 50%) 50% / 20px 20px; touch-action: none; cursor: move; }
.crop-dialog input[type="range"] { padding-inline: 0; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: 190px minmax(0, 1fr); }
  .page-area { width: min(100% - 32px, 1220px); }
  .bilingual-grid, .slot-grid, .media-binding-grid, .split-view { grid-template-columns: 1fr; }
  .media-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .media-table th:nth-child(4), .media-table td:nth-child(4),
  .media-table th:nth-child(6), .media-table td:nth-child(6),
  .media-table th:nth-child(9), .media-table td:nth-child(9) { display: none; }
  .review-content-card { grid-template-columns: 1fr; }
  .review-content-card .status-copy { grid-column: 1; }
  .publication-status-grid, .processing-lanes, .candidate-columns { grid-template-columns: 1fr; }
}

@media (max-width: 1320px) and (min-width: 761px) {
  .media-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px; }
  .brand, .sidebar-note { display: none; }
  .primary-nav { grid-template-columns: repeat(4, 1fr); }
  .primary-nav button { justify-items: center; padding-inline: 6px; }
  .topbar { align-items: flex-start; padding: 18px; }
  .account-menu { align-items: flex-end; flex-direction: column; }
  .notice { margin-inline: 16px; }
  .page-area { width: calc(100% - 24px); }
  .toolbar, .form-grid.compact { grid-template-columns: 1fr; }
  .form-grid.compact .field-help, .form-grid.compact .form-actions { grid-column: 1; }
  .entity-card, .content-card { grid-template-columns: 1fr; }
  .media-filters { grid-template-columns: 1fr 1fr; }
  .media-upload-fields { grid-template-columns: 1fr; }
  .media-table th:nth-child(3), .media-table td:nth-child(3),
  .media-table th:nth-child(5), .media-table td:nth-child(5),
  .media-table th:nth-child(7), .media-table td:nth-child(7) { display: none; }
}
