:root {
  --bg: #04101b;
  --bg-raised: #081a28;
  --panel: rgba(8, 27, 42, 0.76);
  --panel-solid: #0a2030;
  --line: rgba(112, 194, 235, 0.24);
  --line-hot: rgba(58, 201, 255, 0.7);
  --text: #edfaff;
  --muted: #83a6b9;
  --blue: #18aef2;
  --blue-hot: #43d2ff;
  --blue-pale: #b8edff;
  --danger: #ff5572;
  --mono: "DM Mono", monospace;
  --sans: "Manrope", sans-serif;
}

html.dark-mode { --bg: #00050b; --panel: rgba(3, 12, 22, 0.92); --text: #d9efff; --muted: #698196; }
* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, #081824 0, var(--bg) 420px);
  font-family: var(--sans);
  overflow-x: hidden;
}
.auth-pending .app-shell { visibility: hidden; }
.auth-gate { position: fixed; z-index: 200; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(3,12,19,.92); backdrop-filter: blur(18px); }.auth-gate.hidden { display: none; }
.auth-card { width: min(420px,100%); padding: 34px; border: 1px solid var(--line); border-radius: 18px; background: #0a1f2d; box-shadow: 0 28px 90px rgba(0,0,0,.42); }.auth-monogram { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 26px; border-radius: 11px; background: #dff7ff; color: #0a2232; font: 700 11px var(--sans); }.auth-card h1 { margin: 7px 0 10px; font-size: 30px; letter-spacing: -.04em; }.auth-card > p:not(.kicker):not(.auth-error) { margin: 0 0 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }.auth-card .primary { width: 100%; margin-top: 8px; }.auth-error { min-height: 20px; margin: 8px 0 0; color: var(--danger); font: 10px var(--mono); }

.ambient-grid {
  position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: .18;
  background-image: linear-gradient(rgba(94,190,235,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(94,190,235,.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}
.lab-beam { position: fixed; z-index: -1; left: 0; right: 0; top: -80px; height: 80px; pointer-events: none; opacity: 0; background: linear-gradient(to bottom, transparent, rgba(80,196,240,.08), rgba(116,219,255,.24), transparent); animation: analyse-page 10s linear infinite; }
.scanline { position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: .12; background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(0,0,0,.38) 4px); }
.app-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.topbar { min-height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid #3e89aa; background: #102b3b; color: #dff7ff; font: 600 11px var(--sans); letter-spacing: .04em; }
.brand strong { display: block; font-size: 15px; letter-spacing: .34em; }
.brand small { display: block; margin-top: 2px; color: var(--muted); font: 9px var(--mono); letter-spacing: .18em; }
.system-status { display: flex; align-items: center; gap: 9px; font: 10px var(--mono); letter-spacing: .13em; color: var(--muted); }
.system-status strong { color: #50d7a1; font-weight: 500; }
.status-dot, .live-label i, #connectionHint i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #50d7a1; animation: soft-pulse 2.8s ease-in-out infinite; }
.theme-toggle { display: inline-flex; gap: 9px; align-items: center; border: 0; background: transparent; color: var(--muted); font: 10px var(--mono); letter-spacing: .12em; cursor: pointer; }
.theme-toggle span { color: var(--blue-hot); font-size: 19px; }.theme-toggle em { font-style: normal; }
.theme-switch { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 10px; background: rgba(4,14,22,.5); }
.theme-switch button { display: inline-flex; align-items: center; gap: 6px; min-height: 31px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font: 9px var(--mono); letter-spacing: .08em; }
.theme-switch button:hover { transform: none; color: var(--text); }
.theme-switch button.active { background: #17384a; color: #dff7ff; box-shadow: inset 0 0 0 1px rgba(143,216,246,.14); }
.theme-switch button span { font-size: 13px; }
.lock-button { min-height: 31px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font: 8px var(--mono); letter-spacing: .06em; }.lock-button.hidden { display: none; }.lock-button:hover { color: var(--text); border-color: var(--line-hot); }

.hero { min-height: 420px; padding: 78px 4% 52px; display: grid; grid-template-columns: 1fr .55fr; gap: 60px; align-items: center; }
.eyebrow, .kicker { margin: 0; color: var(--muted); font: 10px var(--mono); letter-spacing: .18em; }
.eyebrow span { color: var(--blue-hot); }
.hero h1 { margin: 18px 0 20px; font-size: clamp(3rem, 7vw, 6.3rem); line-height: .91; letter-spacing: -.065em; font-weight: 600; }
.hero h1 span { color: #8fd8f6; }
.hero-lead { max-width: 580px; margin: 0; color: #9eb1c2; font-size: clamp(.95rem, 1.5vw, 1.08rem); line-height: 1.8; }
.signal-visual { justify-self: center; position: relative; width: 230px; height: 230px; display: grid; place-items: center; }
.signal-visual::before, .signal-visual::after { content: ""; position: absolute; border: 1px solid rgba(32,168,255,.28); border-radius: 50%; animation: breathe 3s ease-in-out infinite; }
.signal-visual::before { inset: 0; }.signal-visual::after { inset: 30px; animation-delay: -.8s; }
.signal-core { width: 100px; height: 100px; border: 1px solid var(--line-hot); display: grid; place-items: center; transform: rotate(45deg); background: rgba(8,43,63,.76); box-shadow: 0 0 70px rgba(32,198,255,.27), inset 0 0 30px rgba(64,207,255,.1); backdrop-filter: blur(10px); }
.signal-core span { width: 16px; height: 16px; border-radius: 50%; background: #bceaff; box-shadow: 0 0 9px #fff, 0 0 30px var(--blue); }
.signal-caption { position: absolute; bottom: -5px; text-align: center; }.signal-caption b,.signal-caption small { display: block; }.signal-caption b { color: var(--blue-pale); font: 10px var(--mono); letter-spacing: .35em; }.signal-caption small { margin-top: 5px; color: var(--muted); font: 8px var(--mono); letter-spacing: .12em; }

.personal-card { position: relative; isolation: isolate; width: 260px; min-height: 290px; justify-self: center; display: flex; flex-direction: column; padding: 22px; overflow: hidden; border: 1px solid #315a70; border-radius: 18px; background: linear-gradient(145deg, #102b3b, #0a1d2a); box-shadow: 0 22px 45px rgba(0,0,0,.22); transform: rotate(2deg); animation: card-hover 5s ease-in-out infinite; }
.personal-card::before { content: ""; position: absolute; z-index: -1; inset: -55% -30%; background: linear-gradient(105deg, transparent 42%, rgba(128,222,255,.11) 49%, rgba(128,222,255,.2) 50%, rgba(128,222,255,.11) 51%, transparent 58%); transform: translateX(-55%); animation: card-scan 6s ease-in-out infinite; }
.personal-card-top, .personal-card-bottom { display: flex; align-items: center; justify-content: space-between; }.personal-card-top span { font-weight: 700; letter-spacing: .18em; }.personal-card-top small { color: var(--muted); font: 8px var(--mono); letter-spacing: .08em; }
.personal-monogram { width: 94px; height: 94px; margin: auto auto 12px; display: grid; place-items: center; border-radius: 50%; background: #dff7ff; color: #0a2232; font-size: 48px; font-weight: 600; letter-spacing: -.06em; box-shadow: 0 0 0 0 rgba(143,216,246,.12); animation: monogram-pulse 3.4s ease-in-out infinite; }
.personal-activity { height: 25px; margin: 0 0 14px; display: flex; align-items: center; justify-content: center; gap: 5px; border-bottom: 1px solid rgba(112,194,235,.18); }.personal-activity i { width: 2px; height: 7px; border-radius: 2px; background: #78d3f7; animation: activity 1.45s ease-in-out infinite; }.personal-activity i:nth-child(2) { animation-delay: -.2s; }.personal-activity i:nth-child(3) { animation-delay: -.55s; }.personal-activity i:nth-child(4) { animation-delay: -.85s; }.personal-activity i:nth-child(5) { animation-delay: -.4s; }.personal-activity i:nth-child(6) { animation-delay: -1.1s; }.personal-activity i:nth-child(7) { animation-delay: -.7s; }
.personal-card-bottom { padding-top: 18px; border-top: 1px solid var(--line); }.personal-card-bottom strong { font-size: 13px; letter-spacing: .12em; }.personal-card-bottom span { color: var(--muted); font: 8px var(--mono); }

.lab-strip { position: relative; min-height: 92px; margin-bottom: 16px; padding: 18px 22px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)) 1.3fr; align-items: center; gap: 18px; border: 1px solid var(--line); border-top-color: var(--line-hot); background: rgba(7,26,40,.66); backdrop-filter: blur(14px); box-shadow: inset 0 1px rgba(255,255,255,.04); }
.lab-strip > div:not(.lab-trace) { position: relative; padding-left: 28px; border-right: 1px solid var(--line); }.lab-strip > div:not(.lab-trace) > span { position: absolute; left: 0; top: 1px; color: var(--blue-hot); font: 9px var(--mono); }.lab-strip p { margin: 0 0 6px; color: var(--muted); font: 8px var(--mono); letter-spacing: .15em; }.lab-strip strong { color: var(--blue-pale); font: 10px var(--mono); letter-spacing: .1em; }
.lab-trace { height: 42px; display: flex; align-items: center; justify-content: space-around; gap: 5px; overflow: hidden; border-bottom: 1px solid rgba(67,210,255,.25); }.lab-trace i { width: 2px; background: var(--blue-hot); box-shadow: 0 0 8px var(--blue-hot); animation: spectrum 1.8s ease-in-out infinite; }.lab-trace i:nth-child(1) { height: 12px; }.lab-trace i:nth-child(2) { height: 31px; animation-delay: -.3s; }.lab-trace i:nth-child(3) { height: 19px; animation-delay: -.7s; }.lab-trace i:nth-child(4) { height: 38px; animation-delay: -1s; }.lab-trace i:nth-child(5) { height: 16px; animation-delay: -1.4s; }
.card { position: relative; border: 1px solid var(--line); border-radius: 14px; background: rgba(9,27,41,.9); box-shadow: 0 18px 48px rgba(0,0,0,.18); overflow: hidden; }
.card::before, .card::after { display: none; }
.join-card { padding: 34px 38px 38px; }
.section-heading, .panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.section-heading > div, .panel-heading > div { display: flex; align-items: center; gap: 16px; }
.section-index { color: var(--blue-hot); font: 12px var(--mono); padding-right: 16px; border-right: 1px solid var(--line); }
.section-heading h2, .panel-heading h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.02em; }
.security-tag, .live-label { color: var(--blue-pale); border: 1px solid var(--line); border-radius: 999px; padding: 8px 11px; font: 9px var(--mono); letter-spacing: .08em; }
.live-label { display: flex; align-items: center; gap: 7px; border: 0; }.live-label i { width: 5px; height: 5px; }
.grid-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: grid; gap: 9px; color: #93aabd; font: 10px var(--mono); text-transform: uppercase; letter-spacing: .1em; }
input { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #07141e; color: var(--text); padding: 15px 16px; font: 14px var(--mono); transition: border-color .2s, box-shadow .2s; }
input::placeholder { color: #456075; } input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(21,156,255,.08), inset 0 0 20px rgba(21,156,255,.035); }
.room-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
button { font-family: var(--mono); cursor: pointer; transition: transform .2s, border-color .2s, background .2s, color .2s; }
button:hover { transform: translateY(-1px); }
.room-row button, .history-actions button { border: 1px solid var(--line); border-radius: 9px; background: #102b3b; color: var(--blue-pale); padding: 0 18px; font-size: 10px; letter-spacing: .06em; }
.join-actions { margin-top: 20px; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.auto-connect-status { margin-left: auto; color: var(--muted); font: 9px var(--mono); letter-spacing: .04em; }
.primary { min-width: 250px; border: 0; border-radius: 9px; color: #04131d; background: #8fd8f6; padding: 15px 18px; display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: .08em; }
.primary:hover { background: #b4e9ff; }.primary b { font-size: 17px; transition: transform .2s; }.primary:hover b { transform: translateX(4px); }
#connectionHint { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--muted); font: 10px var(--mono); letter-spacing: .04em; }

.qr-container { margin-top: 30px; padding: 28px; border: 1px solid var(--line); background: rgba(0,7,14,.42); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 30px; }
.qr-container.hidden { display: none; }.qr-copy h3 { margin: 7px 0 8px; font-size: 18px; }.qr-copy > p:not(.kicker) { color: var(--muted); font-size: 13px; }.qr-copy small { display: block; margin-top: 12px; color: var(--muted); font-size: 11px; }.qr-frame { padding: 9px; background: #eaf8ff; border: 1px solid var(--blue); box-shadow: 0 0 28px rgba(21,156,255,.16); }.qr-frame img { display: block; width: 142px; height: 142px; }.qr-actions { display: flex; align-items: center; gap: 10px; }.qr-actions a { max-width: 330px; color: var(--blue-pale); font: 10px var(--mono); overflow-wrap: anywhere; }.qr-actions button { border: 1px solid var(--line-hot); background: transparent; color: var(--blue-pale); padding: 9px 11px; font-size: 9px; }

.layout { display: grid; grid-template-columns: .88fr 1.12fr; gap: 16px; margin-top: 16px; }.layout.hidden { display: none; }
.workspace-header { grid-column: 1/-1; padding: 18px 22px; border: 1px solid var(--line); border-radius: 12px; background: #0b2231; display: flex; align-items: center; justify-content: space-between; }
.workspace-header > div:first-child { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 10px; }.workspace-header .status-dot { grid-row: 1/3; }.workspace-header p { margin: 0; color: var(--muted); font: 8px var(--mono); letter-spacing: .12em; }.workspace-header h3 { margin: 3px 0 0; font: 14px var(--mono); letter-spacing: .06em; }
.device-presence { min-width: 220px; text-align: center; }.connected-devices { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; }.connected-devices span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--blue-pale); background: rgba(75,174,216,.07); font: 8px var(--mono); }.connected-devices span::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: #50d7a1; }
.danger { border: 1px solid rgba(255,85,114,.45); background: rgba(255,85,114,.06); color: #ff91a4; padding: 10px 13px; font-size: 9px; letter-spacing: .12em; }
.panel { min-width: 0; padding: 28px; }.messages-panel { align-self: start; }.panel-heading { margin-bottom: 22px; }
.message-heading-actions { display: flex; align-items: center; gap: 6px; }.message-heading-actions button { border: 0; background: transparent; color: var(--muted); padding: 7px; font-size: 8px; letter-spacing: .08em; }
.messages { height: 330px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--line); background: rgba(0,6,12,.58); scrollbar-color: var(--blue) transparent; }
.empty-state { margin: auto; text-align: center; color: #537087; font: 11px/1.7 var(--mono); }.empty-state span { color: #375267; }
.msg { position: relative; padding: 11px 12px; border-left: 2px solid var(--blue); background: rgba(15,48,72,.48); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }.msg.system { border-left-color: #4e687c; color: var(--muted); font: 10px var(--mono); }.msg-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 5px; }.msg .meta { color: var(--blue-pale); font: 9px var(--mono); }.copy-msg-btn { border: 0; background: transparent; color: var(--muted); font-size: 8px; }.msg a { color: var(--blue-hot); }
.message-form { margin-top: 10px; display: grid; grid-template-columns: 1fr auto; }.message-form input { border-right: 0; }.message-form button { border: 1px solid var(--line-hot); background: rgba(21,156,255,.12); color: var(--blue-pale); padding: 0 16px; font-size: 9px; letter-spacing: .1em; }.message-form button span { margin-left: 7px; }
.history-actions { display: flex; gap: 8px; margin: -8px 0 14px; justify-content: flex-end; }.history-actions button { padding: 8px 10px; }.history-actions .danger-text { border-color: rgba(255,85,114,.35); background: transparent; color: #d77f8e; }
.file-tools { display: grid; grid-template-columns: 1fr 120px; gap: 8px; margin: -8px 0 12px; }.file-tools label { gap: 5px; }.file-tools input,.file-tools select { min-height: 38px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; outline: none; background: #07141e; color: var(--text); font: 10px var(--mono); }.file-tools select { cursor: pointer; }
.drop-zone { min-height: 215px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px; border: 1px dashed #3d7189; border-radius: 12px; background: #071722; text-align: center; transition: border-color .2s, background .2s; }.drop-zone.dragging { border-color: var(--blue-hot); background: #0d2b3d; }.upload-symbol { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 50%; background: #123246; color: var(--blue-hot); animation: upload-idle 3s ease-in-out infinite; }.upload-symbol span { font-size: 20px; }.drop-zone p { margin: 8px 0 4px; font-size: 14px; }.drop-zone small { color: var(--muted); font: 9px var(--mono); }.upload-btn { display: inline-flex; margin-top: 18px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--blue-pale); background: #102b3b; cursor: pointer; }.upload-btn input { display: none; }
.upload-status { min-height: 20px; margin-top: 10px; color: var(--muted); font: 10px var(--mono); }.upload-queue { display: grid; gap: 8px; }.upload-item { padding: 11px; border: 1px solid var(--line); background: rgba(0,7,14,.52); }.upload-item-title { font-size: 12px; overflow-wrap: anywhere; }.upload-item-meta { margin: 5px 0; color: var(--muted); font: 9px var(--mono); }.upload-item-progress { height: 3px; background: #112b3d; }.upload-item-progress-bar { height: 100%; background: var(--blue-hot); box-shadow: 0 0 8px var(--blue); transition: width .18s; }
.file-list { max-height: 260px; overflow-y: auto; display: grid; gap: 7px; margin: 8px 0 0; padding: 0; list-style: none; }.file-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); background: rgba(2,12,22,.75); font-size: 12px; }.file-list small { display: block; margin-top: 3px; color: var(--muted); font: 8px var(--mono); }.file-item-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }.file-list a, .preview-btn, .delete-btn { border: 0; background: transparent; color: var(--blue-pale); padding: 4px; font: 8px var(--mono); text-decoration: none; text-transform: uppercase; }.delete-btn { color: #ff91a4; }
.file-preview { margin-top: 12px; border: 1px solid var(--line); background: #03101c; }.file-preview.hidden { display: none; }.preview-heading { padding: 12px; border-bottom: 1px solid var(--line); }.file-preview-meta { margin-top: 5px; color: var(--muted); font: 9px var(--mono); overflow-wrap: anywhere; }.file-preview-content { min-height: 130px; padding: 10px; display: grid; place-items: center; }.file-preview-content img,.file-preview-content video,.file-preview-content audio,.file-preview-content iframe { width: 100%; max-width: 100%; border: 0; }.file-preview-content iframe { min-height: 260px; background: white; }.file-preview-content a { color: var(--blue-pale); font: 10px/1.6 var(--mono); text-align: center; }
.hidden { display: none; }.error { color: var(--danger)!important; }

footer { margin: 48px 0 26px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: #4d667a; font: 8px var(--mono); letter-spacing: .13em; }footer p { margin: 0; }
.toast { position: fixed; z-index: 100; left: 50%; top: 18px; transform: translate(-50%,-10px); padding: 11px 15px; border: 1px solid var(--line-hot); background: #061725; color: var(--text); opacity: 0; transition: .18s; font: 10px var(--mono); box-shadow: 0 14px 40px #000; }.toast.visible { opacity: 1; transform: translate(-50%,0); }.toast-success { border-color: #50d7a1; }.toast-error { border-color: var(--danger); }
@keyframes pulse { 50% { opacity: .38; box-shadow: 0 0 3px currentColor; } }
@keyframes breathe { 50% { transform: scale(1.07); opacity: .45; } }
@keyframes spectrum { 50% { height: 8px; opacity: .35; } }
@keyframes analyse-page { 0% { transform: translateY(-100px); opacity: 0; } 12%,82% { opacity: 1; } 100% { transform: translateY(calc(100vh + 180px)); opacity: 0; } }
@keyframes soft-pulse { 50% { opacity: .42; box-shadow: 0 0 9px rgba(80,215,161,.65); } }
@keyframes card-hover { 0%,100% { transform: rotate(2deg) translateY(0); } 50% { transform: rotate(1deg) translateY(-7px); } }
@keyframes card-scan { 0%,18% { transform: translateX(-65%); } 60%,100% { transform: translateX(65%); } }
@keyframes monogram-pulse { 50% { box-shadow: 0 0 0 10px rgba(143,216,246,.05); } }
@keyframes activity { 0%,100% { height: 5px; opacity: .4; } 50% { height: 20px; opacity: 1; } }
@keyframes upload-idle { 50% { transform: translateY(-4px); background: #173b51; } }

/* Mode clair : laboratoire lumineux */
html.light-mode {
  color-scheme: light;
  --bg: #e9f3f7;
  --bg-raised: #f6fbfd;
  --panel: rgba(255,255,255,.88);
  --panel-solid: #ffffff;
  --line: rgba(45,103,130,.2);
  --line-hot: rgba(20,132,181,.55);
  --text: #102b3a;
  --muted: #607e8d;
  --blue: #087eaf;
  --blue-hot: #079ccc;
  --blue-pale: #155d7b;
}
html.light-mode body { background: linear-gradient(180deg, #f7fbfd 0, #e9f3f7 440px); }
html.light-mode .auth-gate { background: rgba(231,243,247,.94); }
html.light-mode .auth-card { background: #fff; box-shadow: 0 28px 80px rgba(34,77,97,.16); }
html.light-mode .auth-monogram { background: #153f52; color: #edfaff; }
html.light-mode .ambient-grid { opacity: .22; background-image: linear-gradient(rgba(35,126,165,.1) 1px, transparent 1px), linear-gradient(90deg, rgba(35,126,165,.1) 1px, transparent 1px); }
html.light-mode .lab-beam { background: linear-gradient(to bottom, transparent, rgba(23,156,205,.04), rgba(23,156,205,.16), transparent); }
html.light-mode .brand-mark { border-color: #8bbdce; background: #dceff5; color: #173f52; }
html.light-mode .theme-toggle { color: #536f7d; }
html.light-mode .theme-switch { background: rgba(255,255,255,.58); }
html.light-mode .theme-switch button.active { background: #d2eaf3; color: #16475d; box-shadow: inset 0 0 0 1px rgba(28,111,147,.12); }
html.light-mode .personal-card { border-color: #9cc5d4; background: linear-gradient(145deg, #f9fdff, #dceef4); box-shadow: 0 22px 42px rgba(35,83,105,.15); }
html.light-mode .personal-card::before { background: linear-gradient(105deg, transparent 42%, rgba(0,132,181,.05) 49%, rgba(0,132,181,.13) 50%, rgba(0,132,181,.05) 51%, transparent 58%); }
html.light-mode .personal-monogram { background: #153f52; color: #edfaff; }
html.light-mode .personal-card-bottom { border-color: rgba(35,105,136,.2); }
html.light-mode .card { background: rgba(255,255,255,.9); box-shadow: 0 18px 45px rgba(34,77,97,.1); }
html.light-mode input { background: #f8fcfd; color: #102b3a; }
html.light-mode input::placeholder { color: #8aa1ac; }
html.light-mode .room-row button,
html.light-mode .history-actions button,
html.light-mode .upload-btn { background: #e2f1f6; color: #155d7b; }
html.light-mode .file-tools input,
html.light-mode .file-tools select { background: #f8fcfd; color: #102b3a; }
html.light-mode .connected-devices span { background: #e5f3f7; }
html.light-mode .primary { background: #176f94; color: #fff; }
html.light-mode .primary:hover { background: #0e5c7d; }
html.light-mode .qr-container { background: rgba(235,246,250,.72); }
html.light-mode .workspace-header { background: #f7fcfd; }
html.light-mode .messages { background: #f5fafc; }
html.light-mode .empty-state { color: #668492; }
html.light-mode .empty-state span { color: #87a0ab; }
html.light-mode .msg { background: #e6f3f8; }
html.light-mode .msg.system { color: #607e8d; background: #f1f7f9; }
html.light-mode .message-form button { background: #e1f1f6; color: #155d7b; }
html.light-mode .drop-zone { background: #f5fafc; }
html.light-mode .drop-zone.dragging { background: #def2fa; }
html.light-mode .upload-symbol { background: #dceff6; }
html.light-mode .upload-item,
html.light-mode .file-list li { background: #f8fcfd; }
html.light-mode .upload-item-progress { background: #d1e3ea; }
html.light-mode .file-preview { background: #f8fcfd; }
html.light-mode .file-preview-content { background: #fff; }
html.light-mode .toast { background: #f6fbfd; color: #102b3a; box-shadow: 0 14px 35px rgba(24,57,73,.16); }
html.light-mode .danger { background: #fff5f6; }

@media (max-width: 850px) {
  .app-shell { width: min(100% - 24px, 680px); }.topbar { min-height: 70px; gap: 7px; }.system-status { display: none; }.theme-switch button { padding-inline: 7px; font-size: 8px; }.lock-button { padding-inline: 6px; font-size: 7px; }
  .hero { min-height: auto; padding: 56px 4% 42px; grid-template-columns: 1fr; }.personal-card { display: none; }.hero h1 { font-size: clamp(3rem, 13vw, 5rem); }
  .join-card,.panel { padding: 24px 20px; }.grid-two,.layout { grid-template-columns: 1fr; }.workspace-header { grid-column: 1; }.security-tag { display: none; }.auto-connect-status { width: 100%; margin-left: 0; }.device-presence { text-align: left; }.connected-devices { justify-content: flex-start; }
  .qr-container { grid-template-columns: 1fr; }.qr-frame { justify-self: center; }.qr-actions { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
  .brand small { display: none; }.hero { padding-inline: 0; }.hero h1 { font-size: 2.85rem; }.hero-lead { font-size: .9rem; }.lab-strip { grid-template-columns: 1fr; gap: 13px; }.lab-strip > div:not(.lab-trace) { padding-bottom: 12px; border-right: 0; border-bottom: 1px solid var(--line); }.lab-strip > div:not(.lab-trace):nth-child(3) { padding-bottom: 0; border-bottom: 0; }
  .join-card,.panel { padding: 20px 15px; }.section-heading { align-items: flex-start; }.grid-two { gap: 14px; }.room-row { grid-template-columns: 1fr; }.room-row input,.message-form input { border-right: 1px solid var(--line); }.room-row button { min-height: 42px; }.join-actions { align-items: stretch; }.primary { min-width: 100%; }#connectionHint { line-height: 1.5; }
  .qr-container { padding: 18px 14px; }.workspace-header { align-items: flex-start; gap: 12px; flex-direction: column; }.workspace-header .danger { width: 100%; }.messages { height: 260px; }.message-form { grid-template-columns: 1fr; gap: 7px; }.message-form button { min-height: 42px; }.file-tools { grid-template-columns: 1fr; }.message-heading-actions .live-label { display: none; }
  .file-list li { align-items: flex-start; flex-direction: column; }.file-item-actions { justify-content: flex-start; }footer { gap: 10px; flex-wrap: wrap; }footer p { order: 3; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation: none!important; scroll-behavior: auto!important; transition: none!important; } }
