/* ============================================================
   AI Tour 2026 – Guide App Styles
   Mobile-first dark theme  |  Max 430 px

   Klassennamen-Referenz:
   .scr = Screen | .tb = Toolbar | .sc = Station Card
   .dc = Doc Card | .sv = Slide Viewer | .sl = Slide
   .sh = Slide Header | .sb = Slide Badge | .sb-c = Slide Body
   .al = Alert | .cb = Copy Button | .bn = Bottom Nav
   ============================================================ */

/* --- Design Tokens --- */
:root {
  --blue: #0078D4; --blue-dark: #005A9E; --blue-glow: #4da6ff;
  --bg: #0a0f1a; --card-bg: #111827; --card-border: #1e293b;
  --text: #e2e8f0; --text-dim: #94a3b8; --text-bright: #f8fafc;
  --radius: 16px;
  --ease: cubic-bezier(.4, 0, .2, 1); --dur: 0.32s;
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent;
  scrollbar-width: thin; scrollbar-color: var(--card-border) transparent; }
html, body { height: 100%; overflow: hidden; background: #000; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
@media (max-width: 430px) { html, body { background: var(--bg); } }

/* --- App Container --- */
.app { max-width: 430px; margin: 0 auto; background: var(--bg); height: 100%; display: flex; flex-direction: column; position: relative; overflow: hidden; }

/* --- Scrollbar & Selection --- */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 3px; }
::selection { background: rgba(0, 120, 212, 0.3); color: var(--text-bright); }

/* --- Screen System --- */
.scr { position: absolute; top: 0; left: 0; width: 100%; height: 100%;
        display: flex; flex-direction: column;
        transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
.scr.a { transform: translateX(0); opacity: 1; }
.scr.h { transform: translateX(100%); opacity: 0; pointer-events: none; will-change: transform, opacity; }
.scr.hl { transform: translateX(-30%); opacity: 0; pointer-events: none; will-change: transform, opacity; }

/* --- Toolbar --- */
.tb { flex-shrink: 0; padding: 12px 20px 8px;
       background: rgba(10,15,26,.97);
       border-bottom: 1px solid var(--card-border); z-index: 10; }
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .tb { background: rgba(10,15,26,.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
}
.tb-r { display: flex; align-items: center; gap: 10px; }
.bb { background: 0; border: 0; color: var(--blue-glow); font-size: 22px; cursor: pointer; padding: 12px 16px 12px 0; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; font-family: inherit; }
.tb-t { font-size: 11px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--blue-glow); }
.tb-s { font-size: 13px; color: var(--text-dim); margin-top: 2px; }

/* --- Progress Bar --- */
.pw { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.pt { flex: 1; height: 3px; background: var(--card-border); border-radius: 4px; overflow: hidden; }
.pf { height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue-glow)); transition: width .3s; border-radius: 4px; }
.pl { font-size: 11px; color: var(--text-dim); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

/* --- Home Screen --- */
.ss { justify-content: center; padding: 30px 24px; }
.ss .lg { text-align: center; margin-bottom: 40px; }
.ss .lg h1 { font-size: 22px; font-weight: 700; color: var(--text-bright); }
.ss .lg p { font-size: 13px; color: var(--text-dim); margin-top: 4px; }

/* --- Station Cards --- */
.sc { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius);
       padding: 20px; margin-bottom: 12px; cursor: pointer;
       display: flex; align-items: center; gap: 16px; transition: all .15s; }
.sc:active { transform: scale(.97); background: #1a2332; }
.sc .em { font-size: 32px; }
.sc .si h2 { font-size: 17px; font-weight: 600; color: var(--text-bright); }
.sc .si p { font-size: 13px; color: var(--text-dim); }
.sc .ar { margin-left: auto; color: var(--text-dim); font-size: 18px; }

/* --- Menu --- */
.ms { flex: 1; overflow-y: auto; padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
.ml { font-size: 11px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); margin: 16px 0 8px; }
.dc { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 12px;
       padding: 14px 16px; margin-bottom: 8px; cursor: pointer;
       display: flex; align-items: center; gap: 14px; transition: all .15s; }
.dc:active { transform: scale(.97); background: #1a2332; }
.dc .di { font-size: 24px; flex-shrink: 0; }
.dc .dt h3 { font-size: 15px; font-weight: 600; color: var(--text-bright); }
.dc .dt p { font-size: 12px; color: var(--text-dim); }
.dc .da { margin-left: auto; color: var(--text-dim); }

/* --- Slide Viewer --- */
.sv { flex: 1; overflow: hidden; position: relative; touch-action: pan-y; }
.stk { display: flex; height: 100%; transition: transform .32s cubic-bezier(.4,0,.2,1); }
.sl { min-width: 100%; height: 100%; overflow-y: auto; padding: 20px 20px calc(80px + env(safe-area-inset-bottom, 0px)); }

/* --- Slide Header --- */
.sh { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sb { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--blue), #005A9E);
       display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0; }
.st-t { font-size: 18px; font-weight: 700; color: var(--text-bright); }
.sb-c { font-size: 15px; line-height: 1.6; }
.sb-c p { margin-bottom: 10px; }
.dim { color: var(--text-dim); font-size: 14px; }

/* --- Images --- */
.iw { margin: 14px 0; text-align: center; }
.iw img { max-width: 95%; border-radius: 12px; border: 1px solid var(--card-border); }

/* --- Credential Boxes --- */
.cred-box { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px;
             padding: 12px 14px; margin: 8px 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; }
.cred-label { font-size: 12px; color: var(--text-dim); flex-shrink: 0; }
.cred-value { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--blue-glow); word-break: break-all; }
.cb { cursor: pointer; padding: 4px 8px; border-radius: 6px; background: rgba(0, 120, 212, 0.1); border: 1px dashed rgba(77, 166, 255, 0.3); }
.cb.ok::after { content: ' \2713'; color: #22c55e; }

/* --- Inline Code --- */
code { font-family: 'JetBrains Mono', monospace; font-size: 12px; background: var(--card-bg); padding: 1px 6px; border-radius: 4px; color: var(--blue-glow); }

/* --- Alerts --- */
.al { border-radius: 10px; padding: 10px 14px; margin: 10px 0; font-size: 14px; line-height: 1.5; }
.al.warn { background: #422006; border: 1px solid #f59e0b; color: #fef3c7; }
.al.danger { background: #450a0a; border: 1px solid #ef4444; color: #fecaca; }
.al.tip { background: #052e16; border: 1px solid #22c55e; color: #dcfce7; }

/* --- Data Tables --- */
.st { width: 100%; border-collapse: collapse; margin: 6px 0; }
.st td { padding: 8px 12px; border-bottom: 1px solid var(--card-border); font-size: 14px; }
.st td:first-child { color: var(--text-dim); width: 40%; }
.st td:last-child { color: var(--text-bright); font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* --- Tips --- */
.tips { display: flex; flex-direction: column; gap: 8px; }
.ti { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px; padding: 10px 14px; font-size: 14px; }

/* --- Chips --- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 8px; padding: 6px 12px; font-size: 14px; font-weight: 600; color: var(--text-bright); }

/* --- Sub-steps --- */
.subs { margin: 10px 0; }
.sub { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0; font-size: 14px; }
.n { width: 22px; height: 22px; border-radius: 6px; background: var(--card-border);
     display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--text-bright); flex-shrink: 0; }

/* --- Contact Cards --- */
.cc { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px; padding: 12px 14px; margin: 6px 0; }
.cn { font-size: 15px; font-weight: 600; color: var(--text-bright); }
.cr { font-size: 12px; color: var(--text-dim); margin: 2px 0 6px; }
.cp { font-size: 14px; }
.cp a { color: var(--blue-glow); text-decoration: none; }
.lb { font-size: 10px; background: var(--card-border); color: var(--text-dim); padding: 2px 6px; border-radius: 4px; }
.cl { max-height: calc(100vh - 200px); overflow-y: auto; }

/* --- Green/Success Boxes --- */
.gb { background: #052e16; border: 1px solid #22c55e; border-radius: 10px; padding: 12px 14px; margin: 10px 0; font-size: 14px; color: #dcfce7; }
.gb ul { margin: 6px 0 0 16px; }
.gb li { margin: 3px 0; }
.bc { font-size: 28px; text-align: center; margin: 30px 0; padding: 24px;
       background: #052e16; border: 1px solid #22c55e; border-radius: var(--radius); color: #dcfce7; font-weight: 700; }

/* --- Bottom Navigation --- */
.bn { position: absolute; bottom: 0; left: 0; right: 0;
       display: flex; justify-content: space-between;
       padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
       background: rgba(10,15,26,.98);
       border-top: 1px solid var(--card-border); z-index: 10; }
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .bn { background: rgba(10,15,26,.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
}
.nb { background: var(--blue); border: 0; color: #fff; font-size: 14px; font-weight: 600; font-family: inherit;
       cursor: pointer; padding: 12px 24px; min-height: 48px; border-radius: 10px; transition: all .15s; }
.nb.pr { background: linear-gradient(135deg, var(--blue), var(--blue-glow)); font-weight: 700; }
.nb:active { opacity: .8; }
.nb:disabled { opacity: .3; pointer-events: none; }

/* --- Toast --- */
.toast { position: fixed; bottom: 80px; left: 50%;
         transform: translateX(-50%) translateY(20px);
         background: var(--card-bg); border: 1px solid var(--card-border);
         color: var(--text-bright); padding: 8px 20px; border-radius: 20px;
         font-size: 13px; opacity: 0; transition: all .3s; pointer-events: none; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- Search Screen --- */
.sr-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.sr-input-wrap { padding: 12px 20px; position: relative; flex-shrink: 0; }
.sr-input { width: 100%; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px;
            padding: 12px 40px 12px 14px; color: var(--text-bright); font-size: 15px; font-family: inherit;
            outline: none; transition: border-color .2s; }
.sr-input:focus { border-color: var(--blue); }
.sr-input::placeholder { color: var(--text-dim); }
.sr-clear { position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
            background: 0; border: 0; color: var(--text-dim); font-size: 18px; cursor: pointer;
            padding: 10px 12px; min-width: 44px; min-height: 44px; display: none; }
.sr-clear.vis { display: block; }
.sr-results { flex: 1; overflow-y: auto; padding: 0 20px 20px; }
.sr-item { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px;
           padding: 12px 14px; margin-bottom: 8px; cursor: pointer; transition: all .15s; }
.sr-item:active { transform: scale(.97); background: #1a2332; }
.sr-guide { font-size: 11px; color: var(--blue-glow); font-weight: 500; letter-spacing: .5px; }
.sr-title { font-size: 15px; font-weight: 600; color: var(--text-bright); margin: 2px 0; }
.sr-excerpt { font-size: 13px; color: var(--text-dim); line-height: 1.4; }
.sr-excerpt mark { background: rgba(0,120,212,.3); color: var(--text-bright); border-radius: 2px; padding: 0 2px; }
.sr-empty { text-align: center; color: var(--text-dim); padding: 40px 20px; font-size: 14px; }

/* --- Shared Clipboard --- */
.cl-wrap { flex: 1; overflow-y: auto; padding: 16px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
.cl-field { margin-bottom: 14px; }
.cl-label { font-size: 11px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; display: block; }
.cl-input { width: 100%; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: 10px;
            padding: 12px 14px; color: var(--text-bright); font-size: 14px; font-family: 'JetBrains Mono', monospace;
            outline: none; transition: border-color .2s; resize: none; }
.cl-input:focus { border-color: var(--blue); }
.cl-input::placeholder { color: var(--text-dim); font-family: 'DM Sans', sans-serif; }
.cl-textarea { font-family: 'DM Sans', sans-serif; font-size: 14px; min-height: 80px; }
.cl-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.cl-actions .nb { flex: 1; min-width: 100px; text-align: center; font-size: 13px; padding: 10px 12px; }
.cl-danger { background: #991b1b !important; }
.cl-danger:active { background: #7f1d1d !important; }
.cl-info { margin-top: 14px; font-size: 12px; color: var(--text-dim); text-align: center; line-height: 1.5; }

/* ============================================================
   Desktop Layout (>=1024px) — Sidebar + Split-View
   Mobile stays untouched below 1024px
   ============================================================ */

/* --- Welcome Screen (hidden on mobile) --- */
.desktop-welcome { display: none; }

@media (min-width: 1024px) {

  /* --- Layout Shell --- */
  .app { max-width: 100%; flex-direction: row; }

  /* Reset mobile absolute positioning + disable transitions on desktop */
  .scr { transition: none; position: relative; top: auto; left: auto; width: auto; }

  /* Override mobile hide animations — desktop uses .desktop-hidden instead */
  .scr.h, .scr.hl { transform: none; opacity: 1; pointer-events: auto; }

  /* Master visibility toggle for desktop */
  .desktop-hidden { display: none !important; }

  /* --- Sidebar: Home + Menu --- */
  #s-home, #s-menu {
    position: relative; width: 280px; min-width: 280px; flex-shrink: 0;
    border-right: 1px solid var(--card-border);
  }
  #s-home .ss { padding: 24px 16px; justify-content: flex-start; }
  #s-home .ss .lg { margin-bottom: 24px; }
  #s-home .ss .lg h1 { font-size: 18px; }
  #s-home .sc { padding: 14px 12px; gap: 12px; }
  #s-home .sc .em { font-size: 24px; }
  #s-home .sc .si h2 { font-size: 15px; }

  /* Hide back-button in sidebar menu */
  #s-menu .bb { display: none; }
  #s-menu .ms { padding: 12px 14px; }
  #s-menu .dc { padding: 10px 12px; gap: 10px; }
  #s-menu .dc .di { font-size: 20px; }
  #s-menu .dc .dt h3 { font-size: 14px; }
  #s-menu .dc .dt p { font-size: 11px; }
  #s-menu .ml { font-size: 10px; margin: 12px 0 6px; }

  /* Active guide highlight in sidebar */
  .dc.active { border-color: var(--blue); background: rgba(0, 120, 212, 0.08); }

  /* Station toolbar clickable hint */
  #s-menu .tb { cursor: pointer; }

  /* --- Main Panel: Guide, Search, Clip --- */
  #s-guide, #s-search, #s-clip { position: relative; flex: 1; min-width: 0; }

  /* Hide back-button in guide (sidebar replaces nav); keep for search/clip as dismiss */
  #s-guide .bb { display: none; }

  /* Bottom nav: back in flex flow, reset absolute-positioning leftovers */
  .bn { position: relative; left: auto; right: auto; bottom: auto;
        padding: 12px 20px; flex-shrink: 0; }

  /* Slide viewer: ensure it shrinks so .bn stays visible */
  .sv { min-height: 0; }

  /* Slides: less bottom padding (no overlap offset), constrain reading width */
  .sl { padding-bottom: 20px; }
  .sl > * { max-width: 720px; }

  /* Bigger images on desktop */
  .iw img { max-width: min(600px, 95%); }

  /* Progress bar slightly larger */
  .pt { height: 6px; }
  .pl { font-size: 13px; color: var(--text-dim); }

  /* --- Welcome Screen --- */
  .desktop-welcome {
    display: flex; flex: 1; flex-direction: column;
    align-items: center; justify-content: center;
    color: var(--text-dim); gap: 12px;
  }
  .desktop-welcome p:first-child {
    font-size: 11px; letter-spacing: 2px; color: var(--blue-glow);
  }
  .desktop-welcome p:nth-child(2) {
    font-size: 15px; color: var(--text-dim);
  }
  .desktop-welcome img { height: 32px; opacity: 0.5; margin-top: 20px; }

  /* --- Hover states for desktop --- */
  .sc:hover { background: #1a2332; border-color: var(--blue); }
  .dc:hover:not(.active) { background: #1a2332; border-color: var(--blue); }
  .sr-item:hover { background: #1a2332; border-color: var(--blue); }
  .nb:hover:not(:disabled) { opacity: 0.85; }
  .cb:hover { background: rgba(0, 120, 212, 0.2); border-color: var(--blue-glow); }
  #s-menu .tb:hover { background: rgba(255,255,255,0.03); }

  /* Neutralize mobile :active scale on desktop */
  .sc:active, .dc:active, .sr-item:active { transform: none; }

  /* Focus-visible for keyboard navigation */
  .nb:focus-visible, .bb:focus-visible, .sc:focus-visible, .dc:focus-visible {
    outline: 2px solid var(--blue-glow); outline-offset: 2px;
  }

  /* Wider scrollbar for desktop (Webkit + Firefox) */
  * { scrollbar-color: var(--text-dim) transparent; }
  ::-webkit-scrollbar { width: 6px; }
  ::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text); }

  /* --- Toast: centered on main panel --- */
  .toast { left: calc(50% + 140px); transform: translateX(-50%) translateY(20px); }
  .toast.show { transform: translateX(-50%) translateY(0); }
}
