:root {
  color-scheme: dark;
  --ink: #f5f3ec;
  --muted: #9eb0c4;
  --panel: #0d1b29;
  --panel-2: #12263a;
  --line: rgba(175, 202, 227, 0.18);
  --gold: #e7b74f;
  --danger: #ef6d68;
  --ok: #6fcf97;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 80% -20%, #173b5d 0, transparent 42%), #07121d;
  font: 16px/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; }
p, li, dd, label, .lead, .muted, .notice { overflow-wrap: break-word; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.shell--editor { width: min(1680px, calc(100% - 32px)); }
.shell--history { width: min(1480px, calc(100% - 32px)); }
.topbar { border-bottom: 1px solid var(--line); background: rgba(5, 14, 23, .86); }
.topbar__inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px 24px; }
.brand { flex: 0 0 auto; color: var(--gold); font-weight: 800; letter-spacing: .14em; line-height: 1.25; text-decoration: none; text-transform: uppercase; }
.nav { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 18px; }
.nav a { min-height: 36px; display: inline-flex; align-items: center; color: var(--muted); line-height: 1.2; text-align: center; text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav-identity { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.nav-tools { position: relative; color: var(--muted); }
.nav-tools summary { min-height: 36px; display: inline-flex; align-items: center; cursor: pointer; list-style: none; }
.nav-tools summary::-webkit-details-marker { display: none; }
.nav-tools summary::after { content: '▾'; margin-left: 6px; color: var(--gold); font-size: .72rem; }
.nav-tools[open] summary { color: var(--ink); }
.nav-tools > div { position: absolute; right: 0; top: calc(100% + 7px); z-index: 20; min-width: 145px; display: grid; padding: 7px; border: 1px solid var(--line); background: #071522; box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.nav-tools > div a { padding: 6px 10px; }
main { padding: 56px 0 80px; }
.eyebrow { color: var(--gold); font-size: .75rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3 { max-width: 100%; overflow-wrap: break-word; text-wrap: balance; }
h1, h2 { margin: 0 0 14px; line-height: 1.08; }
h1 { font-size: clamp(2.2rem, 6vw, 4.6rem); text-transform: uppercase; }
h2 { font-size: 1.35rem; }
.lead { max-width: 760px; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.card { padding: 24px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(18, 38, 58, .92), rgba(8, 21, 33, .92)); }
.card--wide { grid-column: 1 / -1; }
.card--scroll { margin-top: 16px; overflow: auto; }
.metric { color: var(--gold); font-size: 2.2rem; font-weight: 800; }
.muted { color: var(--muted); }
.button, button {
  min-width: 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 18px;
  border: 1px solid var(--gold); color: #07121d; background: var(--gold); font: inherit; font-weight: 800;
  letter-spacing: .04em; line-height: 1.25; overflow-wrap: break-word; text-align: center; text-decoration: none; white-space: normal; cursor: pointer;
}
.button--ghost, button.secondary { color: var(--ink); background: transparent; border-color: var(--line); }
.button--small { min-height: 38px; padding: 7px 12px; font-size: .86rem; }
.button--publish { color: #07121d; background: #6fcf97; border-color: #6fcf97; }
button.danger { color: var(--danger); background: transparent; border-color: rgba(239, 109, 104, .45); }
form.inline { min-width: 0; display: inline-flex; gap: 8px; }
label { min-width: 0; display: grid; gap: 7px; color: var(--muted); font-size: .86rem; }
input, select {
  min-width: 0; width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 0;
  color: var(--ink); background: #071522; font: inherit;
}
textarea {
  min-width: 0; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 0;
  color: var(--ink); background: #071522; font: inherit; resize: vertical;
}
.form-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr auto; gap: 12px; align-items: end; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; }
th, td { padding: 13px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; }
.pill { display: inline-block; margin: 2px 4px 2px 0; padding: 3px 8px; border: 1px solid var(--line); color: var(--muted); font-size: .76rem; }
.notice { margin: 24px 0; padding: 14px 16px; border-left: 3px solid var(--gold); background: rgba(231, 183, 79, .08); }
.notice--error { border-color: var(--danger); background: rgba(239, 109, 104, .08); }
.login { min-height: calc(100vh - 72px); display: grid; place-items: center; }
.login .card { width: min(560px, 100%); padding: clamp(28px, 6vw, 54px); }
.auth-card { min-width: 0; text-align: center; }
.auth-card h1 { max-width: 100%; font-size: clamp(2rem, 5vw, 3rem); overflow-wrap: anywhere; }
.auth-card .lead { max-width: 460px; margin-inline: auto; text-align: center; text-wrap: balance; }
.auth-card .notice { text-align: left; }
.auth-form { display: grid; gap: 16px; margin-top: 24px; text-align: left; }
.qr-code { display: block; width: 240px; max-width: 100%; height: auto; margin: 24px auto 16px; padding: 10px; background: #fff; image-rendering: pixelated; }
.secret { display: block; max-width: 100%; padding: 10px; overflow-wrap: anywhere; color: var(--gold); background: #071522; }
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 24px 0; }
.recovery-codes code { padding: 10px; border: 1px solid var(--line); color: var(--gold); background: #071522; }
.status { display: inline-block; padding: 4px 8px; border: 1px solid var(--line); font-size: .78rem; }
.status--draft { color: var(--gold); border-color: rgba(231, 183, 79, .45); }
.status--published { color: var(--ok); border-color: rgba(111, 207, 151, .4); }
.status--denied { color: #ff8c8c; border-color: rgba(255, 108, 108, .45); }
.table-actions { display: grid; grid-template-columns: repeat(2, minmax(84px, 1fr)); align-items: stretch; gap: 8px; }
.table-actions .button { width: 100%; }
.table-actions-cell { vertical-align: middle; }
.pages-table { min-width: 760px; }
.pages-table th:last-child, .pages-table td:last-child { width: 210px; }
.pages-table td { vertical-align: middle; }
.users-table { min-width: 980px; }
.users-table td { vertical-align: middle; }
.users-table th:last-child,
.users-table td:last-child { width: 290px; }
.permission-list { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.permission-entry { display: inline-flex; align-items: center; gap: 4px; }
.permission-entry .pill { margin: 0; }
.permission-remove { width: 32px; min-width: 32px; min-height: 32px; padding: 0; }
.user-actions { display: grid; grid-template-columns: repeat(2, minmax(128px, 1fr)); gap: 8px; }
.user-actions form { display: block; margin: 0; }
.user-actions form:only-child,
.user-actions .protected-owner { grid-column: 1 / -1; }
.user-actions button { width: 100%; min-height: 44px; padding-inline: 10px; }
.protected-owner { margin: 0; padding: 10px 12px; color: var(--gold); border-color: rgba(231, 183, 79, .45); overflow-wrap: break-word; text-align: center; }
.owner-label { color: var(--gold); font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.editor-heading, .section-heading { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px 20px; }
.editor-heading > :first-child, .section-heading > :first-child { min-width: 0; }
.permission-heading { align-items: center; }
.permission-heading h2 { margin-bottom: 0; }
.help-button {
  position: relative;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  color: var(--gold);
  background: transparent;
  border-color: rgba(231, 183, 79, .55);
  font-size: 1rem;
}
.help-button:hover, .help-button:focus-visible { color: #07121d; background: var(--gold); }
.help-button::after {
  content: attr(data-tooltip);
  position: absolute;
  right: -1px;
  bottom: calc(100% + 9px);
  z-index: 5;
  padding: 5px 8px;
  color: var(--ink);
  background: #071522;
  border: 1px solid var(--line);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: normal;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
}
.help-button:hover::after, .help-button:focus-visible::after { opacity: 1; transform: translateY(0); }
.permissions-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  color: var(--ink);
  background: #0b1d2d;
  border: 1px solid rgba(231, 183, 79, .5);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .58);
}
.permissions-dialog::backdrop { background: rgba(2, 8, 14, .78); backdrop-filter: blur(3px); }
.permissions-dialog__content { padding: clamp(22px, 4vw, 38px); }
.permissions-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.permissions-dialog__header h2 { font-size: clamp(1.6rem, 4vw, 2.35rem); }
.dialog-close { width: 40px; min-width: 40px; min-height: 40px; padding: 0; color: var(--muted); background: transparent; border-color: var(--line); font-size: 1.5rem; }
.permission-help-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
.permission-help-list article { padding: 16px; border: 1px solid var(--line); background: rgba(7, 21, 34, .62); }
.permission-help-list article:last-child { grid-column: 1 / -1; }
.permission-help-list h3, .permission-scope-help h3 { margin: 0 0 7px; color: var(--gold); font-size: 1rem; }
.permission-help-list p, .permission-scope-help p { margin: 0; color: var(--muted); }
.permission-scope-help { padding: 16px; border-left: 3px solid var(--gold); background: rgba(231, 183, 79, .06); }
.permissions-dialog__actions { display: flex; justify-content: flex-end; margin-top: 24px; }
.editor-heading__actions, .editor-save-actions, .editor-tool-buttons { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; }
.editor-heading__actions .button, .editor-save-actions button { flex: 1 1 150px; }
.editor-form { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.editor-source { display: none; }
.editor-sidebar { position: sticky; top: 16px; display: grid; gap: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.editor-sidebar h2 { margin-bottom: 0; }
.editor-tools { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.hero-visual-preview { position: relative; display: grid; place-items: center; min-height: 126px; overflow: hidden; border: 1px solid var(--line); background: #030b12; }
.hero-visual-preview img { display: block; width: 100%; height: 150px; object-fit: cover; }
.hero-visual-preview img[data-position="center top"] { object-position: center top; }
.hero-visual-preview img[data-position="center bottom"] { object-position: center bottom; }
.hero-visual-preview img[data-position="left center"] { object-position: left center; }
.hero-visual-preview img[data-position="right center"] { object-position: right center; }
.hero-visual-preview img[data-position="center center"] { object-position: center center; }
.hero-visual-preview span { max-width: 220px; padding: 20px; color: var(--muted); text-align: center; }
.hero-visual-preview--empty { border-style: dashed; }
.hero-visual-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hero-visual-actions button { width: 100%; min-width: 0; padding-inline: 10px; }
.hero-overlay-field > span { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-overlay-field output { color: var(--gold); font-weight: 800; }
.hero-overlay-field input[type="range"] { padding: 0; accent-color: var(--gold); }
.structured-editor__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.structured-editor__heading .eyebrow { margin-bottom: 4px; }
.structured-editor__groups { display: grid; gap: 8px; }
.structured-group { border: 1px solid var(--line); background: rgba(4, 16, 27, .48); }
.structured-group summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; cursor: pointer; list-style: none; }
.structured-group summary::-webkit-details-marker { display: none; }
.structured-group summary::after { content: '+'; color: var(--gold); font-weight: 900; }
.structured-group[open] summary::after { content: '−'; }
.structured-group summary span { margin-left: auto; color: var(--muted); font-size: .7rem; }
.structured-group__fields { display: grid; gap: 12px; padding: 0 12px 14px; border-top: 1px solid var(--line); }
.structured-group__fields label:first-child { padding-top: 12px; }
.structured-checkbox { grid-template-columns: 1fr auto; align-items: center; }
.structured-checkbox input { width: 24px; height: 24px; margin: 0; }
.structured-image-field { display: grid; gap: 10px; padding-top: 12px; }
.structured-image-field + .structured-image-field { padding-top: 14px; border-top: 1px solid var(--line); }
.structured-image-field__preview { display: block; width: 100%; height: 132px; object-fit: contain; border: 1px solid var(--line); background: #030b12; }
.structured-image-field__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.structured-image-field__actions .button,
.structured-image-field__actions button { width: 100%; min-height: 40px; padding: 7px 9px; font-size: .75rem; }
.structured-image-field__upload { position: relative; overflow: hidden; }
.structured-image-field__upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.structured-order-field { display: grid; gap: 9px; padding-top: 12px; }
.structured-order-field__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.structured-order-field__actions button { width: 100%; min-width: 0; min-height: 40px; padding: 7px 9px; font-size: .72rem; }
.structured-repeatable-add,
.structured-repeatable-remove { width: 100%; min-height: 44px; }
.structured-repeatable-add { margin-top: 12px; }
.structured-repeatable-remove { margin-top: 4px; }
.structured-repeatable-remove:disabled { cursor: not-allowed; opacity: .42; }
.editor-insert-tools { padding-bottom: 4px; }
.editor-block-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.editor-block-grid button {
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 1.25rem 1rem;
  align-content: center;
  align-items: center;
  justify-content: stretch;
  justify-items: start;
  gap: 2px;
  padding: 10px 13px;
  text-align: left;
}
.editor-block-grid button span, .editor-block-grid button small {
  max-width: 100%;
  display: block;
  margin: 0;
  overflow-wrap: break-word;
}
.editor-block-grid button span {
  color: var(--ink);
  font-size: .8rem;
  letter-spacing: 0;
  line-height: 1.25rem;
  white-space: nowrap;
}
.editor-block-grid button small { color: var(--muted); font-size: .68rem; font-weight: 500; letter-spacing: 0; line-height: 1rem; }
.editor-media-button { width: 100%; }
.editor-canvas { min-width: 0; padding: 0; overflow: hidden; }
.editor-canvas__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.editor-canvas iframe { display: block; width: 100%; min-height: 760px; border: 0; background: #07121d; }
.media-dialog {
  width: min(1040px, calc(100% - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  color: var(--ink);
  background: #0b1d2d;
  border: 1px solid rgba(231, 183, 79, .5);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .62);
}
.media-dialog::backdrop { background: rgba(2, 8, 14, .82); backdrop-filter: blur(3px); }
.media-dialog__inner { padding: clamp(20px, 3vw, 34px); }
.media-dialog__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.media-dialog__header h2 { font-size: clamp(1.55rem, 4vw, 2.35rem); }
.media-library { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-height: min(620px, 65vh); margin-top: 20px; overflow: auto; }
.media-card { min-width: 0; min-height: 0; display: grid; grid-template-rows: 142px auto; padding: 0; overflow: hidden; color: var(--ink); background: #071522; border-color: var(--line); text-align: left; letter-spacing: 0; }
.media-card:hover, .media-card:focus-visible { border-color: var(--gold); }
.media-card img { width: 100%; height: 142px; display: block; object-fit: cover; background: #030b12; }
.media-card__copy { min-width: 0; display: grid; gap: 4px; padding: 10px; }
.media-card__copy strong, .media-card__copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card__copy strong { font-size: .78rem; }
.media-card__copy small { color: var(--muted); font-size: .68rem; font-weight: 500; }
.settings-editor { display: grid; gap: 16px; margin-top: 30px; }
.form-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-wide { grid-column: 1 / -1; }
.navigation-editor { display: grid; gap: 10px; margin-top: 20px; }
.navigation-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 1.4fr) 72px 142px;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
}
.navigation-row__visibility { align-content: end; justify-items: center; text-align: center; }
.navigation-row__visibility input {
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0 auto;
  accent-color: var(--gold);
  cursor: pointer;
}
.navigation-row__actions { display: grid; grid-template-columns: repeat(3, 44px); gap: 5px; }
.navigation-row__actions button { width: 44px; min-width: 44px; padding: 0; }
.history-table { min-width: 1040px; }
.history-table th, .history-table td { vertical-align: middle; }
.history-table th:nth-child(1), .history-table td:nth-child(1) { width: 110px; }
.history-table th:nth-child(2), .history-table td:nth-child(2) { width: 110px; }
.history-table th:nth-child(3), .history-table td:nth-child(3) { min-width: 180px; }
.history-table th:nth-child(4), .history-table td:nth-child(4) { width: 160px; }
.history-table th:nth-child(5), .history-table td:nth-child(5) { width: 220px; }
.history-table th:nth-child(6), .history-table td:nth-child(6) { width: 350px; }
.history-table td:nth-child(1), .history-table td:nth-child(2), .history-table td:nth-child(4) { white-space: nowrap; }
.history-table td:nth-child(3) { overflow-wrap: anywhere; }
.revision-view-actions, .revision-restore-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 8px; }
.revision-view-actions .button, .revision-view-actions .pill,
.revision-restore-actions button { width: 100%; min-width: 0; min-height: 42px; margin: 0; padding: 7px 10px; text-align: center; }
.revision-view-actions .pill { display: flex; align-items: center; justify-content: center; line-height: 1.25; white-space: normal; }
.revision-view-actions--single { grid-template-columns: 1fr; }
.revision-current-state { display: block; max-width: 230px; line-height: 1.35; }
.revision-meta { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 24px 0 16px; color: var(--muted); }
.revision-meta strong { color: var(--ink); }
.revision-preview { min-width: 0; padding: 0; overflow: hidden; }
.revision-preview__bar { min-height: 58px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.revision-preview iframe { display: block; width: 100%; min-height: 720px; border: 0; background: #07121d; }
.revision-compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.tenders-table { min-width: 1180px; }
.tenders-table th, .tenders-table td { vertical-align: middle; }
.tenders-table th:nth-child(1) { width: 180px; }
.tenders-table th:nth-child(2) { width: 190px; }
.tenders-table th:nth-child(3) { width: 200px; }
.tenders-table th:nth-child(4) { width: 250px; }
.tenders-table th:nth-child(5) { width: 90px; }
.tender-detail { width: 240px; }
.tender-detail summary { color: var(--gold); font-weight: 800; cursor: pointer; }
.tender-detail p { margin: 10px 0 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.tender-settings-card { margin-top: 28px; }
.tender-settings-form { display: grid; gap: 22px; }
.tender-active-toggle { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--line); background: rgba(7, 21, 34, .62); }
.tender-active-toggle input, .tender-category-toggle input { width: 20px; min-height: 20px; margin: 2px 0 0; accent-color: var(--gold); }
.tender-active-toggle span { display: grid; gap: 3px; color: var(--ink); }
.tender-active-toggle small { color: var(--muted); font-weight: 400; }
.tender-categories-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.tender-categories-heading h3 { margin: 0; }
.tender-categories { display: grid; gap: 10px; }
.tender-category-row { display: grid; grid-template-columns: minmax(220px, 1fr) 110px 120px; gap: 12px; align-items: end; padding: 12px; border: 1px solid var(--line); }
.tender-category-row > input[type="hidden"] { display: none; }
.tender-category-toggle { min-height: 44px; display: flex; align-items: center; gap: 9px; color: var(--ink); }
.revision-differences { margin-top: 24px; }
.revision-differences ul { margin: 0; padding-left: 20px; color: var(--muted); }
.locked-page-card { display: grid; gap: 18px; max-width: 760px; margin-inline: auto; }
.locked-page-card h1, .locked-page-card p { margin: 0; }
.activity-locks-section { margin-top: 28px; }
.activity-locks-section h2, .activity-locks-section .eyebrow { margin-bottom: 0; }
.activity-locks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.activity-lock { display: grid; align-content: start; gap: 10px; min-width: 0; padding: 16px; border: 1px solid var(--line); background: rgba(3, 16, 27, .35); }
.activity-lock > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.activity-lock p { margin: 0; }
.activity-lock .button { justify-self: start; margin-top: 3px; }
.activity-lock__pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 5px rgba(111, 207, 151, .12); }
.activity-filters { margin-block: 16px; }
.activity-filters form { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.activity-filter-actions { display: flex; align-items: stretch; gap: 8px; grid-column: 1 / -1; }
.activity-table { min-width: 850px; table-layout: fixed; }
.activity-table th:nth-child(1) { width: 190px; }
.activity-table th:nth-child(2) { width: 190px; }
.activity-table th:nth-child(4) { width: 130px; }
.activity-table td { vertical-align: middle; }
.activity-pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-top: 18px; text-align: center; color: var(--muted); }
.activity-pagination > :last-child { justify-self: end; }
.media-upload-card { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(460px, 1.3fr); gap: 24px; align-items: end; margin-top: 28px; }
.media-upload-card h2, .media-upload-card .eyebrow { margin-bottom: 0; }
.media-upload-card form { display: grid; grid-template-columns: minmax(130px, .45fr) minmax(220px, 1fr) auto; gap: 12px; align-items: end; }
.legacy-media-import { margin-top: 16px; padding: 0; overflow: hidden; }
.legacy-media-import > summary { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 24px; cursor: pointer; list-style-position: inside; }
.legacy-media-import > summary > span:first-child { display: inline-flex; flex-direction: column; gap: 5px; }
.legacy-media-import > summary .eyebrow { margin: 0; }
.legacy-media-import > summary strong { font-size: 1.15rem; }
.legacy-media-import__body { padding: 0 24px 24px; border-top: 1px solid var(--line); }
.legacy-media-import__body > p { max-width: 900px; }
.legacy-media-import__toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 12px; align-items: end; }
.legacy-media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-height: 660px; margin-top: 16px; padding-right: 6px; overflow-y: auto; }
.legacy-media-item { min-width: 0; display: grid; grid-template-rows: auto 112px auto auto; gap: 7px; margin: 0; padding: 10px; border: 1px solid var(--line); background: rgba(1, 10, 18, .42); cursor: pointer; }
.legacy-media-item:hover { border-color: var(--gold); }
.legacy-media-item--imported { opacity: .55; cursor: default; }
.legacy-media-item__check { display: flex; align-items: center; gap: 7px; min-height: 24px; color: var(--blue); font-size: .72rem; }
.legacy-media-item__check input { width: 18px; height: 18px; margin: 0; }
.legacy-media-item img { width: 100%; height: 112px; object-fit: contain; background: #030b12; }
.legacy-media-item strong, .legacy-media-item small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legacy-media-item strong { font-size: .78rem; }
.legacy-media-item small { color: var(--muted); font-size: .66rem; font-weight: 500; }
.media-management-filters { margin-block: 16px; }
.media-management-filters form { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, .45fr) auto; gap: 12px; align-items: end; }
.media-management-filters form > div { display: flex; gap: 8px; }
.media-management-summary { display: flex; justify-content: space-between; gap: 12px; margin-block: 20px 12px; }
.media-management-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.media-management-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.media-management-card__preview { display: grid; place-items: center; height: 230px; padding: 12px; background: rgba(1, 10, 18, .65); border-bottom: 1px solid var(--line); }
.media-management-card__preview img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.media-management-card__body { display: grid; gap: 14px; padding: 16px; }
.media-management-card__heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.media-management-card__heading > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.media-management-card__heading strong { overflow-wrap: anywhere; }
.media-management-card__meta { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.65; }
.media-usage { padding: 12px; border-left: 3px solid var(--ok); background: rgba(111, 207, 151, .06); font-size: .82rem; }
.media-usage--used { border-left-color: var(--gold); background: rgba(231, 183, 79, .06); }
.media-usage p { margin: 5px 0 0; color: var(--muted); }
.media-usage ul { display: grid; gap: 6px; margin: 8px 0 0; padding-left: 18px; }
.media-usage li span { display: block; color: var(--muted); }
.media-card-tools { border-top: 1px solid var(--line); }
.media-card-tools summary { padding-top: 12px; cursor: pointer; color: var(--blue); font-weight: 800; }
.media-card-tools__body { display: grid; gap: 14px; padding-top: 14px; }
.media-card-tools form { display: grid; gap: 8px; }
.media-card-tools button { width: 100%; }
.media-card-tools button:disabled { cursor: not-allowed; opacity: .4; }
.person-create { margin-block: 24px 18px; }
.person-create > summary { cursor: pointer; color: var(--ink); font-size: 1.05rem; font-weight: 900; }
.person-create[open] > summary { margin-bottom: 20px; }
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.person-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; min-width: 0; padding: 18px; }
.person-card__preview { display: grid; place-items: center; align-self: start; min-height: 190px; overflow: hidden; border: 1px solid var(--line); background: rgba(1, 10, 18, .62); }
.person-card__preview img { display: block; width: 100%; height: 190px; object-fit: cover; object-position: center top; }
.person-form { display: grid; gap: 14px; min-width: 0; }
.person-card__heading { display: grid; gap: 9px; }
.person-card__heading > div { display: flex; flex-wrap: wrap; gap: 7px; }
.person-card__heading > strong { color: var(--ink); font-size: 1.15rem; }
.person-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.person-field-wide, .person-visible { grid-column: 1 / -1; }
.person-visible { min-height: 42px; display: flex; align-items: center; gap: 9px; color: var(--ink); }
.person-visible input { width: 20px; min-height: 20px; margin: 0; accent-color: var(--gold); }
.person-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.person-actions button { width: 100%; }
.person-actions .button { display: inline-flex; align-items: center; justify-content: center; text-align: center; }
.stations-grid { display: grid; gap: 24px; }
.station-card { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(420px, 1.2fr); gap: 24px; overflow: hidden; }
.station-live-preview { min-height: 390px; position: relative; display: grid; place-items: center; padding: 28px; isolation: isolate; overflow: hidden; background: #0a1724; border: 1px solid var(--line); }
.station-live-preview::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(2, 12, 21, .2); }
.station-live-preview__map { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.station-live-preview > p { position: absolute; inset: auto 18px 18px; margin: 0; padding: 9px 12px; background: rgba(3, 14, 24, .86); color: var(--ink); font-size: .82rem; text-align: center; }
.station-live-marker { position: relative; display: grid; place-items: center; min-width: 110px; padding: 13px; border: 1px solid var(--gold); background: rgba(5, 20, 33, .94); text-align: center; }
.station-live-marker strong { color: var(--gold); letter-spacing: .13em; }
.station-live-marker small { display: block; margin-top: 4px; }
.station-live-marker figure { position: absolute; left: 50%; bottom: calc(100% + 12px); width: 240px; margin: 0; padding: 7px; opacity: 0; visibility: hidden; transform: translate(-50%, 8px); transition: .18s ease; background: #06111c; border: 1px solid var(--line); z-index: 3; }
.station-live-marker:hover figure, .station-live-marker:focus-within figure { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.station-live-marker img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.station-live-marker figcaption { padding: 7px 3px 2px; font-size: .75rem; }
.station-form { min-width: 0; }
.station-media-control { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .42fr); gap: 8px; }
.station-usage { margin: 14px 0; }
.record-json { max-width: 420px; max-height: 280px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
button.danger { background: transparent; color: #ff8989; border-color: #784044; }
button.danger:hover { background: #441f25; }

@media (max-width: 1040px) {
  .station-card { grid-template-columns: 1fr; }
  .station-media-control { grid-template-columns: 1fr; }
  .topbar__inner { align-items: flex-start; flex-direction: column; padding-block: 14px; }
  .nav { width: 100%; justify-content: flex-start; gap: 5px 11px; font-size: .86rem; }
  .nav-identity { margin-left: auto; }
}

@media (max-width: 820px) {
  .grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .topbar__inner { min-height: 64px; gap: 10px; }
  .nav { gap: 4px 14px; }
  .nav-identity { width: 100%; justify-content: space-between; margin-left: 0; order: 3; }
  table, thead, tbody, tr, th, td { display: block; }
  .pages-table, .users-table, .tenders-table { min-width: 0; }
  thead { position: absolute; clip: rect(0 0 0 0); }
  tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  td { border: 0; padding: 5px 0; }
  .recovery-codes { grid-template-columns: 1fr; }
  .editor-heading { display: grid; }
  .editor-heading__actions, .editor-save-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .editor-form { grid-template-columns: 1fr; }
  .editor-sidebar { position: static; max-height: none; }
  .editor-canvas iframe { min-height: 600px; }
  .media-library { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid--two { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .navigation-row { grid-template-columns: 1fr; }
  .users-table th:last-child,
  .users-table td:last-child { width: auto; }
  .user-actions { grid-template-columns: 1fr; }
  .user-actions form:only-child,
  .user-actions .protected-owner { grid-column: auto; }
  .permission-help-list { grid-template-columns: 1fr; }
  .permission-help-list article:last-child { grid-column: auto; }
  .revision-compare-grid { grid-template-columns: 1fr; }
  .revision-preview iframe { min-height: 560px; }
  .history-table { min-width: 0; table-layout: auto; }
  .history-table td { width: auto !important; white-space: normal !important; }
  .history-table td::before { display: block; margin-bottom: 3px; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
  .history-table td:nth-child(1)::before { content: 'Revize'; }
  .history-table td:nth-child(2)::before { content: 'Autor'; }
  .history-table td:nth-child(3)::before { content: 'Poznámka'; }
  .history-table td:nth-child(4)::before { content: 'Datum'; }
  .history-table td:nth-child(5)::before { content: 'Náhled změn'; }
  .history-table td:nth-child(6)::before { content: 'Obnovení'; }
  .revision-view-actions, .revision-restore-actions { grid-template-columns: 1fr; }
  .tender-category-row { grid-template-columns: 1fr; }
  .tender-categories-heading { align-items: stretch; flex-direction: column; }
  .tender-categories-heading button { width: 100%; }
  .activity-locks, .activity-filters form { grid-template-columns: 1fr; }
  .activity-table { min-width: 0; }
  .activity-table td::before { display: block; margin-bottom: 3px; color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
  .activity-table td:nth-child(1)::before { content: 'Datum'; }
  .activity-table td:nth-child(2)::before { content: 'Uživatel'; }
  .activity-table td:nth-child(3)::before { content: 'Událost'; }
  .activity-table td:nth-child(4)::before { content: 'Výsledek'; }
  .activity-pagination { grid-template-columns: 1fr; }
  .activity-pagination > * { justify-self: stretch !important; }
  .media-upload-card, .media-upload-card form, .legacy-media-import__toolbar, .media-management-filters form { grid-template-columns: 1fr; }
  .legacy-media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .media-management-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .people-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .shell, .shell--editor, .shell--history { width: calc(100% - 20px); }
  main { padding-block: 36px 56px; }
  h1 { font-size: clamp(2rem, 15vw, 3.1rem); }
  .button, button { padding-inline: 12px; letter-spacing: .025em; }
  .nav { align-items: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .nav a { justify-content: center; padding: 7px 5px; border: 1px solid var(--line); }
  .nav .muted, .nav form.inline { grid-column: 1 / -1; width: 100%; }
  .nav form.inline button { width: 100%; }
  .card { padding: 18px; }
  .table-actions, .editor-heading__actions, .editor-save-actions { grid-template-columns: 1fr; }
  .section-heading { display: grid; }
  .section-heading > button { width: 100%; }
  .permission-heading { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .permission-heading > button { width: 34px; }
  .editor-block-grid, .media-library { grid-template-columns: 1fr; }
  .media-management-grid { grid-template-columns: 1fr; }
  .legacy-media-import > summary { align-items: flex-start; flex-direction: column; }
  .legacy-media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-management-filters form > div { display: grid; }
  .person-card { grid-template-columns: 1fr; }
  .person-card__preview { max-width: 220px; }
  .person-fields, .person-actions { grid-template-columns: 1fr; }
  .person-field-wide, .person-visible { grid-column: auto; }
}
