/* ── Colour tokens ── */
:root {
  --bg:        #08000F;
  --surface:   #110020;
  --card:      #1B0030;
  --card-b:    #240040;
  --border:    #3C0F62;
  --border-b:  #5A1E8A;
  --text:      #F0ECFF;
  --text2:     #9B7BBE;
  --text3:     #5A3A7A;
  --acc:       #8B5CF6;
  --acc-hi:    #A78BFA;
  --acc-lo:    #7C3AED;
  --acc-pale:  #C4B5FD;
  --acc-dim:   rgba(139,92,246,0.11);
  --acc-glow:  rgba(139,92,246,0.30);
  --red:       #EF4444;
  --green:     #22C55E;
  --gold:      #F5A623;
  --orange:    #FF9600;
  --blue:      #38BDF8;
  color-scheme: dark;

  /* compat aliases used by shared.jsx */
  --c-bg:       var(--bg);
  --c-surface:  var(--surface);
  --c-card:     var(--card);
  --c-card-b:   var(--card-b);
  --c-text:     var(--text);
  --c-text2:    var(--text2);
  --c-text3:    var(--text3);
  --c-bdr:      var(--border);
  --c-bdr-b:    var(--border-b);
  --c-acc:      var(--acc);
  --c-acc-hi:   var(--acc-hi);
  --c-acc-lo:   var(--acc-lo);
  --c-acc-pale: var(--acc-pale);
  --c-acc-dim:  var(--acc-dim);
  --c-acc-glow: var(--acc-glow);
}

[data-theme="light"] {
  --bg:        #F8FAFC;
  --surface:   #FFFFFF;
  --card:      #FFFFFF;
  --card-b:    #EEF2FF;
  --border:    #CBD5E1;
  --border-b:  #7C3AED;
  --text:      #111827;
  --text2:     #374151;
  --text3:     #64748B;
  --acc:       #7C3AED;
  --acc-hi:    #6D28D9;
  --acc-lo:    #6D28D9;
  --acc-pale:  #5B21B6;
  --acc-dim:   rgba(109,40,217,0.10);
  --acc-glow:  rgba(76,29,149,0.14);
  --red:       #B91C1C;
  --green:     #15803D;
  --gold:      #A16207;
  --orange:    #C2410C;
  --blue:      #0369A1;
  color-scheme: light;
}

/* ── Reset ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { height:100%; -webkit-font-smoothing:antialiased; }
body {
  height:100%;
  font-family:'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  font-weight: 400;
  line-height: 1.45;
}

button, input, select, textarea { font-family:'Nunito', sans-serif; max-width: 100%; }
button { touch-action:manipulation; }
input, select, textarea { min-width: 0; }
img, svg, video, canvas { max-width: 100%; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline:2px solid var(--acc-hi); outline-offset:2px;
}
input, textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 14px;
  transition: border-color .15s;
}
input:focus, textarea:focus { border-color: var(--border-b); }

#root {
  height: 100%;
  min-width: 0;
  max-width: 100%;
}

.phone,
.app-shell,
.main-area,
.main-content,
.login-shell,
.login-card,
.guide-shell,
.guide-section,
.guide-basic-card,
.guide-role-card,
.guide-start-panel,
.bottom-nav-inner,
.confirm-dialog,
.action-menu-popover {
  min-width: 0;
  max-width: 100%;
}

.main-content,
.login-card,
.guide-shell,
.guide-section,
.guide-basic-card,
.guide-role-card,
.role-switcher,
.data-mode-banner,
.confirm-dialog,
.action-menu-popover {
  overflow-wrap: anywhere;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 2000;
  transform: translateY(-150%);
  background: var(--card);
  border: 2px solid var(--border-b);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(15,23,42,.18);
}
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--acc-hi);
  outline-offset: 3px;
}
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Keyframes ── */
@keyframes slideIn {
  from { opacity:0; transform:translateY(5px); }
  to   { opacity:1; transform:translateY(0);   }
}
@keyframes sp-pulse-ring {
  0%, 100% { box-shadow:0 0 0 0 var(--acc-glow), 0 0 18px var(--acc-glow); }
  50%       { box-shadow:0 0 0 10px rgba(139,92,246,0), 0 0 36px var(--acc-glow); }
}
@keyframes tv2-pulse {
  0%,100% { box-shadow:0 0 16px var(--acc-glow); }
  50%     { box-shadow:0 0 36px var(--acc-glow), 0 0 64px color-mix(in srgb,var(--acc) 18%,transparent); }
}
@keyframes tv2-pop {
  from { opacity:0; transform:scale(.86) translateY(-6px); }
  to   { opacity:1; transform:scale(1)   translateY(0);    }
}
@keyframes tv2-slidedown {
  from { opacity:0; transform:translateY(-12px); }
  to   { opacity:1; transform:translateY(0);     }
}
@keyframes tv2-sheetup {
  from { opacity:0; transform:translateY(18px); }
  to   { opacity:1; transform:translateY(0);    }
}
@keyframes tv2-trophy {
  0%   { opacity:0; transform:scale(.5) rotate(-12deg); }
  65%  {            transform:scale(1.12) rotate(4deg); }
  100% { opacity:1; transform:scale(1) rotate(0deg);    }
}
@keyframes tv2-starfade {
  from { opacity:0; transform:scale(0) rotate(-20deg); }
  to   { opacity:1; transform:scale(1) rotate(0deg);   }
}
@keyframes tv2-skeleton {
  from { background-position:140% 0; }
  to   { background-position:-140% 0; }
}

.tv2-pulse     { animation:tv2-pulse 2.2s ease-in-out infinite !important; }
.tv2-pop       { animation:tv2-pop .28s cubic-bezier(.34,1.56,.64,1) both; }
.tv2-slidedown { animation:tv2-slidedown .2s ease forwards; }
.tv2-sheetup   { animation:tv2-sheetup .22s ease forwards; }
.tv2-skeleton  {
  background:linear-gradient(90deg,
    color-mix(in srgb,var(--card) 78%,var(--acc-dim)),
    color-mix(in srgb,var(--acc) 18%,var(--card)),
    color-mix(in srgb,var(--card) 78%,var(--acc-dim)));
  background-size:280% 100%;
  animation:tv2-skeleton 1.35s ease-in-out infinite;
}
.pulse-node { animation:sp-pulse-ring 2.2s ease-in-out infinite !important; }
.role-view  { animation:slideIn .22s ease; height:100%; display:flex; flex-direction:column; }

/* ── App shell: sidebar + main ── */
.app-shell {
  display: flex;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  transition: background .22s;
}

/* ── Sidebar (desktop) ── */
.sidebar-wrap {
  width: 240px;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: background .22s;
}

/* ── Main area ── */
.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: var(--bg);
  transition: background .22s;
  outline: none;
}

/* ── Mobile top bar ── */
.top-bar-mobile {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.mobile-top-appbar-left,
.mobile-top-appbar-right {
  min-width: 64px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-top-appbar-right {
  justify-content: flex-end;
  gap: 4px;
}
.mobile-top-appbar-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  overflow-wrap: anywhere;
}

/* ── Scrollable content ── */
.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.main-content > *,
.main-content section,
.main-content article,
.main-content form,
.main-content [role="list"],
.main-content [role="listitem"],
.main-content [role="tablist"] {
  min-width: 0;
  max-width: 100%;
}

/* ── Bottom nav (hidden until a shell opts in) ── */
.bottom-nav-wrap {
  display: none;
  flex-shrink: 0;
  background: var(--surface);
}
.bottom-nav-inner {
  width: 100%;
  min-width: 0;
}
.bottom-nav-button {
  flex: 1 1 0;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  border-radius: 12px;
  line-height: 1;
}
.bottom-nav-label {
  display: block;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bottom-nav-wrap.is-compact .bottom-nav-inner {
  justify-content: flex-start !important;
  overflow-x: auto;
  scrollbar-width: none;
}
.bottom-nav-wrap.is-compact .bottom-nav-inner::-webkit-scrollbar { display: none; }
.bottom-nav-wrap.is-compact .bottom-nav-button {
  flex: 0 0 56px;
  padding-left: 4px !important;
  padding-right: 4px !important;
}
.bottom-nav-wrap.is-compact .bottom-nav-label {
  max-width: 48px;
  font-size: 9px !important;
}

/* ── Sidebar always visible, narrows on small screens ── */
.sidebar-wrap { width: 200px; }
@media (max-width: 600px) {
  .sidebar-wrap { width: 64px; }
  .sidebar-wrap .sidebar-label { display: none !important; }
  .sidebar-wrap .sidebar-stats { display: none !important; }
  .sidebar-wrap .sidebar-user  { display: none !important; }
  .sidebar-wrap .sidebar-logo-text { display: none !important; }
  .sidebar-wrap > div:first-child { padding-left: 12px !important; padding-right: 12px !important; }
  .sidebar-wrap .sidebar-logo { justify-content: center; }
  .sidebar-wrap .sidebar-nav { padding-left: 8px !important; padding-right: 8px !important; }
  .sidebar-wrap .sidebar-nav-button { justify-content: center; padding-left: 8px !important; padding-right: 8px !important; }
  .sidebar-wrap .sidebar-bottom { padding-left: 8px !important; padding-right: 8px !important; }
  .sidebar-wrap .theme-toggle { display: none !important; }

  .app-shell.mobile-bottom-nav .sidebar-wrap { display: none; }
  .app-shell.mobile-bottom-nav .main-area {
    flex: 1 1 auto;
    width: 100%;
  }
  .app-shell.mobile-bottom-nav .top-bar-mobile { display: flex; }
  .app-shell.mobile-bottom-nav .bottom-nav-wrap { display: block; }
  .app-shell.mobile-bottom-nav .bottom-nav-inner {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .app-shell.mobile-bottom-nav .main-content {
    min-height: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .top-bar-mobile button,
  .bottom-nav-wrap button,
  .main-content button,
  .login-shell button,
  .role-switcher button,
  .btn-ghost,
  .confirm-dialog-action,
  .action-menu-trigger,
  .action-menu-item {
    min-height: 44px;
  }
  .main-content button,
  .login-shell button,
  .role-switcher button {
    min-width: 44px;
  }
}
@media (min-width: 601px) and (max-width: 900px) {
  .sidebar-wrap { width: 184px; }
  .sidebar-wrap .sidebar-stats { display: none; }
  .sidebar-wrap .sidebar-user  { display: block; }
  .sidebar-wrap .sidebar-logo-text { display: block; }
}
/* ── Mobile top bar still available but hidden by default ── */
.top-bar-mobile { display: none; }

/* ── Utility ── */
.show-mobile { display: none; }
.u-min-0 { min-width: 0 !important; }
.u-max-full { max-width: 100% !important; }
.u-wrap-anywhere { overflow-wrap: anywhere !important; }
.u-touch-target {
  min-width: 44px !important;
  min-height: 44px !important;
}

/* ── Full-page login ── */
.login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(109,40,217,.35) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(26,13,62,.7)    0%, transparent 55%),
    var(--bg);
  padding: 24px 16px;
  overflow-y: auto;
}

[data-theme="light"] .login-shell {
  background:
    radial-gradient(ellipse at 16% 18%, rgba(109,40,217,.12) 0%, transparent 48%),
    radial-gradient(ellipse at 82% 84%, rgba(56,189,248,.10) 0%, transparent 50%),
    var(--bg);
}

.login-card {
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1.5px solid var(--border-b);
  border-radius: 24px;
  padding: 32px 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 0 60px var(--acc-glow), 0 24px 60px rgba(0,0,0,.5);
  backdrop-filter: blur(12px);
}

[data-theme="light"] .login-card {
  background: rgba(255,255,255,.88);
  box-shadow: 0 0 42px var(--acc-glow), 0 24px 60px rgba(31,23,51,.16);
}

.login-brand { display:flex; align-items:center; gap:12px; margin-bottom:20px; }
.login-language { margin-left:auto; width:118px; flex-shrink:0; }
.login-mark {
  width:48px; height:48px; border-radius:14px;
  background:linear-gradient(135deg, var(--acc-lo), var(--acc-hi));
  display:flex; align-items:center; justify-content:center;
  font-weight:900; font-size:24px; color:#fff;
  box-shadow:0 0 24px var(--acc-glow);
}
.login-eyebrow {
  font-size:11px; font-weight:800; letter-spacing:1.2px;
  text-transform:uppercase; color:var(--acc-pale);
}
.login-title { font-size:22px; font-weight:900; line-height:1.15; margin-top:2px; }

.login-status {
  font-size:11px; font-weight:700; color:var(--text2);
  background: var(--acc-dim);
  border:1px solid var(--border);
  border-radius:10px;
  padding:8px 12px; margin-bottom:18px;
}
.login-status.ok  { color:#22C55E; border-color:rgba(34,197,94,.3); background:rgba(34,197,94,.06); }
.login-status.bad { color:#EF4444; border-color:rgba(239,68,68,.3); background:rgba(239,68,68,.06); }

.login-tabs { display:grid; grid-template-columns:1fr 1fr; gap:6px; margin-bottom:16px; }
.login-tab {
  background:var(--acc-dim);
  border:1.5px solid var(--border);
  color:var(--text2);
  border-radius:10px; padding:10px 0;
  min-height:44px;
  font-family:'Nunito',sans-serif; font-weight:800; font-size:13px; cursor:pointer;
  transition:all .2s;
}
.login-tab.on {
  background:color-mix(in srgb, var(--acc) 22%, transparent);
  border-color:var(--border-b);
  color:var(--acc-pale);
}

.login-form { display:grid; gap:12px; }
.login-form label {
  display:grid; gap:5px;
  font-size:11px; font-weight:800; color:var(--text2);
  text-transform:uppercase; letter-spacing:.6px;
}
.login-form input, .login-form select {
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border:1.5px solid var(--border);
  color:var(--text);
  border-radius:12px; padding:11px 13px;
  min-height:44px;
  font-family:'Nunito',sans-serif; font-weight:700; font-size:14px;
  outline:none; transition:border-color .2s, box-shadow .2s;
}
.login-form input:focus, .login-form select:focus {
  border-color:var(--border-b);
  box-shadow:0 0 0 3px var(--acc-dim);
}
.login-error {
  background:rgba(239,68,68,.08);
  border:1px solid rgba(239,68,68,.35);
  border-radius:10px; padding:8px 12px;
  font-size:12px; font-weight:700; color:#FCA5A5;
}
.login-submit {
  margin-top:6px;
  background:linear-gradient(135deg, var(--acc-lo), var(--acc));
  border:none; color:#fff;
  border-radius:14px; padding:13px 0;
  font-family:'Nunito',sans-serif; font-weight:800; font-size:14px;
  letter-spacing:.4px; cursor:pointer;
  box-shadow:0 6px 24px var(--acc-glow);
  transition:transform .1s, opacity .2s;
}
.login-submit:active   { transform:translateY(2px); }
.login-submit:disabled { opacity:.55; cursor:not-allowed; }

.login-demo { margin-top:18px; padding-top:16px; border-top:1px solid var(--border); }
.login-demo-label {
  font-size:12px; font-weight:800; letter-spacing:.8px;
  text-transform:uppercase; color:var(--text3); margin-bottom:8px;
}
.login-demo-row { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.login-demo-btn {
  background:var(--acc-dim);
  border:1px solid var(--border);
  color:var(--text2);
  border-radius:10px; padding:8px 10px;
  min-height:44px;
  font-family:'Nunito',sans-serif; font-weight:700; font-size:11px;
  cursor:pointer; text-align:left; transition:all .2s;
}
.login-demo-btn:hover {
  background:color-mix(in srgb, var(--acc) 16%, transparent);
  border-color:var(--border-b);
  color:var(--acc-pale);
}

/* ── Role switcher (sidebar header area) ── */
/* Public guide entry */
.login-guide-button {
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  margin-bottom:16px;
  border-radius:12px;
  border:1.5px solid color-mix(in srgb, var(--blue) 44%, var(--border));
  background:color-mix(in srgb, var(--blue) 12%, var(--acc-dim));
  color:color-mix(in srgb, var(--blue) 66%, #fff);
  font-size:13px;
  font-weight:900;
  text-decoration:none;
  transition:background .16s, border-color .16s, transform .1s;
}
.login-guide-button:hover,
.login-guide-button:focus-visible {
  background:color-mix(in srgb, var(--blue) 20%, var(--acc-dim));
  border-color:color-mix(in srgb, var(--blue) 70%, var(--border-b));
}
.login-guide-button:active { transform:translateY(1px); }

/* Public how-to guide */
.guide-shell {
  height:100%;
  overflow-y:auto;
  overflow-x:hidden;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--surface) 72%, var(--bg)) 0%,
      var(--bg) 46%,
      color-mix(in srgb, var(--bg) 82%, #020617) 100%);
  color:var(--text);
}
.guide-topbar {
  position:sticky;
  top:0;
  z-index:30;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px clamp(16px, 4vw, 44px);
  background:color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom:1px solid var(--border);
  backdrop-filter:blur(14px);
}
.guide-brand,
.guide-login-link,
.guide-primary-action,
.guide-role-pill {
  min-height:44px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  font-family:'Nunito', sans-serif;
}
.guide-brand {
  gap:10px;
  color:var(--text);
  font-weight:900;
  font-size:19px;
}
.guide-mark {
  width:36px;
  height:36px;
  border-radius:10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, var(--acc-lo), var(--acc));
  color:#fff;
  box-shadow:0 6px 20px var(--acc-glow);
}
.guide-login-link,
.guide-primary-action {
  border-radius:12px;
  padding:0 18px;
  background:linear-gradient(135deg, var(--acc-lo), var(--acc));
  color:#fff;
  font-size:13px;
  font-weight:900;
  box-shadow:0 8px 22px var(--acc-glow);
}
.guide-topbar-actions {
  display:flex;
  align-items:center;
  gap:10px;
}
.guide-hero,
.guide-section {
  width:min(1120px, calc(100% - 32px));
  margin:0 auto;
}
.guide-hero {
  min-height:clamp(360px, 58vh, 560px);
  display:grid;
  grid-template-columns:minmax(0, 1.4fr) minmax(280px, .7fr);
  align-items:center;
  gap:28px;
  padding:44px 0 34px;
}
.guide-hero-copy {
  max-width:720px;
}
.guide-eyebrow,
.guide-kicker,
.guide-panel-label {
  color:var(--acc-pale);
  font-size:12px;
  font-weight:900;
  letter-spacing:.9px;
  text-transform:uppercase;
}
.guide-hero h1 {
  margin-top:10px;
  font-size:clamp(34px, 8vw, 72px);
  line-height:.98;
  font-weight:900;
  letter-spacing:0;
  max-width:760px;
}
.guide-hero p,
.guide-section-head p,
.guide-basic-card p,
.guide-role-card p,
.guide-cta p {
  color:var(--text2);
  font-weight:700;
  line-height:1.65;
}
.guide-hero p {
  max-width:640px;
  margin-top:18px;
  font-size:17px;
}
.guide-role-nav {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:24px;
}
.guide-role-pill {
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--acc-dim);
  color:var(--text);
  padding:0 14px;
  font-size:13px;
  font-weight:900;
}
.guide-role-pill.blue { border-color:color-mix(in srgb, var(--blue) 46%, var(--border)); }
.guide-role-pill.green { border-color:color-mix(in srgb, var(--green) 42%, var(--border)); }
.guide-role-pill.gold { border-color:color-mix(in srgb, var(--gold) 46%, var(--border)); }
.guide-role-pill.red { border-color:color-mix(in srgb, var(--red) 42%, var(--border)); }
.guide-start-panel {
  border-radius:8px;
  border:1px solid color-mix(in srgb, var(--blue) 32%, var(--border));
  background:color-mix(in srgb, var(--card) 82%, var(--blue) 8%);
  padding:22px;
  box-shadow:0 22px 58px rgba(0,0,0,.24);
}
.guide-start-panel ol,
.guide-role-card ol {
  margin-top:14px;
  padding-left:20px;
  display:grid;
  gap:10px;
  color:var(--text);
  font-weight:800;
}
.guide-start-panel li,
.guide-role-card li {
  padding-left:4px;
}
.guide-section {
  padding:30px 0;
}
.guide-section-head {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
  margin-bottom:18px;
}
.guide-section-head h2,
.guide-cta h2 {
  margin-top:6px;
  font-size:clamp(24px, 4vw, 38px);
  line-height:1.08;
  font-weight:900;
  letter-spacing:0;
}
.guide-section-head p {
  max-width:430px;
  font-size:14px;
}
.guide-basic-grid,
.guide-role-grid {
  display:grid;
  gap:12px;
}
.guide-basic-grid {
  grid-template-columns:repeat(3, minmax(0, 1fr));
}
.guide-role-grid {
  grid-template-columns:repeat(2, minmax(0, 1fr));
}
.guide-basic-card,
.guide-role-card {
  border-radius:8px;
  border:1px solid var(--border);
  background:color-mix(in srgb, var(--card) 88%, transparent);
  padding:18px;
}
.guide-basic-card h3,
.guide-role-card h3 {
  font-size:18px;
  line-height:1.2;
  color:var(--text);
  font-weight:900;
  letter-spacing:0;
}
.guide-role-card {
  border-top-width:4px;
}
.guide-role-card.blue { border-top-color:var(--blue); }
.guide-role-card.green { border-top-color:var(--green); }
.guide-role-card.gold { border-top-color:var(--gold); }
.guide-role-card.red { border-top-color:var(--red); }
.guide-role-card-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.guide-role-card-head span {
  display:block;
  margin-top:2px;
  color:var(--text3);
  font-size:12px;
  font-weight:800;
}
.guide-role-card p {
  margin-bottom:12px;
}
.guide-cta {
  margin-bottom:42px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  border-radius:8px;
  border:1px solid color-mix(in srgb, var(--green) 34%, var(--border));
  background:color-mix(in srgb, var(--green) 8%, var(--card));
  padding:22px;
}

[data-theme="light"] .guide-shell {
  background:
    linear-gradient(180deg,
      color-mix(in srgb, #EEF2FF 48%, var(--bg)) 0%,
      var(--bg) 46%,
      #EFF6FF 100%);
}
[data-theme="light"] .guide-topbar,
[data-theme="light"] .guide-basic-card,
[data-theme="light"] .guide-role-card,
[data-theme="light"] .guide-start-panel,
[data-theme="light"] .guide-cta {
  background:rgba(255,255,255,.88);
}

@media (max-width: 820px) {
  .guide-hero {
    grid-template-columns:1fr;
    min-height:auto;
    padding-top:32px;
  }
  .guide-basic-grid,
  .guide-role-grid {
    grid-template-columns:1fr;
  }
  .guide-section-head,
  .guide-cta {
    align-items:flex-start;
    flex-direction:column;
  }
  .guide-primary-action {
    width:100%;
  }
}

@media (max-width: 520px) {
  .guide-topbar {
    padding:12px 14px;
  }
  .guide-topbar-actions {
    gap:6px;
  }
  .login-brand {
    align-items:flex-start;
  }
  .login-language {
    width:auto;
  }
  .guide-hero,
  .guide-section {
    width:min(100% - 24px, 1120px);
  }
  .guide-hero h1 {
    font-size:36px;
  }
  .guide-role-nav {
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .guide-role-pill {
    padding:0 10px;
  }
}

/* Role switcher (sidebar header area) */
.role-switcher {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 14px 14px 0;
}

.role-btn {
  padding: 6px 12px;
  border-radius: 99px;
  min-height: 34px;
  border: 1.5px solid var(--border);
  background: var(--acc-dim);
  color: var(--text2);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 11px;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .3px;
  white-space: nowrap;
}
.role-btn.on {
  background: color-mix(in srgb, var(--acc) 22%, transparent);
  border-color: var(--border-b);
  color: var(--acc-pale);
  box-shadow: 0 0 10px var(--acc-glow);
}
.role-btn.locked { opacity:.35; cursor:not-allowed; }

/* ── Data mode banner ── */
.data-mode-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text2);
  background: var(--acc-dim);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Phone-frame removed; legacy stubs kept for compat ── */
.statusbar         { display: none; }
.phone             { display: block; height: 100%; min-height: 0; }
.appwrap           { display: contents; }
.proto-label       { display: none; }
.topbar            { display: none; }
.roles             { display: none; }

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--c-bdr);
  color: var(--c-text2);
  border-radius: 12px;
  padding: 10px 16px;
  font-family: Nunito, sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.btn-ghost:hover { background: var(--c-card); }

/* ── Shared dialog and action menu ── */
.confirm-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: rgba(2, 6, 23, .62);
}
.confirm-dialog {
  width: min(100%, 440px);
  max-height: min(86vh, 640px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-b);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.42);
  outline: none;
}
.confirm-dialog.is-destructive {
  border-color: rgba(239,68,68,.46);
}
.confirm-dialog-content {
  padding: 22px 22px 14px;
}
.confirm-dialog-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}
.confirm-dialog-body {
  margin-top: 8px;
  color: var(--text2);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}
.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 34%, transparent);
}
.confirm-dialog-action {
  min-width: 96px;
  min-height: 44px;
  border-radius: 12px;
  padding: 0 16px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}
.confirm-dialog-cancel {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text2);
}
.confirm-dialog-confirm {
  background: linear-gradient(135deg, var(--acc-lo), var(--acc));
  border: 1px solid transparent;
  color: #fff;
  box-shadow: 0 6px 22px var(--acc-glow);
}
.confirm-dialog-confirm[data-destructive="true"] {
  background: var(--red);
  box-shadow: 0 6px 22px rgba(239,68,68,.24);
}
.confirm-dialog-action:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.action-menu {
  position: relative;
  display: inline-flex;
}
.action-menu-trigger {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--acc-dim);
  color: var(--acc-pale);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.action-menu-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 360;
  min-width: 184px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border-b);
  border-radius: 12px;
  box-shadow: 0 18px 42px rgba(0,0,0,.34);
}
.action-menu-popover.align-start {
  left: 0;
  right: auto;
}
.action-menu-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 9px;
  padding: 8px 10px;
  background: transparent;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}
.action-menu-item:hover,
.action-menu-item:focus-visible {
  background: var(--acc-dim);
}
.action-menu-item.is-destructive {
  color: var(--red);
}
.action-menu-item:disabled {
  cursor: not-allowed;
  opacity: .5;
}
.action-menu-item-icon {
  width: 20px;
  flex: 0 0 20px;
  text-align: center;
}
.action-menu-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .confirm-dialog-overlay {
    align-items: flex-end;
    padding: 12px 10px 0;
  }
  .confirm-dialog {
    width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: 18px 18px 0 0;
  }
  .confirm-dialog-content {
    padding: 20px 18px 12px;
  }
  .confirm-dialog-actions {
    flex-direction: column-reverse;
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .confirm-dialog-action {
    width: 100%;
    min-width: 0;
  }
  .action-menu-popover {
    position: fixed;
    left: 12px;
    right: 12px;
    top: auto;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }
  .action-menu-item {
    min-height: 44px;
  }
}
