/* =========================================================
   CIPHER SQL Console
   Responsive terminal layout / index-aligned visual system
========================================================= */

:root {
    --page-bg: #020617;
    --page-bg-soft: #071120;
    --panel-bg: rgba(7, 17, 32, 0.98);
    --panel-bg-deep: rgba(2, 6, 23, 0.99);

    --line: rgba(96, 165, 250, 0.30);
    --line-strong: rgba(56, 189, 248, 0.68);
    --line-soft: rgba(148, 163, 184, 0.17);

    --text: #e5edf7;
    --text-soft: #bdc9d8;
    --muted: #74869c;

    --cyan: #38bdf8;
    --cyan-soft: #7dd3fc;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --green: #22c55e;
    --red: #ef4444;
    --purple: #7c3aed;
    --yellow: #f59e0b;

    --header-height: 64px;
    --side-width: 370px;
    --terminal-font:
        Consolas,
        "Cascadia Mono",
        "SFMono-Regular",
        "Liberation Mono",
        monospace;

    --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-width: 0;
    min-height: 100%;
}

[hidden] {
    display: none !important;
}

button,
input,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.console-page {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background:
        radial-gradient(circle at 14% 4%, rgba(56, 189, 248, 0.13), transparent 26%),
        radial-gradient(circle at 90% 12%, rgba(37, 99, 235, 0.18), transparent 28%),
        linear-gradient(180deg, var(--page-bg) 0%, #0b1424 52%, var(--page-bg) 100%);
    color: var(--text);
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 16px;
    line-height: 1.7;
    overflow: hidden;
}

.console-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 96%);
    pointer-events: none;
}

/* =========================================================
   Header
========================================================= */

.entry-header {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    display: flex;
    width: 100%;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(3, 7, 18, 0.84);
    backdrop-filter: blur(14px);
}

.entry-logo {
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.18em;
}

.entry-nav {
    display: flex;
    gap: 24px;
}

.entry-nav a {
    color: rgba(226, 232, 240, 0.68);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.entry-nav a:hover,
.entry-nav a.active,
.entry-nav a:focus-visible {
    color: var(--cyan);
}

/* =========================================================
   Main layout
========================================================= */

.console-layout {
    width: 100%;
    height: calc(100vh - var(--header-height));
    margin-top: var(--header-height);
    height: calc(100dvh - var(--header-height));
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--side-width);
    gap: 0;
    overflow: hidden;
}

.console-workspace,
.console-side {
    min-width: 0;
    min-height: 0;
}

.console-workspace {
    border-right: 1px solid var(--line);
}

.console-side {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    background: rgba(2, 6, 23, 0.78);
}

/* =========================================================
   Terminal shell
========================================================= */

.terminal-window {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: 50px minmax(0, 1fr) auto;
    background:
        linear-gradient(180deg, rgba(7, 17, 32, 0.99), rgba(3, 7, 18, 0.995));
    overflow: hidden;
}

.terminal-window::before,
.cipher-panel::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 4;
    width: 5px;
    background: var(--blue);
    box-shadow: 0 0 18px rgba(37, 99, 235, 0.42);
    pointer-events: none;
}

.terminal-titlebar {
    min-width: 0;
    padding: 0 14px 0 18px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--line-soft);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.19), transparent 48%),
        rgba(15, 23, 42, 0.98);
}

.terminal-controls {
    display: flex;
    gap: 7px;
}

.terminal-controls span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #475569;
}

.terminal-controls span:nth-child(1) { background: var(--red); }
.terminal-controls span:nth-child(2) { background: var(--yellow); }
.terminal-controls span:nth-child(3) { background: var(--green); }

.terminal-title {
    min-width: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #8799ae;
    font-family: var(--terminal-font);
    font-size: 12px;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
}

.terminal-title strong {
    color: #dcecff;
    font-size: 13px;
}

.terminal-title span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.terminal-title-button {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.74);
    color: #93a4b8;
    font-family: var(--terminal-font);
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}

.terminal-title-button:hover,
.terminal-title-button:focus-visible {
    border-color: rgba(56, 189, 248, 0.62);
    color: #e0f2fe;
}

.terminal-scroll {
    min-width: 0;
    min-height: 0;
    padding: 22px 24px 34px 28px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-color: rgba(56, 189, 248, 0.35) transparent;
}

.terminal-scroll::-webkit-scrollbar,
.cipher-chat-list::-webkit-scrollbar,
.terminal-composer::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.terminal-scroll::-webkit-scrollbar-thumb,
.cipher-chat-list::-webkit-scrollbar-thumb,
.terminal-composer::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.28);
}

.terminal-history {
    min-width: 0;
}

.terminal-entry {
    min-width: 0;
    margin: 0 0 25px;
    padding: 0 0 25px;
    border-bottom: 1px dashed rgba(56, 189, 248, 0.16);
    font-family: var(--terminal-font);
}

.terminal-entry:last-child {
    margin-bottom: 0;
}

.terminal-entry-system {
    color: #aebfd1;
}

.psql-startup-message {
    font-family: var(--terminal-font);
    font-size: 14px;
    line-height: 1.8;
}

.psql-startup-message p {
    margin: 0;
}

.psql-startup-message p + p {
    margin-top: 2px;
}

.psql-startup-message code,
.terminal-entry code {
    color: var(--cyan-soft);
    font-family: inherit;
}

.terminal-entry-line,
.terminal-command-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.terminal-entry-line {
    margin-bottom: 8px;
}

.terminal-command-header {
    min-height: 18px;
    margin-bottom: 5px;
}

.terminal-system-label {
    color: var(--cyan-soft);
    font-weight: 900;
    letter-spacing: 0.09em;
}

.terminal-command {
    margin: 0 0 13px;
}

.terminal-command pre {
    margin: 0;
    color: #e3edf8;
    font-family: var(--terminal-font);
    font-size: 15px;
    line-height: 1.75;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.terminal-response {
    min-width: 0;
}

.terminal-loading,
.psql-row-count {
    color: #8ea2b9;
    font-family: var(--terminal-font);
    font-size: 13px;
}

.terminal-error {
    color: #fca5a5;
    font-family: var(--terminal-font);
    font-size: 14px;
    line-height: 1.7;
}

.psql-row-count {
    margin-top: 8px;
}

.terminal-table-wrap {
    max-width: 100%;
    max-height: 440px;
    overflow: auto;
    border: 1px solid rgba(56, 189, 248, 0.18);
    background: rgba(2, 6, 23, 0.58);
}

.terminal-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: var(--terminal-font);
    font-size: 13px;
}

.terminal-table th,
.terminal-table td {
    min-width: 110px;
    max-width: 430px;
    padding: 9px 11px;
    border-right: 1px solid rgba(56, 189, 248, 0.14);
    border-bottom: 1px solid rgba(56, 189, 248, 0.12);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.terminal-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #10223a;
    color: #d8efff;
    font-weight: 900;
    white-space: nowrap;
}

.terminal-table td {
    background: rgba(3, 7, 18, 0.96);
    color: #ced9e6;
    line-height: 1.65;
}

.terminal-table tr:nth-child(even) td {
    background: rgba(8, 18, 34, 0.96);
}

.terminal-table tr:hover td {
    background: rgba(17, 46, 76, 0.92);
}

.terminal-null {
    color: #687c94;
    font-style: italic;
}

/* =========================================================
   Composer
========================================================= */

.terminal-composer {
    position: relative;
    max-height: 48vh;
    padding: 14px 20px 15px 24px;
    border-top: 1px solid rgba(56, 189, 248, 0.29);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.09), transparent 50%),
        rgba(5, 12, 24, 0.99);
    box-shadow: 0 -14px 34px rgba(0, 0, 0, 0.28);
    overflow-y: auto;
}

.terminal-composer::before {
    content: "PSQL";
    position: absolute;
    top: 7px;
    right: 20px;
    color: rgba(56, 189, 248, 0.10);
    font-family: var(--terminal-font);
    font-size: 31px;
    font-weight: 950;
    pointer-events: none;
}

.psql-input-row {
    position: relative;
    z-index: 1;
}

#sql {
    width: 100%;
    min-height: 72px;
    max-height: 180px;
    padding: 12px 13px;
    border: 1px solid rgba(56, 189, 248, 0.31);
    background: rgba(2, 6, 23, 0.78);
    color: #e0f2fe;
    font-family: var(--terminal-font);
    font-size: 15px;
    line-height: 1.7;
    resize: none;
}

#sql::placeholder {
    color: #536a83;
}

#sql:focus {
    outline: 0;
    border-color: rgba(56, 189, 248, 0.88);
    box-shadow:
        0 0 0 3px rgba(56, 189, 248, 0.10),
        inset 0 0 24px rgba(0, 0, 0, 0.16);
}

.terminal-command-bar {
    position: relative;
    z-index: 1;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.terminal-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #6f8298;
    font-family: var(--terminal-font);
    font-size: 11px;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-buttons button {
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(30, 41, 59, 0.83);
    color: #d0d9e5;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.terminal-buttons button:hover,
.terminal-buttons button:focus-visible {
    border-color: rgba(56, 189, 248, 0.60);
    color: #ffffff;
}

#run {
    min-width: 96px;
    border-color: var(--blue);
    background: var(--blue);
    color: #ffffff;
    box-shadow: 5px 5px 0 rgba(2, 6, 23, 0.72);
}

#run:hover,
#run:focus-visible {
    background: var(--blue-dark);
    transform: translate(-1px, -1px);
}

#run:disabled {
    opacity: 0.56;
    transform: none;
    box-shadow: none;
    cursor: wait;
}

/* =========================================================
   Table reference
========================================================= */

.terminal-reference {
    position: relative;
    z-index: 1;
    margin-top: 10px;
    border-top: 1px dashed rgba(148, 163, 184, 0.17);
}

.terminal-reference summary {
    padding-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #9daec1;
    font-family: var(--terminal-font);
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.terminal-reference summary small {
    color: #61758d;
    font-size: 10px;
    white-space: nowrap;
}

.terminal-reference ul {
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    list-style: none;
}

.terminal-reference li {
    min-width: 0;
}

.table-copy-button {
    width: 100%;
    min-height: 38px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    background: rgba(15, 23, 42, 0.54);
    color: #b8c8da;
    font-family: var(--terminal-font);
    font-size: 11px;
    text-align: left;
    cursor: pointer;
}

.table-copy-button code {
    min-width: 0;
    color: inherit;
    font: inherit;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.table-copy-action {
    flex: 0 0 auto;
    color: #62768e;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.table-copy-button:hover,
.table-copy-button:focus-visible {
    border-color: rgba(56, 189, 248, 0.62);
    background: rgba(37, 99, 235, 0.12);
    color: #e0f2fe;
}

.table-copy-button.is-copied {
    border-color: rgba(34, 197, 94, 0.66);
    background: rgba(34, 197, 94, 0.10);
    color: #bbf7d0;
}

.table-copy-button.is-copy-error {
    border-color: rgba(239, 68, 68, 0.66);
    background: rgba(239, 68, 68, 0.10);
    color: #fecaca;
}

/* =========================================================
   CIPHER side panel
========================================================= */

.cipher-panel {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.97), rgba(2, 6, 23, 0.99));
    overflow: hidden;
}

.cipher-panel-header {
    min-height: 82px;
    padding: 15px 18px 15px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line-soft);
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.22), transparent 58%),
        rgba(15, 23, 42, 0.98);
}

.console-kicker {
    margin: 0 0 5px;
    color: var(--cyan);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.16em;
}

.cipher-panel-header h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 21px;
    font-weight: 950;
    letter-spacing: -0.025em;
}

.cipher-live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.cipher-live i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 11px rgba(34, 197, 94, 0.78);
}

.cipher-chat-list {
    min-height: 0;
    padding: 5px 18px 18px 24px;
    overflow: auto;
    overscroll-behavior: contain;
}

.chat-row {
    padding: 17px 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.chat-row:last-child {
    border-bottom: 0;
}

.chat-bubble {
    min-width: 0;
    padding-left: 13px;
    border-left: 3px solid var(--cyan);
}

.chat-meta {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 11px;
}

.chat-speaker {
    color: var(--cyan-soft);
    font-weight: 900;
    letter-spacing: 0.07em;
}

.chat-time {
    white-space: nowrap;
}

.chat-title {
    margin-bottom: 6px;
    color: #f3f7fb;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.5;
}

.chat-message {
    color: #c3cfdd;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
}

.chat-bubble,
.chat-title,
.chat-message,
.chat-meta {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.cipher-panel-footer {
    min-height: 48px;
    padding: 0 13px 0 23px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border-top: 1px solid var(--line-soft);
    color: #5e7189;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.11em;
}

#reset-story {
    min-height: 30px;
    padding: 0 9px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    background: transparent;
    color: #71839a;
    font-size: 10px;
    font-weight: 850;
    cursor: pointer;
}

#reset-story:hover,
#reset-story:focus-visible {
    border-color: rgba(239, 68, 68, 0.46);
    color: #fecaca;
}

/* =========================================================
   Evidence
========================================================= */

.evidence-panel {
    position: relative;
    padding: 19px 18px 19px 24px;
    border-top: 1px solid rgba(167, 139, 250, 0.35);
    background:
        linear-gradient(135deg, rgba(124, 58, 237, 0.22), transparent 58%),
        rgba(15, 23, 42, 0.98);
}

.evidence-panel::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 5px;
    background: var(--purple);
}

.evidence-heading p {
    margin: 0 0 4px;
    color: #c4b5fd;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.14em;
}

.evidence-heading h2 {
    margin: 0;
    color: #ffffff;
    font-size: 19px;
    font-weight: 950;
}

.evidence-description {
    margin: 11px 0 13px;
    color: #cbd5e1;
    font-size: 13px;
    line-height: 1.75;
}

.evidence-description code {
    color: #ddd6fe;
}

.evidence-form {
    display: grid;
    gap: 9px;
}

.evidence-form label span {
    display: block;
    margin-bottom: 5px;
    color: #b6a9ce;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.evidence-form input {
    width: 100%;
    min-height: 42px;
    padding: 0 11px;
    border: 1px solid rgba(167, 139, 250, 0.42);
    background: rgba(2, 6, 23, 0.84);
    color: #ffffff;
    font-family: var(--terminal-font);
    font-size: 13px;
}

.evidence-form input:focus {
    outline: 0;
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.12);
}

.evidence-form button {
    min-height: 42px;
    border: 0;
    background: var(--purple);
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.evidence-form button:hover,
.evidence-form button:focus-visible {
    background: #6d28d9;
}

.evidence-result {
    min-height: 18px;
    margin-top: 8px;
    color: #c4b5fd;
    font-size: 12px;
}

.evidence-result.is-error { color: #fecaca; }
.evidence-result.is-success { color: #bbf7d0; }

.terminal-mobile-chat-bubble,
.evidence-panel-mobile {
    display: none;
}

/* =========================================================
   Responsive: tablet
========================================================= */

@media (max-width: 1080px) {
    :root {
        --side-width: 330px;
    }

    .console-logo {
        width: 200px;
        min-width: 200px;
    }

    .console-nav a {
        min-width: 116px;
        padding: 0 16px;
    }
}

/* =========================================================
   Responsive: mobile
========================================================= */

@media (max-width: 760px) {
    .entry-header {
        min-height: 64px;
        padding: 0 14px;
    }

    .entry-logo {
        font-size: 14px;
    }

    .entry-nav {
        gap: 14px;
    }

    .entry-nav a {
        font-size: 12px;
        white-space: nowrap;
    }

    :root {
        --header-height: 64px;
    }

    .console-page {
        overflow: hidden;
    }


    .console-layout {
        grid-template-columns: 1fr;
    }

    .console-workspace {
        border-right: 0;
    }

    .console-side {
        display: none;
    }

    .terminal-window {
        grid-template-rows: 46px minmax(0, 1fr) auto;
    }

    .terminal-window::before {
        width: 4px;
    }

    .terminal-titlebar {
        padding: 0 10px 0 13px;
        gap: 9px;
    }

    .terminal-controls {
        gap: 5px;
    }

    .terminal-controls span {
        width: 8px;
        height: 8px;
    }

    .terminal-title {
        justify-content: flex-start;
        gap: 6px;
        font-size: 10px;
    }

    .terminal-title strong {
        font-size: 11px;
    }

    .terminal-title-button {
        min-height: 28px;
        padding: 0 8px;
        font-size: 9px;
    }

    .terminal-scroll {
        padding: 16px 12px 24px 17px;
    }

    .terminal-entry {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }

    .psql-startup-message {
        font-size: 12px;
        line-height: 1.75;
    }

    .terminal-command pre {
        font-size: 14px;
        line-height: 1.7;
    }

    .terminal-table-wrap {
        max-height: 330px;
    }

    .terminal-table {
        font-size: 12px;
    }

    .terminal-table th,
    .terminal-table td {
        min-width: 98px;
        max-width: 300px;
        padding: 8px 9px;
    }

    .terminal-composer {
        max-height: 46dvh;
        padding: 12px 11px 12px 16px;
    }

    .terminal-composer::before {
        top: 7px;
        right: 12px;
        font-size: 25px;
    }

    #sql {
        min-height: 66px;
        padding: 10px 11px;
        font-size: 14px;
    }

    .terminal-command-bar {
        margin-top: 9px;
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .terminal-shortcuts {
        justify-content: space-between;
        font-size: 10px;
    }

    .terminal-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .terminal-buttons button {
        width: 100%;
        min-height: 42px;
    }

    .terminal-reference summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .terminal-reference summary small {
        white-space: normal;
    }

    .terminal-reference ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .table-copy-button {
        min-height: 42px;
    }

    /* 右側ログの代わりに、SQL履歴の中へ吹き出しのみ表示 */
    .terminal-mobile-chat-bubble {
        display: block;
        margin: 0 0 20px;
        padding: 14px 13px 14px 15px;
        border: 1px solid rgba(56, 189, 248, 0.25);
        border-left: 3px solid var(--cyan);
        background:
            linear-gradient(135deg, rgba(37, 99, 235, 0.14), transparent 55%),
            rgba(15, 23, 42, 0.86);
    }

    .terminal-mobile-chat-bubble .chat-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .terminal-mobile-chat-bubble .chat-title {
        font-size: 15px;
    }

    .terminal-mobile-chat-bubble .chat-message {
        font-size: 13px;
        line-height: 1.75;
    }

    .evidence-panel-mobile:not([hidden]) {
        display: block;
        margin-top: 18px;
        border: 1px solid rgba(167, 139, 250, 0.34);
    }
}

@media (max-width: 420px) {
    .entry-header {
        padding: 0 10px;
    }

    .entry-logo {
        font-size: 13px;
        letter-spacing: 0.12em;
    }

    .entry-nav {
        gap: 9px;
    }

    .entry-nav a {
        font-size: 11px;
    }

    .terminal-shortcuts {
        display: none;
    }

    .terminal-reference ul {
        grid-template-columns: 1fr;
    }

    .terminal-title span {
        display: none;
    }

    .terminal-title {
        justify-content: center;
    }
}

/* =========================================================
   Accessibility
========================================================= */

:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
