:root {
    --bg: #070b16;
    --side: #0b1220;
    --card: #10192c;
    --field: #0c1424;
    --line: #1d2b44;
    --text: #e7eef8;
    --muted: #8b9cb3;
    --blue: #2f7bff;
    --blue-deep: #1d4ed8;
    --danger: #ef6b6b;
    --ok: #3dba7c;
    --amber: #e2a04a;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

a { color: #9ec0ff; text-decoration: none; }
a:hover { color: #c5d8ff; }

button, .button, input, textarea, select { font: inherit; }

button, a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--blue);
    color: #fff;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 0.42rem 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

button:hover, a.button:hover { background: var(--blue-deep); color: #fff; }

button.quiet, a.button.quiet, .quiet {
    background: #121c30;
    color: var(--text);
    border-color: #314864;
    font-weight: 600;
}

button.quiet:hover, a.button.quiet:hover { background: #152238; color: var(--text); }

button.danger {
    background: transparent;
    color: var(--danger);
    border-color: #5a3038;
    font-weight: 550;
}

button.danger:hover { background: #2a161b; color: #ffb4b4; }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 2px;
}

.app { display: flex; min-height: 100vh; }

.side {
    width: 248px;
    flex: 0 0 248px;
    display: flex;
    flex-direction: column;
    background: var(--side);
    border-right: 1px solid var(--line);
    padding: 0.9rem 0.75rem 0.8rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    padding: 0.2rem 0.45rem 0.9rem;
}

.brand:hover { color: var(--text); }

.logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
}

.brand-name { display: block; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub, .who small { display: block; color: var(--muted); font-size: 0.78rem; }

.nav-label {
    margin: 0.35rem 0.55rem 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

nav { display: flex; flex-direction: column; gap: 0.15rem; }
nav a {
    color: #c5d0e0;
    border-radius: 8px;
    padding: 0.48rem 0.65rem;
}
nav a:hover { background: #121c30; color: #fff; }
nav a.active { background: #172744; color: #fff; }

.who {
    margin-top: auto;
    display: flex;
    gap: 0.6rem;
    align-items: center;
    padding: 0.75rem 0.45rem 0.2rem;
    border-top: 1px solid var(--line);
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #1a3f86;
    color: #fff;
    font-weight: 700;
    flex: 0 0 auto;
}

.who strong { display: block; font-size: 0.92rem; }

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--line);
    background: #0a1120;
}

.welcome { margin: 0; font-weight: 600; }

main { padding: 1.1rem 1.25rem 2.5rem; }

h1, h2 {
    font-weight: 650;
    letter-spacing: -0.015em;
    margin: 0 0 0.7rem;
}

h1 { font-size: 1.2rem; }
h2 { font-size: 1rem; }

.lede, .meta, .crumbs { color: var(--muted); }
.lede { margin: -0.35rem 0 1rem; }
.crumbs { margin: -0.25rem 0 0.9rem; }
.crumbs a { color: #9ec0ff; }

.card, .panel, dialog, .dropzone {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.panel { margin: 1rem 0; padding: 0.95rem 1rem; }
.panel h2 { margin-top: 0; }

form.stack, .stack { display: grid; gap: 0.7rem; max-width: 36rem; }
label { display: grid; gap: 0.28rem; }
label span { color: var(--muted); }

input[type="text"], input[type="email"], input[type="password"], input[type="file"], textarea, select {
    width: 100%;
    background: var(--field);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.48rem 0.6rem;
}

textarea { min-height: 9rem; resize: vertical; }

.banner { padding: 0.6rem 0.75rem; border-radius: 8px; border: 1px solid var(--line); margin: 0 0 0.9rem; background: #121c30; }
.banner.bad { border-color: #5a3038; color: #ffc1c1; background: #241418; }
.banner.ok { border-color: #245c40; color: #b7ebc9; background: #102218; }
.passkeys { margin: 0 0 1rem; padding-left: 1.1rem; color: var(--text); }
.passkeys li { margin: 0.2rem 0; }

.row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.inline { display: flex; gap: 0.4rem; align-items: center; }
.inline input[type="text"] { width: 14rem; }

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
}

th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th { color: var(--muted); font-weight: 600; background: #0d1628; }
tbody tr:hover td { background: #132038; }

.actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.actions form { display: flex; gap: 0.35rem; align-items: center; }
.actions input[type="text"] { width: 12rem; }

.dropzone { padding: 1.2rem; text-align: center; }
.dropzone p { margin: 0.2rem 0; }
.dropzone.over { border-color: var(--blue); }
.dropzone .row { justify-content: center; margin-top: 0.75rem; }
.drop-log { list-style: none; margin: 0.8rem 0 0; padding: 0; text-align: left; }
.drop-log .bad { color: #ffb4b4; }

dialog { color: var(--text); padding: 1rem 1.1rem; min-width: 20rem; }
dialog::backdrop { background: rgb(4 8 16 / 72%); }
dialog h2 { margin-top: 0; }

.invite input { font-family: Consolas, "Cascadia Mono", monospace; }
.nda { white-space: pre-wrap; max-width: 42rem; }
.nda-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(5, 10, 20, 0.72);
}
.nda-modal {
    width: min(40rem, 100%);
    max-height: min(36rem, calc(100vh - 2rem));
    overflow: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1.1rem 1.2rem 1.2rem;
}
.nda-modal .nda { max-width: none; margin: 0 0 1rem; }
.nda-actions { display: flex; justify-content: flex-end; gap: 0.6rem; }
.check { display: flex; flex-direction: row; gap: 0.5rem; align-items: center; }
.check input { width: auto; }

.gate {
    min-height: 100vh;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1rem;
    padding: 2rem 1rem;
}

.gate .card { width: min(28rem, 100%); padding: 1.2rem 1.25rem 1.35rem; }
.gate .brand { padding: 0; justify-content: center; }

.menu { display: none; }
.pill { display: inline-block; margin-left: 0.4rem; padding: 0.05rem 0.4rem; border-radius: 999px; background: #1a3f86; color: #d6e4ff; font-size: 0.75rem; }
.summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0.8rem; margin: 0 0 1rem; }
.summary .card { background: var(--card, #10192c); border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1rem; }
.summary .card h2 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.summary .card p { margin: 0; font-size: 1.6rem; }
.preview { position: relative; overflow: hidden; background: #fff; color: #172033; border-radius: 12px; padding: 1.2rem; }
.preview h1, .preview h2, .preview p { color: #172033; }
.preview table { color: #172033; }
.stamp {
    position: absolute; inset: 0; display: grid; place-items: center;
    transform: rotate(-32deg); font-size: 1.1rem; color: rgba(20, 40, 80, 0.28);
    pointer-events: none; text-align: center; padding: 2rem;
}
#drop-log .bad { color: #ffb4b4; }

@media (max-width: 800px) {
    .menu { display: inline-flex; }
    .app { display: block; }
    .side {
        position: fixed; inset: 0 auto 0 0; z-index: 20; width: min(18rem, 86vw);
        transform: translateX(-105%); transition: transform 0.16s ease;
    }
    .side.open { transform: none; }
    .workspace { min-width: 0; }
    .actions, .inline { align-items: stretch; }
    .actions form, .inline { flex-wrap: wrap; }
    table, thead, tbody, tr, th, td { display: block; }
    thead { display: none; }
    tr { border-bottom: 1px solid var(--line); padding: 0.4rem 0; }
    td { border: 0; padding: 0.2rem 0; }
}
