/* ═══════════════════════════════════════════
   FOYL v2 — Industrial Dialectic Interface
   Aesthetic: Dark technical, HUD readout,
   deep red + toxic green on black
   ═══════════════════════════════════════════ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-void: #0d0d0d;
    --bg-surface: #060606;
    --bg-panel: #0a0a0a;
    --bg-input: #050505;
    --bg-elevated: #0e0e0e;

    --text-primary: #c8c8c8;
    --text-secondary: #707070;
    --text-muted: #3a3a3a;
    --text-ghost: #222222;

    --red: #a01020;
    --red-bright: #cc1a2e;
    --red-dim: #661018;
    --red-glow: #ff1a30;

    --green: #00cc44;
    --green-bright: #00ff55;
    --green-dim: #005522;
    --green-glow: #00ff41;

    --gold: #8a7a2a;
    --gold-bright: #b8a830;

    --wire: #1a1a1a;
    --wire-light: #252525;
    --wire-bright: #333333;

    --font-mono: 'JetBrains Mono', 'IBM Plex Mono', 'Fira Code', monospace;
    --font-display: 'changeling-neo', sans-serif;
}

html, body {
    height: 100%;
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.65;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

::selection {
    background: var(--red-dim);
    color: var(--text-primary);
}

/* ══════════════════════════════════════
   LOADING SCREEN
   ══════════════════════════════════════ */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.loading-sigil {
    width: 48px;
    height: 48px;
    background: url('/static/triluna-sigil.svg') no-repeat center;
    background-size: contain;
    opacity: 0.6;
    animation: loading-pulse 1.5s ease-in-out infinite;
}

@keyframes loading-pulse {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.loading-text {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 4px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.loading-bar {
    width: 120px;
    height: 2px;
    background: var(--wire);
    border-radius: 1px;
    overflow: hidden;
}

.loading-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--red-dim);
    transition: width 0.3s ease-out;
}

/* ══════════════════════════════════════
   TOP NAVIGATION BAR
   ══════════════════════════════════════ */

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 8500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    pointer-events: none;
}

/* ══════════════════════════════════════
   DASHBOARD AUTH BUTTON
   ══════════════════════════════════════ */

.dashboard-auth {
    position: fixed;
    top: 0.75rem;
    right: 1rem;
    z-index: 9000;
}

.dashboard-auth-btn {
    color: var(--text-secondary);
    border-color: var(--wire-light);
    padding: 0.4rem 1rem;
    font-size: 0.6rem;
    letter-spacing: 2px;
    font-weight: 300;
}

.dashboard-auth-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.top-nav-left,
.top-nav-right {
    pointer-events: auto;
}

.top-nav-brand {
    display: block;
    line-height: 0;
}

.top-nav-lockup {
    height: 18px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.top-nav-lockup:hover {
    opacity: 1;
}

.top-nav-right {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-auth-btn {
    padding: 0.35rem 1rem;
    font-size: 0.6rem;
    letter-spacing: 3px;
    background: rgba(6, 6, 6, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid var(--wire);
    color: var(--text-secondary);
    transition: all 0.2s;
}

.nav-auth-btn:hover {
    border-color: var(--wire-bright);
    color: var(--text-primary);
    background: rgba(14, 14, 14, 0.8);
}

.nav-auth-btn.nav-signup {
    border-color: var(--red-dim);
    color: var(--red);
}

.nav-auth-btn.nav-signup:hover {
    border-color: var(--red);
    color: var(--red-bright);
    background: rgba(102, 16, 24, 0.15);
}

/* Hide nav on workspace (controls bar has its own logout) */
body.in-workspace .top-nav {
    display: none;
}

/* ══════════════════════════════════════
   AUTH OVERLAY
   ══════════════════════════════════════ */

.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9000;
    background: var(--bg-void);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-box {
    width: 320px;
    text-align: center;
}

.auth-box h2 {
    font-family: var(--font-mono);
    font-size: 0.73rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 6px;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.auth-box form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-box input[type="email"],
.auth-box input[type="password"] {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-primary);
    border: none;
    border-bottom: 1px solid var(--wire);
    padding: 0.6rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
}

.auth-box input::placeholder {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.auth-box input:focus {
    border-bottom-color: var(--red);
}

.auth-error {
    font-size: 0.7rem;
    color: var(--red-bright);
    min-height: 1.2em;
    letter-spacing: 1px;
}

.auth-box .btn-primary {
    margin-top: 0.5rem;
    width: 100%;
}

.auth-toggle {
    margin-top: 1.5rem;
    font-size: 0.68rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.auth-toggle a {
    color: var(--red);
    text-decoration: none;
}

.auth-toggle a:hover {
    color: var(--red-bright);
}

.auth-back-btn {
    margin-top: 1.5rem;
    color: var(--text-muted);
    border-color: var(--wire);
    font-size: 0.6rem;
    letter-spacing: 3px;
    padding: 0.4rem 1.5rem;
}

.auth-back-btn:hover {
    color: var(--text-secondary);
    border-color: var(--wire-bright);
}

/* ══════════════════════════════════════
   WELCOME SCREEN
   ══════════════════════════════════════ */

.welcome {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    background: #000;
}

.welcome-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    touch-action: none;
}

.welcome-bg canvas {
    display: block;
}

.welcome-lockup-link {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 2;
    line-height: 0;
    pointer-events: auto;
}

.welcome-lockup {
    height: 54px;
    width: auto;
    opacity: 0.35;
    transition: opacity 0.3s ease;
}

.welcome-lockup-link:hover .welcome-lockup {
    opacity: 0.6;
}

.welcome-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 560px;
    width: 90%;
    padding: 3rem 3.5rem;
    background: rgba(13, 13, 13, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
}

.welcome-content h1 {
    font-family: "sabbath-black", serif;
    font-size: 10.5rem;
    font-weight: 800;
    font-style: normal;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.welcome-tagline {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 300;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2.5rem;
}

.welcome-shortcuts {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    letter-spacing: 1px;
}

.welcome-shortcuts kbd {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    background: var(--bg-elevated);
    border: 1px solid var(--wire);
    padding: 0.1rem 0.35rem;
    color: var(--text-secondary);
}

/* ══════════════════════════════════════
   WORKSPACE: Two-column layout
   ══════════════════════════════════════ */

.workspace {
    display: flex;
    height: calc(100vh - 43px);
    height: calc(100dvh - 43px);
    width: 100%;
}

/* ══════════════════════════════════════
   LEFT: Document Pane
   ══════════════════════════════════════ */

.document-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--wire);
    min-width: 0;
    width: 50%;
    position: relative;
}

.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 1.5rem;
    border-bottom: 1px solid var(--wire);
    background: var(--bg-surface);
    flex-shrink: 0;
}

.doc-header-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding-left: 1rem;
    color: var(--phase-accent, var(--text-primary));
    transition: color 0.6s ease;
}

a.doc-header-sigil,
a.doc-header-sigil:visited,
a.doc-header-sigil:hover,
a.doc-header-sigil:active {
    color: inherit;
    text-decoration: none;
}

.doc-header-sigil {
    display: inline-block;
    height: 3.2rem;
    width: 3.2rem;
    background-color: currentColor;
    -webkit-mask-image: url('/static/triluna-sigil.svg');
    mask-image: url('/static/triluna-sigil.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.doc-header-foyl {
    font-family: "sabbath-black", serif;
    font-size: 3.2rem;
    font-weight: 800;
    color: var(--phase-accent, var(--text-primary));
    letter-spacing: 1px;
    transition: color 0.6s ease;
}

.document-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem 2.5rem;
}

.document-content {
    max-width: 640px;
}

.doc-section {
    margin-bottom: 2.5rem;
}

.doc-section-divider {
    border-top: 1px solid var(--wire);
    margin: 3rem 0 2rem;
    opacity: 0.4;
}

.doc-section h1 {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--text-primary);
    border: none;
    outline: none;
    min-height: 2rem;
    letter-spacing: 1px;
}

.doc-section h2 {
    font-family: var(--font-mono);
    font-size: 0.63rem;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--red);
    font-weight: 500;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--wire);
}

.doc-editable {
    outline: none;
    border-left: 1px solid transparent;
    padding-left: 0.75rem;
    transition: border-color 0.3s;
    min-height: 1.5rem;
}

.doc-editable:focus {
    border-left-color: var(--red);
}

.doc-editable:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    font-style: normal;
    font-size: 0.88rem;
}

.doc-body {
    line-height: 1.9;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.doc-list {
    padding-left: 0;
}

.doc-list-item {
    padding: 0.4rem 0 0.4rem 0.75rem;
    border-left: 1px solid var(--wire-light);
    margin-bottom: 0.5rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.doc-list-item.argument {
    border-left-color: var(--text-secondary);
    color: var(--text-primary);
}

.doc-list-item.tension {
    border-left-color: var(--red-dim);
    color: var(--text-primary);
}

.doc-list-item.tested {
    border-left-color: var(--green-dim);
    color: var(--text-secondary);
}

.doc-threads {
    background: var(--bg-panel);
    padding: 1.25rem;
    margin-top: 2rem;
    border: 1px solid var(--wire);
}

.threads-list .doc-list-item {
    border-left-color: var(--gold);
    color: var(--text-muted);
}

/* ── Article View ── */

.doc-article-title {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 1px;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.doc-article-body {
    line-height: 2;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.doc-article-body p {
    margin-bottom: 1.25rem;
    text-indent: 0;
}

.doc-article-body p:first-child {
    color: var(--text-primary);
}

/* ══════════════════════════════════════
   RIGHT: Controls + Chat
   ══════════════════════════════════════ */

.right-pane {
    flex: 1;
    width: 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    position: relative;
}

/* ── Controls Bar ── */

.controls-bar {
    padding: 0.55rem 1.15rem;
    border-bottom: 1px solid var(--wire);
    background: var(--bg-panel);
    flex-shrink: 0;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.controls-row + .controls-row {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--wire);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.control-group-right {
    margin-left: auto;
}

.control-label {
    font-size: 0.55rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Selects */
select {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--wire);
    padding: 0.35rem 0.6rem;
    font-size: 0.73rem;
    font-family: var(--font-mono);
    letter-spacing: 1px;
    appearance: none;
    cursor: pointer;
}

select:focus {
    border-color: var(--wire-bright);
    outline: none;
}

select option {
    background: var(--bg-panel);
    color: var(--text-secondary);
}

/* Phase indicator */
.phase-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.phase-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--red);
    font-weight: 600;
    cursor: pointer;
}

.phase-select-hidden {
    display: none;
}

/* Intensity viz row (full-width strip above metrics) */
.controls-viz {
    padding: 0;
}

.controls-viz + .controls-row {
    margin-top: 0.35rem;
    padding-top: 0;
    border-top: none;
}

/* Metrics row */
.controls-metrics {
    gap: 0.75rem;
    align-items: center;
    flex-wrap: nowrap;
}

.metric {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 1;
    min-width: 0;
}

.metric-label {
    font-size: 0.55rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 0.73rem;
    color: var(--green);
    min-width: 2rem;
}

#intensity-slider {
    width: 70px;
    height: 2px;
    accent-color: var(--red);
    cursor: pointer;
}

.mode-toggle {
    font-size: 0.55rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.1rem 0.3rem;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.mode-toggle:hover {
    color: var(--text-secondary);
    border-color: var(--wire);
}

.mode-toggle[data-mode="adaptive"] {
    color: var(--green);
    border-color: var(--green-dim);
}

/* Drift bar */
.drift-bar-container {
    width: 45px;
    height: 2px;
    background: var(--wire);
    overflow: hidden;
}

.drift-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--green);
    transition: width 0.5s ease, background 0.5s ease;
}

.drift-bar-fill.stagnating {
    background: var(--red-bright);
    animation: pulse-warn 2s ease-in-out infinite;
}

@keyframes pulse-warn {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Control action buttons */
.control-actions {
    display: flex;
    gap: 0.35rem;
    margin-left: auto;
    flex-shrink: 0;
}

.btn-action {
    background: none;
    color: var(--text-muted);
    border: 1px solid var(--wire);
    padding: 0.25rem 0.6rem;
    font-size: 0.63rem;
    font-family: var(--font-mono);
    letter-spacing: 2px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.15s;
}

.btn-action:hover {
    color: var(--text-secondary);
    border-color: var(--wire-bright);
}

.btn-icon {
    background: none;
    color: var(--text-muted);
    border: 1px solid var(--wire);
    width: 26px;
    height: 26px;
    font-size: 0.92rem;
    font-family: var(--font-mono);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.btn-icon:hover {
    color: var(--red);
    border-color: var(--red-dim);
}

/* ══════════════════════════════════════
   INTENSITY WAVEFORM VISUALIZER
   ══════════════════════════════════════ */

.intensity-viz-container {
    position: relative;
    width: 100%;
    height: 28px;
    overflow: hidden;
    border-radius: 2px;
}

.intensity-viz-container canvas {
    display: block;
    width: 100%;
    height: 28px;
}

.intensity-viz-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    z-index: 1;
}

.intensity-viz-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.03) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.1) 100%
    );
    z-index: 2;
}

/* ══════════════════════════════════════
   CHAT CHANNEL
   ══════════════════════════════════════ */

.channel-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.channel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.15rem 1.15rem;
}

.channel-msg {
    margin-bottom: 1.25rem;
    font-size: 0.88rem;
    line-height: 1.75;
}

.channel-msg.user {
    color: var(--text-primary);
    padding-left: 0.75rem;
    border-left: 1px solid var(--wire-light);
}

.channel-msg.system {
    color: var(--text-secondary);
    padding-left: 0.75rem;
    border-left: 1px solid var(--red-dim);
}

.channel-msg .msg-label {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.channel-msg.system .msg-label {
    color: var(--red);
}

.channel-msg.intervention {
    border-left-color: var(--gold);
}

.channel-msg.intervention .msg-label {
    color: var(--gold);
}

.channel-msg.perspective-shift {
    border-left-color: var(--green-dim);
}

.channel-msg.perspective-shift .msg-label {
    color: var(--green);
}

/* Chat input */
.channel-input {
    display: flex;
    gap: 0;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--wire);
    flex-shrink: 0;
}

#channel-input {
    flex: 1;
    background: var(--bg-input);
    color: var(--text-primary);
    border: none;
    padding: 0.85rem 1.15rem;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    resize: none;
    outline: none;
    line-height: 1.5;
}

#channel-input::placeholder {
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 1px;
}

#channel-input:focus {
    background: var(--bg-elevated);
}

.btn-send {
    background: var(--bg-panel);
    color: var(--red);
    border: none;
    border-left: 1px solid var(--wire);
    padding: 0.85rem 1.15rem;
    font-size: 1.05rem;
    font-family: var(--font-mono);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-send:hover {
    background: var(--red-dim);
    color: var(--red-bright);
}

.btn-send:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

/* ══════════════════════════════════════
   LOADING
   ══════════════════════════════════════ */

.loading-indicator {
    display: inline-block;
    color: var(--red);
    font-size: 0.78rem;
    letter-spacing: 2px;
}

.loading-indicator::after {
    content: '';
    animation: loading-dots 1.5s steps(4, end) infinite;
}

@keyframes loading-dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* ══════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════ */

.btn-primary {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red-dim);
    padding: 0.7rem 2.5rem;
    font-size: 0.73rem;
    font-family: var(--font-mono);
    letter-spacing: 4px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--red-dim);
    border-color: var(--red);
    color: var(--red-bright);
}

/* ══════════════════════════════════════
   DIALOG
   ══════════════════════════════════════ */

dialog {
    background: var(--bg-panel);
    color: var(--text-primary);
    border: 1px solid var(--wire-light);
    padding: 2.5rem;
    max-width: 420px;
    width: 90%;
    font-family: var(--font-mono);
    margin: auto;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.85);
}

dialog h3 {
    font-family: var(--font-mono);
    font-size: 0.73rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 6px;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

dialog input[type="text"] {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--wire);
    border-top: none;
    border-right: none;
    border-left: none;
    padding: 0.6rem 0.75rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
    margin-bottom: 2rem;
}

dialog input[type="text"]::placeholder {
    color: var(--text-muted);
    font-size: 0.75rem;
}

dialog input[type="text"]:focus {
    border-bottom-color: var(--red);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ══════════════════════════════════════
   LIFECYCLE LABELS
   ══════════════════════════════════════ */

.lifecycle-label {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    padding: 0.18rem 0.55rem;
    font-family: var(--font-mono);
}

.lifecycle-molten {
    color: var(--red);
    border: 1px solid var(--red-dim);
}

.lifecycle-forged {
    color: var(--green);
    border: 1px solid var(--green-dim);
}

.lifecycle-fractured {
    color: var(--text-muted);
    border: 1px solid var(--wire);
    text-decoration: line-through;
}

.lifecycle-subsumed {
    color: var(--text-muted);
    border: 1px solid var(--wire);
    opacity: 0.4;
}

/* ══════════════════════════════════════
   PHASE-DRIVEN ACCENT COLORS
   The entire interface shifts with phase
   ══════════════════════════════════════ */

body[data-phase="dissolution"] {
    --phase-accent: var(--red);
    --phase-accent-bright: var(--red-bright);
    --phase-accent-dim: var(--red-dim);
}

body[data-phase="separation"] {
    --phase-accent: #cc6600;
    --phase-accent-bright: #ff8800;
    --phase-accent-dim: #663300;
}

body[data-phase="illumination"] {
    --phase-accent: #cc9900;
    --phase-accent-bright: #ffcc00;
    --phase-accent-dim: #665500;
}

body[data-phase="integration"] {
    --phase-accent: var(--green);
    --phase-accent-bright: var(--green-bright);
    --phase-accent-dim: var(--green-dim);
}

/* Apply phase accent */
body[data-phase] .phase-label {
    color: var(--phase-accent);
    transition: color 0.6s ease;
}

body[data-phase] #intensity-slider {
    accent-color: var(--phase-accent);
    transition: accent-color 0.6s ease;
}

body[data-phase] .channel-msg.system {
    border-left-color: var(--phase-accent-dim);
    transition: border-left-color 0.6s ease;
}

body[data-phase] .channel-msg.system .msg-label {
    color: var(--phase-accent);
    transition: color 0.6s ease;
}

body[data-phase] .doc-section h2 {
    color: var(--phase-accent);
    transition: color 0.6s ease;
}

body[data-phase] .doc-editable:focus {
    border-left-color: var(--phase-accent);
}

body[data-phase] .btn-send {
    color: var(--phase-accent);
}

body[data-phase] .btn-send:hover {
    background: var(--phase-accent-dim);
    color: var(--phase-accent-bright);
}

body[data-phase] .doc-header {
    border-bottom-color: var(--phase-accent-dim);
    transition: border-bottom-color 0.6s ease;
}

body[data-phase] .doc-list-item.tension {
    border-left-color: var(--phase-accent-dim);
}

/* ══════════════════════════════════════
   SCROLLBAR
   ══════════════════════════════════════ */

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: var(--wire-light); }
::-webkit-scrollbar-thumb:hover { background: var(--wire-bright); }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */

/* ══════════════════════════════════════
   VESSEL VISUALIZATION
   ══════════════════════════════════════ */

:root {
    --vessel-bg: #000;
    --vessel-accent: #4ecdc4;
    --vessel-gold: #d4af37;
}

.vessel-container {
    display: flex;
    flex-direction: column;
    background: var(--vessel-bg);
    border: 1px solid var(--wire);
    overflow: visible;
    position: fixed;
    top: 48px;
    right: 52%;
    left: auto;
    width: 280px;
    height: 280px;
    z-index: 100;
    border-radius: 3px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

.vessel-inactive {
    display: none !important;
}

.vessel-container.vessel-minimized-bar {
    height: auto !important;
    width: 200px !important;
}

.vessel-container.vessel-minimized-bar .vessel-canvas-container,
.vessel-container.vessel-minimized-bar .vessel-resize-handle {
    display: none;
}

.vessel-container.vessel-maximized {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    border: none;
}

.vessel-container.vessel-fullscreen {
    position: fixed;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 9999;
    border-radius: 0;
    border: none;
}

.vessel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.3rem 0.5rem;
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid var(--wire);
    flex-shrink: 0;
    z-index: 1;
    cursor: grab;
    user-select: none;
}

.vessel-header:active {
    cursor: grabbing;
}

.vessel-header-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.vessel-label {
    font-size: 0.5rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.vessel-phase-text {
    font-size: 0.5rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    transition: color 0.5s ease;
}

.vessel-window-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.vessel-ctrl {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--wire);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 1px;
    padding: 0;
}

.vessel-ctrl:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.vessel-resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    z-index: 2;
}

.vessel-resize-nw { top: -2px; left: -2px; cursor: nwse-resize; }
.vessel-resize-ne { top: -2px; right: -2px; cursor: nesw-resize; }
.vessel-resize-sw { bottom: -2px; left: -2px; cursor: nesw-resize; }
.vessel-resize-se { bottom: -2px; right: -2px; cursor: nwse-resize; }

.vessel-resize-se::after,
.vessel-resize-nw::after,
.vessel-resize-ne::after,
.vessel-resize-sw::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
}

.vessel-resize-se::after {
    bottom: 3px; right: 3px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
}

.vessel-resize-nw::after {
    top: 3px; left: 3px;
    border-left: 2px solid var(--text-muted);
    border-top: 2px solid var(--text-muted);
}

.vessel-resize-ne::after {
    top: 3px; right: 3px;
    border-right: 2px solid var(--text-muted);
    border-top: 2px solid var(--text-muted);
}

.vessel-resize-sw::after {
    bottom: 3px; left: 3px;
    border-left: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
}

.vessel-container.vessel-maximized .vessel-resize-handle,
.vessel-container.vessel-fullscreen .vessel-resize-handle {
    display: none;
}

.vessel-canvas-container {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: #000;
}

.vessel-canvas-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    /* width and height managed by JS inline styles — CSS percentages
       are unreliable for WebGL canvas display sizing */
}

.vessel-overlay {
    pointer-events: none;
    z-index: 1;
}

/* ══════════════════════════════════════
   SCROLL INDICATOR
   ══════════════════════════════════════ */

.scroll-indicator {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-panel);
    color: var(--phase-accent, var(--red));
    border: 1px solid var(--phase-accent-dim, var(--red-dim));
    padding: 0.2rem 0.8rem;
    font-size: 0.58rem;
    font-family: var(--font-mono);
    letter-spacing: 3px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.scroll-indicator:hover {
    background: var(--phase-accent-dim, var(--red-dim));
    color: var(--phase-accent-bright, var(--red-bright));
}

/* ══════════════════════════════════════
   INTENSITY TOOLTIP
   ══════════════════════════════════════ */

.metric[data-tooltip] {
    position: relative;
}

.metric[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-panel);
    color: var(--text-secondary);
    border: 1px solid var(--phase-accent-dim, var(--wire));
    padding: 0.3rem 0.6rem;
    font-size: 0.58rem;
    font-family: var(--font-mono);
    letter-spacing: 1px;
    white-space: nowrap;
    z-index: 20;
    pointer-events: none;
}

/* ══════════════════════════════════════
   CONTEXT WARNING BANNER
   ══════════════════════════════════════ */

.context-warning {
    padding: 0.4rem 1.15rem;
    font-size: 0.65rem;
    font-family: var(--font-mono);
    letter-spacing: 1px;
    color: var(--gold-bright);
    border-left: 3px solid var(--gold);
    background: var(--bg-panel);
    cursor: pointer;
    flex-shrink: 0;
}

.context-warning:hover {
    background: var(--bg-elevated);
}

.context-warning.warning-escalated {
    color: var(--red-bright);
    border-left-color: var(--red);
}

/* ══════════════════════════════════════
   MOVE LABEL BADGES
   ══════════════════════════════════════ */

.move-badge {
    display: inline-block;
    font-size: 0.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 0.08rem 0.4rem;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.move-badge.move-dissolve {
    color: var(--red-bright);
    border: 1px solid var(--red-dim);
}

.move-badge.move-separate {
    color: #cc6600;
    border: 1px solid #663300;
}


.move-badge.move-illuminate {
    color: #8844dd;
    border: 1px solid #331155;
}

.move-badge.move-integrate {
    color: var(--green);
    border: 1px solid var(--green-dim);
}

.move-badge.move-intervene {
    color: var(--gold-bright);
    border: 1px solid var(--gold);
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    height: 42px;
    padding: 0 10px;
    display: none;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
    border-top: 1px solid var(--wire);
}

body.in-workspace .site-footer {
    display: flex;
}

.footer-lockup {
    height: 100%;
    width: auto;
    display: block;
    opacity: 0.35;
    margin-right: 1.5rem;
    transition: opacity 0.3s ease;
}

.footer-lockup:hover {
    opacity: 0.6;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.footer-link {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.footer-link:visited {
    color: var(--text-muted);
}

.footer-link:hover {
    color: var(--phase-accent, var(--text-primary));
}

.footer-dot {
    color: var(--text-ghost);
    font-size: 0.55rem;
}

.footer-copy {
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 1px;
    color: var(--red-bright);
    margin-left: auto;
}

/* ══════════════════════════════════════
   MOBILE TAB BAR (base — hidden on desktop)
   ══════════════════════════════════════ */

.mobile-tab-bar {
    display: none;
    width: 100%;
    border-bottom: 1px solid var(--wire);
    background: var(--bg-panel);
    flex-shrink: 0;
}

.mobile-tab {
    flex: 1;
    background: none;
    color: var(--text-muted);
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.6rem 0;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.mobile-tab:hover {
    color: var(--text-secondary);
}

.mobile-tab.active {
    color: var(--phase-accent, var(--red));
    border-bottom-color: var(--phase-accent, var(--red));
}

/* ══════════════════════════════════════
   MOBILE VESSEL TOGGLE (base — hidden on desktop)
   ══════════════════════════════════════ */

.vessel-mobile-toggle-inline {
    display: none;
}

/* ══════════════════════════════════════
   RESPONSIVE: TABLET (601px – 900px)
   ══════════════════════════════════════ */

@media (max-width: 900px) and (min-width: 601px) {
    .workspace {
        flex-direction: column;
    }

    .document-pane {
        border-right: none;
        border-bottom: 1px solid var(--wire);
        max-height: 45vh;
        width: 100%;
    }

    .right-pane {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .vessel-container:not(.vessel-inactive) {
        width: 220px !important;
        height: 220px !important;
        top: auto !important;
        bottom: 52px !important;
        right: 10px !important;
        left: auto !important;
    }

    .controls-metrics {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .control-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.35rem;
    }

    .welcome-content h1 {
        font-size: 7rem;
    }

    .welcome-lockup-link {
        bottom: 1rem;
        left: 1rem;
    }

    .welcome-lockup {
        height: 42px;
    }

    .document-scroll {
        padding: 1.5rem;
    }

    .site-footer {
        padding: 0 8px;
    }

    .footer-lockup {
        height: 28px;
        margin-right: 0.75rem;
    }
}

/* ══════════════════════════════════════
   RESPONSIVE: PHONE (≤600px)
   Tab-based layout, vessel collapsed
   ══════════════════════════════════════ */

@media (max-width: 600px) {

    /* --- Body: flex column so workspace + footer stack --- */
    html, body {
        overflow: auto;
    }

    body {
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
    }

    /* --- Hide welcome/auth from flow when workspace is active --- */
    .welcome.hidden, .auth-overlay.hidden {
        display: none;
    }

    /* --- Tab bar visible --- */
    .mobile-tab-bar {
        display: flex;
    }

    /* --- Workspace: vertical, fills remaining space --- */
    .workspace {
        flex-direction: column;
        flex: 1;
        height: auto;
    }

    /* --- Pane switching via CSS class toggles --- */
    .workspace.tab-document .document-pane {
        display: flex;
        flex: 1;
        width: 100%;
        border-right: none;
        border-bottom: none;
        max-height: none;
        min-height: 0;
    }
    .workspace.tab-document .right-pane {
        display: none;
    }

    .workspace.tab-channel .document-pane {
        display: none;
    }
    .workspace.tab-channel .right-pane {
        display: flex;
        flex: 1;
        width: 100%;
        min-height: 0;
    }

    /* --- Document pane phone --- */
    .doc-header {
        padding: 0.4rem 0.75rem;
    }

    .doc-header-brand {
        gap: 0.4rem;
    }

    .doc-header-sigil {
        height: 2.2rem;
        width: 2.2rem;
    }

    .doc-header-foyl {
        font-size: 2.2rem;
    }

    .document-scroll {
        padding: 1rem;
    }

    .document-content {
        max-width: 100%;
    }

    .doc-section h1 {
        font-size: 1.1rem;
    }

    .doc-section h2 {
        font-size: 0.58rem;
        letter-spacing: 3px;
    }

    .doc-body {
        font-size: 0.85rem;
        line-height: 1.75;
    }

    .doc-list-item {
        font-size: 0.82rem;
        padding: 0.3rem 0 0.3rem 0.6rem;
    }

    .doc-article-title {
        font-size: 1.2rem;
    }

    .doc-article-body {
        font-size: 0.85rem;
        line-height: 1.85;
    }

    /* --- Controls bar phone --- */
    .controls-bar {
        padding: 0.4rem 0.6rem;
    }

    .controls-row {
        gap: 0.4rem;
    }

    .controls-row:first-child {
        flex-wrap: wrap;
    }

    .control-group {
        gap: 0.25rem;
    }

    .control-label {
        font-size: 0.5rem;
        letter-spacing: 2px;
    }

    select {
        font-size: 0.65rem;
        padding: 0.3rem 0.4rem;
    }

    .phase-label {
        font-size: 0.6rem;
        letter-spacing: 2px;
    }

    .controls-metrics {
        flex-wrap: wrap;
        gap: 0.4rem 0.6rem;
    }

    .metric {
        flex-shrink: 0;
    }

    .metric-label {
        font-size: 0.5rem;
        letter-spacing: 1px;
    }

    .metric-value {
        font-size: 0.65rem;
    }

    #intensity-slider {
        width: 50px;
    }

    .control-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
        gap: 0.25rem;
    }

    .btn-action {
        font-size: 0.58rem;
        padding: 0.2rem 0.4rem;
        letter-spacing: 1px;
    }

    .btn-icon {
        width: 24px;
        height: 24px;
        font-size: 0.82rem;
    }

    .intensity-viz-container {
        height: 20px;
    }

    .intensity-viz-container canvas {
        height: 20px;
    }

    /* --- Chat channel phone --- */
    .channel-messages {
        padding: 0.75rem;
    }

    .channel-msg {
        font-size: 0.82rem;
        line-height: 1.65;
        margin-bottom: 1rem;
    }

    .channel-msg .msg-label {
        font-size: 0.5rem;
    }

    #channel-input {
        padding: 0.65rem 0.75rem;
        font-size: 0.82rem;
    }

    #channel-input::placeholder {
        font-size: 0.7rem;
    }

    .btn-send {
        padding: 0.65rem 0.85rem;
        font-size: 0.92rem;
    }

    /* --- Vessel: collapsed by default, no drag/resize --- */
    .vessel-container:not(.vessel-inactive) {
        position: fixed !important;
        bottom: 46px !important;
        left: 10px !important;
        right: 10px !important;
        top: auto !important;
        width: auto !important;
        height: auto !important;
        z-index: 100;
        border-radius: 2px;
    }

    .vessel-container:not(.vessel-inactive):not(.vessel-mobile-expanded) .vessel-canvas-container {
        display: none;
    }

    .vessel-container:not(.vessel-inactive):not(.vessel-mobile-expanded) .vessel-resize-handle {
        display: none;
    }

    .vessel-container.vessel-mobile-expanded {
        height: 260px !important;
    }

    .vessel-container.vessel-mobile-hidden {
        display: none !important;
    }

    .vessel-resize-handle {
        display: none !important;
    }

    .vessel-header {
        cursor: default;
    }

    .vessel-mobile-toggle-inline:not(.hidden) {
        display: inline-block;
    }

    /* --- Welcome screen phone --- */
    .welcome-content h1 {
        font-size: clamp(3.5rem, 18vw, 10.5rem);
    }

    .welcome-tagline {
        font-size: 0.9rem;
        padding: 0 1rem;
    }

    .welcome-content {
        max-width: 90vw;
        padding: 0 1rem;
    }

    .welcome-lockup-link {
        bottom: 0.75rem;
        left: 0.75rem;
    }

    .welcome-lockup {
        height: 36px;
    }

    .welcome-shortcuts {
        display: none;
    }

    .btn-primary {
        padding: 0.6rem 2rem;
        font-size: 0.68rem;
        letter-spacing: 3px;
    }

    /* --- Auth box phone --- */
    .auth-box {
        width: 90vw;
        max-width: 320px;
    }

    .auth-box h2 {
        font-size: 0.68rem;
        letter-spacing: 4px;
    }

    .auth-box input[type="email"],
    .auth-box input[type="password"] {
        font-size: 16px;
    }

    /* --- Dialog phone --- */
    dialog {
        width: 92vw;
        max-width: 420px;
        padding: 1.5rem;
    }

    dialog h3 {
        font-size: 0.68rem;
        letter-spacing: 4px;
        margin-bottom: 1.5rem;
    }

    dialog input[type="text"] {
        font-size: 16px;
    }

    /* --- Footer phone: flow instead of fixed --- */
    .site-footer {
        position: static;
        height: 38px;
        padding: 0 6px;
        flex-shrink: 0;
    }

    .footer-lockup {
        height: 24px;
        margin-right: 0.5rem;
    }

    .footer-link {
        font-size: 0.48rem;
        letter-spacing: 1px;
    }

    .footer-dot {
        font-size: 0.48rem;
    }

    .footer-copy {
        font-size: 0.48rem;
    }

    /* --- Scroll indicator phone --- */
    .scroll-indicator {
        bottom: 55px;
        font-size: 0.5rem;
        padding: 0.15rem 0.6rem;
    }

    .move-badge {
        font-size: 0.45rem;
        letter-spacing: 1px;
        padding: 0.05rem 0.3rem;
    }

    .context-warning {
        font-size: 0.58rem;
        padding: 0.35rem 0.75rem;
    }
}

/* ══════════════════════════════════════
   RESPONSIVE: EXTRA SMALL PHONE (≤360px)
   ══════════════════════════════════════ */

/* ══════════════════════════════════════
   ONBOARDING PULSE
   ══════════════════════════════════════ */

@keyframes onboarding-pulse {
    0%, 100% { border-color: var(--wire); box-shadow: none; }
    50% { border-color: var(--phase-accent, var(--red)); box-shadow: 0 0 8px var(--phase-accent-dim, var(--red-dim)); }
}

.onboarding-pulse {
    animation: onboarding-pulse 2s ease-in-out infinite;
    border: 1px solid var(--wire);
}

.btn-action.onboarding-pulse {
    animation: onboarding-pulse 2s ease-in-out infinite;
}

/* ══════════════════════════════════════
   FORGE PROGRESS INDICATOR
   ══════════════════════════════════════ */

.forge-progress {
    font-size: 0.55rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
    padding: 0.15rem 0.5rem;
    border: 1px solid var(--wire);
}

.forge-progress.forge-ready {
    color: var(--green);
    border-color: var(--green-dim);
    animation: onboarding-pulse 2s ease-in-out infinite;
}

/* ══════════════════════════════════════
   WELCOME AUTH BUTTONS
   ══════════════════════════════════════ */

.welcome-content .btn-primary,
.welcome-auth-actions {
    width: 100%;
    max-width: 240px;
}

.welcome-auth-actions {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 0;
    margin: 1.25rem auto 0;
}

.welcome-auth-btn {
    flex: 1;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 0.7rem 0;
    font-size: 0.6rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-align: center;
}

.welcome-auth-btn:first-child {
    border-right: none;
}

.welcome-auth-btn:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.05);
}

/* ══════════════════════════════════════
   TRY EXAMPLE BUTTON
   ══════════════════════════════════════ */

.welcome-secondary-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.welcome-try-example {
    display: block;
    color: var(--text-muted);
    border-color: var(--wire);
    padding: 0.5rem 1.5rem;
    font-size: 0.65rem;
    letter-spacing: 3px;
}

.welcome-try-example:hover {
    color: var(--text-secondary);
    border-color: var(--wire-bright);
}

/* ══════════════════════════════════════
   UPGRADE BANNER
   ══════════════════════════════════════ */

.upgrade-banner {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 8000;
    background: var(--bg-panel);
    border: 1px solid var(--gold);
    padding: 1rem 1.5rem;
    max-width: 500px;
    width: 90%;
    animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

.upgrade-banner-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    text-align: center;
}

.upgrade-banner-text {
    font-size: 0.73rem;
    letter-spacing: 1px;
    color: var(--gold-bright);
    line-height: 1.6;
}

.upgrade-banner-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.upgrade-banner-btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.63rem;
    letter-spacing: 3px;
}

.upgrade-banner-dismiss {
    font-size: 0.58rem;
    padding: 0.25rem 0.5rem;
}

/* ══════════════════════════════════════
   TIER-LOCKED FEATURE
   ══════════════════════════════════════ */

.tier-locked {
    opacity: 0.3;
    position: relative;
    cursor: not-allowed;
}

.tier-locked::after {
    content: '🔒';
    font-size: 0.5rem;
    position: absolute;
    top: -2px;
    right: -2px;
}

.tier-locked:hover {
    opacity: 0.5;
}

/* ══════════════════════════════════════
   PWA INSTALL BANNER
   ══════════════════════════════════════ */

.install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 8500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.6rem 1rem;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--wire-light);
    font-size: 0.68rem;
    letter-spacing: 1px;
    color: var(--text-secondary);
    animation: slide-down 0.3s ease-out;
}

@keyframes slide-down {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.install-btn {
    padding: 0.35rem 1rem;
    font-size: 0.6rem;
}

.install-dismiss {
    font-size: 0.55rem;
    padding: 0.2rem 0.4rem;
}

/* ══════════════════════════════════════
   CONCEPT GRAPH PANEL
   ══════════════════════════════════════ */

.concept-panel {
    position: fixed;
    top: 48px;
    left: 10px;
    width: 520px;
    height: 540px;
    z-index: 200;
    background: var(--bg-surface);
    border: 1px solid var(--wire);
    border-radius: 3px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.concept-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    background: rgba(0, 0, 0, 0.9);
    border-bottom: 1px solid var(--wire);
    flex-shrink: 0;
    cursor: grab;
    user-select: none;
}

.concept-panel-header:active {
    cursor: grabbing;
}

.concept-panel-header-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.concept-panel-label {
    font-size: 0.5rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.concept-panel-tabs {
    display: flex;
    gap: 2px;
}

.concept-tab {
    background: none;
    border: 1px solid var(--wire);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.5rem;
    letter-spacing: 2px;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.15s;
}

.concept-tab:hover {
    color: var(--text-secondary);
    border-color: var(--wire-bright);
}

.concept-tab.active {
    color: var(--phase-accent, var(--red));
    border-color: var(--phase-accent-dim, var(--red-dim));
}

.concept-window-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.concept-ctrl {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--wire);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 1px;
    padding: 0;
}

.concept-ctrl:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Minimized: header-only bar */
.concept-panel.concept-minimized {
    height: auto !important;
    width: 280px !important;
}

.concept-panel.concept-minimized .concept-panel-search,
.concept-panel.concept-minimized .concept-tab-content,
.concept-panel.concept-minimized .concept-detail,
.concept-panel.concept-minimized .concept-resize-handle,
.concept-panel.concept-minimized .concept-legend {
    display: none;
}

/* Maximized: fill viewport */
.concept-panel.concept-maximized {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    border: none;
}

/* Fullscreen: above everything */
.concept-panel.concept-fullscreen {
    position: fixed;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    z-index: 9999;
    border-radius: 0;
    border: none;
}

/* Hide resize handles when maximized/fullscreen */
.concept-panel.concept-maximized .concept-resize-handle,
.concept-panel.concept-fullscreen .concept-resize-handle {
    display: none;
}

/* Resize handles */
.concept-resize-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    z-index: 2;
}

.concept-resize-nw { top: -2px; left: -2px; cursor: nwse-resize; }
.concept-resize-ne { top: -2px; right: -2px; cursor: nesw-resize; }
.concept-resize-sw { bottom: -2px; left: -2px; cursor: nesw-resize; }
.concept-resize-se { bottom: -2px; right: -2px; cursor: nwse-resize; }

.concept-resize-se::after,
.concept-resize-nw::after,
.concept-resize-ne::after,
.concept-resize-sw::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
}

.concept-resize-se::after {
    bottom: 3px; right: 3px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
}

.concept-resize-nw::after {
    top: 3px; left: 3px;
    border-left: 2px solid var(--text-muted);
    border-top: 2px solid var(--text-muted);
}

.concept-resize-ne::after {
    top: 3px; right: 3px;
    border-right: 2px solid var(--text-muted);
    border-top: 2px solid var(--text-muted);
}

.concept-resize-sw::after {
    bottom: 3px; left: 3px;
    border-left: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
}

/* Legend overlay */
.concept-legend {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.88);
    border: 1px solid var(--wire);
    border-radius: 2px;
    padding: 0.5rem 0.6rem;
    z-index: 10;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-muted);
    max-width: 180px;
}

.concept-legend-title {
    font-size: 0.5rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.concept-legend-section {
    margin-bottom: 0.4rem;
}

.concept-legend-section:last-child {
    margin-bottom: 0;
}

.concept-legend-subtitle {
    font-size: 0.45rem;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    opacity: 0.7;
}

.concept-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 1px 0;
}

.concept-legend-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid;
    flex-shrink: 0;
}

.concept-legend-line {
    display: inline-block;
    width: 16px;
    height: 2px;
    flex-shrink: 0;
}

.concept-legend-line-dashed {
    height: 0;
}

.concept-legend-size-note {
    font-size: 0.5rem;
    font-style: italic;
    opacity: 0.6;
    padding-top: 2px;
}

.concept-panel-search {
    padding: 0.3rem 0.6rem;
    border-bottom: 1px solid var(--wire);
    flex-shrink: 0;
}

.concept-panel-search input {
    width: 100%;
    background: var(--bg-input);
    color: var(--text-primary);
    border: none;
    border-bottom: 1px solid var(--wire);
    padding: 0.3rem 0;
    font-family: var(--font-mono);
    font-size: 0.73rem;
    outline: none;
}

.concept-panel-search input::placeholder {
    color: var(--text-muted);
    font-size: 0.65rem;
}

.concept-panel-search input:focus {
    border-bottom-color: var(--phase-accent, var(--red));
}

.concept-tab-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.concept-graph-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-void);
}

.concept-graph-container svg {
    display: block;
    width: 100%;
    height: 100%;
}

.concept-list-container {
    overflow-y: auto;
    height: 100%;
    padding: 0.5rem;
}

.concept-insights-container {
    overflow-y: auto;
    height: 100%;
    padding: 0.75rem;
}

.concept-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.73rem;
    letter-spacing: 1px;
}

/* -- Concept list items -- */

.concept-list-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--wire);
    cursor: pointer;
    transition: background 0.1s;
}

.concept-list-item:hover {
    background: var(--bg-elevated);
}

.concept-list-name {
    flex: 1;
    font-size: 0.78rem;
    color: var(--text-primary);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.concept-list-freq {
    font-size: 0.65rem;
    color: var(--green);
    font-family: var(--font-mono);
    min-width: 1.5rem;
    text-align: right;
}

.concept-list-meta {
    display: flex;
    gap: 0.3rem;
    font-size: 0.55rem;
    font-family: var(--font-mono);
}

/* -- Concept detail slide-in -- */

.concept-detail {
    position: absolute;
    top: 0;
    right: 0;
    width: 220px;
    height: 100%;
    background: var(--bg-panel);
    border-left: 1px solid var(--wire);
    overflow-y: auto;
    z-index: 5;
    padding: 0.75rem;
}

.concept-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.concept-detail-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
    flex: 1;
}

.concept-detail-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.concept-detail-close:hover {
    color: var(--text-primary);
}

.concept-detail-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.concept-detail-stats {
    display: flex;
    gap: 0.5rem;
    font-size: 0.55rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.concept-detail-section {
    margin-bottom: 0.75rem;
}

.concept-detail-section-label {
    font-size: 0.5rem;
    letter-spacing: 3px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid var(--wire);
    padding-bottom: 0.2rem;
}

.concept-detail-conn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0;
    font-size: 0.65rem;
}

.concept-detail-conn-type {
    font-size: 0.5rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    min-width: 60px;
}

.concept-detail-conn-name {
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.concept-detail-conn-weight {
    color: var(--text-muted);
    font-size: 0.5rem;
}

.concept-detail-appear {
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--wire);
}

.concept-detail-appear-role {
    font-size: 0.48rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    display: inline-block;
    padding: 0.05rem 0.3rem;
    margin-right: 0.3rem;
    border: 1px solid;
}

.concept-detail-appear-text {
    font-size: 0.65rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.concept-detail-loading {
    text-align: center;
    padding: 2rem 0;
    color: var(--text-muted);
    font-size: 0.7rem;
}

.concept-detail-empty {
    font-size: 0.65rem;
    color: var(--text-muted);
    padding: 0.25rem 0;
}

/* -- Concept role colors -- */

.concept-role-introduced {
    color: var(--text-secondary);
    border-color: var(--wire-bright);
}

.concept-role-engaged {
    color: var(--text-primary);
    border-color: var(--wire-bright);
}

.concept-role-challenged {
    color: var(--red-bright);
    border-color: var(--red-dim);
}

.concept-role-synthesized {
    color: #cc6600;
    border-color: #663300;
}

/* -- Concept pills on messages -- */

.concept-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.4rem;
}

.concept-pill {
    display: inline-block;
    font-size: 0.48rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 0.06rem 0.35rem;
    border: 1px solid var(--wire);
    color: var(--text-muted);
    cursor: default;
    transition: all 0.15s;
}

.concept-pill:hover {
    color: var(--text-secondary);
    border-color: var(--wire-bright);
}

.concept-pill.concept-role-challenged {
    border-color: var(--red-dim);
    color: var(--red);
}

.concept-pill.concept-role-synthesized {
    border-color: #663300;
    color: #cc6600;
}

.concept-pill.concept-role-introduced {
    border-color: var(--wire-light);
    color: var(--text-muted);
}

/* -- Concept insight sections -- */

.concept-insight-section {
    margin-bottom: 1rem;
}

.concept-insight-label {
    font-size: 0.5rem;
    letter-spacing: 3px;
    color: var(--phase-accent, var(--red));
    text-transform: uppercase;
    margin-bottom: 0.35rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--wire);
}

.concept-insight-item {
    font-size: 0.73rem;
    color: var(--text-secondary);
    padding: 0.25rem 0 0.25rem 0.5rem;
    border-left: 1px solid var(--wire-light);
    margin-bottom: 0.15rem;
}

.concept-insight-stat {
    font-size: 0.55rem;
    color: var(--text-muted);
    margin-left: 0.3rem;
}

.concept-insight-strength {
    border-left-color: var(--green-dim);
}

.concept-insight-blind {
    border-left-color: var(--red-dim);
}

.concept-insight-challenged {
    border-left-color: #663300;
}

.concept-insight-isolated {
    border-left-color: var(--wire);
    color: var(--text-muted);
}

/* -- Concept panel responsive -- */

@media (max-width: 900px) and (min-width: 601px) {
    .concept-panel {
        width: 420px;
        height: 440px;
    }
}

@media (max-width: 600px) {
    .concept-panel {
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0;
        border: none;
        z-index: 9000;
    }

    .concept-detail {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--wire);
        position: absolute;
        top: auto;
        bottom: 0;
        height: 50%;
    }
}

/* ══════════════════════════════════════
   PRICING PAGE
   ══════════════════════════════════════ */

.pricing-page {
    min-height: 100vh;
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-mono);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 1.5rem;
}

.pricing-header {
    text-align: center;
    margin-bottom: 3rem;
}

.pricing-header h1 {
    font-family: "sabbath-black", serif;
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.pricing-header p {
    font-size: 0.73rem;
    letter-spacing: 4px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.pricing-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.pricing-toggle-switch {
    width: 40px;
    height: 20px;
    background: var(--wire);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: background 0.3s;
}

.pricing-toggle-switch.active {
    background: var(--red-dim);
}

.pricing-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: transform 0.3s;
}

.pricing-toggle-switch.active::after {
    transform: translateX(20px);
}

.pricing-save-badge {
    font-size: 0.55rem;
    color: var(--green);
    border: 1px solid var(--green-dim);
    padding: 0.1rem 0.4rem;
    letter-spacing: 2px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 960px;
    width: 100%;
}

.pricing-card {
    background: var(--bg-surface);
    border: 1px solid var(--wire);
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s;
}

.pricing-card:hover {
    border-color: var(--wire-bright);
}

.pricing-card.featured {
    border-color: var(--red-dim);
    position: relative;
}

.pricing-card.featured::before {
    content: 'MOST POPULAR';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--red);
    color: var(--bg-void);
    font-size: 0.5rem;
    letter-spacing: 3px;
    padding: 0.2rem 0.8rem;
    white-space: nowrap;
}

.pricing-tier-name {
    font-size: 0.65rem;
    letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.pricing-price .currency {
    font-size: 1.2rem;
    vertical-align: super;
    color: var(--text-secondary);
}

.pricing-price .period {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.pricing-price-free {
    font-size: 1.5rem;
    letter-spacing: 3px;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.pricing-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    min-height: 2.5rem;
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
    flex: 1;
}

.pricing-features li {
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--wire);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.5px;
}

.pricing-features li::before {
    content: '—';
    color: var(--text-muted);
    flex-shrink: 0;
}

.pricing-card.featured .pricing-features li::before {
    content: '—';
    color: var(--red);
}

.pricing-cta {
    width: 100%;
    text-align: center;
}

.pricing-cta .btn-primary {
    width: 100%;
}

.pricing-card.featured .pricing-cta .btn-primary {
    background: var(--red-dim);
    border-color: var(--red);
    color: var(--red-bright);
}

.pricing-social-proof {
    margin-top: 3rem;
    text-align: center;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.pricing-back {
    margin-top: 2rem;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
}

.pricing-back:hover {
    color: var(--text-secondary);
}

/* ══════════════════════════════════════
   LIBRARY OVERLAY
   ══════════════════════════════════════ */

.library-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8000;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.library-panel {
    background: var(--bg-surface);
    border: 1px solid var(--wire);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.library-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--wire);
}

.library-header h2 {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.library-grid {
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.library-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.library-card {
    background: var(--bg-panel);
    border: 1px solid var(--wire);
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: border-color 0.2s;
}

.library-card:hover {
    border-color: var(--wire-bright);
}

.library-card-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
    font-weight: 500;
}

.library-card-thesis {
    font-size: 0.73rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.library-card-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.58rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.library-card-actions {
    display: flex;
    gap: 0.35rem;
}

/* ══════════════════════════════════════
   CONNECTION CARD
   ══════════════════════════════════════ */

.connection-card {
    padding: 0.6rem 1rem;
    border-left: 3px solid var(--gold);
    background: var(--bg-panel);
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}

.connection-card-label {
    font-size: 0.5rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--gold-bright);
    margin-bottom: 0.3rem;
}

.connection-card-text {
    font-size: 0.73rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.3rem;
}

.connection-card-text strong {
    color: var(--text-primary);
}

.connection-card-concepts {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 0.4rem;
}

@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }

    .pricing-header h1 {
        font-size: 2.5rem;
    }

    .pricing-page {
        padding: 2rem 1rem;
    }
}

@media (max-width: 360px) {
    .welcome-content h1 {
        font-size: 3rem;
    }

    .doc-header-foyl {
        font-size: 1.8rem;
    }

    .doc-header-sigil {
        height: 1.8rem;
        width: 1.8rem;
    }

    .controls-row:first-child {
        gap: 0.25rem;
    }

    .control-actions .btn-action {
        font-size: 0.52rem;
        padding: 0.18rem 0.3rem;
    }
}
