/* ╔══════════════════════════════════════════════════════════════════╗
   ║  Vivian Portal CSS  —  4 OS themes + shared components           ║
   ║  Themes: android | desktop | xp | tablet                         ║
   ╚══════════════════════════════════════════════════════════════════╝ */

/* ═══════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
button { cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════════════
   LOGIN SCREEN  (all themes share this)
   ═══════════════════════════════════════════════════════════════════ */
#login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 30% 60%, #1a0533 0%, #0a0a1a 60%);
}
.login-box {
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  padding: 48px 44px;
  width: min(420px, 92vw);
  box-shadow: 0 32px 80px rgba(0,0,0,.6);
}
.login-logo { text-align: center; margin-bottom: 36px; }
.login-logo-icon { font-size: 3rem; margin-bottom: 10px; }
.login-logo h1 { font-size: 1.8rem; color: #fff; font-weight: 700; letter-spacing: -.5px; }
.login-logo p  { color: #aaa; font-size: .9rem; margin-top: 4px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form input {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  color: #fff;
  font-size: 1rem;
  padding: 14px 16px;
  transition: border .2s;
}
.login-form input:focus { outline: none; border-color: #7c4dff; background: rgba(124,77,255,.1); }
.login-error { color: #ff6b6b; font-size: .85rem; min-height: 18px; text-align: center; }
.login-btn {
  background: linear-gradient(135deg, #7c4dff, #5c2be0);
  color: #fff;
  padding: 14px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  transition: opacity .2s, transform .1s;
  margin-top: 4px;
}
.login-btn:hover { opacity: .9; }
.login-btn:active { transform: scale(.98); }
.login-btn:disabled { opacity: .5; cursor: default; }

.login-footer {
  text-align: center; margin-top: 8px;
  font-size: .85rem; color: #888;
}
.login-register-link {
  color: #7c4dff; text-decoration: none; font-weight: 600;
}
.login-register-link:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════════════════
   OS PICKER
   ═══════════════════════════════════════════════════════════════════ */
#os-picker {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 40% 50%, #0d0930 0%, #080810 70%);
}
.picker-box {
  text-align: center;
  color: #fff;
  padding: 40px 20px;
}
.picker-box h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 8px; }
.picker-box p  { color: #999; margin-bottom: 32px; }
.picker-grid   { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.picker-option {
  background: rgba(255,255,255,.06);
  border: 2px solid rgba(255,255,255,.1);
  border-radius: 16px;
  color: #fff;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 28px 32px;
  transition: border-color .2s, background .2s;
  min-width: 140px;
}
.picker-option:hover { border-color: #7c4dff; background: rgba(124,77,255,.15); }
.picker-icon  { font-size: 2.5rem; }
.picker-name  { font-size: 1.1rem; font-weight: 600; }
.picker-desc  { font-size: .78rem; color: #999; }

/* ═══════════════════════════════════════════════════════════════════
   NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════ */
#notifications { position: fixed; bottom: 70px; right: 20px; z-index: 99999; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #1e1e2e; color: #fff; border-radius: 10px;
  padding: 12px 18px; font-size: .9rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
  border-left: 3px solid #7c4dff;
  transform: translateX(120%); transition: transform .3s ease;
  max-width: 320px;
}
.toast.visible { transform: translateX(0); }
.toast.toast-err   { border-left-color: #f87171; }
.toast.toast-ok    { border-left-color: #34d399; }
.toast.toast-info  { border-left-color: #60a5fa; }

/* ═══════════════════════════════════════════════════════════════════
   SHARED OS WINDOW CHROME
   ═══════════════════════════════════════════════════════════════════ */
.win-container { position: absolute; inset: 0; pointer-events: none; }
.win-container .os-window { pointer-events: all; }

.os-window {
  position: absolute;
  display: flex; flex-direction: column;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
  min-width: 320px; min-height: 200px;
  transition: box-shadow .15s;
}
.os-window.minimized { display: none; }
.os-window:focus-within { box-shadow: 0 24px 70px rgba(0,0,0,.8), 0 0 0 1px rgba(124,77,255,.4); }

.win-titlebar {
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px 0 12px; height: 36px; flex-shrink: 0;
  cursor: default; user-select: none;
}
.win-title-icon  { font-size: 1rem; }
.win-title-text  { flex: 1; font-size: .85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-controls    { display: flex; gap: 4px; flex-shrink: 0; }
.win-ctrl {
  width: 24px; height: 24px; border-radius: 50%;
  font-size: .7rem; display: flex; align-items: center; justify-content: center;
  transition: opacity .15s;
}
.win-ctrl:hover  { opacity: .8; }
.win-close    { background: #f87171; color: #7f1d1d; }
.win-minimize { background: #fbbf24; color: #78350f; }
.win-maximize { background: #34d399; color: #064e3b; }

.win-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

.win-resize-handle {
  position: absolute; bottom: 0; right: 0;
  width: 16px; height: 16px; cursor: se-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,.15) 50%);
}

/* ═══════════════════════════════════════════════════════════════════
   TASKBAR (shared)
   ═══════════════════════════════════════════════════════════════════ */
.taskbar-app-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 6px;
  color: rgba(255,255,255,.75); font-size: .82rem;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: background .15s;
}
.taskbar-app-btn:hover  { background: rgba(255,255,255,.1); }
.taskbar-app-btn.active { background: rgba(124,77,255,.3); color: #fff; }

/* ════════════════════════════════════════════════════════════════════
   ██████   ANDROID THEME
   ════════════════════════════════════════════════════════════════════ */
[data-theme="android"] {
  --a-bg:         #0f0f0f;
  --a-surface:    #1a1a1a;
  --a-surface2:   #242424;
  --a-primary:    #bb86fc;
  --a-primary-dim:#7c4dff;
  --a-text:       #e0e0e0;
  --a-text2:      #9e9e9e;
  --a-accent:     #03dac6;
  --a-error:      #cf6679;
  --a-status-h:   28px;
  --a-nav-h:      56px;
}
[data-theme="android"] body { background: var(--a-bg); }

[data-theme="android"] .os-shell {
  display: flex; flex-direction: column;
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  background: var(--a-bg);
  overflow: hidden;
}

/* Status bar */
.android-statusbar {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--a-status-h, 28px); padding: 0 16px;
  background: rgba(0,0,0,.6);
  color: #fff; font-size: .75rem; font-weight: 500;
  z-index: 100; flex-shrink: 0;
  cursor: pointer;
}
.sb-icons { display: flex; gap: 6px; font-size: .8rem; }

/* Quick Settings pull-down */
.android-quick-settings {
  position: absolute; top: 0; left: 0; right: 0;
  background: rgba(10,10,24,.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.1);
  transform: translateY(-100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  padding: 16px 20px 20px;
  z-index: 99;
  max-height: 60%;
  overflow-y: auto;
}
.android-quick-settings.open { transform: translateY(0); }
.qs-handle {
  width: 40px; height: 4px; background: rgba(255,255,255,.3);
  border-radius: 2px; margin: 0 auto 16px;
}
.qs-row {
  display: flex; gap: 10px; margin-bottom: 12px;
  flex-wrap: wrap;
}
.qs-tile {
  flex: 1; min-width: 80px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; padding: 14px 10px;
  text-align: center; color: #fff;
  cursor: pointer; transition: background .15s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.qs-tile:hover, .qs-tile:active { background: rgba(255,255,255,.15); }
.qs-tile.active { background: rgba(187,134,252,.2); border-color: var(--a-primary, #bb86fc); }
.qs-tile .qs-icon { font-size: 1.4rem; }
.qs-tile .qs-label { font-size: .7rem; color: rgba(255,255,255,.8); }
.qs-slider-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.qs-slider-row label { color: rgba(255,255,255,.8); font-size: .8rem; min-width: 50px; }
.qs-slider-row input[type=range] { flex: 1; accent-color: var(--a-primary, #bb86fc); }

/* Main screen area */
.android-screen {
  flex: 1; min-height: 0; position: relative; overflow: hidden;
}

/* Homescreen */
.android-homescreen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.android-homescreen.active { opacity: 1; pointer-events: all; }

.android-wallpaper {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 80%, #1a0840 0%, #050510 70%);
}

.android-widgets {
  position: relative; z-index: 2;
  padding: 40px 24px 20px;
  text-align: center; color: #fff;
}
.android-clock-widget { font-size: 3.8rem; font-weight: 200; letter-spacing: -2px; }
.android-date-widget  { font-size: 1rem; color: rgba(255,255,255,.75); margin-top: 4px; }

.android-app-grid {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 4px; padding: 16px 12px;
  margin-top: auto;
}

/* App view (full screen) */
.android-app-view {
  position: absolute; inset: 0;
  background: var(--a-bg);
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  display: flex; flex-direction: column;
}
.android-app-view.active { opacity: 1; pointer-events: all; }

.android-app-frame { display: flex; flex-direction: column; height: 100%; }
.android-app-title {
  background: rgba(0,0,0,.5); color: #fff;
  padding: 10px 16px; font-size: .95rem; font-weight: 600;
  flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
}
.android-app-back {
  background: none; border: none; color: #fff; font-size: 1.2rem;
  cursor: pointer; padding: 0 4px; line-height: 1;
  flex-shrink: 0;
}
.android-app-back:hover { opacity: .7; }
.android-app-content { flex: 1; overflow-y: auto; overflow-x: hidden; }

/* App icon */
.android-app-icon {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 4px; border-radius: 12px;
  color: #fff; transition: background .15s;
}
.android-app-icon:hover, .android-app-icon:active { background: rgba(255,255,255,.1); }
.app-icon-glyph  { font-size: 1.9rem; line-height: 1; }
.app-icon-label  { font-size: .68rem; text-align: center; color: rgba(255,255,255,.9); }

/* App drawer */
.android-drawer {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(10,10,20,.96);
  backdrop-filter: blur(20px);
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(255,255,255,.1);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  padding: 16px;
  max-height: 85%;
  overflow-y: auto;
  z-index: 50;
}
.android-drawer.open { transform: translateY(0); }
.android-drawer::before {
  content: ''; display: block; width: 40px; height: 4px;
  background: rgba(255,255,255,.3); border-radius: 2px;
  margin: 0 auto 16px;
}
.drawer-search { margin-bottom: 14px; }
.drawer-search input {
  width: 100%; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15); border-radius: 24px;
  color: #fff; padding: 10px 16px; font-size: .9rem;
}
.drawer-search input:focus { outline: none; border-color: var(--a-primary, #bb86fc); }
.drawer-app-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
}

/* Recent apps */
.android-recent {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(10px);
  display: none; flex-direction: column; padding: 24px;
  overflow-y: auto; z-index: 40;
}
.android-recent.active { display: flex; }
.recent-header { color: #fff; font-size: 1rem; font-weight: 600; margin-bottom: 16px; }
.recent-card {
  background: var(--a-surface2, #242424);
  border-radius: 16px; padding: 16px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
  color: #fff; cursor: pointer;
}
.recent-icon { font-size: 1.5rem; }

/* Nav bar */
.android-navbar {
  display: flex; align-items: center; justify-content: space-around;
  height: var(--a-nav-h, 68px);
  background: rgba(0,0,0,.78); flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn {
  color: rgba(255,255,255,.8); font-size: 1.2rem;
  padding: 12px 22px; border-radius: 10px;
  transition: background .15s;
  background: none; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-btn:hover, .nav-btn:active { background: rgba(255,255,255,.1); }

/* Tray button — opens the app drawer (replaces the swipe-up gesture) */
.nav-tray {
  display: inline-flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 18px;
  background: linear-gradient(135deg, rgba(187,134,252,.18), rgba(124,77,255,.18));
  border: 1px solid rgba(187,134,252,.35);
  color: #ddd6fe;
}
.nav-tray:hover, .nav-tray:active {
  background: linear-gradient(135deg, rgba(187,134,252,.30), rgba(124,77,255,.30));
}
.nav-tray-icon  { font-size: 1.25rem; line-height: 1; }
.nav-tray-label { font-size: .68rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

/* Android window style */
[data-theme="android"] .win-titlebar { background: #1e1e2e; color: #e0e0e0; }
[data-theme="android"] .os-window { background: #121212; border: 1px solid #333; }
[data-theme="android"] .win-body { background: #121212; color: #e0e0e0; }

/* ════════════════════════════════════════════════════════════════════
   ███████  DESKTOP THEME
   ════════════════════════════════════════════════════════════════════ */
[data-theme="desktop"] {
  --d-bg:      #0d0d1a;
  --d-surface: #141428;
  --d-card:    #1a1a32;
  --d-accent:  #7c4dff;
  --d-text:    #e8e8f0;
  --d-text2:   #888;
  --d-border:  rgba(255,255,255,.08);
  --d-taskbar-h: 42px;
}
[data-theme="desktop"] body { background: var(--d-bg); }
[data-theme="desktop"] .os-shell { height: 100vh; width: 100vw; position: relative; overflow: hidden; }

.desktop-wallpaper {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 60%, #0e0330 0%, #080810 60%),
              radial-gradient(ellipse at 80% 20%, #0a1a40 0%, transparent 50%);
}
.desktop-icons {
  position: absolute; inset: 0 0 var(--d-taskbar-h) 0;
  z-index: 10; pointer-events: none; overflow: hidden;
}
.desktop-icon {
  position: absolute;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px; border-radius: 8px; width: 80px;
  color: #fff; transition: background .15s;
  pointer-events: auto; cursor: grab; user-select: none;
  background: none; border: none;
}
.desktop-icon:hover  { background: rgba(124,77,255,.2); }
.desktop-icon:focus  { background: rgba(124,77,255,.3); outline: none; }
.desktop-icon:active { cursor: grabbing; background: rgba(124,77,255,.3); }
.desktop-icon-glyph  { font-size: 2rem; line-height: 1; pointer-events: none; }
.desktop-icon-label  { font-size: .72rem; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.8); pointer-events: none; }

/* Taskbar */
.desktop-taskbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: var(--d-taskbar-h); background: rgba(12,12,25,.92);
  backdrop-filter: blur(16px); border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 4px; padding: 0 8px;
  z-index: 200;
}
.taskbar-start {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #6020c0, #4010a0);
  color: #fff; padding: 5px 14px; border-radius: 6px;
  font-size: .84rem; font-weight: 700;
  white-space: nowrap; flex-shrink: 0;
  transition: opacity .15s;
}
.taskbar-start:hover { opacity: .9; }
.taskbar-apps { display: flex; gap: 3px; flex: 1; overflow: hidden; }
.taskbar-tray {
  display: flex; align-items: center; gap: 8px;
  padding-left: 8px; border-left: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.tray-time { color: rgba(255,255,255,.8); font-size: .8rem; white-space: nowrap; }

/* Start menu */
.start-menu {
  position: absolute; bottom: calc(var(--d-taskbar-h) + 4px); left: 4px;
  background: rgba(15,10,30,.96);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px; padding: 0; min-width: 240px;
  box-shadow: 0 -20px 60px rgba(0,0,0,.7);
  z-index: 500; overflow: hidden;
}
.start-menu.hidden { display: none; }
.start-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(124,77,255,.2), rgba(80,40,180,.15));
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.start-avatar   { font-size: 1.8rem; }
.start-username { color: #fff; font-weight: 600; font-size: .95rem; }
.start-app-list { padding: 8px; max-height: 360px; overflow-y: auto; }
.start-app-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: #e0e0e0; font-size: .88rem; width: 100%; text-align: left;
  transition: background .15s;
}
.start-app-item:hover { background: rgba(124,77,255,.2); color: #fff; }
.start-footer {
  padding: 10px 12px; border-top: 1px solid rgba(255,255,255,.07);
}
.start-footer button {
  color: rgba(255,255,255,.7); font-size: .84rem; padding: 6px 10px;
  border-radius: 6px; transition: background .15s;
}
.start-footer button:hover { background: rgba(255,100,100,.2); color: #f87171; }

/* Desktop window */
[data-theme="desktop"] .os-window { background: #0e0e1c; border: 1px solid rgba(255,255,255,.1); }
[data-theme="desktop"] .win-titlebar { background: linear-gradient(90deg, #1a1438, #0f0f1e); color: #e0e0f0; border-bottom: 1px solid rgba(255,255,255,.08); }
[data-theme="desktop"] .win-body { background: #0e0e1c; color: #e0e0e0; }

/* ════════════════════════════════════════════════════════════════════
   🪟  WINDOWS XP THEME
   ════════════════════════════════════════════════════════════════════ */
[data-theme="xp"] {
  --xp-taskbar-h: 40px;
  --xp-start-green: #27a825;
}
[data-theme="xp"] body { background: #5a8a32; }
[data-theme="xp"] .os-shell { height: 100vh; overflow: hidden; position: relative; }

/* Bliss-inspired wallpaper */
.xp-desktop {
  position: absolute; inset: 0 0 var(--xp-taskbar-h) 0;
  background: linear-gradient(180deg, #5ba3d8 0%, #98c9e8 40%, #6bba35 60%, #4a9020 100%);
  overflow: hidden;
}
.xp-icons {
  position: absolute; inset: 0 0 var(--xp-taskbar-h) 0;
  pointer-events: none; overflow: hidden;
}
.xp-desktop-icon {
  position: absolute;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 80px; padding: 6px; border-radius: 4px;
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.8);
  transition: background .1s;
  pointer-events: auto; cursor: grab; user-select: none;
  background: none; border: none;
}
.xp-desktop-icon:hover  { background: rgba(20,80,160,.4); }
.xp-desktop-icon:focus  { outline: 1px dotted #fff; background: rgba(20,80,160,.4); }
.xp-desktop-icon:active { cursor: grabbing; }

/* XP Taskbar */
.xp-taskbar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: var(--xp-taskbar-h); z-index: 200;
  background: linear-gradient(180deg, #2457bf 0%, #1a47b0 3%, #1d4ec0 6%, #2255cc 30%, #1d4bbf 70%, #1745b5 100%);
  display: flex; align-items: center; gap: 2px;
  border-top: 1px solid #3a6de0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
  padding: 0 4px;
}
.xp-start-btn {
  display: flex; align-items: center; gap: 5px;
  background: linear-gradient(180deg, #58c035 0%, #3ea020 50%, #2e9015 100%);
  color: #fff; padding: 3px 14px 3px 8px;
  border-radius: 0 12px 12px 0;
  font-size: .9rem; font-weight: 700; font-style: italic;
  margin-left: -4px; height: 36px;
  box-shadow: 2px 0 4px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.4);
  transition: opacity .1s;
}
.xp-start-btn:hover { opacity: .9; }
.xp-taskbar-apps { display: flex; gap: 2px; flex: 1; padding: 3px 0; overflow: hidden; }
.xp-tray {
  background: rgba(0,0,80,.3); border-left: 1px solid rgba(255,255,255,.2);
  padding: 4px 10px; display: flex; align-items: center;
}
#xp-clock { color: #fff; font-size: .78rem; }

/* XP Start menu */
.xp-start-menu {
  position: absolute; bottom: var(--xp-taskbar-h); left: 0;
  width: 300px; background: #e9eff7;
  border-radius: 0 8px 0 0;
  box-shadow: 4px -4px 12px rgba(0,0,0,.4);
  overflow: hidden; z-index: 500;
}
.xp-start-menu.hidden { display: none; }
.xp-sm-header {
  background: linear-gradient(90deg, #1a47b0, #3a78d8);
  padding: 12px 16px; display: flex; align-items: center; gap: 12px;
}
.xp-sm-avatar   { font-size: 2rem; }
.xp-sm-header span:last-child { color: #fff; font-weight: 700; font-size: 1rem; }
.xp-sm-body { padding: 8px; background: #fff; max-height: 380px; overflow-y: auto; }
.xp-sm-apps { display: flex; flex-direction: column; gap: 1px; }
.xp-sm-app {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 4px;
  color: #000; font-size: .88rem; width: 100%; text-align: left;
  transition: background .1s;
}
.xp-sm-app:hover { background: #316ac5; color: #fff; }
.xp-sm-app-icon  { font-size: 1.2rem; }
.xp-sm-footer {
  background: linear-gradient(180deg, #b8cce4, #91afd3);
  padding: 8px 12px; border-top: 1px solid #7a9cc0;
  display: flex; justify-content: flex-end;
}
.xp-sm-logoff {
  background: transparent; color: #000; font-size: .84rem;
  padding: 5px 12px; border: 1px solid rgba(0,0,0,.2); border-radius: 4px;
}
.xp-sm-logoff:hover { background: rgba(0,0,0,.1); }

/* XP window style */
[data-theme="xp"] .os-window { background: #ece9d8; border: 2px solid #0a246a; border-radius: 6px 6px 0 0; }
[data-theme="xp"] .win-titlebar {
  background: linear-gradient(90deg, #0a246a 0%, #a6b5e1 5%, #3168d5 15%, #4a85e8 50%, #3168d5 85%, #6078a0 98%, #0a246a 100%);
  color: #fff; height: 28px; border-radius: 4px 4px 0 0;
}
[data-theme="xp"] .win-ctrl.win-close    { background: #cc0000; }
[data-theme="xp"] .win-ctrl.win-minimize { background: #4470cc; }
[data-theme="xp"] .win-ctrl.win-maximize { background: #4470cc; }
[data-theme="xp"] .win-body { background: #ece9d8; color: #000; }

/* XP taskbar app button */
[data-theme="xp"] .taskbar-app-btn {
  background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.2);
  border-radius: 2px;
}
[data-theme="xp"] .taskbar-app-btn.active { background: rgba(0,0,80,.4); border-inset: 1px solid rgba(0,0,0,.3); }

/* ════════════════════════════════════════════════════════════════════
   📟  TABLET THEME
   ════════════════════════════════════════════════════════════════════ */
[data-theme="tablet"] {
  --t-bg:       #0c0c18;
  --t-surface:  #161624;
  --t-accent:   #06b6d4;
  --t-text:     #e2e8f0;
  --t-text2:    #94a3b8;
  --t-sidebar-w: 72px;
  --t-status-h:  36px;
}
[data-theme="tablet"] body { background: var(--t-bg); }
[data-theme="tablet"] .os-shell { height: 100vh; display: flex; overflow: hidden; }

.tablet-sidebar {
  width: var(--t-sidebar-w, 72px);
  background: rgba(15,15,30,.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255,255,255,.06);
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0; gap: 0; z-index: 100; flex-shrink: 0;
}
.tablet-logo { font-size: 1.5rem; margin-bottom: 16px; padding: 8px; }
.tablet-app-list { flex: 1; width: 100%; overflow-y: auto; display: flex; flex-direction: column; }
.tablet-sidebar-app {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px; width: 100%;
  color: rgba(255,255,255,.7); font-size: .62rem;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.tablet-sidebar-app:hover { background: rgba(6,182,212,.1); color: #fff; }
.tablet-sidebar-app.active { border-left-color: var(--t-accent); color: var(--t-accent); background: rgba(6,182,212,.1); }
.sidebar-app-icon { font-size: 1.4rem; line-height: 1; }
.sidebar-app-name { font-size: .6rem; }
.tablet-sidebar-footer { padding: 12px 0; width: 100%; }
.tablet-sidebar-btn { color: rgba(255,255,255,.5); font-size: 1.2rem; width: 100%; padding: 10px; transition: color .15s; }
.tablet-sidebar-btn:hover { color: #f87171; }

.tablet-workspace { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.tablet-statusbar {
  height: var(--t-status-h, 36px); background: rgba(12,12,24,.8);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.05);
  flex-shrink: 0;
}
.tb-title { color: var(--t-text, #e2e8f0); font-weight: 600; font-size: .9rem; }
.tb-time  { color: var(--t-text2, #94a3b8); font-size: .82rem; }

.tablet-home { position: absolute; inset: var(--t-status-h, 36px) 0 0 0; overflow-y: auto; padding: 24px; }
.tablet-home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
.tablet-home-app {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px; border-radius: 16px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06);
  color: #fff; transition: background .15s;
}
.tablet-home-app:hover { background: rgba(6,182,212,.12); border-color: rgba(6,182,212,.3); }

[data-theme="tablet"] .os-window { background: #0c0c1a; border: 1px solid rgba(6,182,212,.2); border-radius: 14px; }
[data-theme="tablet"] .win-titlebar { background: rgba(20,20,40,.9); color: var(--t-text); border-bottom: 1px solid rgba(6,182,212,.15); }
[data-theme="tablet"] .win-body { background: #0c0c1a; color: var(--t-text); }

/* ═══════════════════════════════════════════════════════════════════
   SHARED APP INNER STYLES (inside .win-body or .android-app-content)
   ═══════════════════════════════════════════════════════════════════ */

/* App containers */
.app-root { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.app-header h3 { font-size: 1rem; font-weight: 700; color: #fff; }
.app-body  { flex: 1; overflow-y: auto; padding: 16px; }
.app-footer { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.06); flex-shrink: 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: .88rem; font-weight: 500; transition: opacity .15s, transform .1s; cursor: pointer; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary   { background: #7c4dff; color: #fff; }
.btn-primary:hover   { background: #6a3de0; }
.btn-secondary { background: rgba(255,255,255,.1); color: #e0e0e0; }
.btn-secondary:hover { background: rgba(255,255,255,.15); }
.btn-danger    { background: #f87171; color: #fff; }
.btn-danger:hover    { background: #ef4444; }
.btn-sm { padding: 5px 10px; font-size: .8rem; border-radius: 6px; }
.btn-icon { padding: 7px; border-radius: 8px; }

/* Form inputs */
.input-field {
  width: 100%; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px; color: #e0e0e0; padding: 10px 14px; font-size: .9rem;
  transition: border-color .2s;
}
.input-field:focus { outline: none; border-color: #7c4dff; }
.input-label { font-size: .82rem; color: #aaa; margin-bottom: 5px; display: block; }
.form-group { margin-bottom: 16px; }

/* Cards */
.card-item {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 10px;
  transition: border-color .15s;
}
.card-item:hover { border-color: rgba(124,77,255,.3); }

/* Chat messages */
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-bubble { max-width: 82%; padding: 10px 14px; border-radius: 14px; font-size: .9rem; line-height: 1.5; word-break: break-word; }
.chat-bubble.user { background: #7c4dff; color: #fff; align-self: flex-end; border-radius: 14px 14px 4px 14px; }
.chat-bubble.assistant { background: rgba(255,255,255,.08); color: #e0e0e0; align-self: flex-start; border-radius: 14px 14px 14px 4px; }
.chat-bubble.assistant pre { white-space: pre-wrap; font-size: .82rem; }
.chat-input-row { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.06); }
.chat-input { flex: 1; }
.chat-typing { color: #aaa; font-size: .82rem; padding: 0 16px 6px; font-style: italic; }

/* Files */
.file-list { display: flex; flex-direction: column; gap: 2px; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  color: #e0e0e0; font-size: .88rem; cursor: default;
  transition: background .1s;
}
.file-item:hover { background: rgba(255,255,255,.06); }
.file-icon { font-size: 1.1rem; flex-shrink: 0; }
.file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: #888; font-size: .78rem; flex-shrink: 0; }
.file-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .1s; }
.file-item:hover .file-actions { opacity: 1; }

/* Scrollable table */
.data-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.data-table th { color: #999; font-weight: 600; padding: 8px 10px; text-align: left; border-bottom: 1px solid rgba(255,255,255,.08); }
.data-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.04); color: #e0e0e0; }
.data-table tr:hover td { background: rgba(255,255,255,.03); }

/* Code block */
.code-block { background: rgba(0,0,0,.4); border-radius: 8px; padding: 12px 14px; font-family: 'Fira Code', monospace; font-size: .82rem; color: #a8e6cf; overflow-x: auto; }

/* Key display */
.key-display {
  background: rgba(0,0,0,.3); border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px; font-family: monospace; font-size: .8rem; color: #bb86fc;
  padding: 6px 10px; cursor: pointer; transition: background .15s;
}
.key-display:hover { background: rgba(0,0,0,.5); }

/* Badge */
.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: .72rem; font-weight: 600; }
.badge-ok   { background: rgba(52,211,153,.15); color: #34d399; }
.badge-err  { background: rgba(248,113,113,.15); color: #f87171; }
.badge-info { background: rgba(96,165,250,.15); color: #60a5fa; }
.badge-warn { background: rgba(251,191,36,.15); color: #fbbf24; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: #666; }
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { font-size: .9rem; }

/* Loading spinner */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.1); border-top-color: #7c4dff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* XP-specific overrides for inner app styles */
[data-theme="xp"] .app-root { background: #ece9d8; }
[data-theme="xp"] .input-field { background: #fff; border-color: #b0c4de; color: #000; }
[data-theme="xp"] .input-field:focus { border-color: #316ac5; }
[data-theme="xp"] .btn-primary { background: #316ac5; }
[data-theme="xp"] .card-item { background: #f0f0f0; border-color: #d0d0d0; color: #000; }
[data-theme="xp"] .chat-bubble.assistant { background: #e8e8e8; color: #000; }
[data-theme="xp"] .app-header h3, [data-theme="xp"] .input-label, [data-theme="xp"] .file-name { color: #000; }
[data-theme="xp"] .data-table td { color: #000; }

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT 3-PANEL LAYOUT  (chat.js rewrite)
═══════════════════════════════════════════════════════════════════════════ */
.chat3-layout { display:flex; height:100%; overflow:hidden; }
.chat3-left, .chat3-right { width:220px; flex-shrink:0; display:flex; flex-direction:column; background:#13131c; border-right:1px solid #252535; overflow-y:auto; transition:width .2s; }
.chat3-right { border-right:none; border-left:1px solid #252535; }
.chat3-left.collapsed, .chat3-right.collapsed { width:32px; overflow:hidden; }
.chat3-main { flex:1; display:flex; flex-direction:column; overflow:hidden; min-width:0; }
.chat3-sidebar-head { display:flex; align-items:center; justify-content:space-between; padding:10px 12px; font-size:.78rem; font-weight:600; color:#9999bb; text-transform:uppercase; letter-spacing:.05em; flex-shrink:0; }
.chat3-sidebar-title { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.chat3-section-head { padding:8px 12px 3px; font-size:.7rem; color:#555; text-transform:uppercase; letter-spacing:.06em; flex-shrink:0; }
.chat3-item { display:block; width:calc(100% - 8px); text-align:left; background:none; border:none; padding:8px 14px; color:#ccc; cursor:pointer; font-size:.85rem; border-radius:6px; margin:1px 4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.chat3-item:hover { background:#1e1e2e; }
.chat3-item.active { background:#2a2a40; color:#fff; }
.chat3-loading, .chat3-empty { padding:12px 14px; font-size:.8rem; color:#555; }
.chat3-mem-entry { padding:6px 12px; border-bottom:1px solid #1c1c2c; }
.chat3-mem-key { font-size:.75rem; color:#7c5cfc; }
.chat3-mem-val { font-size:.8rem; color:#bbb; margin-top:2px; }
.chat3-msgs { flex:1; overflow-y:auto; padding:12px 16px; display:flex; flex-direction:column; gap:8px; }
.chat3-typing { min-height:18px; font-size:.78rem; color:#666; padding:0 16px 4px; }
.chat3-input-row { display:flex; gap:8px; padding:10px 14px; border-top:1px solid #222; }
.chat3-input { flex:1; resize:none; background:#0f0f1a; border:1px solid #333; border-radius:8px; color:#eee; padding:8px 12px; font-size:.9rem; }
.chat3-input:focus { outline:none; border-color:#7c5cfc; }
.chat3-send-btn { background:#7c5cfc; color:#fff; border:none; border-radius:8px; padding:8px 18px; cursor:pointer; }
.chat3-send-btn:hover { background:#8d70ff; }
.chat3-header { display:flex; align-items:center; justify-content:space-between; padding:10px 16px; border-bottom:1px solid #222; flex-shrink:0; }
.chat3-conv-title { font-weight:600; color:#ddd; }
.chat3-new-btn { background:#2a2a40; border:1px solid #444; color:#ccc; border-radius:6px; padding:4px 10px; cursor:pointer; font-size:.8rem; }
.chat3-bubble { background:#1e1e2e; border-radius:10px; padding:10px 14px; font-size:.9rem; line-height:1.55; color:#ddd; max-width:85%; }
.chat3-bubble.user { background:#2a1e50; align-self:flex-end; }
.chat3-bubble.assistant { align-self:flex-start; }
.chat3-expand-left, .chat3-expand-right { background:#1e1e2e; border:1px solid #333; border-radius:4px; padding:3px 7px; cursor:pointer; font-size:.8rem; color:#aaa; }

/* ═══════════════════════════════════════════════════════════════════════════
   CHATROOM APP  (chatroom.js)
═══════════════════════════════════════════════════════════════════════════ */
.cr-layout { display:flex; height:100%; overflow:hidden; background:#0f0f18; }
.cr-left { width:220px; flex-shrink:0; display:flex; flex-direction:column; background:#13131c; border-right:1px solid #222; overflow-y:auto; }
.cr-right { width:200px; flex-shrink:0; display:flex; flex-direction:column; background:#13131c; border-left:1px solid #222; overflow-y:auto; }
.cr-main { flex:1; display:flex; flex-direction:column; min-width:0; overflow:hidden; }
.cr-sidebar-head { display:flex; align-items:center; justify-content:space-between; padding:10px 12px; font-size:.78rem; font-weight:600; color:#9999bb; text-transform:uppercase; letter-spacing:.05em; flex-shrink:0; }
.cr-sidebar-title { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.cr-section-label { padding:8px 12px 3px; font-size:.68rem; color:#555; text-transform:uppercase; letter-spacing:.07em; flex-shrink:0; }
.cr-room-list { padding:4px; }
.cr-room-item { display:flex; align-items:center; gap:7px; padding:7px 10px; cursor:pointer; border-radius:6px; color:#bbb; font-size:.85rem; }
.cr-room-item:hover { background:#1e1e2e; }
.cr-room-item.active { background:#2a2a40; color:#fff; }
.cr-room-icon { flex-shrink:0; }
.cr-room-label { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cr-room-count { font-size:.7rem; color:#555; }
.cr-main-head { display:flex; align-items:center; justify-content:space-between; padding:10px 16px; border-bottom:1px solid #222; flex-shrink:0; font-weight:600; color:#ddd; }
.cr-main-actions { display:flex; gap:6px; }
.cr-icon-btn { background:none; border:1px solid #333; border-radius:6px; padding:4px 9px; cursor:pointer; color:#bbb; font-size:.9rem; }
.cr-icon-btn:hover { background:#2a2a40; color:#fff; }
.cr-icon-btn.cr-danger:hover { border-color:#ff6b6b; color:#ff6b6b; }
.cr-msgs { flex:1; overflow-y:auto; padding:12px 16px; display:flex; flex-direction:column; gap:8px; }
.cr-typing { min-height:18px; padding:0 16px 3px; font-size:.78rem; color:#555; flex-shrink:0; }
.cr-input-row { display:flex; gap:8px; align-items:flex-end; padding:10px 14px; border-top:1px solid #222; flex-shrink:0; }
.cr-input { flex:1; resize:none; background:#0f0f1a; border:1px solid #333; border-radius:8px; color:#eee; padding:8px 12px; font-size:.9rem; max-height:120px; overflow-y:auto; }
.cr-input:focus { outline:none; border-color:#7c5cfc; }
.cr-send-btn { background:#7c5cfc; color:#fff; border:none; border-radius:8px; padding:8px 18px; cursor:pointer; }
.cr-send-btn:hover { background:#8d70ff; }
.cr-msg-wrap { display:flex; }
.cr-msg-wrap.self { flex-direction:row-reverse; }
.cr-msg { background:#1e1e2e; border-radius:10px; padding:8px 12px; max-width:78%; font-size:.88rem; line-height:1.5; color:#ddd; }
.cr-msg-wrap.self .cr-msg { background:#2a1e50; }
.cr-msg-user { font-size:.72rem; color:#7c5cfc; margin-bottom:3px; font-weight:600; }
.cr-msg-wrap.self .cr-msg-user { text-align:right; }
.cr-msg-text { word-break:break-word; }
.cr-msg-ts { font-size:.68rem; color:#555; margin-top:4px; }
.cr-msg-wrap.self .cr-msg-ts { text-align:right; }
.cr-msg-system { text-align:center; font-size:.78rem; color:#555; padding:4px 0; }
.cr-msg-file a { color:#7c5cfc; text-decoration:none; }
.cr-msg-file a:hover { text-decoration:underline; }
.cr-member-list { padding:4px; }
.cr-member-item { display:flex; align-items:center; gap:8px; padding:6px 10px; font-size:.83rem; color:#ccc; }
.cr-member-dot { width:8px; height:8px; border-radius:50%; background:#333; flex-shrink:0; }
.cr-member-dot.online { background:#4ade80; }
.cr-member-name { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cr-member-role { font-size:.7rem; color:#7c5cfc; }
.cr-voice-panel { padding:8px; }
.cr-voice-users { display:flex; flex-direction:column; gap:6px; }
.cr-voice-user { display:flex; align-items:center; gap:8px; padding:4px 8px; background:#1e1e2e; border-radius:6px; font-size:.82rem; color:#ddd; }
.cr-voice-dot { width:8px; height:8px; border-radius:50%; background:#4ade80; flex-shrink:0; animation:pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.cr-voice-controls { display:flex; gap:8px; margin-top:8px; }
.cr-modal { position:fixed; inset:0; background:rgba(0,0,0,.65); display:flex; align-items:center; justify-content:center; z-index:1000; }
.cr-modal-box { background:#1a1a28; border:1px solid #333; border-radius:12px; padding:1.5rem; min-width:320px; max-width:420px; }
.cr-modal-box h3 { margin-bottom:1rem; color:#ddd; }
.cr-modal-box label { display:block; font-size:.82rem; color:#aaa; margin:.6rem 0 .3rem; }
.cr-modal-box input, .cr-modal-box select { width:100%; padding:.5rem .75rem; background:#0f0f1a; border:1px solid #333; border-radius:6px; color:#eee; font-size:.9rem; margin-bottom:.25rem; }
.cr-modal-foot { display:flex; justify-content:flex-end; gap:8px; margin-top:1rem; }
.cr-btn-primary { background:#7c5cfc; color:#fff; border:none; border-radius:6px; padding:6px 18px; cursor:pointer; }
.cr-btn-primary:hover { background:#8d70ff; }
.cr-info { font-size:.8rem; color:#7c5cfc; margin-top:.5rem; }
.cr-empty, .cr-loading { padding:12px; font-size:.82rem; color:#555; }

/* ═══════════════════════════════════════════════════════════════════════════
   VAULT APP  (vault.js)
═══════════════════════════════════════════════════════════════════════════ */
.vault-layout { position:relative; height:100%; display:flex; flex-direction:column; overflow:hidden; }
.vault-locked { position:absolute; inset:0; background:#0f0f18; display:flex; align-items:center; justify-content:center; z-index:10; }
.vault-lock-box { background:#1a1a28; border:1px solid #333; border-radius:12px; padding:2rem 2.5rem; width:340px; text-align:center; }
.vault-lock-icon { font-size:2.5rem; margin-bottom:.5rem; }
.vault-lock-box h2 { font-size:1.1rem; color:#ddd; margin-bottom:.5rem; }
.vault-lock-box p { font-size:.82rem; color:#888; margin-bottom:1rem; }
.vault-lock-box input { width:100%; padding:.5rem .75rem; background:#0f0f1a; border:1px solid #333; border-radius:6px; color:#eee; font-size:.9rem; margin-bottom:.75rem; }
.vault-lock-box input:focus { outline:none; border-color:#7c5cfc; }
.vault-btn-primary { background:#7c5cfc; color:#fff; border:none; border-radius:6px; padding:8px 22px; cursor:pointer; font-size:.9rem; }
.vault-btn-primary:hover { background:#8d70ff; }
.vault-btn-small { background:#2a2a40; color:#ccc; border:1px solid #444; border-radius:6px; padding:5px 14px; cursor:pointer; font-size:.82rem; }
.vault-inner { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.vault-toolbar { display:flex; align-items:center; gap:10px; padding:10px 14px; border-bottom:1px solid #222; flex-shrink:0; }
.vault-status { flex:1; font-size:.8rem; color:#888; }
.vault-list { flex:1; overflow-y:auto; padding:10px; display:flex; flex-direction:column; gap:6px; }
.vault-item { display:flex; align-items:center; gap:10px; padding:10px 12px; background:#1a1a28; border:1px solid #252535; border-radius:8px; }
.vault-item-icon { font-size:1.2rem; flex-shrink:0; }
.vault-item-name { flex:1; font-size:.88rem; color:#ddd; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vault-item-size { font-size:.75rem; color:#555; flex-shrink:0; }
.vault-item-ts { font-size:.73rem; color:#444; flex-shrink:0; }
.vault-icon-btn { background:none; border:1px solid #333; border-radius:5px; padding:3px 9px; cursor:pointer; color:#bbb; font-size:.85rem; }
.vault-icon-btn:hover { background:#2a2a40; }
.vault-danger:hover { border-color:#ff6b6b; color:#ff6b6b; }
.vault-loading, .vault-empty, .vault-err { padding:16px; font-size:.85rem; color:#555; }
.vault-err { color:#ff6b6b; }

/* ═══════════════════════════════════════════════════════════════════════════
   SECURE NOTES APP  (notes.js)
═══════════════════════════════════════════════════════════════════════════ */
.snote-layout { display:flex; flex-direction:column; height:100%; overflow:hidden; }
.snote-toolbar { display:flex; align-items:center; gap:8px; padding:10px 14px; border-bottom:1px solid #222; flex-shrink:0; }
.snote-btn-primary { background:#7c5cfc; color:#fff; border:none; border-radius:6px; padding:6px 16px; cursor:pointer; font-size:.88rem; }
.snote-btn-primary:hover { background:#8d70ff; }
.snote-btn-small { background:#2a2a40; color:#ccc; border:1px solid #444; border-radius:6px; padding:5px 12px; cursor:pointer; font-size:.82rem; }
.snote-list { flex:1; overflow-y:auto; padding:10px; display:flex; flex-direction:column; gap:6px; }
.snote-item { background:#1a1a28; border:1px solid #252535; border-radius:8px; padding:10px 14px; }
.snote-item.burned { opacity:.55; }
.snote-item-title { font-size:.92rem; font-weight:600; color:#ddd; margin-bottom:5px; }
.snote-item-meta { display:flex; align-items:center; gap:10px; font-size:.78rem; color:#777; margin-bottom:6px; }
.snote-badge { background:#2a2a40; border-radius:4px; padding:2px 7px; color:#aaa; font-size:.72rem; }
.snote-badge.burned { background:#3a1010; color:#ff6b6b; }
.snote-ts { color:#555; }
.snote-item-actions { display:flex; gap:6px; }
.snote-icon-btn { background:none; border:1px solid #333; border-radius:5px; padding:3px 9px; cursor:pointer; color:#bbb; font-size:.82rem; }
.snote-icon-btn:hover { background:#2a2a40; }
.snote-danger:hover { border-color:#ff6b6b; color:#ff6b6b; }
.snote-panel { background:#1a1a28; border-top:1px solid #333; padding:16px; flex-shrink:0; overflow-y:auto; }
.snote-panel h3 { margin-bottom:.75rem; color:#ddd; font-size:1rem; }
.snote-panel input, .snote-panel textarea { width:100%; padding:.5rem .75rem; background:#0f0f1a; border:1px solid #333; border-radius:6px; color:#eee; font-size:.88rem; margin-bottom:.6rem; }
.snote-panel input:focus, .snote-panel textarea:focus { outline:none; border-color:#7c5cfc; }
.snote-options label { display:block; font-size:.78rem; color:#888; margin:.4rem 0 .2rem; }
.snote-panel-foot { display:flex; gap:8px; justify-content:flex-end; margin-top:.5rem; }
.snote-err { color:#ff6b6b; font-size:.82rem; margin-top:.4rem; }
.snote-loading, .snote-empty { padding:16px; font-size:.85rem; color:#555; }
.snote-modal { position:fixed; inset:0; background:rgba(0,0,0,.7); display:flex; align-items:center; justify-content:center; z-index:1000; }
.snote-modal-box { background:#1a1a28; border:1px solid #333; border-radius:12px; padding:1.75rem; width:92%; max-width:560px; max-height:85vh; overflow-y:auto; }
.snote-modal-box h3 { color:#ddd; margin-bottom:1rem; }
.snote-content-view { background:#0f0f1a; border:1px solid #252535; border-radius:8px; padding:1rem; font-family:inherit; font-size:.9rem; line-height:1.6; color:#ddd; white-space:pre-wrap; margin-bottom:1rem; }
.snote-burn-info { font-size:.8rem; color:#ff6b6b; margin-bottom:.75rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   FILES TABS  (files.js shared folder tab strip)
═══════════════════════════════════════════════════════════════════════════ */
.files-tabs { display:flex; gap:2px; padding:6px 8px; background:#13131c; border-bottom:1px solid #222; flex-shrink:0; }
.files-tab { background:none; border:1px solid transparent; border-radius:6px; padding:5px 14px; cursor:pointer; font-size:.83rem; color:#888; }
.files-tab:hover { background:#1e1e2e; color:#ccc; }
.files-tab.active { background:#2a2a40; border-color:#444; color:#ddd; }
.files-tab-pane { display:flex; flex-direction:column; flex:1; overflow:hidden; }


/* ═══════════════════════════════════════════════════════════════════════════
   CREDITS APP  (credits.js)
═══════════════════════════════════════════════════════════════════════════ */
.crd-layout { display:flex; flex-direction:column; height:100%; overflow:hidden; background:#0f0f18; }
.crd-tabs { display:flex; gap:2px; padding:6px 10px; background:#13131c; border-bottom:1px solid #222; flex-shrink:0; }
.crd-tab { background:none; border:1px solid transparent; border-radius:6px; padding:5px 14px; cursor:pointer; font-size:.83rem; color:#888; }
.crd-tab:hover { background:#1e1e2e; color:#ccc; }
.crd-tab.active { background:#2a2a40; border-color:#444; color:#ddd; }
.crd-body { flex:1; overflow-y:auto; padding:16px; }
.crd-loading, .crd-empty { padding:20px; color:#555; font-size:.88rem; }
.crd-err { color:#ff6b6b; padding:10px 16px; font-size:.85rem; }
.crd-flash { padding:8px 14px; border-radius:6px; margin-bottom:10px; font-size:.85rem; }
.crd-flash.crd-err { background:#3a1010; color:#ff8888; border:1px solid #662222; }
.crd-flash.crd-info { background:#102030; color:#88ccff; border:1px solid #224466; }

/* ── Balance card ── */
.crd-overview { display:flex; flex-direction:column; gap:16px; }
.crd-balance-card { background:linear-gradient(135deg,#1e1640,#2a1e50); border:1px solid #3a2a70; border-radius:14px; padding:20px 24px; text-align:center; }
.crd-balance-card.crd-bal-unlimited { background:linear-gradient(135deg,#102418,#1a3a28); border-color:#2a6040; }
.crd-balance-card.crd-bal-low { background:linear-gradient(135deg,#2a1210,#3a1a10); border-color:#6a2a20; }
.crd-bal-label { font-size:.8rem; color:#9999bb; text-transform:uppercase; letter-spacing:.07em; margin-bottom:6px; }
.crd-bal-value { font-size:2.6rem; font-weight:700; color:#ddd; }
.crd-bal-unlimited .crd-bal-value { color:#4ade80; }
.crd-bal-low .crd-bal-value { color:#ff8888; }
.crd-pending-note { font-size:.78rem; color:#aaa; margin-top:4px; }
.crd-bal-actions { display:flex; gap:10px; justify-content:center; margin-top:14px; }

/* ── Stat row ── */
.crd-stats-row { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.crd-stat { background:#1a1a28; border:1px solid #252535; border-radius:10px; padding:12px; text-align:center; }
.crd-stat-icon { font-size:1.3rem; margin-bottom:4px; }
.crd-stat-val { font-size:1.15rem; font-weight:700; color:#ddd; }
.crd-stat-label { font-size:.72rem; color:#666; margin-top:3px; }

/* ── Section headings ── */
.crd-section { background:#1a1a28; border:1px solid #252535; border-radius:10px; padding:14px; }
.crd-section-title { font-size:.78rem; font-weight:600; color:#9999bb; text-transform:uppercase; letter-spacing:.07em; margin-bottom:12px; }

/* ── Breakdown bars ── */
.crd-breakdown { display:flex; flex-direction:column; gap:7px; }
.crd-breakdown-row { display:flex; align-items:center; gap:8px; font-size:.83rem; }
.crd-br-icon { width:20px; text-align:center; flex-shrink:0; }
.crd-br-label { width:110px; color:#bbb; flex-shrink:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.crd-br-bar-wrap { flex:1; height:8px; background:#1e1e2e; border-radius:4px; overflow:hidden; }
.crd-br-bar { height:100%; border-radius:4px; background:#7c5cfc; }
.crd-br-bar.tx-ai { background:#4ade80; }
.crd-br-bar.tx-purchase { background:#60a5fa; }
.crd-br-bar.tx-transfer-out { background:#f59e0b; }
.crd-br-bar.tx-transfer-in { background:#34d399; }
.crd-br-bar.tx-admin-grant { background:#a78bfa; }
.crd-br-bar.tx-admin-deduct { background:#f87171; }
.crd-br-val { width:70px; text-align:right; color:#ddd; font-variant-numeric:tabular-nums; }

/* ── Daily chart ── */
.crd-chart { display:flex; align-items:flex-end; gap:4px; height:80px; padding-top:4px; overflow:hidden; }
.crd-chart-col { display:flex; flex-direction:column; align-items:center; flex:1; min-width:0; }
.crd-chart-bar { background:#7c5cfc; border-radius:2px 2px 0 0; min-height:4px; width:100%; transition:height .2s; }
.crd-chart-lbl { font-size:.6rem; color:#555; margin-top:2px; white-space:nowrap; }

/* ── Buttons ── */
.crd-btn-primary { background:#7c5cfc; color:#fff; border:none; border-radius:6px; padding:7px 20px; cursor:pointer; font-size:.88rem; }
.crd-btn-primary:hover { background:#8d70ff; }
.crd-btn-primary:disabled { background:#444; cursor:not-allowed; color:#888; }
.crd-btn-secondary { background:#2a2a40; color:#ccc; border:1px solid #444; border-radius:6px; padding:7px 20px; cursor:pointer; font-size:.88rem; }
.crd-btn-secondary:hover { background:#3a3a55; }
.crd-btn-ghost { background:none; border:1px solid #333; border-radius:6px; padding:5px 14px; cursor:pointer; color:#aaa; font-size:.82rem; }
.crd-btn-ghost:hover { background:#1e1e2e; color:#ccc; }
.crd-btn-ghost:disabled { opacity:.4; cursor:not-allowed; }

/* ── Inputs ── */
.crd-input { width:100%; padding:.5rem .75rem; background:#0f0f1a; border:1px solid #333; border-radius:6px; color:#eee; font-size:.9rem; margin-bottom:.75rem; }
.crd-input:focus { outline:none; border-color:#7c5cfc; }
.crd-label { display:block; font-size:.78rem; color:#888; margin:.5rem 0 .25rem; }

/* ── Buy tab ── */
.crd-buy-panel { display:flex; flex-direction:column; gap:4px; }
.crd-pkg-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); gap:10px; margin-bottom:4px; }
.crd-pkg-card { background:#1a1a28; border:2px solid #252535; border-radius:10px; padding:14px; text-align:center; cursor:pointer; transition:border-color .15s,background .15s; }
.crd-pkg-card:hover { background:#1e1e30; border-color:#3a3a55; }
.crd-pkg-card.selected { background:#1e1640; border-color:#7c5cfc; }
.crd-pkg-tokens { font-size:1.6rem; font-weight:700; color:#7c5cfc; }
.crd-pkg-unit { font-size:.72rem; color:#666; }
.crd-pkg-name { font-size:.85rem; color:#ccc; margin:.4rem 0 .3rem; }
.crd-pkg-price { font-size:1rem; font-weight:600; color:#4ade80; }
.crd-method-row { display:flex; gap:10px; margin-bottom:1rem; }
.crd-radio-label { display:flex; align-items:center; gap:6px; padding:7px 16px; border:1px solid #333; border-radius:6px; cursor:pointer; font-size:.88rem; color:#bbb; }
.crd-radio-label.active, .crd-radio-label:has(input:checked) { border-color:#7c5cfc; color:#ddd; background:#1a1640; }
.crd-radio-label input { accent-color:#7c5cfc; }
.crd-buy-footer { margin-top:.5rem; }
.crd-pending-box { background:#1a1a28; border:1px solid #333; border-radius:10px; padding:16px; margin-top:14px; display:flex; flex-direction:column; gap:8px; }
.crd-pending-title { font-size:1rem; font-weight:600; color:#ddd; }
.crd-pending-note { font-size:.83rem; color:#aaa; line-height:1.5; margin:0; }

/* ── Transfer tab ── */
.crd-transfer-panel { max-width:480px; }
.crd-search-wrap { position:relative; }
.crd-search-dropdown { position:absolute; top:100%; left:0; right:0; background:#1a1a28; border:1px solid #444; border-radius:6px; z-index:50; max-height:200px; overflow-y:auto; }
.crd-search-item { padding:8px 12px; cursor:pointer; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.crd-search-item:hover { background:#2a2a40; }
.crd-srch-name { color:#ddd; font-size:.88rem; }
.crd-srch-user { color:#666; font-size:.78rem; }
.crd-selected-user { display:flex; align-items:center; justify-content:space-between; padding:6px 10px; background:#1a2030; border:1px solid #2a4060; border-radius:6px; margin-bottom:.75rem; font-size:.85rem; color:#ccc; }
.crd-transfer-footer { margin-top:.5rem; }
.crd-transfer-status { margin-top:10px; padding:8px 12px; border-radius:6px; font-size:.84rem; background:#1a1a28; border:1px solid #333; color:#ccc; }

/* ── History tab ── */
.crd-history-panel { display:flex; flex-direction:column; gap:8px; }
.crd-filter-bar { display:flex; flex-wrap:wrap; gap:4px; }
.crd-filter-btn { background:none; border:1px solid #333; border-radius:6px; padding:4px 12px; cursor:pointer; font-size:.78rem; color:#888; }
.crd-filter-btn:hover { background:#1e1e2e; color:#ccc; }
.crd-filter-btn.active { background:#2a2a40; border-color:#7c5cfc; color:#ddd; }
.crd-tx-list { display:flex; flex-direction:column; gap:4px; }
.crd-tx-row { display:flex; align-items:center; gap:10px; padding:10px 12px; background:#1a1a28; border:1px solid #252535; border-radius:8px; }
.crd-tx-icon { font-size:1.1rem; flex-shrink:0; width:22px; text-align:center; }
.crd-tx-info { flex:1; min-width:0; }
.crd-tx-reason { font-size:.85rem; color:#ccc; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.crd-tx-meta { display:flex; align-items:center; gap:8px; margin-top:3px; }
.crd-tx-badge { font-size:.68rem; padding:1px 6px; border-radius:4px; background:#2a2a40; color:#888; }
.crd-tx-badge.tx-purchase { background:#0a2040; color:#60a5fa; }
.crd-tx-badge.tx-ai { background:#0a2a18; color:#4ade80; }
.crd-tx-badge.tx-transfer-in { background:#0a2a20; color:#34d399; }
.crd-tx-badge.tx-transfer-out { background:#2a1a04; color:#f59e0b; }
.crd-tx-badge.tx-admin-grant { background:#1a1040; color:#a78bfa; }
.crd-tx-badge.tx-admin-deduct { background:#2a1010; color:#f87171; }
.crd-tx-date { font-size:.72rem; color:#555; }
.crd-tx-right { flex-shrink:0; text-align:right; }
.crd-tx-delta { font-size:.95rem; font-weight:700; font-variant-numeric:tabular-nums; }
.tx-positive { color:#4ade80; }
.tx-negative { color:#f87171; }
.crd-tx-bal { font-size:.7rem; color:#555; margin-top:2px; }
.crd-pagination { display:flex; align-items:center; gap:10px; justify-content:center; padding:8px 0; }
.crd-page-info { font-size:.8rem; color:#666; }

/* ── Responsive: collapse stats grid on narrow windows ── */
@media (max-width:560px) {
  .crd-stats-row { grid-template-columns:repeat(2,1fr); }
}


/* ═══════════════════════════════════════════════════════════════════
   Subscription Plans — sub-* classes
═══════════════════════════════════════════════════════════════════ */

/* Plan badge on balance card */
.crd-plan-badge {
  display: inline-block;
  margin: .3rem auto .1rem;
  padding: .2rem .75rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.crd-plan-free      { background: #334155; color: #94a3b8; }
.crd-plan-basic     { background: #4338ca; color: #e0e7ff; }
.crd-plan-unlimited { background: linear-gradient(90deg,#d97706,#f59e0b); color: #1a1a2e; }

/* Plans panel */
.sub-panel        { padding: 1.2rem; display: flex; flex-direction: column; gap: 1.2rem; overflow-y: auto; height: 100%; box-sizing: border-box; }
.sub-header       { text-align: center; }
.sub-title        { font-size: 1.25rem; font-weight: 700; color: #e2e8f0; }
.sub-subtitle     { font-size: .85rem; color: #94a3b8; margin-top: .3rem; }

/* Plan cards row */
.sub-cards        { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 640px) { .sub-cards { grid-template-columns: 1fr; } }

.sub-plan-card {
  background: var(--plan-bg, #1e293b);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  transition: border-color .2s, transform .15s;
}
.sub-plan-card:hover { border-color: var(--plan-accent, #6366f1); transform: translateY(-2px); }
.sub-plan-card.sub-current {
  border-color: var(--plan-accent, #6366f1);
  box-shadow: 0 0 18px color-mix(in srgb, var(--plan-accent, #6366f1) 30%, transparent);
}

.sub-plan-header  { display: flex; justify-content: space-between; align-items: baseline; }
.sub-plan-name    { font-size: 1rem; font-weight: 700; color: #f1f5f9; }
.sub-plan-price   { font-size: 1rem; font-weight: 700; color: var(--plan-accent, #94a3b8); }
.sub-plan-tokens  { font-size: .8rem; color: #94a3b8; font-weight: 600; padding: .25rem .6rem; background: #0f172a; border-radius: 6px; text-align: center; }

.sub-feat-list    { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.sub-feat         { font-size: .8rem; color: #cbd5e1; padding-left: 1.1em; position: relative; }
.sub-feat::before { content: "✓"; position: absolute; left: 0; color: var(--plan-accent, #6366f1); font-weight: 700; }

.sub-plan-action  { margin-top: auto; }
.sub-current-badge {
  display: block; text-align: center; padding: .5rem;
  background: color-mix(in srgb, var(--plan-accent, #6366f1) 20%, transparent);
  color: var(--plan-accent, #6366f1);
  border-radius: 8px;
  font-size: .8rem; font-weight: 700;
  margin-bottom: .5rem;
}
.sub-upgrade-btn, .sub-cancel-btn {
  width: 100%;
  padding: .55rem;
  border-radius: 8px;
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .15s;
}
.sub-upgrade-btn { background: var(--plan-accent, #6366f1); color: #fff; }
.sub-upgrade-btn:hover { opacity: .85; }
.sub-cancel-btn { background: transparent; color: #ef4444; border: 1px solid #ef4444; margin-top: .4rem; }
.sub-cancel-btn:hover { background: #ef444420; }

/* Payment box */
.sub-pay-box {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.sub-pay-title    { font-weight: 700; color: #e2e8f0; font-size: .95rem; }
.sub-pay-note     { color: #94a3b8; font-size: .83rem; margin: 0; }
.sub-method-row   { display: flex; gap: .75rem; }
.sub-method-label {
  flex: 1; text-align: center;
  padding: .5rem;
  background: #0f172a;
  border: 2px solid #334155;
  border-radius: 8px;
  cursor: pointer;
  font-size: .85rem;
  color: #94a3b8;
  transition: border-color .15s, color .15s;
}
.sub-method-label.active { border-color: #6366f1; color: #a5b4fc; }
.sub-method-label input  { display: none; }
.sub-pay-footer   { display: flex; gap: .6rem; }

/* Pending subscription notice */
.sub-pending-box {
  background: #1e293b;
  border: 1px solid #d97706;
  border-radius: 10px;
  padding: .9rem 1rem;
  font-size: .85rem;
  color: #fcd34d;
}
.sub-status       { padding: .7rem 1rem; border-radius: 8px; background: #1e293b; color: #94a3b8; font-size: .85rem; text-align: center; }


/* ═══════════════════════════════════════════════════════════════════
   STORE APP  (store.js)  — redesign
═══════════════════════════════════════════════════════════════════ */

/* ── Outer shell ─────────────────────────────────────────────── */
.store-shell {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
  background: #0d1117; color: #e2e8f0;
  font-family: inherit;
}

/* ── Top header bar ──────────────────────────────────────────── */
.store-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1.25rem .6rem;
  background: #161b22;
  border-bottom: 1px solid #21262d;
  flex-shrink: 0;
}
.store-header-left { display: flex; align-items: center; gap: .65rem; }
.store-header-icon { font-size: 1.3rem; }
.store-header-title { font-size: 1rem; font-weight: 700; color: #f0f6fc; }
.store-header-right { display: flex; align-items: center; gap: .5rem; }
.store-bal-chip {
  display: flex; align-items: center; gap: .4rem;
  background: #21262d; border: 1px solid #30363d;
  border-radius: 999px; padding: .25rem .75rem;
  font-size: .78rem; color: #c9d1d9;
}
.store-bal-chip strong { color: #58a6ff; }
.store-plan-chip {
  background: #21262d; border: 1px solid #30363d;
  border-radius: 999px; padding: .25rem .75rem;
  font-size: .75rem; font-weight: 600;
}
.store-plan-chip.chip-free      { color: #8b949e; border-color: #484f58; }
.store-plan-chip.chip-basic     { color: #a5b4fc; border-color: #6366f1; }
.store-plan-chip.chip-unlimited { color: #fbbf24; border-color: #f59e0b; }

/* ── Tab bar ─────────────────────────────────────────────────── */
.store-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid #21262d;
  background: #161b22;
  flex-shrink: 0;
}
.store-tab {
  padding: .65rem 1.25rem;
  border: none; border-bottom: 3px solid transparent;
  background: transparent; color: #8b949e;
  font-size: .85rem; font-weight: 500; cursor: pointer;
  transition: color .15s, border-color .15s;
  display: flex; align-items: center; gap: .4rem;
}
.store-tab:hover  { color: #c9d1d9; background: #1c2128; }
.store-tab.active { color: #58a6ff; border-bottom-color: #58a6ff; font-weight: 700; }

/* ── Scrollable content area ─────────────────────────────────── */
.store-content {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 1.4rem 1.5rem 2rem;
}

/* ── Section headings ────────────────────────────────────────── */
.store-sh { font-size: 1.05rem; font-weight: 700; color: #f0f6fc; margin: 0 0 .2rem; }
.store-ss { font-size: .8rem; color: #8b949e; margin: 0 0 1.3rem; }

/* ── Plan cards ──────────────────────────────────────────────── */
.store-plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin-bottom: 1.2rem;
}
@media (max-width: 640px) { .store-plans-grid { grid-template-columns: 1fr; } }

.store-pc {
  border-radius: 14px; overflow: hidden;
  border: 1.5px solid #21262d;
  display: flex; flex-direction: column;
  transition: border-color .2s, box-shadow .2s, transform .15s;
  background: #161b22;
}
.store-pc:hover { border-color: var(--pc-acc,#58a6ff); transform: translateY(-3px); }
.store-pc.store-pc-cur {
  border-color: var(--pc-acc,#58a6ff);
  box-shadow: 0 0 24px color-mix(in srgb, var(--pc-acc,#58a6ff) 22%, transparent);
}

.store-pc-head {
  padding: 1.1rem 1.1rem .8rem;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--pc-acc,#58a6ff) 18%, #161b22) 0%,
    #161b22 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--pc-acc,#58a6ff) 25%, #21262d);
}
.store-pc-name {
  font-size: .95rem; font-weight: 800;
  color: var(--pc-acc,#58a6ff); display: block; margin-bottom: .3rem;
}
.store-pc-price {
  font-size: 1.6rem; font-weight: 800; color: #f0f6fc; line-height: 1;
}
.store-pc-price sub { font-size: .65rem; font-weight: 400; color: #8b949e; }
.store-pc-tok {
  display: inline-block; margin-top: .4rem;
  font-size: .72rem; font-weight: 600;
  background: color-mix(in srgb, var(--pc-acc,#58a6ff) 14%, #0d1117);
  color: var(--pc-acc,#58a6ff);
  border-radius: 5px; padding: .15rem .5rem;
}

.store-pc-body { padding: .9rem 1.1rem; flex: 1; display: flex; flex-direction: column; gap: .8rem; }
.store-pc-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.store-pc-feats li { font-size: .78rem; color: #c9d1d9; padding-left: 1.2em; position: relative; }
.store-pc-feats li::before { content: "✓"; position: absolute; left: 0; color: var(--pc-acc,#58a6ff); font-weight: 800; }

.store-pc-cur-badge {
  display: block; text-align: center;
  padding: .4rem; border-radius: 8px;
  background: color-mix(in srgb, var(--pc-acc,#58a6ff) 14%, transparent);
  color: var(--pc-acc,#58a6ff); font-size: .77rem; font-weight: 700;
}
.store-pc-btn {
  display: block; width: 100%; padding: .55rem;
  border-radius: 9px; border: none; cursor: pointer;
  font-size: .82rem; font-weight: 700; text-align: center;
  background: var(--pc-acc,#58a6ff); color: #0d1117;
  transition: opacity .15s;
}
.store-pc-btn:hover { opacity: .88; }
.store-pc-btn.store-pc-btn-ghost {
  background: transparent; color: #ef4444;
  border: 1.5px solid #ef4444;
  margin-top: .35rem;
}
.store-pc-btn.store-pc-btn-ghost:hover { background: #ef444418; }

/* ── Payment flow box ────────────────────────────────────────── */
.store-flow {
  background: #161b22; border: 1.5px solid #30363d;
  border-radius: 12px; padding: 1.2rem 1.3rem;
  margin-top: 1rem; display: flex; flex-direction: column; gap: .8rem;
}
.store-flow h3 { margin: 0; font-size: .9rem; font-weight: 700; color: #f0f6fc; }
.store-flow p  { margin: 0; font-size: .8rem; color: #8b949e; }
.store-flow-ref { font-size: .85rem; color: #fbbf24; font-weight: 600; }

.store-method-row { display: flex; gap: .65rem; }
.store-method-lbl {
  flex: 1; text-align: center; padding: .55rem;
  background: #0d1117; border: 1.5px solid #30363d;
  border-radius: 9px; font-size: .82rem; color: #8b949e;
  cursor: pointer; transition: border-color .15s, color .15s;
}
.store-method-lbl.active { border-color: #58a6ff; color: #58a6ff; }
.store-method-lbl input  { display: none; }

.store-input {
  background: #0d1117; border: 1.5px solid #30363d;
  border-radius: 8px; padding: .55rem .8rem;
  color: #e2e8f0; font-size: .85rem; width: 100%; box-sizing: border-box;
}
.store-input:focus { outline: none; border-color: #58a6ff; }

.store-flow-btns { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* ── Buttons ─────────────────────────────────────────────────── */
.store-btn {
  padding: .5rem 1.15rem; border-radius: 8px;
  font-size: .82rem; font-weight: 600;
  cursor: pointer; border: none; transition: opacity .15s;
  display: inline-flex; align-items: center; gap: .35rem;
  text-decoration: none;
}
.store-btn-blue   { background: #238636; color: #fff; }
.store-btn-indigo { background: #6366f1; color: #fff; }
.store-btn-ghost  { background: transparent; color: #8b949e; border: 1.5px solid #30363d; }
.store-btn-danger { background: transparent; color: #ef4444; border: 1.5px solid #ef4444; padding: .38rem .8rem; }
.store-btn:hover       { opacity: .85; }
.store-btn:disabled    { opacity: .45; cursor: not-allowed; }

/* ── Status/notice banners ───────────────────────────────────── */
.store-status-ok  { padding: .7rem .9rem; border-radius: 9px; background: #0f2a1a; border: 1px solid #238636; color: #3fb950; font-size: .82rem; margin-bottom: .6rem; }
.store-status-err { padding: .7rem .9rem; border-radius: 9px; background: #2a0a0a; border: 1px solid #b91c1c; color: #f87171; font-size: .82rem; margin-bottom: .6rem; }
.store-notice     { padding: .7rem .9rem; border-radius: 9px; background: #1a1500; border: 1px solid #854d0e; color: #fbbf24; font-size: .82rem; margin-bottom: .8rem; }
.store-loading    { text-align: center; padding: 3rem; color: #8b949e; }
.store-empty      { color: #8b949e; font-size: .82rem; padding: .4rem 0; }

/* ── Token pack grid ─────────────────────────────────────────── */
.store-pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .85rem; margin-bottom: 1.2rem;
}
.store-pkg-card {
  background: #161b22; border: 1.5px solid #21262d;
  border-radius: 12px; padding: 1rem .9rem; text-align: center;
  cursor: pointer; transition: border-color .15s, transform .15s;
}
.store-pkg-card:hover     { border-color: #58a6ff; transform: translateY(-2px); }
.store-pkg-card.pkg-sel   { border-color: #58a6ff; background: #112240; }
.store-pkg-tokens  { font-size: 1.25rem; font-weight: 800; color: #f0f6fc; }
.store-pkg-unit    { font-size: .68rem; color: #8b949e; margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .05em; }
.store-pkg-name    { font-size: .75rem; color: #8b949e; }
.store-pkg-price   { font-size: 1rem; font-weight: 700; color: #58a6ff; margin-top: .35rem; }

/* ── API Access ──────────────────────────────────────────────── */
.store-api-info-box {
  background: #161b22; border: 1px solid #21262d;
  border-radius: 12px; margin-bottom: 1.2rem; overflow: hidden;
}
.store-api-row {
  display: flex; align-items: flex-start; gap: .9rem;
  padding: .9rem 1.1rem; border-bottom: 1px solid #21262d;
}
.store-api-row:last-child { border-bottom: none; }
.store-api-row-icon { font-size: 1rem; margin-top: .1rem; flex-shrink: 0; }
.store-api-row-lbl  { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: #6e7681; margin-bottom: .2rem; }
.store-api-code {
  display: inline-block;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: .78rem; background: #0d1117;
  color: #79c0ff; padding: .18rem .5rem;
  border-radius: 5px; border: 1px solid #30363d;
  word-break: break-all;
}
.store-api-row-val { font-size: .8rem; color: #c9d1d9; }

.store-nk-box {
  background: #071a12; border: 1.5px solid #238636;
  border-radius: 10px; padding: .9rem 1rem; margin-bottom: 1rem;
}
.store-nk-title { font-size: .82rem; font-weight: 700; color: #3fb950; margin-bottom: .5rem; }
.store-nk-row   { display: flex; align-items: center; gap: .6rem; }
.store-nk-code  {
  flex: 1; font-family: monospace; font-size: .75rem;
  color: #79c0ff; background: #0d1117;
  padding: .4rem .65rem; border-radius: 6px;
  border: 1px solid #21262d; word-break: break-all;
}

.store-keys-hdr { display: flex; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.store-keys-hdr span { font-weight: 600; color: #f0f6fc; font-size: .88rem; }
.store-keys-list { display: flex; flex-direction: column; gap: .55rem; }
.store-key-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: #161b22; border: 1px solid #21262d;
  border-radius: 10px; padding: .8rem 1rem;
}
.store-key-name { font-weight: 600; color: #f0f6fc; font-size: .86rem; }
.store-key-meta { font-size: .72rem; color: #6e7681; margin-top: .1rem; }
.store-key-acts { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }
.store-badge-ok  { font-size: .68rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; background: #0f2a1a; color: #3fb950; border: 1px solid #238636; }
.store-badge-err { font-size: .68rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; background: #2a0a0a; color: #f87171; border: 1px solid #b91c1c; }
