/* Shared SDK/Home foundational styles. Extracted from duplicated inline CSS. */


    * { box-sizing: border-box; }

    body {
      margin: 0;
      background:
        radial-gradient(ellipse at 8% 0%, rgba(133, 211, 239, 0.32), transparent 34rem),
        radial-gradient(ellipse at 92% 8%, rgba(255, 183, 126, 0.25), transparent 30rem),
        var(--canvas);
      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; }

    .site-header {
      position: relative;
      z-index: 10;
      background: transparent;
    }

    .header-inner, .page {
      width: min(1120px, calc(100% - 40px));
      margin: 0 auto;
    }

    .header-inner {
      min-height: 76px;
      padding-top: 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 24px;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }

    .brand-name { font-weight: 750; letter-spacing: -0.025em; font-size: 0.98rem; }


    .anonymous-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 8px 2px;
      border: 1px solid transparent;
      border-radius: 999px;
      color: #45516a;
      background: transparent;
      font-size: 0.86rem;
      white-space: nowrap;
    }

    .dot { width: 7px; height: 7px; border-radius: 50%; background: #8b95a8; }
    .button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      min-height: 42px;
      padding: 10px 15px;
      border: 1px solid transparent;
      border-radius: 12px;
      font-weight: 650;
      transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
    }

    .button:hover { transform: translateY(-1px); }
    .button:focus-visible, input:focus-visible {
      outline: 3px solid rgba(75, 167, 201, 0.28);
      outline-offset: 2px;
    }

    .button-small { min-height: 34px; padding: 6px 11px; font-size: 0.82rem; border-radius: 8px; }
    .top-link { color: #465166; text-decoration: none; font-size: 0.9rem; font-weight: 650; }
    .top-link:hover { color: #20242b; text-decoration: underline; text-underline-offset: 4px; }

    .button-secondary { color: #39445c; background: #fff; border-color: var(--line); }
    .button-secondary:hover { background: #f8f9fc; border-color: #cbd3e2; }



    .page { padding: 42px 0 60px; }





    h1, h2, h3, p { margin-top: 0; }
    h1 {
      margin-bottom: 10px;
      font-size: clamp(2rem, 4vw, 2.75rem);
      line-height: 1.1;
      letter-spacing: -0.055em;
    }



    .status-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 16px;
      margin-bottom: 24px;
    }

    .status-card, .panel {
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 18px;
      box-shadow: var(--shadow);
    }

    .status-card { padding: 19px; min-width: 0; }
    .status-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
    .status-label { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
    .status-icon {
      display: grid;
      place-items: center;
      width: 34px;
      height: 34px;
      border-radius: 11px;
      color: #347f9d;
      background: var(--sky);
      font-size: 1rem;
      font-weight: 800;
    }
    .status-value { font-size: 1.1rem; font-weight: 750; letter-spacing: -0.025em; overflow-wrap: anywhere; }
    .status-detail { margin-top: 5px; color: var(--muted); font-size: 0.79rem; }
    .status-text { display: inline-flex; align-items: center; gap: 7px; }
    .status-text::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
    .tone-neutral { color: #68758d; }
    .tone-good { color: var(--green); }
    .tone-warn { color: var(--amber); }
    .tone-bad { color: var(--red); }

    .main-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
    .main-grid { margin-bottom: 20px; }
    .history-panel { margin-top: 20px; }
    .stack { display: grid; gap: 20px; min-width: 0; }
    .panel { padding: 24px; min-width: 0; }
    .panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
    .panel-heading h2 { margin-bottom: 5px; font-size: 1.1rem; letter-spacing: -0.025em; }
    .panel-heading p { margin-bottom: 0; color: var(--muted); font-size: 0.88rem; }


    .tool-console { margin-top: 18px; overflow: hidden; border: 1px solid #dbe4ef; border-radius: 13px; background: #f7f9fc; }
    .tool-console-heading { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-bottom: 1px solid #dbe4ef; color: #47566e; font-size: 0.76rem; font-weight: 750; letter-spacing: 0.02em; }
    .tool-console-dot { width: 8px; height: 8px; border-radius: 50%; background: #32a879; }
    .tool-console-label { margin-left: auto; font-size: 0.68rem; color: #7c8ba1; }
    .tool-console-output { min-height: 62px; padding: 14px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.82rem; color: #35445e; white-space: pre-wrap; overflow-wrap: anywhere; }
    .tool-console-output[data-tone="success"] { color: #176b4b; }
    .tool-console-output[data-tone="error"] { color: #a32232; }
    .event-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .event-button {
      display: flex;
      align-items: center;
      gap: 12px;
      min-height: 78px;
      padding: 14px;
      text-align: left;
      color: var(--ink);
      background: #fff;
      border: 1px solid var(--line);
      border-radius: 14px;
      transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
    }
    .event-button:hover { border-color: #b8dfea; background: #f8fcfe; transform: translateY(-1px); }
    .reset-button:not(:disabled):hover { border-color: #dc3545; background: #fff0f1; color: #b42332; }
    .reset-button:not(:disabled):hover .event-symbol { background: #ffe0e3; color: #b42332; }
    .event-button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
    .event-symbol { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 12px; color: #347f9d; background: var(--sky); font-weight: 800; }
    .event-button:nth-child(3) .event-symbol { color: #a85b24; background: var(--orange-wash); }
    .event-title { display: block; font-size: 0.9rem; font-weight: 750; }


    .custom-event { display: flex; gap: 10px; }
    .text-input {
      width: 100%;
      min-width: 0;
      min-height: 44px;
      padding: 10px 13px;
      color: var(--ink);
      border: 1px solid #dce2ed;
      border-radius: 11px;
      background: #fff;
    }


    .event-list { display: grid; gap: 0; }
    .event-entry {
      display: grid;
      grid-template-columns: 78px minmax(0, 1fr);
      gap: 12px;
      padding: 13px 0;
      border-bottom: 1px solid #edf0f5;
      font-size: 0.86rem;
    }
    .event-entry:last-child { border-bottom: 0; padding-bottom: 0; }
    .event-time { color: #8993a6; font-size: 0.75rem; padding-top: 2px; }
    .event-type { display: block; margin-bottom: 2px; color: #39445c; font-weight: 750; }
    .event-message { color: var(--muted); overflow-wrap: anywhere; }
    .empty-state { padding: 18px 0 4px; color: var(--muted); font-size: 0.88rem; }










    .toast {
      position: fixed;
      left: 22px;
      bottom: 22px;
      z-index: 20;
      width: min(390px, calc(100% - 44px));
      padding: 15px 17px;
      color: #263344;
      background: rgba(255, 255, 255, 0.97);
      border: 1px solid #dce5ee;
      border-radius: 14px;
      box-shadow: 0 16px 36px rgba(20, 28, 48, 0.24);
      opacity: 0;
      transform: translateY(10px);
      pointer-events: none;
      transition: opacity 160ms ease, transform 160ms ease;
    }
    .toast.visible { opacity: 1; transform: translateY(0); }
    .toast strong { display: block; margin-bottom: 3px; }
    .toast span { color: #65718a; font-size: 0.86rem; }

    .anonymous-pill.authenticated .dot { background: var(--green); }
    .profile-value { overflow-wrap: anywhere; }

    @media (max-width: 900px) {
      .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .main-grid { grid-template-columns: 1fr; }


    }

    @media (max-width: 560px) {
      .header-inner, .page { width: min(100% - 28px, 1120px); }
      .header-inner { min-height: 68px; gap: 10px; }

      .anonymous-pill { font-size: 0.76rem; gap: 6px; }

      .toast { left: 14px; bottom: 14px; width: min(360px, calc(100% - 28px)); }
      .page { padding-top: 30px; }
      .status-grid { gap: 10px; }
      .status-card { padding: 14px; }
      .status-value { font-size: 1rem; }
      .panel { padding: 18px; }
      .event-buttons { grid-template-columns: 1fr; }
      .custom-event { flex-direction: column; }
      .custom-event .button { width: 100%; }
      .panel-heading { gap: 10px; }
    }
    body {
      background: linear-gradient(to bottom, #ffffff 0%, #c5c5c5 100%);
      color: #172033;
      background-attachment: fixed;
    }
    .brand-name.top-link,
    .brand .top-link { color: #172033; }
    .brand-name.top-link:hover,
    .brand .top-link:hover { color: #000000; }
    .anonymous-pill { color: #172033; }
    .dot { background: #f0a36c; }

    .header-inner { min-height: 64px; }
    .page { padding-top: 34px; }
    .brand-caption, .eyebrow, .hero-note, .section-kicker,
    .status-icon, .event-symbol, .notice, .footer { display: none; }
    h1 { font-size: clamp(1.8rem, 3.5vw, 2.35rem); letter-spacing: -0.04em; }


    .status-grid { gap: 10px; margin-bottom: 18px; }
    .status-card, .panel {
      border: 1px solid rgba(220, 228, 237, 0.9);
      border-radius: 14px;
      background: rgba(255, 255, 255, 0.94);
      box-shadow: 0 8px 24px rgba(39, 58, 83, 0.07), 0 1px 3px rgba(39, 58, 83, 0.04);
      transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease;
    }
    .status-card:hover, .panel:hover {
      border-color: rgba(190, 211, 225, 0.95);
      box-shadow: 0 12px 30px rgba(39, 58, 83, 0.09), 0 2px 5px rgba(39, 58, 83, 0.04);
    }
    .status-card { padding: 15px 16px; }
    .status-top { margin-bottom: 7px; }
    .status-value { font-size: 1rem; color: var(--ink); }
    .panel { padding: 20px; }
    .panel-heading { margin-bottom: 15px; }
    .event-buttons { gap: 8px; }
    .event-button { min-height: 64px; padding: 12px; border-radius: 10px; }
    .event-button:hover { border-color: #cbd2dc; background: #fafbfc; }
    .button { border-radius: 9px; }



    .history-panel { margin-top: 18px; }
    .toast { left: 18px; bottom: 18px; box-shadow: 0 8px 24px rgba(20, 28, 48, 0.12); }
    @media (max-width: 760px) {
      .header-inner { align-items: flex-start; flex-direction: column; gap: 10px; padding: 14px 0; }
      .brand { width: 100%; flex-wrap: wrap; gap: 8px 16px; }

      .anonymous-pill { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

    }
    @media (max-width: 560px) {
      .page { padding-top: 24px; }

      .panel { padding: 16px; }
      .status-card { padding: 12px; }
      .header-inner, .page { width: calc(100% - 24px); }
      .brand { gap: 6px 12px; }
      .brand-name.top-link, .brand .top-link { font-size: 0.84rem; }

      .anonymous-pill { flex: 1 1 100%; padding: 2px 0; font-size: 0.8rem; }

      .status-grid { grid-template-columns: minmax(0, 1fr); }
    }

    /* Dashboard theme */
    :root { color-scheme: dark; --ink: #edf1f7; --muted: #a0a9bb; --line: #404652; --surface: #30353f; --canvas: #23262e; --sky: #344c63; --orange-wash: #51402f; --green: #5cdbac; --green-bg: #24483e; --amber: #f2bf6a; --red: #ff6676; --shadow: 0 6px 18px rgba(0,0,0,.12); }
    body { background: #24272f; color: var(--ink); background-attachment: initial; }
    .site-header { position: fixed; inset: 0 auto 0 0; width: 242px; background: #2d313b; border-right: 1px solid #424753; z-index: 20; }
    .header-inner { width: 100%; min-height: 100%; padding: 24px 14px; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 30px; }
    .sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 2px 5px 22px; border-bottom: 1px solid #454a55; text-decoration: none; color: #fff; min-width: 0; }
    .sidebar-brand img { width: 48px; height: 48px; border-radius: 11px; object-fit: contain; flex-shrink: 0; }
    .sidebar-brand strong { display: block; font-size: .91rem; letter-spacing: -.02em; line-height: 1.3; }
    .sidebar-brand small { display: block; font-size: .69rem; color: #aab4c4; line-height: 1.35; }
    .brand { display: grid; gap: 6px; width: 100%; }
    .brand .top-link, .brand-name.top-link { display: block; color: #aeb8c8; padding: 11px 13px; border-radius: 8px; font-weight: 550; font-size: .88rem; text-decoration: none; }
    .brand .top-link:hover, .brand-name.top-link:hover { background: #3a404d; color: #fff; text-decoration: none; }
    .brand .active-link { background: #414956; color: #fff; border-left: 3px solid #53baf1; }



    .anonymous-pill { color: #e5e9f1; width: 100%; overflow-wrap: anywhere; white-space: normal; font-size: .78rem; }
    .page { width: auto; max-width: 1440px; margin: 0 0 0 242px; padding: 38px 32px 50px; }
    .dashboard-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 27px; }


    .status-grid { gap: 14px; margin-bottom: 20px; }
    .status-card, .panel { background: #30353f; border: 1px solid #414753; border-radius: 9px; box-shadow: 0 4px 12px rgba(0,0,0,.11); }
    .status-card:hover, .panel:hover { border-color: #535d6d; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
    .status-card { padding: 18px; border-top: 2px solid #4a89ae; }
    .status-top { margin-bottom: 10px; }
    .status-label { color: #b6c0d0; font-size: .76rem; }
    .status-value { color: #f3f6fa; font-size: 1rem; }
    .status-detail { color: #9ba7b9; }
    .tone-neutral { color: #bbc5d4; } .tone-good { color: #67d9a4; } .tone-warn { color: #f0c27b; } .tone-bad { color: #ff7887; }
    .main-grid { margin-bottom: 16px; }
    .stack { gap: 16px; }
    .panel { padding: 0 18px 18px; overflow: hidden; }
    .panel-heading { margin: 0 -18px 17px; padding: 13px 18px; background: #383e49; border-bottom: 1px solid #4a505d; align-items: center; }
    .panel-heading h2 { color: #f4f6fa; font-size: .98rem; margin: 0 0 3px; }
    .panel-heading p { color: #aab4c4; font-size: .77rem; }
    .event-button { background: #363c47; color: #edf2f9; border-color: #515a68; border-radius: 7px; min-height: 65px; }
    .event-button:hover { background: #414b59; border-color: #67b7e8; }

    .event-symbol { display: grid; color: #73c8ff; background: #30495d; border-radius: 8px; }
    .reset-button:not(:disabled):hover { background: #5c303a; border-color: #ff6777; color: #fff; }
    .reset-button:not(:disabled):hover .event-symbol { background: #753540; color: #ffadb5; }
    .tool-console { background: #272c35; border-color: #444c59; border-radius: 7px; }
    .tool-console-heading { background: #343b47; color: #c9d3e2; border-color: #444c59; }
    .tool-console-label { color: #a1adbd; }
    .tool-console-output { color: #c9d3e2; }
    .tool-console-output[data-tone="success"] { color: #84e6b5; }
    .tool-console-output[data-tone="error"] { color: #ff8996; }
    .text-input { background: #272c35; color: #f3f6fb; border-color: #515a68; border-radius: 7px; }
    .text-input::placeholder { color: #909db0; }
    .button-secondary { background: #414854; border-color: #5b6574; color: #f0f4fa; }
    .button-secondary:hover { background: #505b69; border-color: #7a899c; }

    .event-entry { border-color: #444b56; }
    .event-entry:nth-child(odd) { background: #343a45; }
    .event-entry { padding: 10px 12px; border-radius: 4px; grid-template-columns: 90px minmax(0,1fr); }
    .event-time { color: #a4b0c1; }
    .event-type { color: #80c6f4; }
    .event-message { color: #d0d7e2; }
    .empty-state { color: #a4afc0; }



    .toast { background: #363e49; border-color: #566171; color: #f3f6fa; }
    .toast span { color: #c3cedd; }
    @media (min-width: 1080px) {
      .main-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
      .main-grid .stack { display: contents; }
    }
    @media (max-width: 900px) {
      .site-header { position: relative; width: 100%; border-right: 0; border-bottom: 1px solid #444b57; }
      .header-inner { min-height: 0; padding: 12px 20px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px; }
      .sidebar-brand { border: 0; padding: 0; }
      .brand { display: flex; width: auto; gap: 5px; }


      .anonymous-pill { width: auto; }
      .page { width: auto; margin: 0; padding: 28px 20px 40px; }
      .dashboard-heading { align-items: flex-start; }
    }
    @media (max-width: 620px) {
      .header-inner { align-items: flex-start; }
      .sidebar-brand { width: 100%; }
      .brand { width: 100%; }


      .dashboard-heading { flex-direction: column; gap: 10px; }
      .page { padding: 22px 14px 36px; }
      .status-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
      .event-entry { grid-template-columns: 1fr; gap: 3px; }
    }


    /* Calm, spacious dashboard refinements */
    body { background: #1d2026; }
    .site-header { background: #24272e; border-color: #333840; }
    .header-inner { gap: 36px; }
    .sidebar-brand { border-color: #373c45; }
    .brand .top-link, .brand-name.top-link { color: #a9afbb; }
    .brand .active-link { background: #30343d; border-left-color: #818d9c; }
    .brand .top-link:hover { background: #343943; }
    .page { max-width: 1320px; padding: 30px 52px 70px; }



    .dashboard-heading { margin-bottom: 36px; }


    .status-grid { gap: 18px; margin-bottom: 34px; }
    .status-card, .panel { background: #282c33; border-color: #393f48; box-shadow: 0 3px 12px rgba(0,0,0,.1); }
    .status-card { border-top: 1px solid #434a54; padding: 20px; }
    .status-card:hover, .panel:hover { border-color: #505762; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
    .main-grid { display: block; margin-bottom: 30px; }
    .main-grid .stack { display: grid; gap: 30px; }
    .panel { padding: 0 24px 24px; margin-bottom: 30px; }
    .main-grid .panel { margin-bottom: 0; }
    .panel-heading { margin: 0 -24px 24px; padding: 17px 24px; background: #2c3038; border-bottom-color: #3b424b; }
    .panel-heading p { color: #9da6b5; }
    .event-buttons { gap: 14px; }
    .event-button { background: #30343b; border-color: #414751; }
    .event-button:hover { background: #383d45; border-color: #737e8b; }
    .event-symbol { color: #bbc6d2; background: #393f49; }
    .event-entry:nth-child(odd) { background: #2d323a; }
    .event-type { color: #b5c5d6; }
    .tool-console { background: #22262d; }
    .tool-console-heading { background: #2b3038; }
    .history-panel { margin-top: 0; }

    @media (max-width: 900px) {
      .page { padding: 25px 30px 50px; }

      .main-grid .stack { gap: 26px; }
    }
    @media (max-width: 620px) {
      .page { padding: 20px 16px 40px; }



      .status-grid { gap: 12px; margin-bottom: 26px; }
      .panel { padding: 0 16px 18px; margin-bottom: 24px; }
      .panel-heading { margin: 0 -16px 18px; padding: 15px 16px; }
      .main-grid .stack { gap: 24px; }
      .dashboard-heading { margin-bottom: 28px; }
    }

  
    /* 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; }
    }


    .global-auth {
      position: fixed;
      top: 24px;
      right: 32px;
      z-index: 100;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .global-auth [hidden] { display: none !important; }
    .global-auth .button { flex-shrink: 0; }
    .page { padding-top: 105px; }
    @media (max-width: 900px) {
      .global-auth { top: 18px; right: 20px; }
      .sidebar-brand { padding-right: 175px; }
      .page { padding-top: 48px; }
    }
    @media (max-width: 620px) {
      .global-auth { top: 16px; right: 14px; gap: 6px; }
      .global-auth .button { padding: 8px 10px; font-size: .75rem; }
      .sidebar-brand { padding-right: 140px; }
      .page { padding-top: 26px; }
    }

    .global-auth .anonymous-pill { display: inline-flex; align-items: center; gap: 8px; color: #c9d1dd; font-size: .82rem; max-width: 280px; }
    .global-auth .anonymous-pill .dot { flex-shrink: 0; width: 8px; height: 8px; background: #e5a04c; }
    .global-auth .anonymous-pill.authenticated .dot { background: #58d69a; }
    .global-auth #authStatusText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    @media (max-width: 620px) {
      .global-auth .anonymous-pill { max-width: 120px; font-size: .73rem; }
    }

    /* 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; }
    .event-button { background: #343a44; }
    .event-button:hover { background: #404753; }

    /* Unified, text-only console surfaces */
    .event-list {
      display: block;
      background: #171b21;
      border: 1px solid #343b45;
      border-radius: 8px;
      padding: 12px 14px;
      max-height: 420px;
      overflow-y: auto;
      font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    }
    .event-entry,
    .event-entry:nth-child(odd) {
      display: grid;
      grid-template-columns: 92px minmax(0, 1fr);
      gap: 12px;
      padding: 7px 0;
      background: transparent;
      border: 0;
      border-radius: 0;
      font-size: .78rem;
      line-height: 1.55;
    }
    .event-entry:last-child { padding-bottom: 7px; }
    .event-time { color: #8995a5; font: inherit; font-size: .75rem; padding: 0; }
    .event-type { color: #b0bcca; font-weight: 650; margin-bottom: 2px; }
    .event-message { color: #d0d7e2; }
    .event-list .empty-state { color: #8995a5; padding: 6px 0; font-family: inherit; font-size: .8rem; }
    .tool-console { background: #171b21; border: 1px solid #343b45; border-radius: 8px; }
    .tool-console-heading { background: transparent; border-bottom: 1px solid #343b45; padding: 10px 14px; color: #aeb9c8; }
    .tool-console-label { color: #8995a5; }
    .tool-console-output { background: transparent; color: #d0d7e2; padding: 14px; line-height: 1.65; }
    .tool-console-output[data-tone="success"] { color: #a6dfbd; }
    .tool-console-output[data-tone="error"] { color: #f1a0a9; }
    @media (max-width: 620px) {
      .event-entry, .event-entry:nth-child(odd) { grid-template-columns: 1fr; gap: 2px; }
    }

    .tool-console.anonymous .tool-console-dot { background: #e5a04c; }
    .text-input { background: #171b21; border: 1px solid #343b45; border-radius: 8px; color: #d0d7e2; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
    .text-input::placeholder { color: #8995a5; }
    .text-input:focus { outline: 1px solid #778595; border-color: #778595; }

    /* Dashboard usability and restrained polish */
    .status-card { transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
    .status-card:hover { transform: translateY(-2px); }
    .status-value .status-text { display: inline-flex; align-items: center; gap: 8px; font-size: .91rem; font-weight: 700; }
    .status-value .status-text::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #8995a5; }
    .status-value .tone-good::before { background: #64d4a0; }
    .status-value .tone-warn::before { background: #e5a04c; }
    .status-value .tone-bad::before { background: #f17b88; }
    .status-icon { opacity: .55; }



    .history-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
    .history-controls #historySearch { flex: 2 1 210px; min-height: 38px; }
    .history-controls #historyFilter { flex: 1 1 150px; min-height: 38px; }
    .history-check { display: flex; gap: 7px; align-items: center; color: #b2bdcb; font-size: .8rem; }
    .history-controls .button { min-height: 38px; }
    .event-entry[hidden] { display: none !important; }




    .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; color: #fff; }
    .sidebar-toggle-text { margin-left: 8px; font-size: .78rem; }
    .sidebar-brand, .brand .top-link { transition: background .2s ease; }
    @media (min-width: 901px) {
      .site-header, .page { transition: width .2s ease, margin-left .2s ease; }
      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 (max-width: 620px) {

 }

    /* Compact controls, unified headers and unobstructed top account bar */
    .panel-heading { background: #343a44; border-bottom-color: #454c58; }
    .button:not(.event-button) { padding: 7px 11px; font-size: .78rem; min-height: 34px; width: auto; }
    .event-button { min-height: 58px; padding: 10px 12px; }
    .event-symbol { width: 36px; height: 36px; }
    .global-auth { position: fixed; top: 18px; right: 28px; }
    .page { box-sizing: border-box; max-width: none; width: auto; margin-left: 242px; padding: 112px 52px 70px; }
    .page > .dashboard-heading, .page > .status-grid, .page > .main-grid,
    .page > .panel, .page > .footer { width: 100%; max-width: 1320px; margin-left: auto; margin-right: auto; }
    .page > .dashboard-heading { margin-bottom: 36px; }
    .page > .status-grid { margin-bottom: 34px; }
    .page > .main-grid { margin-bottom: 30px; }
    .page > .panel { margin-bottom: 30px; }
    @media (min-width: 901px) {
      body.sidebar-collapsed .page { margin-left: 86px; }
    }
    @media (max-width: 900px) {
      .page { margin-left: 0; padding: 90px 30px 50px; }
      .global-auth { top: 16px; right: 20px; }
    }
    @media (max-width: 620px) {
      .page { padding: 85px 16px 40px; }
      .global-auth { top: 14px; right: 14px; }
      .button:not(.event-button) { padding: 7px 10px; }
    }

    /* Lower-contrast controls */
    .panel-heading { background: #2d323a; border-bottom-color: #3b424b; }
    .event-button, .button-secondary { background: #30353d; border-color: #434a55; }
    .event-button:hover, .button-secondary:hover { background: #393f49; border-color: #687381; }
    .event-symbol { background: #353b45; }




    .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) {


    }







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










    /* 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 .anonymous-pill:not(.authenticated) #authStatusText { display: none; }
      .global-auth .anonymous-pill:not(.authenticated) { gap: 0; }


    }

    /* Keep mobile authentication buttons above the header and give them reliable tap targets */
    @media (max-width: 900px) {
      .site-header { z-index: 1; }
      .global-auth {
        position: absolute; top: 12px; right: 12px; z-index: 110;
        max-width: none; width: auto; gap: 5px;
        pointer-events: auto;
      }
      .global-auth .button, .global-auth .button:not(.event-button) {
        position: relative; z-index: 1; min-height: 40px;
        padding: 9px 11px; font-size: .75rem; touch-action: manipulation;
      }
      .global-auth .anonymous-pill { flex: 0 0 auto; max-width: none; }
      .header-inner { position: relative; z-index: 0; }
      .sidebar-brand { max-width: calc(100% - 190px); }
    }
    @media (max-width: 390px) {
      .global-auth { right: 8px; gap: 3px; }
      .global-auth .button, .global-auth .button:not(.event-button) { padding: 9px 8px; }
      .sidebar-brand { max-width: calc(100% - 174px); }
    }

    /* Truncate authenticated mobile identity without overlapping the app brand */
    @media (max-width: 900px) {
      .global-auth:has(.anonymous-pill.authenticated) {
        max-width: min(52vw, 225px);
        min-width: 0;
      }
      .global-auth .anonymous-pill.authenticated {
        display: flex; align-items: center; flex: 1 1 auto;
        min-width: 0; max-width: none; overflow: hidden;
      }
      .global-auth .anonymous-pill.authenticated #authStatusText {
        display: block; min-width: 0; max-width: 100%;
        overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
      }
      .global-auth .anonymous-pill.authenticated .dot { flex: 0 0 auto; }
      .global-auth #logoutButton { flex: 0 0 auto; }
    }
    @media (max-width: 390px) {
      .global-auth:has(.anonymous-pill.authenticated) { max-width: 49vw; }
    }

    /* Mobile auth buttons: restore compact visual size while keeping tap area accessible */
    @media (max-width: 900px) {
      .global-auth .button, .global-auth .button:not(.event-button) {
        min-height: 34px;
        padding: 7px 10px;
        font-size: .78rem;
        touch-action: manipulation;
      }
      .global-auth .button::before {
        content: "";
        position: absolute;
        inset: -5px -2px;
      }
    }
    @media (max-width: 390px) {
      .global-auth .button, .global-auth .button:not(.event-button) {
        padding: 7px 8px;
        font-size: .75rem;
      }
    }

    /* Unified floating section headings and elevated clickable controls */
    .panel { overflow: visible; padding-top: 22px; }

    .panel-heading h2 { margin: 0; font-size: 1rem; font-weight: 700; }
    .panel-heading p, .section-kicker { display: none; }
    .event-button, .button, .button-secondary {
      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, background .15s ease;
    }
    .event-button:hover:not(:disabled), .button:hover:not(:disabled) {
      box-shadow: 0 5px 12px rgba(0,0,0,.27), 0 2px 4px rgba(0,0,0,.14);
      transform: translateY(-1px);
    }
    .event-button:active:not(:disabled), .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);
    }
    .anonymous-pill.authenticated .dot, .status-pill[data-state="ready"] .status-dot {
      box-shadow: 0 0 0 3px rgba(105,212,162,.1), 0 0 9px rgba(105,212,162,.2);
    }
    @media (prefers-reduced-motion: reduce) {
      .panel, .status-card, .stat, .event-button, .button { transition: none !important; }
    }
