:root {
      --desk: #e6e4de;
      --paper: #f4f3ef;
      --ink: #121211;
      --mid: #4a4945;
      --muted: #75746f;
      --soft: #a3a29d;
      --rule: #d2d1cb;
      --stamp: #a8321f;
      --field: rgba(18, 18, 17, 0.055);
      --font: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

      --text-main: var(--ink);
      --text-muted: var(--muted);
      --text-dim: var(--soft);
      --border-subtle: var(--rule);
      --primary: var(--ink);
      --danger: var(--stamp);
      --radius-sm: 2px;
      
      --ease-out-gentle: cubic-bezier(0.16, 1, 0.3, 1);

      /* NEW: Colored Inks */
      --ink-blue: #325b99;
      --ink-green: #376b42;
      --ink-gold: #9e7314;
      --ink-purple: #6d478f;
      
      /* NEW: Subtle Colored Backgrounds */
      --bg-blue: rgba(50, 91, 153, 0.08);
      --bg-green: rgba(55, 107, 66, 0.08);
      --bg-gold: rgba(158, 115, 20, 0.08);
      --bg-purple: rgba(109, 71, 143, 0.08);
      --bg-red: rgba(168, 50, 31, 0.08);
    }

    [data-theme="dark"] {
      --desk: #0c0c0b;
      --paper: #1a1a18;
      --ink: #efeee9;
      --mid: #c5c4be;
      --muted: #8d8c86;
      --soft: #62615c;
      --rule: #34342f;
      --stamp: #ff8f70;
      --field: rgba(255, 255, 255, 0.06);

      /* NEW: Colored Inks (Dark Mode) */
      --ink-blue: #86b2ff;
      --ink-green: #81cf93;
      --ink-gold: #f2c14e;
      --ink-purple: #c79ff5;

      /* NEW: Subtle Colored Backgrounds (Dark Mode) */
      --bg-blue: rgba(134, 178, 255, 0.12);
      --bg-green: rgba(129, 207, 147, 0.12);
      --bg-gold: rgba(242, 193, 78, 0.12);
      --bg-purple: rgba(199, 159, 245, 0.12);
      --bg-red: rgba(255, 143, 112, 0.12);
    }

    * { 
      box-sizing: border-box; 
      margin: 0; 
      padding: 0; 
      -webkit-tap-highlight-color: transparent; 
    }

    * {
      scrollbar-width: thin;
      scrollbar-color: var(--rule) transparent;
    }
    ::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }
    ::-webkit-scrollbar-track {
      background: transparent;
    }
    ::-webkit-scrollbar-thumb {
      background: var(--rule);
      border-radius: 99px;
      border: 1px solid transparent;
      background-clip: padding-box;
      transition: background 0.15s ease;
    }
    ::-webkit-scrollbar-thumb:hover {
      background: var(--soft);
    }
    ::-webkit-scrollbar-thumb:active {
      background: var(--mid);
    }
    ::-webkit-scrollbar-corner {
      background: transparent;
    }
    ::-webkit-scrollbar-button {
      display: none;
      width: 0;
      height: 0;
    }

    html { 
      -webkit-text-size-adjust: 100%; 
      background: var(--desk);
      height: 100%;
      height: 100dvh;
      overflow: hidden;
    }

    body {
      font-family: var(--font);
      font-size: 13px;
      line-height: 1.5;
      background: var(--desk);
      color: var(--ink);
      height: 100%;
      height: 100dvh;
      width: 100vw;
      max-width: 100vw;
      overflow: hidden;
      display: flex;
      justify-content: center;
      align-items: stretch;
      -webkit-font-smoothing: antialiased;
      font-variant-numeric: slashed-zero;
    }

    .container { 
      width: 100%; 
      max-width: 520px; 
      min-width: 0; 
      height: 100%;
      height: 100dvh;
      max-height: 100dvh;
      display: flex;
      flex-direction: column;
      position: relative;
      overflow: hidden;
      background: var(--paper);
      box-shadow: 0 0 35px rgba(0, 0, 0, 0.08);
      border-left: 1px solid var(--rule);
      border-right: 1px solid var(--rule);
    }

    @keyframes smoothCardEnter {
      0% {
        opacity: 0;
        transform: translateY(14px) scale(0.99);
      }
      100% {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    @keyframes smoothFadeUp {
      0% {
        opacity: 0;
        transform: translateY(8px);
      }
      100% {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes smoothTileEnter {
      0% {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
      }
      100% {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }

    .card {
      position: relative;
      background: var(--paper);
      width: 100%;
      height: 100%;
      flex: 1;
      min-height: 0;
      display: flex;
      flex-direction: column;
      margin: 0;
      box-sizing: border-box;
      animation: smoothCardEnter 0.45s var(--ease-out-gentle) both;
      will-change: transform, opacity;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-y: contain;
      padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    }

    .card::before {
      content: '';
      position: absolute;
      left: 0;
      right: 0;
      top: 0;
      height: 8px;
      pointer-events: none;
      background: radial-gradient(circle at 6px 0, var(--desk) 4px, transparent 4.5px) 0 0/12px 8px repeat-x;
      z-index: 45;
    }

    .anim-header {
      animation: smoothFadeUp 0.4s var(--ease-out-gentle) 0.08s both;
    }

    h1 {
      font-size: 15px;
      font-weight: 700;
      letter-spacing: 0.01em;
      text-transform: none;
      margin-bottom: 4px;
      text-align: center;
    }

    p.subtitle {
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 16px;
      line-height: 1.5;
      text-align: center;
    }

    .section-title {
      font-size: 11px;
      font-weight: 400;
      text-transform: uppercase;
      color: var(--soft);
      margin-bottom: 10px;
    }

    .nav-breadcrumbs {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      flex-wrap: wrap;
      padding-bottom: 10px;
      margin-bottom: 14px;
      border-bottom: 1px solid var(--border);
      font-size: 12px;
      animation: smoothFadeUp 0.4s var(--ease-out-gentle) 0.05s both;
    }

    .nav-back-link {
      display: inline-flex;
      align-items: center;
      font: inherit;
      color: var(--muted);
      text-decoration: none;
      cursor: pointer;
      background: none;
      border: 0;
      padding: 4px 0;
      min-height: 30px;
      transition: color 0.15s ease;
    }
    .nav-back-link:hover { color: var(--ink); }

    .tag {
      display: inline-block;
      padding: 1px 8px;
      font-size: 11px;
      font-weight: 700;
      border: 1px solid var(--border-strong);
      border-radius: var(--radius-sm);
      text-transform: uppercase;
    }

    .btn-theme-toggle {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 4px 8px;
      font-size: 13px;
      line-height: 1;
      min-height: 30px;
      min-width: 30px;
      border: 1px solid var(--border);
      background: transparent;
      color: var(--ink);
      border-radius: var(--r-sm);
      cursor: pointer;
      user-select: none;
      transition: all 0.15s ease;
    }
    .btn-theme-toggle:hover {
      border-color: var(--border-strong);
      background: var(--field);
    }


    .toast-banner {
      position: fixed;
      top: 18px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--solid);
      color: var(--on-solid);
      padding: 9px 16px;
      font-size: 12px;
      font-weight: 700;
      border-radius: var(--r-sm);
      z-index: 1200;
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
      max-width: 90%;
      text-align: center;
      animation: smoothFadeUp 0.2s ease;
    }

    .hidden {
      display: none !important;
    }

    .footer-note {
      margin-top: auto;
      padding-top: 20px;
      border-top: 1px solid var(--border);
      text-align: center;
      font-size: 11px;
      color: var(--soft);
      animation: smoothFadeUp 0.4s var(--ease-out-gentle) 0.3s both;
    }

    @media (max-width: 480px) {
      .card { padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
    }

    /* Desktop: same frame as the zSuite hub, so the shell holds still across page transitions */
    @media (min-width: 768px) {
      html, body {
        overflow: hidden;
        height: 100vh;
        max-height: 100vh;
      }
      body {
        padding: 28px;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
      }
      .container {
        max-width: 1120px;
        width: 100%;
        height: min(94vh, 860px);
        max-height: min(94vh, 860px);
        margin: 0 auto;
        border-radius: 8px;
        border: 1px solid var(--rule);
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.08);
        overflow: hidden;
        display: flex;
        flex-direction: column;
      }
      .card {
        padding: 20px 24px 16px;
        height: 100%;
        max-height: 100%;
        min-height: 0;
        flex: 1;
        border-radius: 8px;
        display: flex;
        flex-direction: column;
      }
      .nav-breadcrumbs, .footer-note { flex-shrink: 0; }
    }

    @media (prefers-reduced-motion: reduce) {
      * { animation: none !important; transition: none !important; }
    }

/* ==========================================================================
   zUI polish layer — lobby (hero + tiles come from /shared/zui.css)
   ========================================================================== */
.card { padding-top: 18px; view-transition-name: zui-page; }
.footer-note { border-top: 0 !important; color: var(--text-4); font-size: 11.5px; }

/* ---------- Scroll layer hooks ---------- */
.card { timeline-scope: --zui-hero; }
.nav-breadcrumbs.zui-sticky-head { top: -18px; margin: -18px -20px 14px; padding: 14px 20px; border-bottom: 1px solid transparent !important; }
.nav-breadcrumbs.zui-sticky-head > span:first-child { display: inline-flex; align-items: center; }
.arcade-compact { margin-left: 6px; font-weight: 600; color: var(--text); }
@media (max-width: 480px) {
  .nav-breadcrumbs.zui-sticky-head { margin: -18px -16px 14px; padding: 14px 16px; }
}
@media (min-width: 768px) {
  .nav-breadcrumbs.zui-sticky-head { margin: -18px -24px 14px; padding: 14px 24px; }
}
