/* Admin workspace: system fonts, no remote assets or UI dependencies. */
:root { color-scheme: light; --bg: #f5f6f8; --card: #fff; --line: #e3e7ec; --text: #202c36; --muted: #66747f; --accent: #176a60; --danger: #b33c3c; --ok: #176a60; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #66afa4; outline-offset: 3px; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .55; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(26px, 3vw, 34px); line-height: 1.2; letter-spacing: -.035em; margin-bottom: 10px; font-weight: 650; overflow-wrap: anywhere; }
h2 { font-size: 18px; line-height: 1.35; letter-spacing: -.025em; margin-bottom: 6px; font-weight: 650; }
h3 { font-size: 15px; margin-bottom: 4px; font-weight: 600; }
p { margin-bottom: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .14em; margin-bottom: 10px; }
.admin-header { height: 80px; padding: 0 max(28px, calc((100vw - 1280px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: var(--card); }
.brand, .admin-header-right { display: flex; align-items: center; gap: 14px; }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; background: var(--accent); color: white; border-radius: 11px 11px 11px 3px; font-size: 19px; font-weight: 650; letter-spacing: -.07em; flex-shrink: 0; }
.brand-name { display: block; font-weight: 650; font-size: 15px; letter-spacing: -.02em; }
.brand-caption { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.environment-badge { background: #eff2f5; color: #566471; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.account-name { color: var(--muted); font-size: 12px; }
.admin-main { max-width: 1336px; padding: 32px 28px 64px; margin: auto; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 12px 0 28px; }
.page-heading p:last-child { margin-bottom: 0; }
.event-heading { margin-top: 24px; margin-bottom: 24px; align-items: flex-start; }
.event-heading-text { min-width: 0; }
.count-badge { border: 1px solid var(--line); padding: 7px 12px; border-radius: 8px; white-space: nowrap; color: var(--muted); font-size: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; min-width: 0; }
.btn { min-height: 42px; padding: 9px 15px; border: 1px solid #d8dee4; border-radius: 8px; background: white; color: var(--text); font-size: 12px; font-weight: 600; transition: background 120ms, border-color 120ms; }
.btn:hover { background: #f6f8f9; border-color: #aab7c0; }
.btn-primary { color: white; background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: #10564e; border-color: #10564e; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); }
.btn-small { min-height: 40px; padding: 8px 12px; font-size: 12px; }
input, select, textarea { min-height: 42px; border: 1px solid #d8dee4; border-radius: 8px; background: white; padding: 10px 12px; color: var(--text); max-width: 100%; min-width: 0; }
input::placeholder { color: #7a8791; }
input:hover, select:hover { border-color: #aab7c0; }
a, .link { color: var(--accent); }
.link { border: 0; padding: 0; background: transparent; font: inherit; text-align: left; }
.back-link { font-size: 12px; font-weight: 600; color: var(--muted); }
.back-link:hover { color: var(--accent); }
.row-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding-top: 24px; }
.access-menu { position: relative; }
.access-menu summary { color: var(--muted); cursor: pointer; padding: 12px; border-radius: 8px; font-size: 12px; white-space: nowrap; }
.access-menu[open] summary { background: #e9edf0; }
.access-menu-body { position: absolute; z-index: 5; top: 100%; right: 0; width: 250px; padding: 18px; margin-top: 8px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 36px #202c3614; }
.access-menu-body p { margin-bottom: 8px; }
.access-menu-body button { color: var(--danger); }
.event-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-bottom: 25px; font-size: 13px; }
.summary-label { color: var(--muted); font-size: 10px; letter-spacing: .1em; font-weight: 600; }
.summary-online { color: var(--ok); font-weight: 600; }
.summary-caption { font-size: 11px; color: var(--muted); margin-left: auto; }
.section-nav { display: flex; gap: 28px; border-bottom: 1px solid #dce2e6; margin-bottom: 26px; }
.section-button { min-height: 46px; border: 0; border-bottom: 2px solid transparent; padding: 0 2px 12px; margin-bottom: -1px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.section-button:hover { color: var(--text); }
.section-button[aria-pressed="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.artwork-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; align-items: start; }
.back-card { padding: 22px; }
.back-card .assign-row { display: flex; flex-direction: column; gap: 12px; }
.back-card .thumb { width: 100%; height: 277px; padding: 15px; }
.back-card select { width: 100%; font-size: 11px; }
.back-card .upload, .back-card .upload .btn { width: 100%; }
.section-hint { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.7; }
.assignment-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px 14px; margin-top: 22px; }
.assignment-grid .assign-row { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.assignment-caption { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 11px; color: var(--muted); }
.code { display: inline-grid; place-items: center; color: var(--text); background: #eef1f4; width: 26px; height: 26px; border-radius: 6px; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.thumb { display: flex; align-items: center; justify-content: center; width: 100%; height: 200px; border: 1px solid #e5e9e9; border-radius: 9px; overflow: hidden; background: #f0f3f2; padding: 10px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb-empty { color: var(--muted); font-size: 12px; }
.assignment-grid select { width: 100%; font-size: 11px; padding: 8px; text-overflow: ellipsis; }
.upload { position: relative; display: inline-flex; overflow: hidden; border-radius: 8px; }
.upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; min-height: 0; }
.upload:focus-within { outline: 3px solid #66afa4; outline-offset: 3px; }
.upload .btn { text-align: center; }
.assignment-grid .upload { width: 100%; }
.assignment-grid .upload .btn { width: 100%; }
.mapping-card, .live-card { padding: 28px; }
.mapping-card > .muted { max-width: 700px; }
.mapping-notice { color: #526d65; background: #eff6f2; border: 1px solid #e0ece5; padding: 12px 16px; border-radius: 8px; font-size: 12px; margin: 20px 0; }
.panel-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.panel-table th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; padding: 12px; text-align: left; }
.panel-table th:first-child { width: 80px; }
.panel-table th:last-child { width: 90px; }
.panel-table td { padding: 10px 12px; border-top: 1px solid var(--line); }
.panel-table td:first-child { font-weight: 650; }
.panel-table input { width: 100%; font-size: 13px; }
.panel-table .btn { width: 100%; }
/* A row with edits that have not been saved yet, so several rows can be typed
   before saving them one at a time without anyone losing track of which is
   which. `is-error` additionally marks a save the server refused. */
.panel-table tr.is-dirty td { background: #fffdf4; }
.panel-table tr.is-dirty input { border-color: #dcb76d; }
.panel-table tr.is-error input { border-color: #c9776b; }
.row-status { display: block; margin-top: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: #9a7423; }
.panel-table tr.is-error .row-status { color: #a5453a; }
.status-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.status-chip { position: relative; display: grid; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; font-size: 13px; }
.status-chip::after { content: ''; position: absolute; right: 18px; top: 26px; width: 7px; height: 7px; border-radius: 50%; background: #a0a9b2; }
.status-chip[data-online="true"]::after { background: #278a6d; }
.status-chip[data-status="pending"] { border-color: #dcb76d; background: #fffcf5; }
.status-chip .muted { font-size: 11px; }
.status-chip .code { margin-bottom: 8px; }
.events-card { padding: 0; overflow: hidden; }
.list-toolbar { padding: 22px 26px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.list-toolbar h2 { margin: 0; }
.event-search { width: 280px; background: #f8fafb; font-size: 12px; }
.event-list { list-style: none; padding: 0; margin: 0; }
.event-list li + li { border-top: 1px solid #edf0f3; }
.event-link { display: flex; align-items: center; gap: 18px; width: 100%; padding: 19px 26px; border: 0; background: white; color: var(--text); text-align: left; }
.event-link:hover { background: #f7faf9; }
.event-symbol { font-size: 20px; color: #5f7b72; display: grid; place-items: center; width: 42px; height: 46px; background: #edf3ef; border: 1px solid #e1e9e4; border-radius: 8px; flex-shrink: 0; }
.event-info { min-width: 0; flex: 1; }
.event-name { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.event-id { display: block; font-family: ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; margin-top: 5px; }
.event-version { font-size: 11px; color: var(--muted); white-space: nowrap; }
.event-arrow { color: var(--muted); font-size: 19px; margin-left: 12px; }
.empty-state { padding: 28px; color: var(--muted); text-align: center; }
.create-section { padding: 24px 26px; background: #fafbfc; border-top: 1px solid var(--line); }
.create-section p { font-size: 12px; }
.inline-form { display: flex; gap: 10px; max-width: 540px; }
.inline-form input { flex: 1; width: 100%; }
.inline-form button { white-space: nowrap; }
.login-card { max-width: 420px; margin: 10vh auto; padding: 38px; box-shadow: 0 8px 40px #202c3605; }
.login-card > .brand-mark { margin-bottom: 30px; width: 46px; height: 46px; font-size: 24px; }
.login-card h1 { font-size: 30px; }
.login-form { display: grid; gap: 8px; margin-top: 28px; }
.field-label { font-size: 12px; font-weight: 600; margin-top: 8px; }
.login-form .btn { margin-top: 16px; }
.login-environment { text-align: center; font-size: 10px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 22px; margin: 18px 0 0; }
.error { color: var(--danger); min-height: 20px; font-size: 12px; margin: 0; }
.card-warning { margin: 24px auto; max-width: 1280px; background: #fffaf0; border-color: #e9d5ab; }
.token-box { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.links-card .btn, .screen-links .btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.link-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.package-card { background: #f6f9f8; border: 1px solid var(--line); border-radius: 10px; padding: 22px; margin-top: 24px; }
.package-card p { margin-bottom: 0; }
.package-steps { padding-left: 22px; margin: 22px 0; color: var(--muted); font-size: 13px; }
.package-steps li { padding: 4px 0; }
.screen-links { margin-top: 20px; }
.screen-link-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.screen-link-row input { width: 100%; font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
/* The operator link leads the section: same row shape, no screen-code column. */
.operator-card { padding: 18px 20px; margin-bottom: 22px; border: 1px solid #d9c9a3; border-radius: 10px; background: #fffdf6; }
.operator-card h3 { margin: 0 0 6px; }
.operator-link-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; margin-top: 10px; }
.operator-link-row input { width: 100%; font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
.operator-card .btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.operator-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid #ece2c8; }
.operator-actions .muted { flex: 1; min-width: 220px; font-size: 11px; }
.display-import { display: flex; gap: 10px; margin: 20px 0; }
.display-import input { flex: 1; }
/* CMS framing policy: an editable field plus the header value it produces. */
.frame-ancestors { margin: 24px 0 4px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf6; }
.frame-ancestors h3 { margin: 0 0 6px; }
.frame-ancestors-form { display: flex; gap: 10px; margin: 14px 0 8px; }
.frame-ancestors-form input { flex: 1; font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
.frame-ancestors .section-hint { font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.cms-link-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0 0; }
.cms-link-row input { width: 100%; font-size: 12px; font-family: ui-monospace, Consolas, monospace; }
.toast { position: fixed; z-index: 20; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: #253b34; color: white; padding: 14px 22px; max-width: calc(100vw - 32px); width: max-content; border-radius: 10px; box-shadow: 0 8px 30px #20352a26; opacity: 0; pointer-events: none; transition: opacity 150ms, transform 150ms; font-size: 13px; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast-error { background: var(--danger); }
.page-landing { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.page-landing .card { max-width: 560px; }
.loading { text-align: center; padding: 15vh 24px; color: var(--muted); }
@media (max-width: 1150px) {
  .assignment-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .row-actions { padding-top: 0; }
  .event-heading { flex-direction: column; gap: 16px; }
  .thumb { height: 215px; }
}
@media (max-width: 760px) {
  .admin-header { height: 70px; padding: 0 20px; }
  .admin-main { padding: 24px 20px 48px; }
  .account-name { display: none; }
  .artwork-layout { grid-template-columns: 1fr; gap: 20px; }
  .back-card .assign-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; }
  .back-card .thumb { width: 96px; height: 150px; grid-row: span 2; padding: 7px; }
  .back-card .upload { align-self: start; }
  .back-card select { align-self: end; }
  .back-card .section-hint { margin-top: 16px; padding-top: 12px; }
  .status-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-caption { display: none; }
  .event-version { display: none; }
  .event-link { padding: 18px 20px; gap: 12px; }
}
@media (max-width: 500px) {
  .admin-header { padding: 0 16px; gap: 8px; }
  .brand { gap: 9px; }
  .brand-mark { width: 32px; height: 34px; font-size: 17px; }
  .brand-name { font-size: 13px; }
  .brand-caption { font-size: 10px; }
  .admin-header-right { gap: 4px; }
  .environment-badge { padding: 3px 6px; font-size: 9px; }
  .admin-header .btn { padding: 9px; font-size: 11px; }
  .admin-main { padding: 24px 16px 40px; }
  .page-heading { gap: 12px; }
  .page-heading .muted { font-size: 12px; }
  .row-actions { flex-wrap: wrap; gap: 6px; }
  .row-actions > .btn { padding: 10px; }
  .access-menu summary { padding: 10px 6px; }
  .event-summary { gap: 8px 15px; }
  .summary-label { width: 100%; }
  .section-nav { gap: 24px; margin-bottom: 20px; }
  .section-nav { flex-wrap: wrap; gap: 0 20px; }
  .section-button { font-size: 12px; }
  .card { padding: 20px; }
  .assignment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .thumb { height: 200px; padding: 8px; }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .status-chip { padding: 14px; }
  .panel-table, .panel-table tbody { display: block; }
  .panel-table tr:first-child { display: none; }
  .panel-table tr:not(:first-child) { display: grid; grid-template-columns: 20px minmax(0, 1fr) 58px; gap: 8px; padding: 14px 0; border-top: 1px solid var(--line); }
  .panel-table td { border: 0; padding: 0; min-width: 0; }
  .panel-table td:first-child { grid-row: span 2; padding-top: 12px; }
  .panel-table td:nth-child(2) { grid-column: 2 / 4; }
  .panel-table td:nth-child(3) { grid-column: 2; }
  .panel-table input { font-size: 12px; padding: 10px; }
  .panel-table .btn { min-height: 42px; padding: 8px; }
  .mapping-notice { padding: 12px; }
  .events-card { padding: 0; }
  .list-toolbar { padding: 20px; display: block; }
  .event-search { width: 100%; margin-top: 14px; }
  .event-symbol { display: none; }
  .event-arrow { margin-left: 0; }
  .event-name { font-size: 13px; }
  .event-id { font-size: 9px; }
  .create-section { padding: 20px; }
  .inline-form { flex-direction: column; }
  .login-card { margin: 6vh 16px; max-width: none; padding: 28px; }
  .card-warning { margin: 16px; }
  .card-warning .link-actions { flex-direction: column; }
  .display-import { flex-direction: column; }
  .frame-ancestors-form { flex-direction: column; }
  .cms-link-row { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; }
  .package-card { padding: 16px; }
  .screen-link-row { grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; }
  .operator-link-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .operator-link-row input { grid-column: 1 / 3; }
  .screen-link-row input { grid-column: 2 / 4; }
  .screen-link-row button { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
