/* Levanter — static copy. Dark theme, monospace throughout. */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: #0a0a0a; color: #e5e5e5; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; min-height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }
a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }

/* Top bar */
.topbar { background: #000; color: #fff; display: flex; align-items: center; justify-content: center; position: relative; height: 56px; border-bottom: 1px solid #1f1f1f; flex-shrink: 0; }
.hamburger { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); background: none; border: none; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.hamburger span { display: block; width: 22px; height: 2px; background: #fff; }
.brand { color: #fff; font-weight: 700; font-size: 20px; letter-spacing: 2px; }
.top-links { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); display: flex; gap: 16px; font-size: 13px; }
.top-links a { color: #d4d4d4; }
@media (max-width: 640px) { .top-links { display: none; } }

/* Side menu */
.side-menu { position: fixed; top: 0; left: 0; bottom: 0; width: 280px; background: #111; border-right: 1px solid #262626; z-index: 60; padding: 20px; transform: translateX(-100%); transition: transform .2s ease; overflow-y: auto; }
.side-menu.open { transform: translateX(0); }
.side-menu .menu-head { display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 700; margin-bottom: 20px; }
.side-menu .close-btn { background: none; border: none; color: #fff; font-size: 22px; }
.side-menu a { display: block; color: #e5e5e5; padding: 10px 4px; border-bottom: 1px solid #1f1f1f; }
.side-menu .menu-section { color: #737373; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; margin: 18px 0 6px; }
.menu-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 50; display: none; }
.menu-overlay.open { display: block; }

/* Layout */
main { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 40px 16px 60px; }
.card { background: #171717; border: 1px solid #2e2e2e; border-radius: 20px; width: 100%; max-width: 640px; padding: 36px 32px; margin: 0 auto; }
@media (max-width: 640px) { .card { padding: 28px 20px; } }
.card h1 { color: #fff; font-size: 30px; font-weight: 700; text-align: center; margin-bottom: 12px; }
.card .subtitle { color: #a3a3a3; text-align: center; font-size: 15px; margin-bottom: 28px; }
.card h2 { color: #fff; font-size: 18px; font-weight: 700; margin: 28px 0 16px; }

/* Option toggles */
.option { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: #e5e5e5; cursor: pointer; font-size: 15px; }
.option input { width: 18px; height: 18px; accent-color: #3b82f6; cursor: pointer; }

/* Custom ID */
.custom-id-box { margin: 8px 0 4px; display: none; }
.custom-id-box.visible { display: block; }
.custom-id-row { display: flex; gap: 10px; align-items: center; }
.custom-id-row input[type="text"] { flex: 1; background: #0a0a0a; border: 1px solid #404040; color: #fff; border-radius: 8px; padding: 10px 12px; font-family: inherit; font-size: 15px; min-width: 0; }
.char-counter { color: #737373; font-size: 13px; white-space: nowrap; }
.btn { border: none; border-radius: 8px; padding: 10px 18px; font-size: 15px; font-weight: 700; }
.btn-save { background: #3b82f6; color: #fff; }
.btn-edit { background: #262626; color: #fff; border: 1px solid #404040; }
.custom-id-active { display: none; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 4px; }
.custom-id-active.visible { display: flex; }
.badge { background: #14532d; color: #86efac; border: 1px solid #166534; font-size: 12px; font-weight: 700; letter-spacing: 1px; padding: 4px 10px; border-radius: 999px; }
.custom-id-name { color: #fff; font-weight: 700; }

/* Method buttons */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .method-grid { grid-template-columns: 1fr; } }
.method-btn { background: #334155; border: 1px solid #475569; border-radius: 12px; padding: 20px 16px; text-align: left; color: #fff; display: flex; gap: 14px; align-items: flex-start; }
.method-btn:hover { background: #3f4f66; }
.method-icon { width: 44px; height: 44px; min-width: 44px; border-radius: 50%; background: #fff; color: #334155; display: flex; align-items: center; justify-content: center; }
.method-icon svg { width: 24px; height: 24px; }
.method-title { color: #fff; font-weight: 700; font-size: 17px; display: block; margin-bottom: 4px; }
.method-sub { color: #cbd5e1; font-size: 13px; }

/* Alerts */
.alert { border-radius: 10px; padding: 14px 16px; margin-top: 16px; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.alert-red { background: #450a0a; color: #fca5a5; border: 1px solid #7f1d1d; }
.alert-amber { background: #451a03; color: #fcd34d; border: 1px solid #78350f; }
.alert-icon { flex-shrink: 0; font-weight: 700; }

/* Phone / QR views */
.subview { display: none; margin-top: 20px; }
.subview.visible { display: block; }
.subview label { display: block; color: #d4d4d4; font-size: 14px; margin-bottom: 8px; }
.subview input[type="tel"], .subview input[type="text"] { width: 100%; background: #0a0a0a; border: 1px solid #404040; color: #fff; border-radius: 8px; padding: 12px; font-family: inherit; font-size: 16px; }
.btn-primary { background: #3b82f6; color: #fff; width: 100%; margin-top: 14px; padding: 12px; font-size: 16px; }
.qr-area { text-align: center; padding: 20px 0 8px; }
.qr-area img { background: #fff; padding: 12px; border-radius: 12px; max-width: 260px; width: 100%; }
.qr-area p { color: #e5e5e5; font-weight: 700; margin-top: 14px; }
.qr-note { color: #a3a3a3; font-size: 13px; text-align: center; margin-top: 6px; }
.qr-status { color: #a3a3a3; font-size: 13px; text-align: center; margin-top: 10px; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 80; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal-overlay.visible { display: flex; }
.modal { background: #111; border: 1px solid #262626; border-radius: 16px; width: 100%; max-width: 440px; padding: 28px 24px; text-align: center; }
.modal h2 { color: #fff; font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.modal .modal-sub { color: #a3a3a3; font-size: 14px; margin-bottom: 20px; }
.loading-dots { display: flex; justify-content: center; gap: 8px; margin: 24px 0 12px; }
.loading-dots span { width: 10px; height: 10px; border-radius: 50%; background: #3b82f6; animation: blink 1s infinite; }
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.connecting-text { color: #60a5fa; font-size: 14px; letter-spacing: 1px; font-weight: 700; }
.pairing-code-card { background: #000; border: 1px solid #262626; border-radius: 12px; padding: 24px 12px; margin: 20px 0; }
.pairing-code { color: #60a5fa; font-size: 40px; font-weight: 700; letter-spacing: 6px; text-shadow: 0 0 18px rgba(59,130,246,.9), 0 0 42px rgba(59,130,246,.5); }
.modal-actions { display: flex; gap: 12px; }
.modal-actions .btn { flex: 1; padding: 12px; }
.btn-copy-code { background: #262626; color: #fff; border: 1px solid #404040; }
.btn-change { background: transparent; color: #fff; border: 1px solid #404040; }
.linking-steps { text-align: left; margin-top: 24px; border-top: 1px solid #262626; padding-top: 20px; }
.linking-steps h3 { color: #fff; font-size: 16px; margin-bottom: 16px; text-align: center; }
.step { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; color: #d4d4d4; font-size: 14px; }
.step-num { width: 28px; height: 28px; min-width: 28px; border-radius: 50%; background: #000; border: 1px solid #404040; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.modal-close { margin-top: 20px; background: none; border: none; color: #737373; font-size: 14px; }

/* Recent Session */
.recent-inner { background: #0a0a0a; border: 1px solid #262626; border-radius: 14px; padding: 28px 20px; margin-top: 24px; text-align: center; }
.session-label { color: #737373; font-size: 12px; font-weight: 700; letter-spacing: 3px; margin-bottom: 14px; }
.session-value-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.session-value { background: #1e3a8a; color: #60a5fa; font-weight: 700; font-size: 18px; padding: 12px 18px; border-radius: 10px; word-break: break-all; }
.copy-btn { background: #262626; border: 1px solid #404040; border-radius: 8px; width: 44px; height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
.copy-btn svg { width: 20px; height: 20px; }
.scanned-on { color: #a3a3a3; font-size: 13px; margin-top: 16px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.warning-box { background: #1e293b; border: 1px solid #1d4ed8; color: #cbd5e1; border-radius: 10px; padding: 14px 16px; margin-top: 20px; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; text-align: left; }
.warning-icon { width: 24px; height: 24px; min-width: 24px; border-radius: 50%; background: #000; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.btn-new-session { background: #475569; color: #fff; width: 100%; margin-top: 20px; padding: 14px; font-size: 17px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn-new-session:hover { background: #52657e; }

/* Stub pages */
.stub { text-align: left; }
.stub h1 { text-align: left; }
.stub p { color: #d4d4d4; line-height: 1.7; margin-bottom: 14px; font-size: 15px; }
.stub ul { color: #d4d4d4; line-height: 1.8; margin: 0 0 14px 20px; }
.stub code { background: #0a0a0a; border: 1px solid #404040; border-radius: 6px; padding: 2px 6px; color: #93c5fd; }
.stub .qa { margin-bottom: 18px; }
.stub .qa strong { color: #fff; display: block; margin-bottom: 4px; }

/* Footer */
footer { background: #000; border-top: 1px solid #1f1f1f; color: #a3a3a3; padding: 36px 24px 24px; }
.footer-inner { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; } }
.footer-brand { color: #fff; font-weight: 700; font-size: 18px; letter-spacing: 2px; margin-bottom: 10px; }
.footer-tagline { font-size: 14px; line-height: 1.6; }
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 12px; }
.footer-col a { display: block; color: #a3a3a3; font-size: 14px; padding: 4px 0; }
.footer-copy { text-align: center; color: #737373; font-size: 13px; margin-top: 28px; padding-top: 20px; border-top: 1px solid #1f1f1f; }
/* ---- Full-screen link pages (QR / Pairing), like the original ---- */
.link-page { position: fixed; inset: 0; background: #0a0a0a; z-index: 90; overflow-y: auto; display: flex; flex-direction: column; }
.link-page.hidden { display: none; }
.link-page-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #1f1f1f; font-size: 17px; font-weight: 600; color: #fff; position: sticky; top: 0; background: #0a0a0a; z-index: 2; }
.link-page-close { background: none; border: none; color: #a3a3a3; font-size: 28px; line-height: 1; cursor: pointer; padding: 0 4px; }
.link-page-close:hover { color: #fff; }
.link-page-body { max-width: 480px; width: 100%; margin: 0 auto; padding: 28px 20px 40px; }
.qr-box { background: #fff; border-radius: 12px; min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.qr-box img { max-width: 260px; width: 100%; }
.qr-connecting { color: #737373; font-size: 15px; text-align: center; }
.qr-connecting.hidden { display: none; }
.howto { margin-top: 28px; }
.howto h3 { color: #fff; font-size: 16px; margin-bottom: 12px; }
.howto ol { color: #d4d4d4; font-size: 15px; line-height: 2; padding-left: 22px; }
.qr-status { color: #a3a3a3; font-size: 14px; text-align: center; margin-top: 20px; }
/* Method buttons: disabled while connecting on load */
.connect-status { color: #a3a3a3; font-size: 13px; display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }
.connect-status .connect-dot { width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; animation: blink 1s infinite; }
.connect-status.ready { color: #4ade80; }
.connect-status.ready .connect-dot { background: #22c55e; animation: none; }
.method-btn:disabled { opacity: .45; cursor: not-allowed; }
.method-btn:disabled:hover { background: #334155; }
/* Pairing page */
.pairing-heading { color: #fff; font-size: 17px; margin-bottom: 6px; }
.pairing-sub { color: #a3a3a3; font-size: 14px; margin-bottom: 16px; }
#pairingPage input[type="tel"] { width: 100%; background: #0a0a0a; border: 1px solid #404040; color: #fff; border-radius: 8px; padding: 12px; font-family: inherit; font-size: 16px; margin-bottom: 12px; }
.btn-block { width: 100%; padding: 13px; }
.pairing-code-title { color: #fff; font-size: 20px; text-align: center; margin-bottom: 4px; }
#pairingCodeView .modal-sub { text-align: center; color: #a3a3a3; font-size: 14px; margin-bottom: 8px; }
#pairingCodeView #pairingLoading { text-align: center; padding: 20px 0; }
#pairingCodeView .loading-dots span { width: 9px; height: 9px; }
#pairingCodeView .loading-dots span:nth-child(4) { animation-delay: .6s; }
#pairingCodeView .loading-dots span:nth-child(5) { animation-delay: .8s; }
#pairingCodeView .loading-dots span:nth-child(6) { animation-delay: 1s; }
.pairing-error { background: #2a1215; color: #fca5a5; border: 1px solid #7f1d1d; border-radius: 10px; padding: 12px 14px; margin: 16px 0; font-size: 14px; line-height: 1.5; }
.btn-retry { background: #2563eb; color: #fff; border: 1px solid #2563eb; padding: 12px; width: 100%; border-radius: 10px; font-size: 15px; font-weight: 600; margin: 4px 0 8px; }
.hidden { display: none !important; }
