/* Survey Embed page-specific styles. */
:root { color-scheme: dark; --ink: #edf1f7; --muted: #a4adbb; --line: #393f48; --surface: #282c33; }
    * { box-sizing: border-box; }
    body { margin: 0; background: #1d2026; color: var(--ink); font-family: Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; line-height: 1.5; }
    button,input { font: inherit; } button { cursor: pointer; } a { color: inherit; }
    .site-header { position: fixed; inset: 0 auto 0 0; width: 242px; background: #24272e; border-right: 1px solid #333840; }
    .header-inner { padding: 24px 14px; display: flex; flex-direction: column; gap: 36px; height: 100%; }
    .sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 2px 5px 22px; border-bottom: 1px solid #373c45; text-decoration: none; }
    .sidebar-brand img { width: 48px; height: 48px; border-radius: 11px; object-fit: contain; flex-shrink: 0; }
    .sidebar-brand strong { display: block; font-size: .91rem; line-height: 1.3; }
    .sidebar-brand small { display: block; font-size: .69rem; color: #aab4c4; line-height: 1.35; }
    .brand { display: grid; gap: 6px; }
    .top-link { display: block; color: #a9afbb; padding: 11px 13px; border-radius: 8px; font-size: .88rem; text-decoration: none; }
    .top-link:hover { background: #343943; color: #fff; }
    .active-link { background: #30343d; color: #fff; border-left: 3px solid #818d9c; }
    .page { max-width: 1320px; margin-left: 242px; padding: 38px 52px 70px; }





    .heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 36px; }

    h1 { font-size: clamp(1.55rem,2.5vw,2rem); letter-spacing: -.035em; margin: 5px 0 4px; }
    
    .environment { border: 1px solid #424d48; background: #292e32; color: #a5c8b1; padding: 8px 12px; border-radius: 8px; white-space: nowrap; font-size: .76rem; }
    .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; margin-bottom: 30px; padding: 0 24px 24px; box-shadow: 0 3px 12px rgba(0,0,0,.1); overflow: hidden; }
    .panel-heading { margin: 0 -24px 24px; padding: 17px 24px; background: #2c3038; border-bottom: 1px solid #3b424b; }
    h2 { font-size: .98rem; margin: 0 0 3px; }
    .panel-heading p { color: #9da6b5; font-size: .77rem; margin: 0; }
    .controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
    .button { border: 1px solid #515a68; background: #343a44; color: #f0f4fa; padding: 10px 14px; border-radius: 7px; font-size: .84rem; font-weight: 600; }
    .button:hover { background: #424a56; border-color: #7b8797; }
    .button:focus-visible,input:focus-visible { outline: 2px solid #9bb2c7; outline-offset: 2px; }



    .helper { font-size: .78rem; color: #a4adbb; margin: 12px 0 0; }
    .viewer { background: #20242b; border: 1px solid #424952; border-radius: 8px; padding: 20px; overflow: auto; }

    .embed-shell { width: 100%; max-width: 100%; margin: 0 auto; background: #fff; border-radius: 5px; overflow: hidden; transition: width 180ms ease; }
    .embed-frame { display: block; width: 100%; min-height: 600px; border: 0; background: #fff; }
    .stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-bottom: 30px; }
    .stat { padding: 18px; border: 1px solid #393f48; background: #282c33; border-radius: 9px; }
    .stat-label { display: block; color: #a4adbb; font-size: .77rem; margin-bottom: 6px; }
    .stat-value { font-size: 1rem; font-weight: 700; overflow-wrap: anywhere; }







    @media(max-width:900px) {
      .site-header { position: relative; width: 100%; border-right: 0; border-bottom: 1px solid #333840; }
      .header-inner { height: auto; padding: 12px 20px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
      .sidebar-brand { border: 0; padding: 0; }
      .brand { display: flex; gap: 5px; }
      .page { margin: 0; padding: 28px 30px 50px; }
    }
    @media(max-width:620px) {
      .header-inner { flex-direction: column; align-items: flex-start; }
      .page { padding: 20px 16px 40px; }
      .heading { flex-direction: column; align-items: flex-start; gap: 10px; }
      .panel { padding: 0 16px 18px; margin-bottom: 24px; }
      .panel-heading { margin: 0 -16px 18px; padding: 15px 16px; }
      .stats { grid-template-columns: 1fr; gap: 10px; }

      .viewer { padding: 10px; }

    }
  
    /* Floating sidebar: same page background, no enclosing rail */
    .site-header { background: transparent; border-right: 0; }
    .sidebar-brand { border-bottom: 0; padding-bottom: 0; }
    .header-inner { padding-left: 22px; padding-right: 22px; }
    .brand .active-link { border-left: 0; background: #30343d; }
    .brand .top-link, .brand-name.top-link { border-radius: 9px; }
    @media (max-width: 900px) {
      .site-header { border-bottom: 0; }
      .header-inner { padding-left: 20px; padding-right: 20px; }
    }


    /* Deeper panel surfaces and stronger elevation */
    .panel {
      background: #22262d;
      border-color: #3c424c;
      box-shadow: 0 10px 24px rgba(0, 0, 0, .28), 0 3px 8px rgba(0, 0, 0, .16);
    }
    .panel:hover {
      border-color: #505762;
      box-shadow: 0 13px 28px rgba(0, 0, 0, .32), 0 4px 10px rgba(0, 0, 0, .18);
    }
    .panel-heading { background: #252a32; border-bottom-color: #393f49; }





    .heading { margin-top: 4px; }

    /* Shared SDK dashboard layout and inactive account controls */
    .global-auth { position: fixed; top: 18px; right: 28px; z-index: 100; display: flex; align-items: center; gap: 10px; }
    .global-auth .button { padding: 7px 11px; min-height: 34px; font-size: .78rem; }
    .global-auth .button:disabled { cursor: not-allowed; opacity: .48; background: #30353d; color: #b5beca; border-color: #434a55; }
    .auth-indicator { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: #aab4c2; }
    .auth-dot { width: 8px; height: 8px; border-radius: 50%; background: #e5a04c; }
    .page { box-sizing: border-box; max-width: none; width: auto; margin-left: 242px; padding: 112px 52px 70px; }
    .page > .heading, .page > .stats, .page > .panel, .page > .footer { width: 100%; max-width: 1320px; margin-left: auto; margin-right: auto; }
    .heading { margin-bottom: 36px; }
    .stats { margin-bottom: 34px; gap: 18px; }
    .panel { background: #22262d; border-color: #3c424c; box-shadow: 0 10px 24px rgba(0,0,0,.28),0 3px 8px rgba(0,0,0,.16); }
    .panel-heading { background: #2d323a; border-bottom-color: #3b424b; }
    .button { background: #30353d; border-color: #434a55; padding: 7px 11px; min-height: 34px; font-size: .78rem; }
    .button:hover:not(:disabled) { background: #393f49; border-color: #687381; }
    @media (max-width: 900px) {
      .page { margin-left: 0; padding: 90px 30px 50px; }
      .global-auth { top: 16px; right: 20px; }
      .sidebar-brand { padding-right: 175px; }
    }
    @media (max-width: 620px) {
      .page { padding: 85px 16px 40px; }
      .global-auth { top: 14px; right: 14px; gap: 6px; }
      .global-auth .button { padding: 7px 9px; font-size: .75rem; }
      .sidebar-brand { padding-right: 140px; }
    }




    .global-auth { gap: 9px; }




















    @media (max-width: 620px) {
 }

    /* Compact sidebar theme switch and white light-mode headers */
    .header-inner { gap: 18px; }
    .brand { margin-bottom: 10px; }









    @media (min-width: 901px) {


    }
    @media (max-width: 620px) {


    }

    .sidebar-toggle { background: transparent; border: 1px solid #3d444f; border-radius: 8px; padding: 9px 12px; color: #abb6c4; text-align: left; cursor: pointer; }
    .sidebar-toggle:hover { background: #30353d; }
    .sidebar-toggle-text { margin-left: 8px; font-size: .78rem; }

    @media (min-width: 901px) {
      body.sidebar-collapsed .site-header { width: 86px; }
      body.sidebar-collapsed .page { margin-left: 86px; }
      body.sidebar-collapsed .header-inner { padding-left: 14px; padding-right: 14px; }
      body.sidebar-collapsed .sidebar-brand { justify-content: center; }
      body.sidebar-collapsed .sidebar-brand span, body.sidebar-collapsed .sidebar-toggle-text { display: none; }
      body.sidebar-collapsed .brand .top-link { font-size: 0; text-align: center; }
      body.sidebar-collapsed .brand .top-link::first-letter { font-size: 1.2rem; }
      body.sidebar-collapsed .sidebar-toggle { text-align: center; }
    }







    @media (min-width: 901px) {
 }









    /* Simplified embed testing: two stats, code editor and preview */
    .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .embed-label { display: block; margin-bottom: 10px; font-size: .8rem; color: #aab4c2; }
    .embed-code { display: block; width: 100%; min-height: 132px; resize: vertical; padding: 14px; border-radius: 8px; border: 1px solid #343b45; background: #171b21; color: #d0d7e2; font: .83rem/1.6 ui-monospace,SFMono-Regular,Consolas,monospace; }
    .embed-code:focus { outline: 1px solid #778595; border-color: #778595; }
    .embed-code::placeholder { color: #8995a5; }
    .embed-tools { margin-top: 14px; }
    .embed-empty { min-height: 320px; display: flex; align-items: center; justify-content: center; padding: 30px; color: #6d7887; background: #f7f8fa; text-align: center; }
    .helper[data-error="true"] { color: #f09aa3; }



    @media (max-width: 620px) { .stats { grid-template-columns: 1fr; } }

    /* Mobile-only two-row header: branding/account, then navigation/theme */
    @media (max-width: 900px) {
      .site-header { position: relative; inset: auto; width: 100%; height: auto; background: transparent; border: 0; }
      .header-inner {
        display: grid; grid-template-columns: minmax(0,1fr) auto;
        grid-template-areas: "identity identity" "navigation theme";
        align-items: center; column-gap: 10px; row-gap: 12px;
        height: auto; padding: 14px 16px 12px; margin: 0;
      }
      .sidebar-brand {
        grid-area: identity; min-width: 0; max-width: calc(100% - 178px);
        padding: 0; margin: 0; border: 0; gap: 9px;
      }
      .sidebar-brand img { width: 40px; height: 40px; flex-shrink: 0; }
      .sidebar-brand span { min-width: 0; overflow: hidden; }
      .sidebar-brand strong, .sidebar-brand small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
      .brand { grid-area: navigation; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; min-width: 0; margin: 0; }
      .brand .top-link { padding: 9px 10px; font-size: .8rem; white-space: nowrap; }
      .sidebar-toggle { display: none !important; }

      .global-auth {
        position: absolute; top: 16px; right: 16px; left: auto; z-index: 5;
        display: flex; align-items: center; gap: 5px; max-width: 170px;
      }
      .global-auth .anonymous-pill, .global-auth .auth-indicator {
        min-width: 0; max-width: 94px; overflow: hidden; white-space: nowrap;
        text-overflow: ellipsis; font-size: .72rem;
      }
      .global-auth #authStatusText { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
      .global-auth .button, .global-auth .button:not(.event-button) {
        padding: 6px 8px; min-height: 32px; font-size: .72rem; flex-shrink: 0;
      }
      .page, body.sidebar-collapsed .page { margin-left: 0; padding: 22px 16px 40px; }
      .page > .heading { margin-top: 0; }
    }
    @media (max-width: 390px) {
      .sidebar-brand { max-width: calc(100% - 150px); }
      .sidebar-brand img { width: 36px; height: 36px; }
      .sidebar-brand strong { font-size: .78rem; }
      .sidebar-brand small { font-size: .63rem; }
      .global-auth { max-width: 145px; gap: 3px; }
      .global-auth .anonymous-pill, .global-auth .auth-indicator { max-width: 68px; }
      .brand .top-link { padding: 8px 7px; font-size: .75rem; }
    }

    @media (max-width: 900px) {


      .global-auth .auth-indicator { font-size: 0; gap: 0; }
      .global-auth .auth-indicator .auth-dot { display: inline-block; flex: 0 0 8px; }
    }

    /* Consistent floating panel headings and clickable button elevation */
    .panel { overflow: visible; padding-top: 22px; }

    .panel-heading h2 { margin: 0; font-size: 1rem; font-weight: 700; }
    .panel-heading p { display: none; }
    .button { box-shadow: 0 3px 7px rgba(0,0,0,.22), 0 1px 2px rgba(0,0,0,.15); transition: box-shadow .15s ease, transform .15s ease; }
    .button:hover:not(:disabled) { box-shadow: 0 5px 12px rgba(0,0,0,.27); transform: translateY(-1px); }
    .button:active:not(:disabled) { transform: translateY(0); }

    @media (max-width: 620px) { .panel { padding-top: 18px; } .panel-heading { margin-bottom: 14px; } }

    /* Refined depth and atmospheric lighting, without changing layout or theme colors */
    body {
      background-image:
        radial-gradient(ellipse 54rem 35rem at 95% -8%, rgba(111, 149, 205, .105), transparent 72%),
        radial-gradient(ellipse 42rem 34rem at 5% 42%, rgba(112, 171, 184, .075), transparent 75%);
      background-attachment: fixed;
    }

    .panel, .status-card, .stat {
      border-radius: 17px;
      box-shadow: 0 10px 30px rgba(0,0,0,.105), 0 2px 6px rgba(0,0,0,.055);
      transition: box-shadow .22s ease, border-color .22s ease;
    }
    .panel:hover, .status-card:hover, .stat:hover {
      box-shadow: 0 14px 36px rgba(0,0,0,.14), 0 3px 9px rgba(0,0,0,.07);
    }

    .event-button, .button:not(:disabled) {
      transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
    }
    .event-button:focus-visible, .button:focus-visible {
      outline-offset: 3px;
    }
    .anonymous-pill .dot, .auth-indicator .auth-dot, .status-dot {
      box-shadow: 0 0 0 3px rgba(245,164,77,.10), 0 0 9px rgba(245,164,77,.2);
    }

    @media (prefers-reduced-motion: reduce) {
      .panel, .status-card, .stat, .event-button, .button { transition: none !important; }
    }

.global-auth [hidden] {display:none!important}
#authStatus[data-authenticated="true"] .auth-dot {background:#28b67a}
