/* Local responsive fixes. Keep the approved desktop palette and composition. */
@media (max-width: 1100px) {
  .editorial-theme #app-layout { flex-direction: column; position: relative; height: 100dvh; }
  .editorial-theme #app-layout > main { min-width: 0; min-height: 0; }
  .editorial-theme #main-sidebar {
    width: 100%; height: 64px; flex: 0 0 64px; position: relative;
    border-right: 0; z-index: 40;
  }
  .editorial-theme #main-sidebar > .sidebar-brand-row {
    display: flex; align-items: center; justify-content: space-between;
    height: 64px; padding: 8px 16px; gap: 16px;
  }
  .editorial-theme #main-sidebar .sidebar-brand-row .ed-brand { display: flex; flex-direction: row; align-items: center; gap: 12px; }
  .editorial-theme #main-sidebar .sidebar-brand-row .ed-brand img { width: 76px; height: 40px; object-fit: contain; }
  .editorial-theme #main-sidebar .sidebar-brand-row .ed-brand span { font-size: 12px; letter-spacing: 0; white-space: normal; max-width: 130px; }
  .editorial-theme #main-sidebar .sidebar-brand-row .sidebar-toggle {
    display: grid; align-self: center; margin: 0; width: 44px; height: 44px; font-size: 24px;
  }
  .editorial-theme #main-sidebar:not(.ed-nav-open) > :not(.sidebar-brand-row) { display: none !important; }
  .editorial-theme #main-sidebar.ed-nav-open { position: absolute; inset: 0; height: 100%; }
  .editorial-theme #main-sidebar.ed-nav-open nav {
    display: flex; flex-direction: column; overflow: auto; padding: 12px 16px;
    gap: 4px; flex: 1 1 auto; min-height: 0;
  }
  .editorial-theme #main-sidebar.ed-nav-open nav button {
    width: 100%; min-height: 48px; flex: 0 0 auto; padding: 12px 16px; font-size: 14px;
  }
  .editorial-theme #main-sidebar.ed-nav-open > div:last-child {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 8px 16px; gap: 4px;
  }
  .editorial-theme #main-sidebar.ed-nav-open > div:last-child button {
    width: 100%; min-height: 48px; padding: 8px; margin: 0; font-size: 12px;
  }
  .editorial-theme #main-sidebar.ed-nav-open > div:last-child button > div { flex-wrap: wrap; gap: 6px; }
  .editorial-theme #main-sidebar .ed-nav-label { display: none; }
  .editorial-theme #app-layout > main > header { height: 48px; padding: 8px 16px; }
  .editorial-theme #current-tab-title { font-size: 20px; }
  .editorial-theme #app-layout > main > header + div { padding: 16px; scroll-padding-block: 16px var(--editor-footer-clearance, 160px); }
  .editorial-theme .ed-page { min-width: 0; }
  .editorial-theme .ed-page button { min-height: 44px; background-image: none; }
  .editorial-theme button { background-image: none; }
  .editorial-theme button[class*="bg-gradient"] { background-color: var(--ed-accent); color: #18251e; }
  .editorial-theme :is(.text-\[9px\], .text-\[10px\], .text-\[11px\]) { font-size: 12px; }
  .editorial-theme .em-eyebrow { font-size: 12px; letter-spacing: 0; text-transform: none; }
  .editorial-theme :is(.em-card-meta, .em-target-hints span, .em-context-line span, .em-counter,
    .ep-analytics-waiting, .ep-analytics-delta, .ed-modes small) { font-size: 12px; }
  .editorial-theme .em-card-meta { text-transform: none; letter-spacing: 0; }
  .editorial-theme .ep-sites { flex-wrap: wrap; overflow: visible; }
  .editorial-theme .ep-sites button { min-height: 44px; white-space: normal; }
  .editorial-theme .em-header { gap: 12px; padding-bottom: 12px; }
  .editorial-theme .em-header h1 { font-size: 24px; }
  .editorial-theme .em-sections { padding: 12px 0; }
  .editorial-theme .em-toolbar { flex-direction: column; gap: 12px; margin-top: 16px; }
  .editorial-theme .em-toolbar-actions { width: 100%; }
  .editorial-theme .em-toolbar-actions button { width: auto; }
  .editorial-theme .em-editor-v2 { padding: 0 0 16px; }
  .editorial-theme .em-editor-v2 .em-editor-head {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
    gap: 8px 16px; margin: 0 0 16px; padding: 0;
  }
  .editorial-theme .em-editor-v2 .em-editor-head h2 { font-size: 24px; }
  .editorial-theme .em-editor-v2 .em-editor-head .em-state { grid-column: 1 / -1; margin: 0; font-size: 12px; }
  .editorial-theme .em-editor-v2 .em-editor-flow { gap: 16px; }
  .editorial-theme .em-editor-v2 .em-panel-heading { min-height: 56px; padding: 12px 16px; }
  .editorial-theme .em-editor-v2 .em-writing-fields { padding: 16px; gap: 16px; }
  .editorial-theme .em-editor-v2 .em-disclosure-trigger { min-height: 64px; padding: 10px 16px; }
  .editorial-theme .em-editor-v2 .em-site-selectors { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
  .editorial-theme .em-editor-v2 .em-site-selectors .em-target-option { min-width: 0; }
  .editorial-theme .em-editor-v2 .em-site-selectors .em-target-option span { min-width: 0; overflow-wrap: anywhere; }
  .editorial-theme .em-editor-v2 .em-editor-footer.em-save-panel {
    padding: 8px 12px max(8px, env(safe-area-inset-bottom)); gap: 4px;
    background: #15191d; backdrop-filter: none; box-shadow: none;
  }
  .editorial-theme .em-editor-v2 .em-footer-actions { gap: 8px; }
  .editorial-theme .em-editor-v2 .em-editor-footer button { min-height: 44px; padding: 8px 10px; font-size: 13px; }
  .editorial-theme .em-editor-v2 :is(input, textarea, [contenteditable], summary) { scroll-margin-block: 24px var(--editor-footer-clearance, 160px); }
}
@media (max-width: 650px) {
  .editorial-theme .em-header { grid-template-columns: minmax(0, 1fr) auto; }
  .editorial-theme .em-header > div { min-width: 0; }
  .editorial-theme .em-header-actions { align-self: start; }
  .editorial-theme .em-subtitle { font-size: 13px; }
  .editorial-theme .em-toolbar p { font-size: 13px; }
  .editorial-theme .em-toolbar-actions button { flex: 1 1 auto; }
  .editorial-theme .em-toolbar-actions .ed-primary { flex-basis: 100%; }
  .editorial-theme .em-editor-v2 .em-editor-head { grid-template-columns: minmax(0, 1fr); }
  .editorial-theme .em-editor-v2 .em-editor-head > button { justify-self: start; }
  .editorial-theme .em-editor-v2 .em-editor-head h2 { font-size: 22px; }
  .editorial-theme .em-editor-v2 .em-footer-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .editorial-theme .em-editor-v2 .em-secondary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .editorial-theme .em-editor-v2 .em-footer-actions button { width: 100%; font-size: 12px; min-width: 0; }
  .editorial-theme .em-editor-v2 .em-ready-state { line-height: 1.4; }
  .editorial-theme .em-editor-v2 .em-publish-modes { gap: 4px 16px; }
  .editorial-theme .em-editor-v2 .em-publish-modes label { min-height: 44px; }
}
@media (max-width: 360px) {
  .editorial-theme #main-sidebar .sidebar-brand-row .ed-brand span { max-width: 110px; }
  .editorial-theme #main-sidebar.ed-nav-open > div:last-child { grid-template-columns: 1fr; }
  .editorial-theme .em-header { grid-template-columns: 1fr; }
  .editorial-theme .em-header-actions { justify-self: start; }
}
