// =================================================================
// pw-styles.jsx — App-shell styles for the Operator Dashboard.
// Adapted from the Helix shell, plus role-switch / env-badge / context.
// =================================================================
const PaywallStyles = () => (
  <style>{`
    .hx-app { display:flex; flex-direction: column; min-height: 100vh; background: var(--bg); }

    /* ----- Top nav ----- */
    .hx-topnav { position: sticky; top: 0; z-index: 50; display:flex; align-items: center; gap: 12px; padding: 0 22px; height: 60px; background: var(--panel); border-bottom: 1px solid var(--line); }
    .hx-topnav-left { display:flex; align-items: center; gap: 12px; min-width: 0; }
    .hx-hamburger { display: none; width: 36px; height: 36px; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; color: var(--ink); padding: 0; }
    .hx-hamburger:hover { background: var(--hover); }
    .hx-brand { display:flex; gap: 8px; align-items: center; text-decoration: none; color: inherit; flex-shrink: 0; }
    .pw-logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }
    .hx-brand-name { font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
    .hx-brand-dot { color: var(--accent); }

    .pw-env { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--ink-2); background: var(--panel-2); white-space: nowrap; }
    .pw-env-dot { width: 7px; height: 7px; border-radius: 50%; }

    /* ----- Tabs: kill the stray vertical scrollbar from overflow-x:auto ----- */
    .hx-tabs-list { overflow-y: hidden; }

    /* ----- Connection badge ----- */
    .pw-conn-badge { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); cursor: pointer; font: inherit; color: var(--ink-2); white-space: nowrap; transition: border-color .12s, background .12s; }
    .pw-conn-badge:hover { border-color: var(--accent); background: var(--panel); }
    .pw-conn-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
    .pw-conn-dot.pulse { animation: pwpulse 1.1s ease-in-out infinite; }
    @keyframes pwpulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
    .pw-conn-mode { font-size: 12px; font-weight: 600; }
    .pw-conn-env { font-size: 11.5px; color: var(--muted); padding-left: 7px; border-left: 1px solid var(--line); }

    /* ----- Session row in avatar menu ----- */
    .pw-session-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; }
    .pw-session-extend { background: transparent; border: 1px solid var(--line); border-radius: 7px; padding: 3px 10px; font: inherit; font-size: 12px; color: var(--accent-strong); cursor: pointer; }
    .pw-session-extend:hover { background: var(--accent-soft); border-color: var(--accent); }

    /* ----- Role switch ----- */
    .pw-roleswitch { flex: 1; display: flex; justify-content: center; min-width: 0; }
    .pw-rs { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
    .pw-rs-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 0; background: transparent; border: none; cursor: pointer; font: inherit; color: var(--ink-2); border-radius: 9px; padding: 5px 16px; line-height: 1.25; transition: background .12s, color .12s; }
    .pw-rs-btn:hover { color: var(--ink); }
    .pw-rs-btn.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
    .pw-rs-label { font-size: 13px; font-weight: 600; }
    .pw-rs-hint { font-size: 11px; color: var(--muted); }
    .pw-rs-btn.on .pw-rs-hint { color: var(--accent); }

    .hx-topnav-right { display:flex; gap: 4px; align-items: center; flex-shrink: 0; }
    .hx-tn-icon { position: relative; background: transparent; border: none; cursor: pointer; padding: 8px; border-radius: 8px; color: var(--ink-2); display: inline-flex; }
    .hx-tn-icon:hover { background: var(--hover); color: var(--ink); }
    .hx-dot { position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

    /* ----- Dropdowns ----- */
    .hx-dd { position: relative; display: inline-flex; }
    .hx-avatar-btn { background: transparent; border: none; cursor: pointer; padding: 0; border-radius: 999px; transition: box-shadow .12s; }
    .hx-avatar-btn:hover { box-shadow: 0 0 0 2px var(--accent-soft); }
    .hx-dd-menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-modal); min-width: 240px; padding: 6px; z-index: 60; animation: hxpop .12s ease both; }
    .hx-avatar-menu { min-width: 260px; }
    .hx-notif-menu { width: 360px; max-width: calc(100vw - 24px); }
    .hx-dd-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; }
    .hx-dd-user { display: flex; gap: 12px; align-items: center; padding: 10px; }
    .hx-dd-sep { height: 1px; background: var(--line-2); margin: 4px 6px; }
    .hx-dd-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; background: transparent; border: none; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--ink-2); text-align: left; text-decoration: none; }
    .hx-dd-item:hover { background: var(--hover); color: var(--ink); }
    .hx-dd-item.danger { color: var(--bad); }
    .hx-dd-item.danger:hover { background: color-mix(in oklab, var(--bad) 8%, transparent); }
    .hx-kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border-radius: 4px; background: var(--line-2); color: var(--ink-2); border: 1px solid var(--line); }

    .hx-notif-list { max-height: 380px; overflow-y: auto; }
    .hx-notif-row { display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px; border-radius: 8px; width: 100%; text-align: left; }
    .hx-notif-row:hover { background: var(--hover); }
    .hx-notif-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--line-2); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .hx-notif-row.unread .hx-notif-icon { background: var(--accent-soft); color: var(--accent); }
    .hx-notif-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
    .hx-notif-title { font-size: 13.5px; font-weight: 500; color: var(--ink); }
    .hx-notif-body { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
    .hx-notif-time { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

    /* ----- Shell ----- */
    .hx-shell { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 60px); }
    body[data-sidebar="compact"] .hx-shell { grid-template-columns: 220px 1fr; }

    /* ----- Sidebar ----- */
    .hx-sidebar { background: var(--bg); border-right: 1px solid var(--line-2); padding: 18px 14px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 60px; align-self: start; height: calc(100vh - 60px); overflow-y: auto; }
    .hx-sidebar-close-row { display: none; justify-content: flex-end; }
    .hx-sidebar-close { width: 32px; height: 32px; background: transparent; border: none; cursor: pointer; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); }
    .hx-sidebar-close:hover { background: var(--hover); }
    .hx-drawer-backdrop { display: none; }

    .pw-ctx { display: flex; gap: 11px; align-items: center; padding: 10px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
    .pw-ctx-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .pw-ctx-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
    .pw-ctx-name { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    .hx-side-group { display: flex; flex-direction: column; }
    .hx-side-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 10px; margin-bottom: 6px; }
    .hx-side-items { display:flex; flex-direction: column; gap: 1px; }
    .hx-side-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font: inherit; font-size: 13.5px; color: var(--ink-2); text-align: left; transition: background .12s, color .12s, border-color .12s; min-height: 36px; }
    .hx-side-item:hover { background: var(--hover); color: var(--ink); }
    .hx-side-item.on { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in oklab, var(--accent) 22%, transparent); font-weight: 500; }

    /* ----- Main + screens ----- */
    .hx-main { padding: 22px 36px 48px; min-width: 0; }
    .hx-main-inner { display: flex; flex-direction: column; gap: 18px; max-width: 1280px; margin: 0 auto; }
    .hx-screen { display: flex; flex-direction: column; gap: var(--gap); margin-top: 4px; }
    .hx-card-grid { display: grid; gap: var(--gap); }
    .hx-card-grid > * { min-width: 0; }

    /* ================ RESPONSIVE ================ */
    @media (max-width: 1180px) { .hx-main { padding: 20px 24px 40px; } }
    @media (max-width: 1023px) {
      .hx-shell { grid-template-columns: 1fr; }
      .hx-hamburger { display: inline-flex; }
      .pw-roleswitch { justify-content: flex-end; flex: 1; }
      .pw-rs-hint { display: none; }
      .hx-topnav { padding: 0 16px; gap: 10px; }
      .hx-sidebar { position: fixed; left: 0; top: 0; height: 100vh; width: 300px; max-width: 88vw; z-index: 60; transform: translateX(-100%); transition: transform .22s ease; background: var(--panel); border-right: 1px solid var(--line); padding-top: 12px; }
      .hx-sidebar.hx-sidebar-open { transform: translateX(0); box-shadow: 8px 0 32px rgba(13,17,28,.18); }
      .hx-sidebar-close-row { display: flex; padding: 0 6px 6px; }
      .hx-drawer-backdrop { display: block; position: fixed; inset: 0; background: rgba(13,17,28,.42); z-index: 55; animation: hxfade .15s ease both; }
      .hx-main { padding: 18px 20px 40px; }
    }
    @media (max-width: 700px) {
      .pw-env { display: none; }
      .pw-rs-btn { padding: 6px 12px; }
    }
    @media (max-width: 560px) {
      .hx-topnav { padding: 0 12px; height: 56px; }
      .hx-main { padding: 16px 14px 32px; }
      .pw-rs-label { font-size: 12px; }
    }
    @media (pointer: coarse) {
      .hx-side-item { min-height: 44px; padding: 10px 12px; font-size: 14px; }
      .hx-tn-icon, .hx-hamburger { width: 40px; height: 40px; }
    }
  `}</style>
);

Object.assign(window, { PaywallStyles });
