/* Layout constraints shared by the archive, administration and public day view. */
/* Reading surfaces remain still until the dedicated motion control is enabled. */
body[data-motion="off"] *, body[data-motion="off"] *::before, body[data-motion="off"] *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
body[data-motion="off"] :is(.motion-section, .hero, .workspace, .panel, .tilt-card, .magnetic, .archive-card) {
  transform: none !important; opacity: 1 !important;
}
body[data-motion="off"] :is(.cursor-dot, .cursor-ring) { display: none; }
body[data-motion="off"], body[data-motion="off"] * { cursor: auto; }
body[data-motion="off"] :is(button, a) { cursor: pointer; }
body[data-sonic-bg="hybrid"] #sound-unlock-banner { display: none !important; }
body[data-sonic-bg="hybrid"] .topbar { background: rgba(250, 251, 252, .97); border-radius: 8px; box-shadow: 0 4px 18px #18202b14; }
body[data-sonic-bg="hybrid"] .topbar .notice { font-size: 18px; }
body[data-sonic-bg="hybrid"] .topbar .sound-toggle { min-height: 40px; padding: 8px 12px; color: #252b31; background: #fff; border: 1px solid #bcc6ce; border-radius: 4px; font-size: 13px; white-space: nowrap; }
body[data-sonic-bg="hybrid"] #motion-toggle[aria-pressed="true"] { background: #14675f; color: white; border-color: #14675f; }
body[data-sonic-bg="hybrid"] .sonic-bg-shell { opacity: .65; }
body[data-sonic-bg="hybrid"] .archive-feed > .feed-head { padding: 18px 20px; background: #f8fafc; border-top: 3px solid #14675f; margin-bottom: 0; }
body[data-sonic-bg="hybrid"] .archive-feed > .feed-head :is(h2, p) { color: #20252b; text-shadow: none; }
body[data-sonic-bg="hybrid"] .archive-feed > .feed-head .eyebrow { font: 600 12px/1.5 var(--body-font); color: #53616d; }
body[data-sonic-bg="hybrid"] .archive-feed > .feed-head h2 { font: 700 28px/1.3 var(--body-font); }
body[data-sonic-bg="hybrid"] .pinned-moments:has(.empty-state) { display: none; }
body[data-sonic-bg="hybrid"] .archive-card { gap: 24px; }
body[data-sonic-bg="hybrid"] .archive-card p { font: 400 15px/1.8 var(--body-font); max-width: 76ch; }
body[data-sonic-bg="hybrid"] .archive-card img { border-radius: 4px; }
body[data-sonic-bg="hybrid"] .control-panel { box-shadow: none; border: 1px solid #d6dce1; }
body[data-sonic-bg="hybrid"] :is(.mode-btn, .persona-btn, .sort-btn) { box-shadow: none; border-radius: 4px; font-style: normal; }
body[data-sonic-bg="hybrid"] .section-head h2 { font-style: normal; }
@media (max-width: 600px) {
  body[data-sonic-bg="hybrid"] .topbar .notice { display: none; }
  body[data-sonic-bg="hybrid"] .topbar .topbar-tools { width: 100%; justify-content: space-between; margin: 0; }
}
body { letter-spacing: 0; }
body[data-sonic-bg="hybrid"] :is(.feature-item, .panel, .pinned-card) { content-visibility: visible; }
body :is(button, input, select, textarea) { font: inherit; letter-spacing: 0; }
body :is(button, .btn) { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
body :is(input, select, textarea) { min-width: 0; box-sizing: border-box; }
body :is(button, a, input, select, textarea):focus-visible { outline: 3px solid #087c78; outline-offset: 3px; }
body button:disabled { opacity: .55; cursor: not-allowed; }
body :is(main, section, aside, form, .panel, .feed, .archive-feed) { min-width: 0; }
body :is(h1, h2, h3) { letter-spacing: 0; overflow-wrap: anywhere; }
body :is(.button-row, .sort-tabs, .mode-grid) { flex-wrap: wrap; }
body .topbar { box-sizing: border-box; max-width: calc(100% - 24px); }
body .topbar .notice { font-size: 22px; white-space: nowrap; }
body .topbar .tab { font-size: 16px; white-space: nowrap; }
body .topbar .nav-tabs { min-width: 0; overflow-x: auto; flex-wrap: nowrap; }
body .topbar .topbar-tools { flex-shrink: 0; }
body :is(.workspace, .motion-section, .admin-shell) { scroll-margin-top: 112px; }

body[data-sonic-bg="hybrid"] :is(.workspace, .signal-deck, .map-section, .constellation-band, .reports-band, .ops-band, .terminal-section, .hero) {
  width: 100%; max-width: 1680px; box-sizing: border-box; padding-inline: 0;
}
body[data-sonic-bg="hybrid"] main { width: calc(100% - 48px); max-width: 1680px; }
body[data-sonic-bg="hybrid"] .workspace { grid-template-columns: 280px minmax(0, 1fr); gap: 24px; align-items: start; }
body[data-sonic-bg="hybrid"] .archive-feed { display: block; width: 100%; }
body[data-sonic-bg="hybrid"] .archive-scroll-window {
  width: 100%; height: 90svh; min-height: 620px; max-height: none; resize: vertical;
  padding: 20px; overflow: auto; clip-path: none; border-radius: 4px;
  background: rgba(248, 250, 252, .96); color: #20252b; scrollbar-gutter: stable;
}
body[data-sonic-bg="hybrid"] .control-panel {
  width: 100%; padding: 16px; top: 104px; max-height: calc(100svh - 128px);
  clip-path: none; border-radius: 4px; background: rgba(248, 250, 252, .96); color: #20252b;
}
body[data-sonic-bg="hybrid"] .search-box {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px;
  padding: 10px; margin: 0 0 16px; transform: none; clip-path: none;
}
body[data-sonic-bg="hybrid"] .search-box svg { width: 20px; height: 20px; flex: 0 0 20px; color: #414852; }
body[data-sonic-bg="hybrid"] .search-box input { width: 100%; padding: 0; font-size: 14px; color: #20252b; }
body[data-sonic-bg="hybrid"] .control-panel::before { display: none; }
body[data-sonic-bg="hybrid"] .mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
body[data-sonic-bg="hybrid"] :is(.mode-btn, .persona-btn) { padding: 10px 6px; font-size: 14px; min-width: 0; }
body[data-sonic-bg="hybrid"] :is(.assistant-panel, .profile-box) {
  padding: 16px 0; clip-path: none; box-shadow: none; border-radius: 0; background: transparent;
  transform: none; content-visibility: visible;
}
body[data-sonic-bg="hybrid"] :is(.panel-title, .answer-box, .class-chip, .timeline-date-pill, .timeline-preview-note) { color: #303841; text-shadow: none; }
body[data-sonic-bg="hybrid"] .panel-title { font-size: 20px; line-height: 1.3; }
body[data-sonic-bg="hybrid"] .answer-box { white-space: pre-wrap; font-size: 13px; }
body[data-sonic-bg="hybrid"] .class-strip { display: flex; flex-wrap: wrap; gap: 8px; overflow: visible; }
body[data-sonic-bg="hybrid"] .class-chip { padding: 8px 12px; font-size: 14px; background: #fff; border: 1px solid #cbd1d6; box-shadow: none; }
body[data-sonic-bg="hybrid"] .class-chip span { color: inherit; }
body[data-sonic-bg="hybrid"] .class-chip.is-active { color: #fff; background: #252b31; }
/* The timeline must participate in the feed, never cover the records as a sticky panel. */
body[data-sonic-bg="hybrid"] .history-timeline {
  position: relative; top: auto; width: 100%; max-width: none; min-width: 0;
  height: auto; min-height: 0; max-height: none; overflow: visible;
  grid-template-columns: minmax(0, 1fr); padding: 16px 0; clip-path: none;
  background: transparent; box-shadow: none; border: 0; border-bottom: 1px solid #cbd1d6;
  contain: none; content-visibility: visible; transform: none; animation: none;
}
body[data-sonic-bg="hybrid"] .history-timeline::before { display: none; }
body[data-sonic-bg="hybrid"] .timeline-meta { flex-wrap: wrap; gap: 12px; }
body[data-sonic-bg="hybrid"] .timeline-meta h3 { font-size: 24px; line-height: 1.15; }
body[data-sonic-bg="hybrid"] .timeline-date-pill { font-size: 13px; width: auto; }
body[data-sonic-bg="hybrid"] .timeline-graph { gap: 0; min-height: 80px; }
body[data-sonic-bg="hybrid"] .timeline-stop { min-width: 0; padding: 0; height: 76px; }
body[data-sonic-bg="hybrid"] .timeline-stop-year {
  min-width: 0; width: auto; font-size: 13px; line-height: 1;
  white-space: nowrap; overflow-wrap: normal; word-break: normal; letter-spacing: 0;
}
body[data-sonic-bg="hybrid"] .timeline-controls { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
body[data-sonic-bg="hybrid"] .timeline-jump-row { display: flex; flex-wrap: wrap; }
body[data-sonic-bg="hybrid"] .timeline-jump-row input { width: 200px; max-width: 100%; }
body[data-sonic-bg="hybrid"] .timeline-jump-row .btn { width: auto; }
body[data-sonic-bg="hybrid"] .timeline-preview { grid-template-columns: 96px minmax(0, 1fr); }
body[data-sonic-bg="hybrid"] .timeline-preview .timeline-preview-media { width: 96px; max-width: 100%; }
body[data-sonic-bg="hybrid"] .timeline-preview-copy { min-width: 0; }
body[data-sonic-bg="hybrid"] .feed-head { margin: 20px 0 12px; gap: 12px; flex-wrap: wrap; }
body[data-sonic-bg="hybrid"] .feed-head h2 { font-size: 28px; line-height: 1.2; }
body[data-sonic-bg="hybrid"] .pinned-moments { min-height: 0; padding: 0; margin-bottom: 20px; background: transparent; clip-path: none; }
body[data-sonic-bg="hybrid"] .pinned-feed { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
body[data-sonic-bg="hybrid"] .archive-card { min-width: 0; clip-path: none; grid-template-columns: 120px minmax(0, 1fr); padding: 18px 0; }
body[data-sonic-bg="hybrid"] .archive-card :is(h3, p, span, small, strong) { color: #20252b; text-shadow: none; }
body[data-sonic-bg="hybrid"] .archive-card h3 { font-size: 20px; line-height: 1.4; }
body[data-sonic-bg="hybrid"] .archive-card :is(img, video) { max-width: 100%; }

/* Remove competing fixed column and viewport-height rules on supporting views. */
body[data-sonic-bg="hybrid"] :is(.map-layout, .constellation-layout, .reports-layout) { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 24px; }
body[data-sonic-bg="hybrid"] :is(.sonic-console, .feature-ledger, .place-list, .fusion-radar, .report-constellation, .heat-cascade, .voice-capsule, .ops-grid .panel) {
  min-height: 0; max-height: none; overflow: visible; clip-path: none; transform: none;
}
body[data-sonic-bg="hybrid"] .feature-ledger-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); max-height: none; }
body[data-sonic-bg="hybrid"] .hero { grid-template-columns: minmax(220px, .8fr) minmax(0, 1.5fr) minmax(240px, .8fr); }
body[data-sonic-bg="hybrid"] :is(.hero-copy, .hero-sidecard) { min-height: 0; max-height: none; overflow: visible; clip-path: none; }
body[data-sonic-bg="hybrid"] .hero-copy h1 { font-size: 48px; line-height: 1.05; letter-spacing: 0; }
body[data-sonic-bg="hybrid"] .hero-live-body { grid-template-columns: minmax(0, 1fr); }
body[data-sonic-bg="hybrid"] .hero-now-head strong { font-size: 22px; }
body[data-sonic-bg="hybrid"] .sound-stage { grid-template-columns: minmax(0, 1fr); }
body[data-sonic-bg="hybrid"] .sound-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body[data-sonic-bg="hybrid"] .sound-metric-pill { padding: 10px 6px; }
body[data-sonic-bg="hybrid"] .sound-metric-pill strong { font-size: 24px; white-space: nowrap; }
body[data-sonic-bg="hybrid"] .sound-metric-pill small { white-space: nowrap; font-size: 12px; }
body[data-sonic-bg="hybrid"] .sonic-console { background: rgba(248, 250, 252, .96); }
body[data-sonic-bg="hybrid"] .sonic-console :is(h2, p, small, strong, span, b) { color: #20252b; text-shadow: none; }
body[data-sonic-bg="hybrid"] #signal-deck > * { grid-area: auto; min-width: 0; width: 100%; }
body[data-sonic-bg="hybrid"] #signal-deck .sonic-console { clip-path: none; grid-template-columns: minmax(0, 1fr); }
body[data-sonic-bg="hybrid"] #signal-deck .sonic-console::before { display: none; }
body[data-sonic-bg="hybrid"] :is(.section-head, .feed-head) { display: flex; flex-wrap: wrap; min-width: 0; max-width: 100%; box-sizing: border-box; }
body[data-sonic-bg="hybrid"] .section-head { clip-path: none; }
body[data-sonic-bg="hybrid"] .section-head::after { right: 0; }
body[data-sonic-bg="hybrid"] .section-head > * { min-width: 0; max-width: 100%; }
body[data-sonic-bg="hybrid"] .section-head h2 { font-size: 32px; line-height: 1.2; }
body[data-sonic-bg="hybrid"] .profile-box h2 { font-size: 24px; line-height: 1.25; }
body[data-sonic-bg="hybrid"] .topbar {
  left: 12px; right: 12px; width: auto; max-width: none; transform: none;
  display: flex; align-items: center; gap: 16px; padding: 14px 18px;
}
body[data-sonic-bg="hybrid"] .topbar .nav-tabs { position: static; width: auto; transform: none; min-height: 0; padding: 0; flex: 1; background: transparent; box-shadow: none; }
body .media-dialog { width: min(960px, calc(100% - 32px)); max-height: calc(100svh - 32px); box-sizing: border-box; overflow: auto; }
body #dialog-media :is(img, video) { max-width: 100%; max-height: 70svh; object-fit: contain; }

body.admin-page { background: #f3f5f7; }
body.admin-page #legacy-bg { opacity: .12; }
body.admin-page .admin-shell { width: calc(100% - 48px); max-width: 1440px; padding-top: 108px; }
body.admin-page .admin-hero { grid-template-columns: 1fr; gap: 12px; padding: 20px 0; }
body.admin-page .admin-hero h1 { font-size: 36px; line-height: 1.2; }
body.admin-page :is(.moments-import-section h2, .admin-grid .panel h2) { font-size: 24px; line-height: 1.3; margin: 0 0 18px; }
body.admin-page .moments-import-section { padding: 24px 0; }
body.admin-page .moments-import-form { gap: 16px; margin-bottom: 20px; }
body.admin-page #moments-setup { grid-template-columns: minmax(200px, 1fr) minmax(0, 3fr); }
body.admin-page :is(.moments-import-form, .admin-grid) label { font-size: 14px; font-weight: 600; }
body.admin-page :is(.moments-import-form, .admin-grid) label:has(input[type="checkbox"]) { display: flex; flex-direction: row; align-items: center; gap: 8px; }
body.admin-page :is(.moments-import-form, .admin-grid) :is(input, select, textarea) {
  border: 1px solid #adb6c0; border-radius: 4px; background: #fff; color: #232930;
  min-height: 42px; font-size: 14px; width: 100%; padding: 10px 12px;
}
body.admin-page :is(.moments-import-form, .admin-grid) input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; flex: 0 0 18px; }
body.admin-page :is(.moments-import-form, .admin-grid) :disabled { background: #e9edf0; }
body.admin-page :is(.moments-import-section, .admin-grid) button {
  padding: 10px 16px; min-height: 42px; font-size: 14px; line-height: 1.4;
  border: 1px solid #adb6c0; border-radius: 4px; background: #fff; color: #20252b;
  box-shadow: none; transform: none; cursor: pointer;
}
body.admin-page :is(.moments-import-section, .admin-grid) button:hover { background: #e5edef; transform: none; box-shadow: none; }
body.admin-page :is(#moments-publish-job, button[value="apply"], #login-form button[type="submit"]) { background: #14675f; color: #fff; border-color: #14675f; }
body.admin-page #moments-job-status { padding: 12px 0; margin: 0 0 12px; line-height: 1.6; }
body.admin-page .admin-grid { grid-template-columns: 320px minmax(0, 1fr); }
body.admin-page .admin-grid .panel { clip-path: none; border: 0; border-top: 1px solid #cbd1d6; background: transparent; box-shadow: none; padding: 20px 0; opacity: 1; transform: none; }
body.admin-page .admin-event-list { max-height: 640px; overflow: auto; }

@media (max-width: 1200px) {
  body .topbar { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  body .topbar .nav-tabs { order: 3; flex-basis: 100%; justify-content: flex-start; }
  body .topbar .topbar-tools { margin-left: auto; }
  body[data-sonic-bg="hybrid"] .topbar { flex-wrap: wrap; gap: 8px; }
  body[data-sonic-bg="hybrid"] .topbar .nav-tabs { order: 3; flex: 1 0 100%; }
  body[data-sonic-bg="hybrid"] main, body.admin-page .admin-shell { padding-top: 144px; }
  body[data-sonic-bg="hybrid"] .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
  body[data-sonic-bg="hybrid"] .hero-sidecard { grid-column: 1 / -1; }
  body[data-sonic-bg="hybrid"] .control-panel { top: 144px; max-height: calc(100svh - 164px); }
  body[data-sonic-bg="hybrid"] .signal-deck { grid-template-columns: minmax(240px, .7fr) minmax(0, 1.3fr); }
}
@media (max-width: 900px) {
  body[data-sonic-bg="hybrid"] main, body.admin-page .admin-shell { width: calc(100% - 28px); }
  body[data-sonic-bg="hybrid"] :is(.workspace, .signal-deck, .map-layout, .constellation-layout, .reports-layout, .ops-grid) { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; }
  body[data-sonic-bg="hybrid"] .reports-layout > * { grid-area: auto; }
  body[data-sonic-bg="hybrid"] main { padding-inline: 0; }
  body[data-sonic-bg="hybrid"] .control-panel { position: static; max-height: none; order: 2; }
  body[data-sonic-bg="hybrid"] .archive-feed { order: 1; }
  body[data-sonic-bg="hybrid"] .sonic-console { max-width: none; }
  body[data-sonic-bg="hybrid"] .archive-scroll-window { height: 84svh; min-height: 480px; padding: 12px; resize: none; }
  body.admin-page .admin-grid { grid-template-columns: minmax(0, 1fr); }
  body.admin-page .admin-grid > * { grid-column: auto; grid-row: auto; }
  body.admin-page .moments-import-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  body .topbar .notice { font-size: 17px; }
  body .topbar .tab { font-size: 14px; }
  body .topbar :is(.brand-mark, .mini-mark) { display: none; }
  body[data-sonic-bg="hybrid"] .topbar { padding: 10px; border-radius: 8px; }
  body[data-sonic-bg="hybrid"] .topbar .notice { font-size: 14px; }
  body[data-sonic-bg="hybrid"] .topbar .tab { color: #20252b; font-size: 13px; padding: 8px; }
  body[data-sonic-bg="hybrid"] .topbar .tab.is-active { color: #fff; }
  body[data-sonic-bg="hybrid"] .topbar-tools { gap: 4px; }
  body[data-sonic-bg="hybrid"] main { padding-top: 164px; }
  body[data-sonic-bg="hybrid"] :is(.workspace, .motion-section, #top) { scroll-margin-top: 164px; }
  body[data-sonic-bg="hybrid"] .section-head h2 { font-size: 26px; }
  body[data-sonic-bg="hybrid"] .hero { grid-template-columns: minmax(0, 1fr); }
  body[data-sonic-bg="hybrid"] .hero-copy h1 { font-size: 36px; }
  body[data-sonic-bg="hybrid"] .hero-poster { min-height: 240px; max-height: 380px; }
  body[data-sonic-bg="hybrid"] .hero-sidecard { grid-column: auto; }
  body[data-sonic-bg="hybrid"] .timeline-preview { grid-template-columns: 64px minmax(0, 1fr); }
  body[data-sonic-bg="hybrid"] .timeline-preview .timeline-preview-media { width: 64px; }
  body[data-sonic-bg="hybrid"] .timeline-stop-year { font-size: 11px; }
  body[data-sonic-bg="hybrid"] .archive-card { grid-template-columns: minmax(0, 1fr); }
  body[data-sonic-bg="hybrid"] .archive-card h3 { font-size: 18px; }
  body[data-sonic-bg="hybrid"] .feed-head h2 { font-size: 24px; }
  body.admin-page .admin-hero h1 { font-size: 28px; }
  body.admin-page :is(.moments-import-form, #moments-setup) { grid-template-columns: minmax(0, 1fr); }
  body.admin-page .button-row { display: grid; grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  body :is(.tilt-card, .motion-section, .panel, .hero, .workspace) { animation: none !important; transition: none !important; transform: none !important; }
}
