    /* SIDEBAR + MAIN LAYOUT */
    .app-layout {
      min-height: calc(100vh - 64px);
      position: relative;
    }
    .sidebar {
      width: 200px;
      background: var(--white);
      border-right: 1px solid var(--gray-100);
      padding: 12px 0;
      position: fixed;
      top: 64px;
      left: 0;
      bottom: 0;
      z-index: 60;
      overflow: visible;
      /* Visible by default with .locked applied — visitors see the 8 panels
         they'll unlock after upload. .locked class disables interaction
         cleanly (per Marcus: don't make grayed items clickable-but-broken). */
    }
    .sidebar.active { display: block; }
    .sidebar.locked .sidebar-nav button,
    .sidebar.locked .sidebar-nav a {
      opacity: 0.45;
      cursor: not-allowed;
      pointer-events: none;
      /* Lock icon via ::after makes items visibly inert, not just dimmer.
         Priya: "0.4 opacity isn't enough; eye keeps trying to click them." */
    }
    /* Lock glyph appended to each locked nav item label via pseudo-element.
       margin-left:auto pushes it flush-right; won't shift SVG icon or label text. */
    .sidebar.locked .sidebar-nav button::after,
    .sidebar.locked .sidebar-nav a::after {
      content: '\1F512';
      font-size: 10px;
      margin-left: auto;
      padding-left: 6px;
      opacity: 0.6;
      filter: grayscale(1) brightness(0.5);
      flex-shrink: 0;
      line-height: 1;
    }
    .sidebar.locked .sidebar-nav button.active {
      background: transparent;
      color: var(--gray-600);
      border-left-color: transparent;
      font-weight: 500;
    }
    .sidebar-lock-banner {
      display: none;
      margin: 4px 14px 12px;
      padding: 10px 12px;
      background: var(--accent-50);
      border: 1px solid rgba(216,90,48,0.2);
      border-left: 3px solid var(--accent-500);
      border-radius: 6px;
      font-size: 12px;
      line-height: 1.4;
      color: var(--gray-700);
    }
    .sidebar.locked .sidebar-lock-banner { display: block; }
    .sidebar-nav { list-style: none; overflow-y: auto; max-height: calc(100vh - 88px); }
    .sidebar-nav li { padding: 0; }
    /* Sidebar items used to be <a href="#"> with inline onclick; they're now
       <button> elements so keyboard semantics are correct and "#" anchors
       don't pollute the URL bar. Selector covers both for safety. */
    .sidebar-nav a,
    .sidebar-nav button {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 10px;
      padding: 10px 14px;
      font-size: 14px;
      font-weight: 500;
      color: var(--gray-600);
      text-decoration: none;
      transition: background 0.15s, color 0.15s;
      border-left: 3px solid transparent;
      white-space: nowrap;
      background: transparent;
      border-top: none;
      border-right: none;
      border-bottom: none;
      width: 100%;
      text-align: left;
      cursor: pointer;
      font-family: inherit;
    }
    .sidebar-nav a:hover,
    .sidebar-nav button:hover { background: var(--gray-50); color: var(--gray-800); }
    .sidebar-nav a.active,
    .sidebar-nav button.active {
      background: var(--accent-50);
      /* color-accessible-pairs: --accent-500 (#D85A30) on the sidebar accent-50
         wash (rgba(216,90,48,0.12) over rgb(17,22,42)) composites to ~4.08:1 for
         14px text — below 4.5:1 AA. --accent-text (#E06535) gives 4.57:1. */
      color: var(--accent-text);
      font-weight: 600;
      border-left-color: var(--accent-text);
    }
    .sidebar-nav a svg,
    .sidebar-nav button svg { flex-shrink: 0; min-width: 18px; }
    /* "Search Terms" sub-heading in the sidebar. Was previously inline-styled. */
    .sidebar-nav .sidebar-group-label { padding: 12px 14px 4px; margin-top: 12px; }
    .sidebar-nav .sidebar-group-label span {
      font-size: 11px; font-weight: 600; text-transform: uppercase;
      letter-spacing: 1px; color: var(--gray-400);
    }

    /* SIDEBAR TOGGLE */
    .sidebar.collapsed { width: 0; padding: 0; overflow: visible; }
    .sidebar.collapsed + .main-content { padding-left: 24px; }
    .sidebar.collapsed .sidebar-nav { display: none; }

    /* Sidebar toggle button (the chevron pill on the sidebar's right edge).
       JS sets the `left` value on toggle; everything else is here. Hidden by
       default; revealed when the sidebar is shown via .active. */
    #sidebarToggleBtn {
      position: fixed;
      top: 50%;
      left: 200px;
      transform: translateY(-50%);
      z-index: 9999;
      background: #1A1E2E;
      color: #ffffff;
      border: none;
      width: 20px;
      height: 48px;
      border-radius: 0 10px 10px 0;
      font-size: 18px;
      line-height: 1;
      cursor: pointer;
      display: none;
      align-items: center;
      justify-content: center;
      box-shadow: 2px 0 6px rgba(0,0,0,0.2);
      transition: left 0.2s ease;
      padding: 0;
      font-family: inherit;
    }

    .main-content {
      max-width: none;
      margin: 0;
      padding: 88px 24px 48px 220px;
      width: 100%;
    }

    /* TOGGLE SWITCH — iOS-style pill toggle */
    .toggle-switch {
      position: relative; display: inline-block; flex-shrink: 0;
      width: 36px; min-width: 36px; max-width: 36px;
      height: 18px; min-height: 18px; max-height: 18px;
      vertical-align: middle; overflow: hidden;
    }
    .toggle-switch input {
      position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
    }
    .toggle-slider {
      position: absolute; cursor: pointer; top: 0; left: 0;
      width: 36px; height: 18px;
      background: var(--gray-200); border-radius: 9px; transition: background 0.25s;
    }
    .toggle-slider::before {
      content: ''; position: absolute; top: 2px; left: 2px;
      width: 14px; height: 14px;
      background: var(--white); border-radius: 50%; transition: transform 0.25s;
      box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    }
    .toggle-switch input:checked + .toggle-slider { background: var(--accent-500); }
    .toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

    /* CAMPAIGN OVERVIEW PANEL */
    .campaignoverview-panel { display: none; }
    .campaignoverview-panel.active { display: block; }

    /* STRATEGY PANEL */
    .strategy-panel { display: none; max-width: none; }
    .strategy-panel.active { display: block; }
    .config-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
      margin-bottom: 24px;
    }
    .config-card {
      background: var(--white);
      border: 1px solid var(--gray-100);
      border-radius: 10px;
      overflow: clip;
    }
    .campaign-overview-card { margin-top: 0; overflow: visible; }
    /* overflow-x:auto lets a widened column scroll the wrapper rather than
       shrinking peers. overflow-x:auto also forces overflow-y to auto (CSS spec),
       so this is a 2-axis scroll container — cap the height and anchor the sticky
       thead to top:0 (the .strategy-table-scroll pattern) so the header keeps
       pinning instead of scrolling away. */
    .campaign-overview-scroll {
      overflow-x: auto; overflow-y: auto; max-height: 70vh; padding: 0;
    }
    .campaign-overview-scroll table { width: 100%; font-size: 14px; border-collapse: collapse; table-layout: fixed; min-width: 600px; }
    .campaign-overview-scroll thead th {
      position: sticky; top: 0; z-index: 10; background: var(--gray-50);
      padding: 12px 10px; white-space: nowrap; text-align: left; font-weight: 600; font-size: 11px;
      text-transform: uppercase; letter-spacing: 0.1em; color: var(--gray-400);
      border-bottom: 2px solid var(--gray-100);
      overflow: visible; text-overflow: ellipsis; cursor: pointer; user-select: none;
    }
    .campaign-overview-scroll thead th.sort-asc::after,
    .campaign-overview-scroll thead th.sort-desc::after {
      content: ''; display: inline-block; margin-left: 5px; vertical-align: middle;
      width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
    }
    .campaign-overview-scroll thead th.sort-asc::after { border-bottom: 5px solid var(--gray-800); }
    .campaign-overview-scroll thead th.sort-desc::after { border-top: 5px solid var(--gray-800); }
    .campaign-overview-scroll thead th.num { text-align: right; }
    .campaign-overview-scroll td {
      padding: 8px 10px; font-size: 14px; border-bottom: 1px solid var(--gray-50); white-space: nowrap;
      overflow: hidden; text-overflow: ellipsis;
    }
    .campaign-overview-scroll td.campaign-name { max-width: none; }
    .config-card-header {
      padding: 14px 24px;
      background: var(--gray-50);
      border-bottom: 1px solid var(--gray-100);
      font-size: 12px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: var(--gray-600);
    }
    .config-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 24px;
      border-bottom: 1px solid var(--gray-50);
      font-size: 14px;
    }
    .config-row:last-child { border-bottom: none; }
    .config-row label { flex: 1; color: var(--gray-700); font-weight: 500; white-space: nowrap; font-size: 14px; }
    .config-row input[type="number"] {
      width: 72px; padding: 8px 12px; height: 36px; border: 1px solid var(--gray-200); border-radius: 6px;
      font-size: 14px; font-family: var(--font-body); text-align: right; outline: none;
    }
    .config-row input[type="number"]:focus { border-color: var(--accent-500); }
    .config-row .unit { font-size: 14px; color: var(--gray-400); min-width: 14px; }
    .config-default { font-size: 14px; color: var(--gray-400); padding: 8px 24px; }
    .config-sub-row {
      display: flex; align-items: center; justify-content: space-between;
      padding: 4px 24px 4px 36px; font-size: 14px;
    }
    .config-sub-row label { flex: none; color: var(--gray-600); font-weight: 400; font-size: 14px; }
    .config-sub-row input[type="number"] {
      width: 70px; padding: 8px 12px; height: 36px; border: 1px solid var(--gray-200); border-radius: 6px;
      font-size: 14px; font-family: var(--font-body); text-align: right; outline: none;
    }

    .strategy-table-wrap {
      background: var(--white);
      border: 1px solid var(--gray-100);
      border-radius: 10px;
      width: 100%;
    }
    .strategy-table-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 16px 20px; border-bottom: 1px solid var(--gray-100);
    }
    .strategy-table-header h2 { font-size: 16px; font-weight: 700; color: var(--gray-900); }
    /* overflow-x:auto makes this wrapper a scroll context (overflow-y resolves to
       auto too, per spec), so a sticky thead pins relative to THIS wrapper, not
       the page. The old top:64px (meant to clear the page's sticky anchor-nav)
       then opened a 64px gap inside the wrapper that data rows showed through,
       leaving the header "sandwiched" mid-table. Fix: cap the wrapper height so it
       scrolls internally and pin the header to the wrapper top (top:0). */
    .strategy-table-scroll { overflow-x: auto; overflow-y: auto; max-height: 70vh; }
    .strategy-table-scroll table { font-size: 14px; width: 100%; border-collapse: collapse; table-layout: fixed; }
    .strategy-table-scroll thead th { position: sticky; top: 0; z-index: 10; background: var(--gray-50); white-space: nowrap; cursor: pointer; user-select: none; overflow: visible; text-overflow: ellipsis; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; color: var(--gray-400); border-bottom: 2px solid var(--gray-100); }
    .strategy-table-scroll thead th.sort-asc::after,
    .strategy-table-scroll thead th.sort-desc::after {
      content: ''; display: inline-block; margin-left: 5px; vertical-align: middle;
      width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
    }
    .strategy-table-scroll thead th.sort-asc::after { border-bottom: 5px solid var(--gray-800); }
    .strategy-table-scroll thead th.sort-desc::after { border-top: 5px solid var(--gray-800); }
    .strategy-table-scroll td, .strategy-table-scroll th { padding: 8px 10px; white-space: nowrap; text-overflow: ellipsis; }
    .strategy-table-scroll td { overflow: hidden; font-size: 14px; }
    .strategy-table-scroll td.campaign-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
    .bid-up { color: var(--green-500); }
    /* color-accessible-pairs: --red-500 (#EF4444) on --gray-50 (rgb(23,29,51)) = 4.43:1,
       just under 4.5:1 AA for 14px/normal text. Use --badge-crit-fg (#F87171) = 6.03:1. */
    .bid-down { color: var(--badge-crit-fg); }
    .acos-good { color: var(--accent-600); font-weight: 600; }
    .bid-edit {
      width: 70px; padding: 4px 8px; height: 28px; border: 1px solid #E2E0DC; border-radius: 6px;
      font-size: 14px; font-family: var(--font-body); text-align: center; outline: none;
      background: var(--white); color: inherit;
    }
    .bid-edit:focus { border-color: var(--accent-500); }
    .bid-up .bid-edit { color: var(--green-500); }
    .bid-down .bid-edit { color: var(--badge-crit-fg); }
    .campaign-target-edit {
      width: 60px; padding: 4px 8px; height: 28px; border: 1px solid #E2E0DC; border-radius: 6px;
      font-size: 14px; font-family: var(--font-body); text-align: center; outline: none;
      /* color-accessible-pairs: browser default black on --white (rgb(17,22,42)) = 1.17:1.
         --gray-800 (#EEF1F8) gives 15.85:1 on this surface. */
      color: var(--gray-800);
      background: var(--white);
    }
    .campaign-target-edit:focus { border-color: var(--accent-500); }
    .bulk-op-edit {
      padding: 4px 8px; border: 1px solid #E2E0DC; border-radius: 6px;
      font-size: 14px; font-family: var(--font-body); outline: none;
      background: var(--white);
    }
    .bulk-op-edit:focus { border-color: var(--accent-500); }
    #bulkPreviewWrap .strategy-table-scroll { overflow-x: auto; }
    #bulkPreviewWrap .strategy-table-scroll table { table-layout: fixed; min-width: 900px; }
    #bulkPreviewWrap .strategy-table-scroll th,
    #bulkPreviewWrap .strategy-table-scroll td {
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    #bulkPreviewWrap .strategy-table-scroll thead th { position: sticky; top: 0; z-index: 10; }
    #bulkPreviewBody td[contenteditable] { cursor: text; }
    #bulkPreviewBody td[contenteditable]:focus { outline: 2px solid var(--accent-500); outline-offset: -2px; background: var(--accent-50); overflow: visible; white-space: normal; }

    /* FILE UPLOAD PANEL */
    .fileupload-panel { display: none; }
    .fileupload-panel.active { display: block; }
    .download-card {
      background: var(--white); border: 1px solid var(--gray-100); border-radius: 10px;
      padding: 48px 40px; text-align: center; max-width: 600px; margin: 0 auto;
      display: flex; flex-direction: column; align-items: center; gap: 16px;
    }
    .download-card h2 { font-size: 28px; font-weight: 700; color: var(--gray-900); margin-bottom: 0; }
    .download-card p { color: var(--gray-600); margin-bottom: 4px; font-size: 16px; }
    .download-summary { text-align: left; margin: 0 auto 8px; max-width: 400px; width: 100%; }
    .download-summary-row {
      display: flex; justify-content: space-between; padding: 8px 0;
      font-size: 14px; border-bottom: 1px solid var(--gray-50);
    }
    .download-summary-row .lbl { color: var(--gray-600); }
    .download-summary-row .val { font-weight: 600; color: var(--gray-900); }

    /* FOOTER */
    footer {
      text-align: center;
      padding: 40px 24px;
      background: #1A1E2E;
      color: rgba(255,255,255,0.5);
      font-size: 14px;
    }
    footer a { color: rgba(255,255,255,0.7); }
    footer a:hover { color: var(--accent-500); }
