/* ============================================================
   AstraSlack — design tokens
   ============================================================ */
:root {
    --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    /* Brand */
    --gold: #c9a24b;
    --gold-strong: #b08a35;
    --gold-soft: rgba(201, 162, 75, 0.16);
    --navy: #1f2b3d;
    --navy-strong: #16202e;

    /* Chrome (rail + sidebar) */
    --rail-bg: #0b1119;
    --side-bg: #131c29;
    --side-text: #c5ccd6;
    --side-muted: #8792a2;
    --side-hover: rgba(255, 255, 255, 0.06);
    --side-current: #c9a24b;
    --side-current-text: #1a1408;
    --side-line: rgba(255, 255, 255, 0.08);

    /* Content */
    --bg: #ffffff;
    --bg-soft: #f7f7f8;
    --bg-hover: #f5f6f8;
    --text: #1d1f23;
    --text-muted: #616770;
    --text-faint: #8e949c;
    --line: #e4e6ea;
    --line-strong: #cfd3d9;
    --link: #1264a3;
    --danger: #c0392b;
    --danger-soft: #fdecea;
    --success: #2e8b57;

    --mention-bg: rgba(201, 162, 75, 0.18);
    --mention-text: #7a5b14;
    --mention-me-bg: rgba(201, 162, 75, 0.38);
    --mine-bg: #f3e7c9;
    --mine-text: #1d1f23;

    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow: 0 4px 12px rgba(16, 24, 40, 0.10);
    --shadow-lg: 0 18px 48px rgba(16, 24, 40, 0.22);

    --rail-w: 68px;
    --side-w: 260px;
    --thread-w: 400px;
    --head-h: 52px;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1d21;
        --bg-soft: #222529;
        --bg-hover: #222529;
        --text: #e8e9eb;
        --text-muted: #a9adb3;
        --text-faint: #80858c;
        --line: #2e3238;
        --line-strong: #3d424a;
        --link: #5aa9e6;
        --danger-soft: rgba(192, 57, 43, 0.18);
        --mention-text: #e0c173;
        --mine-bg: #4a3d1f;
        --mine-text: #f3efe6;
        --shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
        --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
    }
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.46;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, p { margin: 0; }
h1:focus { outline: none; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
::selection { background: rgba(201, 162, 75, 0.35); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.icon { flex: none; display: block; }
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}
kbd {
    font-family: inherit;
    font-size: 0.72rem;
    padding: 0 0.3rem;
    border: 1px solid var(--line-strong);
    border-bottom-width: 2px;
    border-radius: 4px;
    background: var(--bg-soft);
}
code {
    font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
    font-size: 0.85em;
}

/* ============================================================
   Controls
   ============================================================ */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    height: 38px;
    padding: 0 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    background: var(--navy);
    color: #fff;
    font-weight: 700;
    font-size: 0.93rem;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.12s, box-shadow 0.12s, border-color 0.12s;
}
.button:hover { background: var(--navy-strong); text-decoration: none; }
.button:disabled { opacity: 0.45; }
.button.block { width: 100%; height: 44px; }
.button.small { height: 30px; padding: 0 0.7rem; font-size: 0.82rem; }
.button.secondary {
    background: var(--bg);
    color: var(--text);
    border-color: var(--line-strong);
    box-shadow: var(--shadow-sm);
}
.button.secondary:hover { background: var(--bg-hover); }
.button.danger { background: var(--bg); color: var(--danger); border-color: var(--line-strong); }
.button.danger:hover { background: var(--danger-soft); border-color: var(--danger); }

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}
.icon-button:hover { background: var(--bg-hover); color: var(--text); }
.icon-button.small { width: 24px; height: 24px; }

.form { display: flex; flex-direction: column; gap: 1rem; }
.form label { display: flex; flex-direction: column; gap: 0.35rem; }
.form label > span { font-weight: 700; font-size: 0.88rem; }
.form input:not([type=checkbox]),
.input-prefix {
    width: 100%;
    height: 42px;
    padding: 0 0.8rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
    transition: border-color 0.12s, box-shadow 0.12s;
}
.form input:not([type=checkbox]):focus,
.input-prefix:focus-within {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-soft);
}
.input-prefix { display: flex; align-items: center; gap: 0.4rem; color: var(--text-muted); }
.input-prefix input { border: 0 !important; box-shadow: none !important; padding: 0 !important; height: 100% !important; outline: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.25rem; }

.toggle { flex-direction: row !important; align-items: flex-start; gap: 0.6rem !important; cursor: pointer; }
.toggle input { margin-top: 0.25rem; width: 16px; height: 16px; accent-color: var(--navy); }
.toggle span { display: flex; flex-direction: column; }
.toggle small { color: var(--text-muted); font-weight: 400; }

.banner {
    display: flex;
    gap: 0.5rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid #f0c6c0;
    border-left: 4px solid var(--danger);
    border-radius: var(--radius);
    background: var(--danger-soft);
    color: var(--text);
    font-size: 0.9rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}
.badge.owner { background: var(--gold-soft); border-color: transparent; color: var(--mention-text); }
.badge.done { color: var(--success); }

.muted-text { color: var(--text-muted); }

/* ============================================================
   Avatar
   ============================================================ */
.avatar {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: var(--tone);
    color: #fff;
    font-weight: 700;
    font-size: calc(var(--size) * 0.4);
    letter-spacing: 0.02em;
    line-height: 1;
    user-select: none;
}
.avatar.square { border-radius: calc(var(--size) * 0.22); }

/* ============================================================
   App shell
   ============================================================ */
.app {
    display: grid;
    grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--rail-bg);
}
.app.with-thread { grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr) var(--thread-w); }

/* Rail */
.rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    background: var(--rail-bg);
    min-height: 0;
}
.rail-logo img { display: block; width: 40px; height: 40px; border-radius: 50%; }
.rail-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    overflow-y: auto;
    padding-top: 0.5rem;
    border-top: 1px solid var(--side-line);
    width: 100%;
}
.rail-list form { margin: 0; }
.rail-item {
    position: relative;
    padding: 2px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: none;
    opacity: 0.75;
    transition: opacity 0.12s, border-color 0.12s;
}
.rail-item:hover { opacity: 1; }
.rail-item.current { opacity: 1; border-color: #fff; }
.rail-add {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--side-text);
    transition: background 0.12s, color 0.12s;
}
.rail-add:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.rail-foot { padding-top: 0.5rem; }

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--side-bg);
    color: var(--side-text);
    border-radius: 10px 0 0 10px;
    margin: 6px 0 6px 0;
}
.side-head {
    position: relative;
    display: flex;
    align-items: center;
    height: var(--head-h);
    padding: 0 0.75rem;
    border-bottom: 1px solid var(--side-line);
}
.workspace-button {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.3rem 0.5rem;
    border: 0;
    border-radius: 6px;
    background: none;
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
}
.workspace-button:hover { background: var(--side-hover); }
.workspace-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-scrim { display: none; }

.side-scroll { flex: 1; overflow-y: auto; padding: 0.75rem 0.5rem 1.5rem; }
.side-scroll::-webkit-scrollbar { width: 8px; }
.side-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 8px; }

.side-section { margin-top: 1.1rem; }
.side-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.5rem 0.25rem 0.75rem;
    color: var(--side-muted);
    font-size: 0.85rem;
    font-weight: 600;
}
.side-section-head .icon-button { color: var(--side-muted); opacity: 0; }
.side-section:hover .side-section-head .icon-button,
.side-section-head .icon-button:focus-visible { opacity: 1; }
.side-section-head .icon-button:hover { background: var(--side-hover); color: #fff; }

.side-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    height: 30px;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--side-text);
    font-size: 0.95rem;
    text-align: left;
}
.side-link span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link .icon { opacity: 0.75; }
.side-link:hover { background: var(--side-hover); color: #fff; }
.side-link.current { background: var(--side-current); color: var(--side-current-text); font-weight: 700; }
.side-link.current .icon { opacity: 1; }
.side-link.muted { color: var(--side-muted); }
.side-link.muted:hover { color: #fff; }
.add-chip {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.08);
}

/* Workspace menu */
.menu-backdrop { position: fixed; inset: 0; z-index: 40; }
.menu {
    position: absolute;
    top: calc(var(--head-h) - 6px);
    left: 0.75rem;
    z-index: 41;
    width: 280px;
    padding: 0.4rem 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}
.menu-user { display: flex; align-items: center; gap: 0.7rem; padding: 0.6rem 1rem; }
.menu-user div { display: flex; flex-direction: column; min-width: 0; }
.menu-user small { color: var(--text-muted); }
.menu hr { margin: 0.35rem 0; border: 0; border-top: 1px solid var(--line); }
.menu form { margin: 0; }
.menu button {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.45rem 1rem;
    border: 0;
    background: none;
    color: var(--text);
    text-align: left;
    font-size: 0.93rem;
}
.menu button:hover { background: var(--navy); color: #fff; }

/* ============================================================
   Main pane
   ============================================================ */
.main, .thread {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: var(--bg);
    margin: 6px 0;
}
.main { margin-right: 6px; border-radius: 0 10px 10px 0; }
.app.with-thread .main { margin-right: 0; border-radius: 0; }
.thread { margin-right: 6px; border-radius: 0 10px 10px 0; border-left: 1px solid var(--line); }

.channel-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: none;
    height: var(--head-h);
    padding: 0 1rem 0 1.25rem;
    border-bottom: 1px solid var(--line);
}
.channel-head h1, .channel-head h2 {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
    font-size: 1.08rem;
    font-weight: 800;
}
.channel-head h1 span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-head h2 small { color: var(--text-muted); font-weight: 400; font-size: 0.85rem; margin-left: 0.25rem; }
.channel-actions { display: flex; align-items: center; gap: 0.5rem; }
.nav-toggle { display: none; }

.member-stack {
    display: flex;
    align-items: center;
    padding: 0.2rem 0.5rem 0.2rem 0.3rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.85rem;
}
.member-stack:hover { background: var(--bg-hover); }
.member-stack .avatar { border: 2px solid var(--bg); margin-right: -6px; }
.member-stack span:last-child { margin-left: 0.6rem; }

.toast {
    position: absolute;
    top: calc(var(--head-h) + 0.75rem);
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: min(560px, calc(100% - 2rem));
    padding: 0.6rem 0.6rem 0.6rem 0.9rem;
    border-radius: var(--radius);
    background: var(--navy-strong);
    color: #fff;
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
}
.toast > .icon { color: #f5a097; }
.toast .icon-button { color: rgba(255, 255, 255, 0.7); }
.toast .icon-button:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* Messages */
.messages {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 1rem;
    overscroll-behavior: contain;
}

.intro { padding: 2.5rem 1.25rem 1rem; }
.intro-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 14px;
    background: var(--gold-soft);
    color: var(--mention-text);
}
.intro h2 { margin: 0.9rem 0 0.35rem; font-size: 1.6rem; font-weight: 800; }
.intro p { color: var(--text-muted); }

.day-divider {
    position: relative;
    z-index: 0;
    display: flex;
    justify-content: center;
    margin: 1rem 0 0.25rem;
}
.day-divider::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 50%;
    border-top: 1px solid var(--line);
    z-index: -1;
}
.day-divider span {
    padding: 0.15rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    font-size: 0.8rem;
    font-weight: 700;
}

.message {
    position: relative;
    display: flex;
    gap: 0.6rem;
    padding: 0.45rem 1.25rem;
    margin-top: 0.35rem;
}
.message.continued { padding-top: 0.12rem; padding-bottom: 0.12rem; margin-top: 0; }
.message:hover, .message.active { background: var(--bg-hover); }
.message.active { box-shadow: inset 3px 0 0 var(--gold); }
.message-gutter { flex: none; width: 36px; display: flex; justify-content: center; }
.hover-time {
    visibility: hidden;
    padding-top: 0.15rem;
    color: var(--text-faint);
    font-size: 0.7rem;
    white-space: nowrap;
}
.message:hover .hover-time { visibility: visible; }
.message-content { flex: 1; min-width: 0; }
.message-meta { display: flex; align-items: baseline; gap: 0.5rem; }
.message-meta strong { font-weight: 800; }
.message-meta time { color: var(--text-faint); font-size: 0.75rem; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Your own messages: right-aligned bubbles, no avatar or name */
.message.mine { justify-content: flex-end; padding-left: 4rem; }
.message.mine.continued { padding-top: 0.1rem; padding-bottom: 0.1rem; }
.message.mine .message-gutter { display: none; }
.message.mine .message-content { display: flex; flex-direction: column; align-items: flex-end; flex: 0 1 auto; max-width: min(680px, 100%); }
.message.mine .message-meta strong { display: none; }
.message.mine .message-meta { margin-bottom: 0.15rem; }
.message.mine .message-body {
    padding: 0.5rem 0.8rem;
    border-radius: 16px 4px 16px 16px;
    background: var(--mine-bg);
    color: var(--mine-text);
}
.message.mine.continued .message-body { border-radius: 16px; }
.message.mine .message-body a { color: inherit; text-decoration: underline; }
.message.mine .mention { background: rgba(0, 0, 0, 0.08); color: inherit; }
.message.mine .reactions, .message.mine .attachments { justify-content: flex-end; }
.message.mine .message-actions { left: auto; right: 1.25rem; }
.message.mine:hover, .message.mine.active { background: transparent; }
.message.mine.active .message-body { box-shadow: 0 0 0 2px var(--gold); }
.message.mine.active { box-shadow: none; }

.mention {
    padding: 0 0.15rem;
    border-radius: 4px;
    background: var(--mention-bg);
    color: var(--mention-text);
    font-weight: 600;
}
.mention.me { background: var(--mention-me-bg); }

/* Sits just above the hovered message, lined up with its text (or with your bubble's right edge). */
.message-actions {
    position: absolute;
    bottom: calc(100% - 6px);
    left: calc(1.25rem + 36px + 0.6rem);
    z-index: 3;
    display: none;
    align-items: center;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
    box-shadow: var(--shadow);
}
.message:hover .message-actions,
.message:focus-within .message-actions { display: flex; }
.message-actions button {
    display: grid;
    place-items: center;
    width: 32px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text-muted);
    font-size: 1rem;
}
.message-actions button:hover { background: var(--bg-hover); color: var(--text); }

.reactions { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.reaction {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 24px;
    padding: 0 0.5rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg-soft);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.reaction:hover { border-color: var(--line-strong); background: var(--bg); }
.reaction.mine { border-color: var(--gold); background: var(--gold-soft); color: var(--mention-text); }

.attachments { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.file-card, .pending-file {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    max-width: 340px;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--text);
}
.file-card:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.file-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--navy);
    color: #fff;
    flex: none;
}
.file-text { display: flex; flex-direction: column; min-width: 0; }
.file-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.file-text small { color: var(--text-faint); font-size: 0.78rem; }

.image-card {
    display: block;
    overflow: hidden;
    max-width: min(360px, 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
}
.image-card img { display: block; max-width: 100%; max-height: 280px; object-fit: contain; }
.image-card:hover { box-shadow: var(--shadow); }

.pending-thumb { width: 36px; height: 36px; flex: none; border-radius: 6px; object-fit: cover; }

/* Drag a file over the conversation */
.drop-overlay {
    position: absolute;
    inset: 0;
    z-index: 70;
    display: none;
    place-items: center;
    padding: 1rem;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.82);
    pointer-events: none;
}
.drop-overlay > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 2.5rem 3rem;
    border: 2px dashed var(--gold);
    border-radius: 16px;
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}
.drop-overlay .icon { color: var(--gold-strong); }
.drop-overlay strong { font-size: 1.15rem; }
.drop-overlay span { color: var(--text-muted); }
.main.dragging .drop-overlay { display: grid; }
@media (prefers-color-scheme: dark) {
    .drop-overlay { background: rgba(26, 29, 33, 0.82); }
}

/* Mentions view */
.mention-card {
    margin: 0.75rem 1.25rem 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: box-shadow 0.12s, border-color 0.12s;
}
.mention-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.mention-where { margin-bottom: 0.4rem; color: var(--text-muted); font-size: 0.8rem; font-weight: 600; }
.message-row { display: flex; gap: 0.6rem; }

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 5rem 1.5rem;
    text-align: center;
}
.empty-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 0.5rem;
    border-radius: 50%;
    background: var(--gold-soft);
    color: var(--mention-text);
}
.empty h2 { font-size: 1.25rem; font-weight: 800; }
.empty p { color: var(--text-muted); margin-bottom: 0.75rem; }

/* Thread */
.reply-count {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.reply-count::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.message.root { padding-top: 1rem; }

/* Composer */
.composer { position: relative; flex: none; padding: 0 1.25rem 1.25rem; }
.composer-box {
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--bg);
    transition: border-color 0.12s, box-shadow 0.12s;
}
.composer-box:focus-within { border-color: var(--text-faint); box-shadow: var(--shadow-sm); }
.composer textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    max-height: 40vh;
    field-sizing: content;
    padding: 0.7rem 0.9rem 0.3rem;
    border: 0;
    background: transparent;
    resize: none;
    outline: none;
    line-height: 1.45;
}
.composer textarea::placeholder { color: var(--text-faint); }
.pending-file { margin: 0.3rem 0.7rem 0.2rem; }
.composer-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.25rem 0.4rem 0.4rem;
}
.composer-tools label.icon-button { position: relative; }
.composer-hint { flex: 1; color: var(--text-faint); font-size: 0.74rem; text-align: right; }
.send-button {
    display: grid;
    place-items: center;
    width: 34px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: var(--gold);
    color: var(--side-current-text);
    transition: background 0.12s;
}
.send-button:hover:not(:disabled) { background: var(--gold-strong); }
.send-button:disabled { background: transparent; color: var(--text-faint); }

.mention-popup {
    position: absolute;
    bottom: calc(100% - 0.5rem);
    left: 1.25rem;
    z-index: 20;
    width: min(340px, calc(100% - 2.5rem));
    padding: 0.35rem 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg);
    box-shadow: var(--shadow-lg);
}
.mention-popup button {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.4rem 0.85rem;
    border: 0;
    background: none;
    color: var(--text);
    text-align: left;
}
.mention-popup button:hover, .mention-popup button:focus-visible { background: var(--navy); color: #fff; outline: none; }
.mention-popup small { color: inherit; opacity: 0.65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   Modal
   ============================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(11, 17, 25, 0.55);
    animation: fade 0.12s ease-out;
}
.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 101;
    display: flex;
    flex-direction: column;
    width: min(520px, calc(100vw - 2rem));
    max-height: calc(100dvh - 4rem);
    transform: translate(-50%, -50%);
    border-radius: var(--radius-lg);
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    animation: pop 0.14s ease-out;
}
.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.25rem 0.75rem 1.5rem;
}
.modal-head h2 { font-size: 1.35rem; font-weight: 800; }
.modal-head p { margin-top: 0.2rem; color: var(--text-muted); font-size: 0.9rem; }
.modal-body { overflow-y: auto; padding: 0.25rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

.people-list { display: flex; flex-direction: column; margin: 0 -0.5rem; }
.person {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.5rem;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--text);
    text-align: left;
}
.person:hover { background: var(--bg-hover); }
.person-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.person-text small { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.secret {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-soft);
}
.secret > label { font-weight: 700; font-size: 0.85rem; }
.secret > code, .copy-row code {
    display: block;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--bg);
    word-break: break-all;
}
.secret small { color: var(--text-muted); }
.copy-row { display: flex; align-items: center; gap: 0.5rem; }
.copy-row code { flex: 1; min-width: 0; }

.status-line { display: flex; align-items: center; gap: 0.5rem; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.2); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(0.98); } }

/* ============================================================
   Auth pages
   ============================================================ */
.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 2rem 1rem;
    background:
        radial-gradient(70% 50% at 50% 0%, rgba(201, 162, 75, 0.14), transparent 70%),
        var(--bg-soft);
}
.auth-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: min(420px, 100%);
    padding: 2.25rem 2rem 2rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--bg);
    box-shadow: var(--shadow);
}
.auth-card.center { text-align: center; }
.auth-logo { width: 72px; height: 72px; margin: 0 auto 0.25rem; border-radius: 50%; }
.auth-card h1 { font-size: 1.65rem; font-weight: 800; text-align: center; letter-spacing: -0.01em; }
.auth-sub { color: var(--text-muted); text-align: center; margin-top: -0.4rem; }
.auth-card .form { margin-top: 0.25rem; }
.auth-foot { color: var(--text-muted); font-size: 0.9rem; }
.auth-foot a { font-weight: 700; }

/* Sign-in codes */
.code-input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1.35rem !important; letter-spacing: 0.3em; text-align: center; }
.code-input.wide { font-size: 1.05rem !important; letter-spacing: 0.08em; }
.auth-switch { text-align: center; font-size: 0.9rem; }
.auth-switch a { font-weight: 600; }
.setup-steps, .setup-notes { margin: 0; padding-left: 1.2rem; color: var(--text-muted); display: grid; gap: 0.35rem; font-size: 0.92rem; }
.totp-qr { display: block; margin: 0 auto; width: 200px; height: 200px; padding: 8px; background: #fff; border-radius: 10px; image-rendering: pixelated; }
.totp-secret { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; margin: 0; }
.totp-secret span { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.totp-secret code, .recovery-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; user-select: all; overflow-wrap: anywhere; text-align: center; }
.totp-secret code { font-size: 0.95rem; }
.recovery-code { margin: 0; padding: 0.9rem 1rem; font-size: 1.15rem; font-weight: 700; letter-spacing: 0.06em; border: 1px dashed var(--border, #c9a24b); border-radius: 10px; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
    .app.with-thread { grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr); }
    .thread {
        position: fixed;
        inset: 0 0 0 auto;
        z-index: 60;
        width: min(var(--thread-w), 100vw);
        margin: 0;
        border-radius: 0;
        box-shadow: var(--shadow-lg);
    }
    .app.with-thread .main { margin-right: 6px; border-radius: 0 10px 10px 0; }
}

@media (max-width: 760px) {
    .app, .app.with-thread { grid-template-columns: minmax(0, 1fr); }
    .rail, .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        z-index: 50;
        transform: translateX(-120%);
        transition: transform 0.18s ease-out;
    }
    .rail { left: 0; width: var(--rail-w); }
    .sidebar {
        left: var(--rail-w);
        width: min(var(--side-w), calc(100vw - var(--rail-w) - 2rem));
        margin: 0;
        border-radius: 0;
        transform: translateX(calc(-100% - var(--rail-w) - 8px));
    }
    .nav-open .rail, .nav-open .sidebar { transform: none; }
    .nav-scrim { display: none; }
    .nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(11, 17, 25, 0.5); }
    .main, .app.with-thread .main { margin: 0; border-radius: 0; }
    .nav-toggle { display: inline-grid; margin-left: -0.5rem; }
    .channel-head { padding: 0 0.75rem; }
    .composer-hint { display: none; }
    .message { padding-left: 0.75rem; padding-right: 0.75rem; }
    .message-actions { left: calc(0.75rem + 36px + 0.6rem); }
    .message.mine .message-actions { left: auto; right: 0.75rem; }
    .composer { padding: 0 0.75rem 0.75rem; }
    .member-stack .avatar { display: none; }
    .member-stack span:last-child { margin-left: 0.2rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   Quote-replies and reply counts
   ============================================================ */
.quote {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    max-width: min(520px, 100%);
    margin: 0.2rem 0 0.3rem;
    padding: 0.35rem 0.7rem;
    border: 0;
    border-left: 3px solid var(--gold);
    border-radius: 6px;
    background: var(--bg-soft);
    color: var(--text-muted);
    font-size: 0.86rem;
    text-align: left;
}
.quote:hover { background: var(--bg-hover); color: var(--text); }
.quote strong { color: var(--text); font-size: 0.8rem; }
.quote span { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.message.mine .quote { align-self: flex-end; border-left: 0; border-right: 3px solid var(--gold); text-align: right; }

.reply-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.3rem;
    padding: 0.15rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: none;
    color: var(--link);
    font-size: 0.82rem;
    font-weight: 700;
}
.reply-link:hover { border-color: var(--line); background: var(--bg); }

.actions-divider { width: 1px; height: 18px; margin: 0 2px; background: var(--line); }

.quote-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0.6rem 0;
    padding: 0.4rem 0.4rem 0.4rem 0.7rem;
    border-left: 3px solid var(--gold);
    border-radius: 6px;
    background: var(--bg-soft);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.quote-chip > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-chip strong { color: var(--text); margin-right: 0.3rem; }

.message:focus { outline: none; }
.message:focus-visible { box-shadow: inset 0 0 0 2px var(--gold-soft); }
.message.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { background: var(--gold-soft); } 100% { background: transparent; } }

.button.danger-solid { background: var(--danger); color: #fff; }
.button.danger-solid:hover { background: #a93226; }

/* ============================================================
   Tasks: boards home
   ============================================================ */
.boards-home { flex: 1; overflow-y: auto; padding: 1.5rem 1.25rem; }
.board-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.board-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg);
    color: var(--text);
    text-align: left;
    transition: box-shadow 0.12s, border-color 0.12s;
}
.board-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.board-card strong { font-size: 1.05rem; }
.board-card small { color: var(--text-muted); }
.board-card-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: 0.4rem;
    border-radius: 10px;
    background: var(--gold-soft);
    color: var(--mention-text);
}
.board-card.add { border-style: dashed; background: transparent; }
.board-card.add .board-card-icon { background: var(--bg-soft); color: var(--text-muted); }

/* ============================================================
   Tasks: board header
   ============================================================ */
.board-head { gap: 0.75rem; }
.board-head h1 { flex: 0 1 auto; }
.title-button {
    padding: 0.15rem 0.4rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: none;
    color: inherit;
    font: inherit;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.title-button:hover { border-color: var(--line-strong); }
.title-input {
    min-width: 220px;
    padding: 0.15rem 0.4rem;
    border: 1px solid var(--gold);
    border-radius: 6px;
    background: var(--bg);
    font: inherit;
    outline: none;
    box-shadow: 0 0 0 3px var(--gold-soft);
}
.view-tabs {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 8px;
    background: var(--bg-soft);
}
.view-tabs button {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
}
.view-tabs button.current { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }
.board-head .channel-actions { margin-left: auto; }
.board-search {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    height: 32px;
    padding: 0 0.6rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    color: var(--text-faint);
}
.board-search:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.board-search input { width: 150px; border: 0; outline: none; background: transparent; font-size: 0.88rem; }

/* Popovers (menus, status picker, people picker) */
.anchor { position: relative; display: inline-flex; }
.anchor.fill { display: flex; width: 100%; height: 100%; }
.pop-backdrop { position: fixed; inset: 0; z-index: 80; }
.pop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 81;
    min-width: 200px;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    text-align: left;
    font-weight: 400;
}
.pop.right { left: auto; right: 0; }
.pop hr { margin: 0.3rem 0; border: 0; border-top: 1px solid var(--line); }
.pop-title { padding: 0.35rem 0.6rem 0.4rem; color: var(--text-muted); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.menu-pop button, .pop-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.42rem 0.6rem;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text);
    font-size: 0.9rem;
    text-align: left;
    white-space: nowrap;
}
.menu-pop button:hover:not(:disabled), .pop-link:hover { background: var(--bg-hover); }
.menu-pop button:disabled { opacity: 0.4; }
.menu-pop button.danger { color: var(--danger); }

/* ============================================================
   Tasks: table
   ============================================================ */
.board-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.board-scroll { flex: 1; overflow: auto; padding: 1rem 1.25rem 3rem; }
.board-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 5rem 1.5rem;
    color: var(--text-muted);
    text-align: center;
}
.board-empty h2 { color: var(--text); font-size: 1.2rem; font-weight: 800; }

.group { margin-bottom: 1.75rem; }
.group-head { display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.4rem; }
.group-head > .icon-button { color: var(--group); }
.group-name, .group-input {
    padding: 0.1rem 0.35rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: none;
    color: var(--group);
    font-size: 1.05rem;
    font-weight: 800;
}
.group-name:hover { border-color: var(--line-strong); }
.group-input { border-color: var(--gold); outline: none; background: var(--bg); }
.group-count { color: var(--text-faint); font-size: 0.82rem; }
.group-more { opacity: 0; }
.group-head:hover .group-more, .group-more:focus-visible { opacity: 1; }

.grid {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: 0.9rem;
}
.grid col.col-name { width: 340px; }
.grid col.col-status { width: 150px; }
.grid col.col-person { width: 130px; }
.grid col.col-date { width: 150px; }
.grid col.col-text { width: 200px; }
.grid col.col-number { width: 120px; }
.grid col.col-checkbox { width: 100px; }
.grid col.col-add { width: 48px; }
.grid th, .grid td {
    height: 38px;
    padding: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.grid th {
    border-top: 1px solid var(--line);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}
.grid th.name-cell { padding-left: 1.6rem; text-align: left; }
.grid th:first-child, .grid td:first-child { border-left: 4px solid var(--group); }
.grid thead th:first-child { border-top-left-radius: 8px; }
.grid .name-cell { position: sticky; left: 0; z-index: 2; background: var(--bg); }
.grid tbody tr:hover td { background: var(--bg-hover); }
.grid tr.dragging td { opacity: 0.45; }
.grid tr.drop-target td { box-shadow: inset 0 2px 0 var(--gold); }
.column-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    height: 38px;
    padding: 0 0.5rem;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
}
.column-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-head:hover { background: var(--bg-hover); color: var(--text); }
.grid th .anchor { display: flex; }
.add-cell { text-align: center; }
.row-delete { opacity: 0; }
.grid tr:hover .row-delete, .row-delete:focus-visible { opacity: 1; }
.row-delete:hover { color: var(--danger); }

.grid td.name-cell { padding: 0 0.3rem 0 0.15rem; }
.grid td.name-cell { display: table-cell; }
.grid td.name-cell > * { vertical-align: middle; }
.grip { display: inline-grid; place-items: center; width: 16px; color: var(--text-faint); cursor: grab; opacity: 0; }
.grid tr:hover .grip { opacity: 1; }
.cell-input {
    width: 100%;
    height: 100%;
    min-height: 36px;
    padding: 0 0.55rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: center;
}
.cell-input:hover { border-color: var(--line-strong); }
.cell-input:focus { outline: none; border-color: var(--gold); background: var(--bg); }
.name-input { width: calc(100% - 64px); text-align: left; font-weight: 500; }
.add-row .cell-input { padding-left: 1.6rem; text-align: left; color: var(--text-muted); }
.add-row td { background: transparent !important; }
.number-input { text-align: right; }
.date-input { font-size: 0.85rem; color-scheme: light dark; }
.date-input.overdue { color: var(--danger); font-weight: 700; }

.updates-button {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    height: 28px;
    padding: 0 0.4rem;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text-faint);
    font-size: 0.78rem;
    font-weight: 700;
}
.updates-button:hover { background: var(--bg-soft); color: var(--text); }
.updates-button.has { color: var(--link); }

.status-pill {
    display: grid;
    place-items: center;
    width: 100%;
    height: 37px;
    padding: 0 0.4rem;
    border: 0;
    background: var(--status);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.status-pill.empty { background: #c4c4c4; }
.status-pill:hover { filter: brightness(1.06); }
.status-pop { width: 210px; display: flex; flex-direction: column; gap: 4px; padding: 0.5rem; }
.status-option {
    height: 32px;
    border: 0;
    border-radius: 4px;
    background: var(--status);
    color: #fff;
    font-weight: 600;
    font-size: 0.86rem;
}
.status-option:hover { filter: brightness(1.08); }
.status-option.empty { background: #c4c4c4; }

.person-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 37px;
    border: 0;
    background: none;
}
.person-cell:hover { background: var(--bg-soft); }
.person-cell .avatar { margin-left: -6px; border: 2px solid var(--bg); }
.person-cell .avatar:first-child { margin-left: 0; }
.person-empty { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-soft); color: var(--text-faint); }
.more-count { margin-left: 0.25rem; color: var(--text-muted); font-size: 0.78rem; font-weight: 700; }
.people-pop { width: 240px; }
.person-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--text);
    text-align: left;
}
.person-option span { flex: 1; }
.person-option:hover { background: var(--bg-hover); }
.person-option.on { background: var(--gold-soft); }

.check-cell { display: grid; place-items: center; height: 37px; cursor: pointer; }
.check-cell input { width: 18px; height: 18px; accent-color: var(--success); cursor: pointer; }

.add-group { margin-top: 0.25rem; }

/* ============================================================
   Tasks: Kanban
   ============================================================ */
.kanban-bar { padding: 0.75rem 1.25rem 0; color: var(--text-muted); font-size: 0.88rem; }
.kanban-bar select { margin-left: 0.4rem; padding: 0.25rem 0.4rem; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg); }
.kanban {
    flex: 1;
    display: flex;
    gap: 0.85rem;
    min-height: 0;
    overflow-x: auto;
    padding: 1rem 1.25rem 1.25rem;
}
.lane {
    display: flex;
    flex-direction: column;
    flex: none;
    width: 280px;
    max-height: 100%;
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
    border-top: 4px solid var(--lane);
    transition: box-shadow 0.12s;
}
.lane.drop-target { box-shadow: 0 0 0 2px var(--lane); }
.lane-head { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 0.85rem 0.4rem; font-weight: 800; }
.lane-head small { padding: 0 0.45rem; border-radius: 999px; background: var(--bg); color: var(--text-muted); font-weight: 700; }
.lane-cards { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem; padding: 0.25rem 0.6rem 0.5rem; min-height: 60px; }
.card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg);
    box-shadow: var(--shadow-sm);
    cursor: grab;
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card.dragging { opacity: 0.45; }
.card-title { font-weight: 600; overflow-wrap: anywhere; }
.card-meta, .card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--text-muted); }
.card-foot { justify-content: space-between; }
.chip { padding: 0.05rem 0.45rem; border-radius: 999px; background: color-mix(in srgb, var(--chip) 16%, transparent); color: var(--chip); font-weight: 700; }
.card-date { display: inline-flex; align-items: center; gap: 0.2rem; }
.card-date.overdue { color: var(--danger); font-weight: 700; }
.avatars { display: flex; }
.avatars .avatar { margin-left: -5px; border: 2px solid var(--bg); }
.avatars .avatar:first-child { margin-left: 0; }
.card-updates { display: inline-flex; align-items: center; gap: 0.2rem; color: var(--link); font-weight: 700; }
.lane-add {
    margin: 0 0.6rem 0.6rem;
    padding: 0.45rem 0.6rem;
    border: 1px dashed transparent;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.88rem;
}
.lane-add:hover { border-color: var(--line-strong); }
.lane-add:focus { outline: none; border-style: solid; border-color: var(--gold); background: var(--bg); color: var(--text); }

/* ============================================================
   Tasks: updates drawer
   ============================================================ */
.drawer-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(11, 17, 25, 0.3); animation: fade 0.12s ease-out; }
.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 91;
    display: flex;
    flex-direction: column;
    width: min(520px, 100vw);
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    animation: slide 0.16s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.1rem 0.6rem 1.4rem; }
.drawer-head small { color: var(--text-muted); font-weight: 700; font-size: 0.8rem; }
.drawer-head h2 { font-size: 1.35rem; font-weight: 800; overflow-wrap: anywhere; }
.drawer-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem 1rem;
    margin: 0;
    padding: 0.5rem 1.4rem 1rem;
    border-bottom: 1px solid var(--line);
}
.drawer-fields dt { display: flex; align-items: center; gap: 0.3rem; color: var(--text-faint); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.drawer-fields dd { margin: 0.2rem 0 0; display: flex; flex-wrap: wrap; gap: 0.3rem; font-size: 0.9rem; }
.status-chip { padding: 0.1rem 0.55rem; border-radius: 4px; background: var(--status); color: #fff; font-weight: 600; font-size: 0.82rem; }
.person-chip { display: inline-flex; align-items: center; gap: 0.3rem; }
.drawer-title { padding: 0.9rem 1.4rem 0.3rem; font-weight: 800; }
.drawer-feed { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.75rem; padding: 0.4rem 1.4rem 1rem; }
.drawer-empty { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 2rem 1rem; color: var(--text-muted); text-align: center; }
.update { padding: 0.75rem 0.85rem; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.update-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.update-head time { margin-left: auto; color: var(--text-faint); font-size: 0.78rem; }
.update .image-card, .update .file-card { margin-top: 0.4rem; }
.drawer .composer { padding: 0.5rem 1.4rem 1.25rem; }

/* Label editor */
.label-editor { display: flex; flex-direction: column; gap: 0.5rem; }
.label-row { display: flex; align-items: center; gap: 0.5rem; }
.label-row input[type=color] { width: 36px; height: 34px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg); cursor: pointer; }
.label-text { flex: 1; height: 34px; padding: 0 0.6rem; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--bg); }
.label-text:focus { outline: none; border-color: var(--gold); }

@media (max-width: 760px) {
    .board-head { flex-wrap: wrap; height: auto; min-height: var(--head-h); padding-top: 0.4rem; padding-bottom: 0.4rem; }
    .board-search input { width: 100px; }
    .board-head .channel-actions { margin-left: 0; }
    .grid col.col-name { width: 240px; }
    .boards-home, .board-scroll { padding-left: 0.75rem; padding-right: 0.75rem; }
}

/* ============================================================
   ASTRA THEME
   Matches the Astra Alerts console (Market Data Service):
   navy glass panels over the deep-water background, gold accents,
   Bebas Neue titles, Raleway uppercase labels, Hanken Grotesk text.
   This layer comes last on purpose: it re-points the tokens above
   and restyles the shared pieces.
   ============================================================ */
:root, :root:not([data-theme]) {
    color-scheme: dark;
    --navy-900: #05080b;
    --navy-800: #0b111a;
    --navy-700: #111927;
    --navy-600: #18222f;
    --ivory: #f3efe6;
    --muted: #9ba6b4;
    --muted-dim: #6a7585;
    --gold: #c9a24b;
    --gold-light: #e0c173;
    --accent-rgb: 201, 162, 75;
    --ok: #d7e2c8;
    --ok-rgb: 160, 196, 132;
    --bad: #e7a394;
    --bad-rgb: 231, 120, 100;
    --serif: "Bebas Neue", "Arial Narrow", sans-serif;
    --subhead: "Raleway", system-ui, sans-serif;
    --panel-bg: rgba(17, 25, 39, 0.8);

    --bg: #0b111a;
    --bg-soft: #111927;
    --bg-hover: rgba(214, 224, 240, 0.04);
    --text: #f3efe6;
    --text-muted: #9ba6b4;
    --text-faint: #6a7585;
    --line: rgba(214, 224, 240, 0.1);
    --line-strong: rgba(214, 224, 240, 0.18);
    --link: #e0c173;
    --danger: #e2604d;
    --danger-soft: rgba(231, 120, 100, 0.12);
    --success: #9cc47f;
    --gold-soft: rgba(201, 162, 75, 0.16);
    --gold-strong: #b38a37;
    --navy: #18222f;
    --navy-strong: #111927;
    --mention-bg: rgba(201, 162, 75, 0.16);
    --mention-text: #e0c173;
    --mention-me-bg: rgba(201, 162, 75, 0.32);
    --mine-bg: rgba(201, 162, 75, 0.13);
    --mine-text: #f3efe6;
    --radius: 7px;
    --radius-lg: 10px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9);
    --shadow-lg: 0 30px 80px -30px rgba(0, 0, 0, 0.95);
    --side-w: 248px;
    --rail-w: 64px;
    --head-h: 88px;
}

html, body {
    color: var(--ivory);
    background:
        linear-gradient(180deg, rgba(5, 8, 11, 0.72), rgba(5, 8, 11, 0.86)),
        url("bg-body.webp") center / cover fixed,
        var(--navy-900);
}
::selection { background: rgba(var(--accent-rgb), 0.35); color: #fff; }
:focus-visible { outline: 2px solid var(--gold-light); }

.eyebrow {
    font-family: var(--subhead);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
}

/* Buttons: Raleway uppercase. Primary is the gold bar; secondary is outlined glass. */
.button {
    min-height: 2.4rem;
    height: auto;
    padding: 0 1rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(5, 8, 11, 0.35);
    color: var(--ivory);
    font-family: var(--subhead);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.button:not(.secondary):not(.danger) {
    border-color: transparent;
    background: linear-gradient(#d4ad57, #b38a37);
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    box-shadow: 0 8px 22px -10px rgba(var(--accent-rgb), 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.button:not(.secondary):not(.danger):hover { background: linear-gradient(#d4ad57, #b38a37); filter: brightness(1.08); }
.button.secondary { background: rgba(5, 8, 11, 0.35); color: var(--ivory); border-color: var(--line-strong); box-shadow: none; }
.button.secondary:hover { background: rgba(5, 8, 11, 0.5); border-color: rgba(var(--accent-rgb), 0.7); color: var(--gold-light); }
.button.danger { background: rgba(5, 8, 11, 0.35); color: var(--ivory); border-color: var(--line-strong); }
.button.danger:hover { background: rgba(var(--bad-rgb), 0.12); border-color: rgba(var(--bad-rgb), 0.6); color: var(--bad); }
.button.danger-solid:not(.secondary):not(.danger) { background: rgba(var(--bad-rgb), 0.18); border-color: rgba(var(--bad-rgb), 0.65); color: #f2b3a6; text-shadow: none; box-shadow: none; }
.button.danger-solid:not(.secondary):not(.danger):hover { background: rgba(var(--bad-rgb), 0.28); color: #fff; }
.button.small { min-height: 1.95rem; padding: 0 0.7rem; font-size: 0.68rem; }
.button.block { min-height: 2.7rem; }
.icon-button { color: var(--muted); }
.icon-button:hover { background: rgba(214, 224, 240, 0.06); color: var(--ivory); }

/* Forms */
.form label > span, .secret > label, .drawer-fields dt {
    font-family: var(--subhead);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}
.form input:not([type=checkbox]), .input-prefix, .label-text, .board-search, .kanban-bar select {
    background: rgba(5, 8, 11, 0.6);
    border-color: var(--line-strong);
    color: var(--ivory);
}
.form input:not([type=checkbox]):focus, .input-prefix:focus-within, .board-search:focus-within {
    border-color: rgba(var(--accent-rgb), 0.7);
    background: rgba(5, 8, 11, 0.8);
    box-shadow: none;
}
input::placeholder, textarea::placeholder { color: var(--muted-dim); }
.toggle input, input[type=checkbox] { accent-color: var(--gold); }
.badge { font-family: var(--subhead); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; background: transparent; border-color: var(--line-strong); }
.badge.owner { color: var(--gold-light); border-color: rgba(var(--accent-rgb), 0.45); background: rgba(var(--accent-rgb), 0.07); }
.banner { background: rgba(var(--bad-rgb), 0.1); border-color: rgba(var(--bad-rgb), 0.4); border-left-color: var(--danger); color: var(--ivory); }

/* Avatars: tinted glass circles with a coloured rim, like the console's */
.avatar {
    background: color-mix(in srgb, var(--tone) 28%, rgba(5, 8, 11, 0.6));
    border: 1px solid color-mix(in srgb, var(--tone) 70%, transparent);
    color: color-mix(in srgb, var(--tone) 35%, #fff);
    font-family: var(--subhead);
    font-weight: 700;
}

/* ── Shell ───────────────────────────────────────── */
.app { background: transparent; }
.rail {
    gap: 0.6rem;
    padding: 1.1rem 0;
    background: rgba(5, 8, 11, 0.9);
    border-right: 1px solid var(--line);
}
.rail-list { border-top: 0; padding-top: 0; }
.rail-item { border-radius: 12px; opacity: 0.6; }
.rail-item.current { border-color: var(--gold); box-shadow: 0 0 22px -8px rgba(var(--accent-rgb), 0.7); }
.rail-add { background: rgba(214, 224, 240, 0.05); border: 1px dashed var(--line-strong); color: var(--muted); }
.rail-add:hover { background: rgba(var(--accent-rgb), 0.1); border-color: rgba(var(--accent-rgb), 0.6); color: var(--gold-light); }

.sidebar {
    margin: 0;
    border-radius: 0;
    background: rgba(5, 8, 11, 0.8);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--line);
    color: var(--muted);
}
.side-head {
    flex-direction: column;
    justify-content: center;
    gap: 0.55rem;
    height: auto;
    margin: 0 0.9rem;
    padding: 1.4rem 0 1.1rem;
    border-bottom: 1px solid var(--line);
}
.brand-logo {
    display: block;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.85), 0 0 36px -10px rgba(var(--accent-rgb), 0.45);
}
.workspace-button {
    justify-content: center;
    max-width: 100%;
    padding: 0.25rem 0.6rem;
    color: var(--gold-light);
    font-family: var(--subhead);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.workspace-button:hover { background: rgba(var(--accent-rgb), 0.08); }
.menu {
    top: calc(100% - 0.6rem);
    left: 50%;
    transform: translateX(-50%);
    width: 260px;
    background: var(--navy-700);
    border-color: var(--line-strong);
}
.menu button { font-size: 0.9rem; }
.menu button:hover { background: rgba(var(--accent-rgb), 0.12); color: var(--gold-light); }

.side-scroll { padding: 1rem 0.9rem 1rem; }
.side-section { margin-top: 1.2rem; }
.side-section-head {
    padding: 0.2rem 0.4rem 0.4rem 0.75rem;
    color: var(--muted-dim);
    font-family: var(--subhead);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.side-section-head .icon-button { color: var(--muted-dim); }
.side-section-head .icon-button:hover { background: rgba(214, 224, 240, 0.06); color: var(--gold-light); }

.side-link {
    position: relative;
    gap: 0.75rem;
    height: auto;
    min-height: 2.45rem;
    margin: 1px 0;
    padding: 0 0.75rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--muted);
    font-family: var(--subhead);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.side-link .icon { opacity: 0.9; }
.side-link:hover { background: rgba(214, 224, 240, 0.04); color: var(--ivory); }
.side-link.current {
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.02));
    border-color: rgba(var(--accent-rgb), 0.22);
    color: var(--gold-light);
    font-weight: 700;
}
.side-link.current::before {
    content: "";
    position: absolute;
    left: -0.9rem;
    top: 0.55rem;
    bottom: 0.55rem;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--gold);
}
.side-link.current .icon { color: var(--gold-light); }
.side-link.muted { color: var(--muted-dim); }
.side-link.muted:hover { color: var(--gold-light); }
.add-chip { background: transparent; border: 1px dashed var(--line-strong); }

.account {
    display: grid;
    gap: 0.5rem;
    margin: 0 0.9rem;
    padding: 0.9rem 0 1rem;
    border-top: 1px solid var(--line);
}
.account form { margin: 0; }
.account-card { display: flex; align-items: center; gap: 0.7rem; padding: 0 0.35rem; }
.account-card .who { display: grid; min-width: 0; line-height: 1.25; }
.account-card .who strong { color: var(--ivory); font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-card .who span { color: var(--muted); font-size: 0.76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Main column ─────────────────────────────────── */
.main, .thread, .app.with-thread .main {
    margin: 0;
    border-radius: 0;
    background: transparent;
}
.thread { background: rgba(5, 8, 11, 0.72); backdrop-filter: blur(10px); border-left: 1px solid var(--line); }
.channel-head {
    align-items: flex-end;
    gap: 1rem;
    height: auto;
    min-height: var(--head-h);
    padding: 1.3rem 2rem 1rem;
    border-bottom: 1px solid var(--line);
}
.head-text { display: grid; gap: 0.3rem; flex: 1; min-width: 0; }
.channel-head h1, .channel-head h2 {
    gap: 0.5rem;
    font-family: var(--serif);
    font-size: clamp(1.9rem, 3vw, 2.5rem);
    font-weight: 400;
    letter-spacing: 0.03em;
    line-height: 1;
}
.channel-head h1 .icon { color: var(--gold); }
.thread .channel-head { min-height: var(--head-h); padding: 1.3rem 1.25rem 1rem; }
.thread .channel-head h2 { font-size: 1.8rem; }
.thread .channel-head h2 small { font-family: var(--sans); letter-spacing: 0; }
.channel-actions { padding-bottom: 0.2rem; }
.member-stack {
    min-height: 2rem;
    border-radius: 999px;
    border-color: var(--line-strong);
    background: rgba(5, 8, 11, 0.55);
    color: var(--ivory);
    font-family: var(--subhead);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}
.member-stack:hover { border-color: rgba(var(--accent-rgb), 0.6); background: rgba(5, 8, 11, 0.7); }
.member-stack .avatar { border-color: var(--navy-900); }

.toast { background: var(--navy-700); border: 1px solid rgba(var(--bad-rgb), 0.45); }

/* Messages */
.messages { padding-left: 0.75rem; padding-right: 0.75rem; }
.intro { padding: 2.2rem 1.25rem 1rem; }
.intro h2, .empty h2, .board-empty h2, .modal-head h2, .drawer-head h2, .auth-card h1 {
    font-family: var(--serif);
    font-weight: 400;
    letter-spacing: 0.03em;
    line-height: 1;
}
.intro h2 { font-size: 2.1rem; }
.intro-icon, .empty-icon, .board-card-icon { background: rgba(var(--accent-rgb), 0.1); border: 1px solid rgba(var(--accent-rgb), 0.35); color: var(--gold-light); }
.day-divider span {
    border-color: var(--line-strong);
    background: var(--navy-800);
    color: var(--muted);
    font-family: var(--subhead);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.message { border-radius: var(--radius); }
.message:hover, .message.active { background: rgba(214, 224, 240, 0.035); }
.message.active { box-shadow: inset 3px 0 0 var(--gold); }
.message-meta strong { color: var(--ivory); font-weight: 700; }
.message-meta time, .hover-time { color: var(--muted-dim); }
.message-body { color: #e6e2d9; }
.message.mine .message-body { border: 1px solid rgba(var(--accent-rgb), 0.3); }
.message.mine .mention { background: rgba(var(--accent-rgb), 0.22); color: var(--gold-light); }
.message.mine .message-body a { color: var(--gold-light); }
.message-actions { background: var(--navy-700); border-color: var(--line-strong); }
.message-actions button:hover { background: rgba(var(--accent-rgb), 0.12); color: var(--gold-light); }
.reaction { background: rgba(5, 8, 11, 0.5); border-color: var(--line); color: var(--muted); }
.reaction:hover { background: rgba(5, 8, 11, 0.7); border-color: var(--line-strong); }
.reaction.mine { border-color: rgba(var(--accent-rgb), 0.55); background: rgba(var(--accent-rgb), 0.12); color: var(--gold-light); }
.file-card, .pending-file { background: rgba(5, 8, 11, 0.45); border-color: var(--line-strong); }
.file-card:hover { border-color: rgba(var(--accent-rgb), 0.5); }
.file-icon { background: rgba(var(--accent-rgb), 0.14); border: 1px solid rgba(var(--accent-rgb), 0.4); color: var(--gold-light); }
.image-card { background: rgba(5, 8, 11, 0.45); border-color: var(--line-strong); }
.quote, .quote-chip { background: rgba(5, 8, 11, 0.45); }
.reply-link { color: var(--gold-light); font-family: var(--subhead); font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; }
.reply-link:hover { background: rgba(5, 8, 11, 0.45); border-color: rgba(var(--accent-rgb), 0.4); }
.mention-card { background: var(--panel-bg); border-color: var(--line); backdrop-filter: blur(10px); }
.mention-card:hover { border-color: rgba(var(--accent-rgb), 0.4); }
.mention-where { font-family: var(--subhead); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-dim); }
.reply-count { font-family: var(--subhead); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* Composer */
.composer { padding: 0 2rem 1.4rem; }
.thread .composer, .drawer .composer { padding: 0 1.25rem 1.25rem; }
.composer-box {
    border-color: var(--line-strong);
    border-radius: var(--radius-lg);
    background: rgba(11, 17, 26, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}
.composer-box:focus-within { border-color: rgba(var(--accent-rgb), 0.7); box-shadow: var(--shadow); }
.composer textarea { color: var(--ivory); }
.composer-hint { color: var(--muted-dim); }
kbd { background: rgba(5, 8, 11, 0.6); border-color: var(--line-strong); color: var(--muted); }
.send-button { background: linear-gradient(#d4ad57, #b38a37); color: #fff; box-shadow: 0 6px 16px -8px rgba(var(--accent-rgb), 0.8); }
.send-button:hover:not(:disabled) { background: linear-gradient(#d4ad57, #b38a37); filter: brightness(1.08); }
.send-button:disabled { background: transparent; box-shadow: none; color: var(--muted-dim); }
.mention-popup { background: var(--navy-700); border-color: var(--line-strong); }
.mention-popup button:hover, .mention-popup button:focus-visible { background: rgba(var(--accent-rgb), 0.14); color: var(--gold-light); }
.drop-overlay { background: rgba(5, 8, 11, 0.75); }
.drop-overlay > div { background: var(--navy-700); border-color: var(--gold); }

/* Dialogs */
.modal-backdrop { background: rgba(5, 8, 11, 0.75); backdrop-filter: blur(3px); }
.modal { background: var(--navy-700); border: 1px solid var(--line-strong); border-radius: 12px; }
.modal-head { padding: 1.4rem 1.25rem 0.75rem 1.5rem; }
.modal-head h2 { font-size: 1.9rem; }
.form-actions { padding-top: 1rem; border-top: 1px solid var(--line); }
.secret { background: rgba(5, 8, 11, 0.45); border-color: var(--line); }
.secret > code, .copy-row code { background: rgba(5, 8, 11, 0.7); border-color: var(--line-strong); color: var(--gold-light); }
.person:hover { background: rgba(214, 224, 240, 0.04); }

/* Empty states */
.empty h2 { font-size: 1.9rem; }
.empty-icon { border-radius: 50%; }

/* ── Auth pages: the console's sign-in gate ─────── */
.auth-page { background: transparent; }
.auth-card {
    gap: 0.9rem;
    padding: 2rem 2rem 1.6rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(11, 17, 26, 0.88);
    backdrop-filter: blur(10px);
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.95);
    text-align: center;
}
.auth-card .form { text-align: left; }
.auth-logo { width: 96px; height: 96px; margin: 0 auto 0.4rem; box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.85), 0 0 36px -10px rgba(var(--accent-rgb), 0.45); }
.auth-card .eyebrow { margin-bottom: -0.4rem; }
.auth-card h1 { font-size: 2.2rem; text-transform: uppercase; }
.auth-sub { color: var(--muted); font-size: 0.88rem; margin-top: -0.2rem; }
.auth-foot { color: var(--muted); }
.auth-foot a, .auth-card a:not(.button) { color: var(--gold-light); }

/* ── Tasks ───────────────────────────────────────── */
.view-tabs { padding: 0; gap: 0; border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; overflow: hidden; }
.view-tabs button {
    min-height: 2.2rem;
    border-radius: 0;
    border-right: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--subhead);
    font-size: 0.7rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
.view-tabs button:last-child { border-right: 0; }
.view-tabs button.current { background: rgba(var(--accent-rgb), 0.18); color: var(--gold-light); box-shadow: none; }
.title-button:hover { border-color: rgba(var(--accent-rgb), 0.5); }
.title-input { background: rgba(5, 8, 11, 0.8); color: var(--ivory); font-family: var(--serif); }
.board-search { height: 2.2rem; }
.board-search input { color: var(--ivory); }
.pop { background: var(--navy-700); border-color: var(--line-strong); }
.pop-title { font-family: var(--subhead); color: var(--muted-dim); letter-spacing: 0.14em; }
.menu-pop button:hover:not(:disabled), .pop-link:hover { background: rgba(var(--accent-rgb), 0.12); color: var(--gold-light); }
.menu-pop button.danger { color: var(--bad); }
.menu-pop button.danger:hover { background: rgba(var(--bad-rgb), 0.12); color: var(--bad); }

.boards-home, .board-scroll { padding: 1.4rem 2rem 2.4rem; }
.board-card { background: var(--panel-bg); border-color: var(--line); backdrop-filter: blur(10px); box-shadow: var(--shadow); }
.board-card:hover { border-color: rgba(var(--accent-rgb), 0.45); }
.board-card strong { font-family: var(--serif); font-size: 1.6rem; font-weight: 400; letter-spacing: 0.03em; line-height: 1; }
.board-card.add { background: transparent; border-color: var(--line-strong); }

.group {
    padding: 1rem 1.1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}
.group-name, .group-input { font-family: var(--serif); font-size: 1.55rem; font-weight: 400; letter-spacing: 0.03em; }
.group-input { background: rgba(5, 8, 11, 0.8); }
.group-count { font-family: var(--subhead); font-size: 0.66rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-dim); }
.grid { font-size: 0.9rem; }
.grid th {
    background: rgba(5, 8, 11, 0.3);
    color: var(--muted-dim);
    font-family: var(--subhead);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}
.column-head:hover { background: rgba(var(--accent-rgb), 0.08); color: var(--gold-light); }
.grid .name-cell { background: #0f1722; }
.grid tbody tr:hover td { background: rgba(214, 224, 240, 0.035); }
.grid tbody tr:hover td.name-cell { background: #131c29; }
.add-row td, .add-row td.name-cell { background: transparent !important; }
.cell-input { color: var(--ivory); }
.cell-input:focus { background: rgba(5, 8, 11, 0.8); border-color: rgba(var(--accent-rgb), 0.7); }
.date-input { color-scheme: dark; }
.date-input::-webkit-calendar-picker-indicator { filter: invert(0.75) sepia(1) saturate(3) hue-rotate(5deg); cursor: pointer; }
.updates-button:hover { background: rgba(var(--accent-rgb), 0.1); color: var(--gold-light); }
.updates-button.has { color: var(--gold-light); }
.status-pill { font-family: var(--subhead); font-size: 0.72rem; letter-spacing: 0.04em; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.status-pill.empty, .status-option.empty { background: rgba(214, 224, 240, 0.08); color: var(--muted-dim); text-shadow: none; }
.status-option { font-family: var(--subhead); font-size: 0.74rem; }
.person-cell:hover { background: rgba(var(--accent-rgb), 0.06); }
.person-empty { background: rgba(5, 8, 11, 0.5); border: 1px dashed var(--line-strong); color: var(--muted-dim); }
.person-cell .avatar, .avatars .avatar { border-color: #0f1722; }
.person-option:hover { background: rgba(214, 224, 240, 0.05); }
.person-option.on { background: rgba(var(--accent-rgb), 0.14); color: var(--gold-light); }

.kanban-bar { padding: 1rem 2rem 0; font-family: var(--subhead); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
.kanban { padding: 1.2rem 2rem 1.6rem; }
.lane { background: var(--panel-bg); border: 1px solid var(--line); border-top: 3px solid var(--lane); backdrop-filter: blur(10px); }
.lane-head span { font-family: var(--serif); font-size: 1.35rem; font-weight: 400; letter-spacing: 0.03em; }
.lane-head small { background: rgba(5, 8, 11, 0.5); border: 1px solid var(--line); font-family: var(--subhead); }
.card { background: rgba(5, 8, 11, 0.55); border-color: var(--line-strong); }
.card:hover { border-color: rgba(var(--accent-rgb), 0.5); }
.chip { font-family: var(--subhead); font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; }
.card-updates { color: var(--gold-light); }
.lane-add:focus { background: rgba(5, 8, 11, 0.8); }

.drawer-backdrop { background: rgba(5, 8, 11, 0.6); backdrop-filter: blur(2px); }
.drawer { background: var(--navy-700); border-left: 1px solid var(--line-strong); }
.drawer-head small { font-family: var(--subhead); font-size: 0.66rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.drawer-head h2 { font-size: 2rem; }
.drawer-title { font-family: var(--serif); font-size: 1.4rem; font-weight: 400; letter-spacing: 0.03em; }
.update { background: rgba(5, 8, 11, 0.4); border-color: var(--line); }
.status-chip { font-family: var(--subhead); font-size: 0.7rem; }

.label-row input[type=color] { background: rgba(5, 8, 11, 0.6); }

/* Scrollbars */
* { scrollbar-color: rgba(214, 224, 240, 0.16) transparent; scrollbar-width: thin; }

@media (max-width: 760px) {
    :root { --head-h: 72px; }
    .channel-head { padding: 0.9rem 0.9rem 0.8rem; align-items: center; }
    .composer { padding: 0 0.75rem 0.75rem; }
    .sidebar { background: rgba(5, 8, 11, 0.96); }
    .side-link.current::before { left: -0.9rem; }
    .boards-home, .board-scroll, .kanban { padding-left: 0.75rem; padding-right: 0.75rem; }
}

/* ============================================================
   WHITE MESSAGE SPACE
   The chat column (and the thread beside it) sits on white, with the
   navy sidebar and gold accents kept. Tokens are re-pointed for this
   area only, then the few glass surfaces from the theme are made light.
   ============================================================ */
.main.chat, .thread {
    --bg: #ffffff;
    --bg-soft: #f6f7f9;
    --bg-hover: #f5f6f8;
    --text: #1d1f23;
    --text-muted: #5d6570;
    --text-faint: #8b929b;
    --ivory: #1d1f23;
    --muted: #5d6570;
    --muted-dim: #8b929b;
    --line: #e7e9ec;
    --line-strong: #d5d9de;
    --link: #8f6b1f;
    --mention-bg: rgba(201, 162, 75, 0.18);
    --mention-text: #7a5b14;
    --mention-me-bg: rgba(201, 162, 75, 0.38);
    --mine-bg: #f7efdc;
    --mine-text: #1d1f23;
    --shadow: 0 6px 18px -8px rgba(16, 24, 40, 0.18);
    --shadow-lg: 0 18px 48px rgba(16, 24, 40, 0.22);
    color-scheme: light;
    background: #ffffff;
    color: var(--text);
}
.thread { backdrop-filter: none; border-left-color: var(--line); }
.main.chat .channel-head, .thread .channel-head { background: #ffffff; }
.main.chat .channel-head h1, .thread .channel-head h2 { color: #0b111a; }
.main.chat .channel-head h1 .icon { color: var(--gold); }
.main.chat .member-stack { background: #fff; color: var(--text); }
.main.chat .member-stack:hover { background: var(--bg-hover); }
.main.chat .member-stack .avatar { border-color: #fff; }

.main.chat .message-body, .thread .message-body { color: var(--text); }
.main.chat .message:hover, .main.chat .message.active, .thread .message:hover { background: var(--bg-hover); }
.main.chat .message.mine:hover, .thread .message.mine:hover { background: transparent; }
.main.chat .message.mine .message-body, .thread .message.mine .message-body { border-color: rgba(201, 162, 75, 0.45); }
.main.chat .message.mine .mention { background: rgba(201, 162, 75, 0.25); color: #7a5b14; }
.main.chat .message.mine .message-body a { color: #8f6b1f; }
.main.chat .day-divider span { background: #fff; color: var(--text-muted); }
.main.chat .message-actions { background: #fff; border-color: var(--line-strong); box-shadow: var(--shadow); }
.main.chat .message-actions button:hover { background: var(--bg-hover); color: var(--text); }
.main.chat .reaction { background: var(--bg-soft); border-color: var(--line); color: var(--text-muted); }
.main.chat .reaction:hover { background: #fff; border-color: var(--line-strong); }
.main.chat .reaction.mine { background: rgba(201, 162, 75, 0.16); border-color: var(--gold); color: #7a5b14; }
.main.chat .file-card, .main.chat .pending-file, .main.chat .image-card,
.thread .file-card, .thread .pending-file { background: #fff; border-color: var(--line-strong); }
.main.chat .file-icon, .thread .file-icon { background: #0b111a; border-color: #0b111a; color: var(--gold-light); }
.main.chat .quote, .main.chat .quote-chip { background: var(--bg-soft); color: var(--text-muted); }
.main.chat .quote:hover { background: var(--bg-hover); }
.main.chat .reply-link { color: #8f6b1f; }
.main.chat .reply-link:hover { background: var(--bg-soft); border-color: var(--line-strong); }
.main.chat .intro-icon, .main.chat .empty-icon { background: rgba(201, 162, 75, 0.12); border-color: rgba(201, 162, 75, 0.45); color: #8f6b1f; }
.main.chat .intro h2, .main.chat .empty h2 { color: #0b111a; }
.main.chat .mention-card { background: #fff; backdrop-filter: none; }
.main.chat .mention-card:hover { box-shadow: var(--shadow); }

.main.chat .composer-box, .thread .composer-box { background: #fff; backdrop-filter: none; box-shadow: var(--shadow); }
.main.chat .composer-box:focus-within, .thread .composer-box:focus-within { border-color: var(--gold); }
.main.chat kbd, .thread kbd { background: var(--bg-soft); color: var(--text-muted); }
.main.chat .send-button:disabled, .thread .send-button:disabled { color: var(--text-faint); }
.main.chat .mention-popup { background: #fff; }
.main.chat .mention-popup button:hover, .main.chat .mention-popup button:focus-visible { background: rgba(201, 162, 75, 0.14); color: var(--text); }
.main.chat .drop-overlay { background: rgba(255, 255, 255, 0.85); }
.main.chat .drop-overlay > div { background: #fff; }
.main.chat .toast { background: #0b111a; color: #f3efe6; }
.main.chat .icon-button:hover, .thread .icon-button:hover { background: var(--bg-hover); color: var(--text); }

/* Header bar keeps the console look: dark glass over the deep-water background. Only the messages and composer are white. */
.main.chat { background: transparent; }
.main.chat .messages, .main.chat .composer { background: #ffffff; }
.main.chat .composer { margin: 0; padding-top: 0.25rem; }
.thread { background: transparent; backdrop-filter: none; }
.thread .messages, .thread .composer { background: #ffffff; }
.main.chat .channel-head, .thread .channel-head {
    --text: #f3efe6;
    --text-muted: #9ba6b4;
    --ivory: #f3efe6;
    --line-strong: rgba(214, 224, 240, 0.18);
    background: rgba(5, 8, 11, 0.55);
    border-bottom-color: rgba(214, 224, 240, 0.1);
    color: #f3efe6;
}
.main.chat .channel-head h1, .thread .channel-head h2 { color: #f3efe6; }
.thread .channel-head h2 small { color: #9ba6b4; }
.main.chat .channel-head .icon-button, .thread .channel-head .icon-button { color: #9ba6b4; }
.main.chat .channel-head .icon-button:hover, .thread .channel-head .icon-button:hover { background: rgba(214, 224, 240, 0.06); color: #f3efe6; }
.main.chat .member-stack { background: rgba(5, 8, 11, 0.55); border-color: rgba(214, 224, 240, 0.18); color: #f3efe6; }
.main.chat .member-stack:hover { background: rgba(5, 8, 11, 0.7); border-color: rgba(201, 162, 75, 0.6); }
.main.chat .member-stack .avatar { border-color: #05080b; }
.main.chat .channel-head .button.secondary { background: rgba(5, 8, 11, 0.35); color: #f3efe6; border-color: rgba(214, 224, 240, 0.18); }

/* Sign-on card: same as the console's gate */
.auth-card { width: min(420px, 100%); gap: 1rem; padding: 2rem 2rem 1.6rem; text-align: left; }
.auth-logo { width: 96px; height: 96px; margin: 0 auto; }
.auth-heading { display: grid; gap: 0.4rem; margin-bottom: 0.3rem; text-align: center; }
.auth-heading .eyebrow { margin: 0; }
.auth-heading h1 { font-size: 2.2rem; }
.auth-heading .auth-sub { margin: 0; font-size: 0.88rem; line-height: 1.55; }
.auth-card .form { gap: 1rem; }
.auth-card .form input:not([type=checkbox]) { height: 2.4rem; }
.auth-card .button.block { min-height: 2.7rem; margin-top: 0.2rem; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--muted-dim);
    font-family: var(--subhead);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line-strong); }
.auth-dev { display: flex; gap: 0.5rem; }
.auth-dev .button { flex: 1; padding: 0 0.6rem; }
.auth-foot { font-family: var(--subhead); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

/* Empty date cells stay blank until clicked (no "mm/dd/yyyy"). */
.date-input.empty:not(:focus)::-webkit-datetime-edit { color: transparent; }
.date-input.empty:not(:focus) { color: transparent; }
.date-input.empty:not(:focus)::-webkit-calendar-picker-indicator { opacity: 0; }
.grid tr:hover .date-input.empty::-webkit-calendar-picker-indicator { opacity: 0.6; }

/* One workspace (Astra Alerts): no workspace rail. */
:root { --rail-w: 0px; }
.app { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.app.with-thread { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--thread-w); }
@media (max-width: 1100px) {
    .app.with-thread { grid-template-columns: var(--side-w) minmax(0, 1fr); }
}
@media (max-width: 760px) {
    .app, .app.with-thread { grid-template-columns: minmax(0, 1fr); }
    .sidebar { left: 0; width: min(var(--side-w), calc(100vw - 2rem)); transform: translateX(calc(-100% - 8px)); }
}

/* ============================================================
   BRAINSTORM: whiteboards and mind maps
   The drawing surface is white with a dot grid; the header stays dark.
   ============================================================ */
.brainstorm-section { margin-bottom: 2rem; }
.section-title { display: grid; gap: 0.25rem; margin-bottom: 0.9rem; }
.section-title h2 { font-family: var(--serif); font-size: 1.8rem; font-weight: 400; letter-spacing: 0.03em; line-height: 1; }
.section-title p { color: var(--muted); font-size: 0.9rem; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2rem;
    padding: 0 0.8rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(5, 8, 11, 0.55);
    font-family: var(--subhead);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}
.pill .dot { width: 0.5rem; height: 0.5rem; box-shadow: none; }
.pill.live { color: var(--ok); border-color: rgba(var(--ok-rgb), 0.35); }
.pill.live .dot { background: #9cc47f; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.kind-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.kind-picker button {
    display: grid;
    justify-items: start;
    gap: 0.25rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: rgba(5, 8, 11, 0.35);
    color: var(--ivory);
    text-align: left;
}
.kind-picker button .icon { color: var(--muted); }
.kind-picker button small { color: var(--muted); font-size: 0.78rem; }
.kind-picker button.on { border-color: rgba(var(--accent-rgb), 0.7); background: rgba(var(--accent-rgb), 0.1); }
.kind-picker button.on .icon { color: var(--gold-light); }

.main.canvas { background: transparent; }
.canvas-body {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    background: #ffffff;
    color-scheme: light;
}

/* Floating tool rail on the left of the surface */
.wb-toolbar {
    position: absolute;
    top: 50%;
    left: 1rem;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    max-height: calc(100% - 2rem);
    overflow-y: auto;
    padding: 0.4rem;
    border: 1px solid #e3e6ea;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 10px 30px -12px rgba(16, 24, 40, 0.35);
    transform: translateY(-50%);
    scrollbar-width: none;
}
.wb-toolbar > button {
    display: grid;
    place-items: center;
    width: 36px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: #4a525d;
}
.wb-toolbar > button:hover:not(:disabled) { background: #f2f4f7; color: #1d1f23; }
.wb-toolbar > button.on { background: #0b111a; color: var(--gold-light); }
.wb-toolbar > button:disabled { opacity: 0.35; }
.wb-toolbar .swatch { width: 24px; height: 24px; }
.wb-toolbar .swatch span { display: none; }
.swatch {
    border-radius: 50% !important;
    background: var(--swatch) !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.wb-toolbar > button.swatch { width: 22px; height: 22px; margin: 2px 0; }
.wb-toolbar > button.swatch.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0b111a; }
.wb-toolbar > button.width span { display: block; width: 18px; border-radius: 99px; background: #4a525d; }
.wb-toolbar > button.width.on span { background: var(--gold-light); }

.wb-host, .mm-host {
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    outline: none;
    background-color: #ffffff;
    background-image: radial-gradient(circle, #d6dae0 1px, transparent 1.2px);
    background-size: 24px 24px;
    touch-action: none;
    user-select: none;
}
.wb-host:focus-visible, .mm-host:focus-visible { box-shadow: inset 0 0 0 2px rgba(var(--accent-rgb), 0.5); }
.wb-svg, .mm-svg { display: block; width: 100%; height: 100%; }
.wb-host[data-tool="select"] .wb-svg { cursor: default; }
.wb-host[data-tool="hand"] .wb-svg, .mm-svg { cursor: grab; }
.mm-svg.panning { cursor: grabbing; }
.wb-host[data-tool="pen"] .wb-svg, .wb-host[data-tool="highlighter"] .wb-svg,
.wb-host[data-tool="rect"] .wb-svg, .wb-host[data-tool="ellipse"] .wb-svg,
.wb-host[data-tool="line"] .wb-svg, .wb-host[data-tool="arrow"] .wb-svg { cursor: crosshair; }
.wb-host[data-tool="text"] .wb-svg { cursor: text; }
.wb-host[data-tool="sticky"] .wb-svg { cursor: copy; }
.wb-host[data-tool="eraser"] .wb-svg { cursor: cell; }
.wb-host[data-tool="select"] .wb-item { cursor: move; }

.wb-hit { stroke: transparent; fill: none; pointer-events: stroke; }
.wb-selection { fill: none; stroke: #c9a24b; pointer-events: none; }
.wb-editor {
    position: absolute;
    z-index: 6;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 2px solid #c9a24b;
    border-radius: 4px;
    outline: none;
    resize: none;
    background: transparent;
    font-family: var(--font);
    font-weight: 500;
    line-height: 1.4;
}

.wb-zoom {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0.25rem;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 30px -12px rgba(16, 24, 40, 0.35);
    color: #4a525d;
    font-family: var(--subhead);
    font-size: 0.72rem;
    font-weight: 700;
}
.wb-zoom span { min-width: 3.2rem; text-align: center; }
.wb-zoom button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 7px; background: none; color: #4a525d; }
.wb-zoom button:hover { background: #f2f4f7; color: #1d1f23; }

/* Mind map */
.mm-link { fill: none; stroke-width: 2.5; stroke-linecap: round; opacity: 0.85; }
.mm-node { cursor: pointer; }
.mm-node rect { stroke-width: 2; filter: drop-shadow(0 4px 8px rgba(16, 24, 40, 0.1)); transition: stroke-width 0.1s; }
.mm-node.root rect { stroke-width: 0; filter: drop-shadow(0 10px 18px rgba(201, 162, 75, 0.35)); }
.mm-node.selected rect { stroke-width: 3; }
.mm-node.selected:not(.root) rect { filter: drop-shadow(0 0 0 2px) drop-shadow(0 6px 14px rgba(16, 24, 40, 0.18)); }
.mm-node.selected.root rect { stroke: #0b111a; stroke-width: 3; }

@media (max-width: 760px) {
    .wb-toolbar { top: auto; bottom: 4.2rem; left: 50%; flex-direction: row; max-width: calc(100% - 1rem); overflow-x: auto; transform: translateX(-50%); }
    .kind-picker { grid-template-columns: 1fr; }
}

/* Selected tool stays gold even while hovered, and the pointer shows the tool. */
.wb-toolbar > button.on,
.wb-toolbar > button.on:hover:not(:disabled) { background: linear-gradient(#d4ad57, #b38a37); color: #ffffff; box-shadow: 0 4px 12px -4px rgba(201, 162, 75, 0.8); }
.wb-toolbar > button.width.on span, .wb-toolbar > button.width.on:hover span { background: #ffffff; }
.wb-host[data-tool="pen"] .wb-svg {
    cursor: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='%23ffffff' stroke='%231d1f23' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4z'/%3E%3C/svg%3E") 3 25, crosshair;
}
.wb-host[data-tool="highlighter"] .wb-svg {
    cursor: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='%23ffe27a' stroke='%231d1f23' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='m9 11-6 6v3h9l3-3z'/%3E%3Cpath d='M22 12l-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4z'/%3E%3C/svg%3E") 3 25, crosshair;
}
.wb-host[data-tool="eraser"] .wb-svg {
    cursor: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='%23ffb7c5' stroke='%231d1f23' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='m7 21-4.3-4.3a1 1 0 0 1 0-1.4l10-10a1 1 0 0 1 1.4 0l5.6 5.6a1 1 0 0 1 0 1.4L13 21z'/%3E%3C/svg%3E") 5 22, cell;
}
.wb-host[data-tool="sticky"] .wb-svg {
    cursor: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='%23ffe27a' stroke='%231d1f23' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M15.5 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5z'/%3E%3Cpath d='M15 3v6h6' fill='none'/%3E%3C/svg%3E") 14 14, copy;
}
.wb-host[data-tool="rect"] .wb-svg, .wb-host[data-tool="ellipse"] .wb-svg,
.wb-host[data-tool="line"] .wb-svg, .wb-host[data-tool="arrow"] .wb-svg { cursor: crosshair; }

/* Delete button on Brainstorm cards */
.card-wrap { position: relative; display: grid; }
.card-wrap .board-card { height: 100%; }
.card-delete {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--muted-dim);
    opacity: 0;
    transition: opacity 0.12s;
}
.card-wrap:hover .card-delete, .card-delete:focus-visible { opacity: 1; }
.card-delete:hover { border-color: rgba(var(--bad-rgb), 0.6); background: rgba(var(--bad-rgb), 0.12); color: var(--bad); }
@media (hover: none) { .card-delete { opacity: 1; } }

/* ============================================================
   Pickers (Tasks, Brainstorm) and pins
   ============================================================ */
.modal.wide { width: max(min(80vw, calc(100vw - 2rem)), min(520px, calc(100vw - 2rem))); height: 80dvh; max-height: calc(100dvh - 2rem); }
.modal.wide .modal-body { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }
.modal.wide .modal-body > .form-actions { margin-top: auto; }
.picker-section + .picker-section { margin-top: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.picker-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.picker-head h3 {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0;
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.03em;
}
.picker-head h3 small { color: var(--muted-dim); font-family: var(--subhead); font-size: 0.72rem; letter-spacing: 0.1em; }
.picker-empty {
    padding: 1.4rem 1rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.75rem; }
.picker-card {
    position: relative;
    display: grid;
    align-content: start;
    gap: 0.3rem;
    min-height: 128px;
    padding: 0.9rem 0.9rem 0.8rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: rgba(5, 8, 11, 0.4);
    cursor: pointer;
    user-select: none;
    outline: none;
    transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}
.picker-card:hover { border-color: rgba(var(--accent-rgb), 0.45); background: rgba(5, 8, 11, 0.55); }
.picker-card.on, .picker-card:focus-visible {
    border-color: var(--gold);
    background: rgba(var(--accent-rgb), 0.1);
    box-shadow: 0 0 0 1px var(--gold), 0 12px 28px -18px rgba(var(--accent-rgb), 0.8);
}
.picker-card .board-card-icon { width: 38px; height: 38px; margin-bottom: 0.35rem; }
.picker-card strong { color: var(--ivory); font-family: var(--serif); font-size: 1.35rem; font-weight: 400; letter-spacing: 0.03em; line-height: 1.05; overflow-wrap: anywhere; }
.picker-card small { color: var(--muted); font-size: 0.76rem; }
.picker-actions { position: absolute; top: 0.5rem; right: 0.5rem; display: flex; gap: 2px; }
.picker-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--muted-dim);
    opacity: 0;
    transition: opacity 0.12s;
}
.picker-card:hover .picker-icon, .picker-card.on .picker-icon, .picker-card:focus-within .picker-icon, .picker-icon.pinned { opacity: 1; }
.picker-icon:hover { border-color: var(--line-strong); color: var(--gold-light); }
.picker-icon.pinned { color: var(--gold-light); }
.picker-icon.pinned .icon { fill: currentColor; }
.picker-icon.danger:hover { border-color: rgba(var(--bad-rgb), 0.6); background: rgba(var(--bad-rgb), 0.12); color: var(--bad); }
@media (hover: none) { .picker-icon { opacity: 1; } }

.side-pin { position: relative; }
.side-pin .side-link { padding-right: 2rem; }
.side-pin .unpin { position: absolute; top: 50%; right: 0.35rem; color: var(--muted-dim); opacity: 0; transform: translateY(-50%); }
.side-pin:hover .unpin, .side-pin .unpin:focus-visible { opacity: 1; }
.side-pin .unpin:hover { background: rgba(214, 224, 240, 0.06); color: var(--ivory); }

.pin-button.pinned { color: var(--gold-light); }
.pin-button.pinned .icon { fill: currentColor; }

/* Mind map pointer: a plain arrow on the canvas, a hand over topics, an I-beam over the selected one */
.mm-svg { cursor: default; }
.mm-svg.panning { cursor: grabbing; }
.mm-node.selected { cursor: text; }

/* ============================================================
   CHANNEL TABS
   Under the channel name: Messages | Files & links | Passwords |
   Tasks | Whiteboards | Mind maps. Everything lives in a channel.
   ============================================================ */
.channel-tabs {
    display: flex;
    flex: none;
    gap: 0.25rem;
    padding: 0 1.6rem;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}
.channel-tabs::-webkit-scrollbar { display: none; }
.channel-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: none;
    padding: 0.7rem 0.75rem 0.65rem;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.channel-tabs button:hover { color: var(--text); }
.channel-tabs button.on { border-bottom-color: var(--gold); color: var(--text); }
.channel-tabs button.on .icon { color: var(--gold); }
.main.chat .channel-tabs { background: #fff; }

.tab-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.tab-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 1.25rem 2rem 3rem; }
.tab-scroll > .picker-section + .picker-section { margin-top: 1.25rem; }

/* A board, whiteboard or mind map opened inside a tab gets a slimmer header of its own. */
.tab-body > .channel-head { min-height: 0; padding: 0.7rem 2rem 0.6rem; align-items: center; }
.tab-body > .channel-head h1 { font-size: 1.6rem; }
.tab-body > .channel-head .nav-toggle { display: none; }

/* People in the channel, shown as overlapping round photos */
.people-stack { padding: 0.2rem 0.55rem 0.2rem 0.3rem; gap: 0; }
.people-stack .avatar { margin-right: -7px; border: 2px solid var(--navy-900); }
.main.chat .people-stack .avatar { border-color: #fff; }
.people-stack .more-faces { margin-left: 0.8rem; font-weight: 700; }

/* Files & links */
.shared-list { display: grid; gap: 0.4rem; }
.shared-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(5, 8, 11, 0.35);
    color: var(--text);
    text-decoration: none;
}
.shared-row:hover { border-color: rgba(var(--accent-rgb), 0.6); }
.shared-row > .icon:last-child { color: var(--text-muted); flex: none; }
.shared-thumb { width: 40px; height: 40px; flex: none; border-radius: 6px; object-fit: cover; }
.shared-icon {
    display: grid; place-items: center; flex: none;
    width: 40px; height: 40px; border-radius: 8px;
    background: rgba(var(--accent-rgb), 0.14); color: var(--gold);
}
.shared-text { display: grid; gap: 0.15rem; min-width: 0; flex: 1; }
.shared-text strong, .shared-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shared-text small { color: var(--text-muted); }
.shared-url { color: var(--gold-light); }

/* ============================================================
   PASSWORD VAULT (drawn by vault.js)
   ============================================================ */
.vault-scroll { padding-top: 1.5rem; }
.vault-host { position: relative; max-width: 980px; margin: 0 auto; }
.vault-icon { display: inline-flex; vertical-align: -0.15em; }
.vault-card {
    display: grid;
    gap: 0.9rem;
    padding: 1.4rem 1.5rem;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--navy-700);
}
.vault-gate { max-width: 460px; margin: 2rem auto; }
.vault-intro { display: grid; justify-items: center; gap: 0.5rem; text-align: center; }
.vault-intro h2 { margin: 0.2rem 0 0; font-family: var(--serif); font-size: 1.8rem; font-weight: 400; letter-spacing: 0.03em; }
.vault-intro p, .vault-muted { margin: 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }
.vault-badge {
    display: grid; place-items: center;
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(var(--accent-rgb), 0.16); color: var(--gold);
}
.vault-card label { display: grid; gap: 0.35rem; position: relative; }
.vault-card label > span:first-child { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; }
.vault-card input, .vault-card textarea, .vault-search input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: rgba(5, 8, 11, 0.55);
    color: var(--text);
    font: inherit;
}
.vault-card input:focus, .vault-card textarea:focus, .vault-search input:focus { outline: 2px solid rgba(var(--accent-rgb), 0.6); outline-offset: 0; }
.vault-field-tools { position: absolute; right: 0.35rem; bottom: 0.3rem; display: flex; gap: 0.15rem; }
.vault-editor label:has(.vault-field-tools) input { padding-right: 4.6rem; }
.vault-actions { display: flex; justify-content: flex-end; gap: 0.5rem; flex-wrap: wrap; }
.button.danger-text { color: #ff8a8a; }
.vault-status { padding: 0.55rem 0.8rem; border-radius: 8px; font-size: 0.88rem; }
.vault-status.error { background: rgba(226, 68, 92, 0.15); color: #ffb3bf; }
.vault-status.info { background: rgba(var(--accent-rgb), 0.12); color: var(--gold-light); }

.vault { display: grid; gap: 0.9rem; }
.vault-toolbar { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.vault-search { position: relative; flex: 1; min-width: 200px; }
.vault-search .vault-icon { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.vault-search input { padding-left: 2.1rem; }
.vault-count { color: var(--text-muted); font-size: 0.8rem; }
.vault-editor h3 { margin: 0; font-family: var(--serif); font-size: 1.4rem; font-weight: 400; letter-spacing: 0.03em; }
.vault-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.8rem; }

.vault-list { display: grid; gap: 0.45rem; }
.vault-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(5, 8, 11, 0.35);
}
.vault-row:hover { border-color: var(--line-strong); }
.vault-row.broken { opacity: 0.7; grid-template-columns: auto minmax(0, 1fr) auto; }
.vault-row-icon {
    display: grid; place-items: center;
    width: 38px; height: 38px; border-radius: 8px;
    background: rgba(var(--accent-rgb), 0.14); color: var(--gold);
}
.vault-row-main { display: grid; gap: 0.2rem; min-width: 0; }
.vault-row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vault-row-main small { color: var(--text-muted); font-size: 0.75rem; }
.vault-row-meta { display: flex; gap: 0.8rem; flex-wrap: wrap; font-size: 0.82rem; color: var(--text-muted); }
.vault-link { color: var(--gold-light); text-decoration: none; }
.vault-link:hover { text-decoration: underline; }
.vault-notes { margin: 0.15rem 0 0; color: var(--text-muted); font-size: 0.82rem; white-space: pre-wrap; }
.vault-row-secret { display: flex; align-items: center; gap: 0.2rem; }
.vault-secret {
    min-width: 8.5rem; max-width: 16rem;
    padding: 0.3rem 0.55rem; border-radius: 6px;
    background: rgba(5, 8, 11, 0.6); color: var(--gold-light);
    font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vault-row-actions { display: flex; gap: 0.15rem; }
.vault-icon-button {
    display: grid; place-items: center;
    width: 32px; height: 32px;
    border: 0; border-radius: 7px;
    background: none; color: var(--text-muted); cursor: pointer;
}
.vault-icon-button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.vault-icon-button.danger:hover { color: #ff8a8a; }
.vault-icon-button:disabled { opacity: 0.35; cursor: default; }
.vault-empty { display: grid; justify-items: center; gap: 0.4rem; padding: 2.5rem 1rem; color: var(--text-muted); text-align: center; }
.vault-empty .vault-icon { color: var(--gold); }
.vault-empty strong { color: var(--text); }
.vault-foot { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin: 0.5rem 0 0; color: var(--text-muted); font-size: 0.78rem; }
.vault-toast {
    position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%); z-index: 50;
    padding: 0.55rem 0.9rem; border-radius: 8px;
    background: var(--navy-900); border: 1px solid rgba(var(--accent-rgb), 0.5); color: var(--text);
    font-size: 0.85rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

@media (max-width: 720px) {
    .channel-tabs { padding: 0 0.6rem; }
    .tab-scroll { padding: 1rem 0.9rem 2.5rem; }
    .tab-body > .channel-head { padding: 0.6rem 0.9rem; }
    .vault-row { grid-template-columns: auto minmax(0, 1fr); }
    .vault-row-secret, .vault-row-actions { grid-column: 2; }
}

/* The channel header and the thread header share one height, so their dark bands line up. */
@media (min-width: 721px) {
    .main > .channel-head, .thread > .channel-head { box-sizing: border-box; height: 5.8rem; min-height: 5.8rem; }
    .thread > .channel-head { padding-top: 1.3rem; padding-bottom: 1rem; align-items: flex-end; }
}

/* Message action bar: appears after hovering a message for 1 second, hides at once on leave.
   Keyboard focus shows it straight away. */
.message .message-actions {
    display: flex;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease, visibility 0s linear 0.12s;
}
.message:hover .message-actions {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.12s ease 1s, visibility 0s linear 1s;
}
.message:focus-within .message-actions {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transition: none;
}

/* A channel's pins, listed under it in the sidebar while it is open */
.side-pin.nested .side-link { padding-left: 2.6rem; min-height: 0; padding-top: 0.35rem; padding-bottom: 0.35rem; font-size: 0.72rem; }
.side-pin.nested .side-link.current { background: none; border-color: transparent; box-shadow: none; color: var(--gold-light); }
.side-pin.nested .side-link.current::before { display: none; }

/* Quotes tab: requests for quotation (RFQs) and sealed quotes */
.rfq-scroll { padding-top: 1.5rem; }
.rfq-panel { max-width: 980px; margin: 0 auto; display: grid; gap: 1rem; }
.link-back { justify-self: start; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0; border: 0; background: none; color: var(--muted); font-size: 0.82rem; font-weight: 600; cursor: pointer; }
.link-back:hover { color: var(--gold-light); }
.rfq-title { margin: 0; color: var(--ivory); font-family: var(--serif); font-size: 1.9rem; font-weight: 400; letter-spacing: 0.03em; line-height: 1.1; overflow-wrap: anywhere; }
.rfq-help { margin: -0.4rem 0 0; color: var(--muted); font-size: 0.9rem; }
.rfq-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.rfq-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; margin: 0.45rem 0 0; color: var(--muted); font-size: 0.84rem; }
.rfq-meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.rfq-tools { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.rfq-details { padding: 0.9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(5, 8, 11, 0.35); color: var(--ivory); font-size: 0.92rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.rfq-subhead { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem 1rem; flex-wrap: wrap; margin-top: 0.4rem; }
.rfq-subhead h4 { margin: 0; color: var(--ivory); font-family: var(--serif); font-size: 1.35rem; font-weight: 400; letter-spacing: 0.03em; }
.rfq-subhead h4 small { color: var(--muted-dim); font-family: var(--subhead); font-size: 0.72rem; letter-spacing: 0.1em; }
.rfq-sealed { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--muted); font-size: 0.8rem; }
.rfq-form { gap: 0.85rem; }
.rfq-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.85rem; }
.rfq-form label > span small { color: var(--muted-dim); font-weight: 500; text-transform: none; letter-spacing: 0; }
.rfq-form textarea, .rfq-form select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(5, 8, 11, 0.6);
    color: var(--ivory);
    font: inherit;
    resize: vertical;
}
.rfq-form select { height: 42px; padding: 0 0.6rem; }
.rfq-form textarea:focus, .rfq-form select:focus { outline: none; border-color: rgba(var(--accent-rgb), 0.7); background: rgba(5, 8, 11, 0.8); }
.rfq-form input[type=datetime-local] { color-scheme: dark; }
.rfq-saved { display: flex; align-items: center; gap: 0.4rem; margin: 0; color: var(--success); font-size: 0.85rem; }
.rfq-status { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.1rem 0.55rem; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.rfq-status.open { border-color: rgba(var(--accent-rgb), 0.55); color: var(--gold-light); }
.rfq-status.closed { color: var(--muted); }
.rfq-status.awarded { border-color: var(--success); color: var(--success); }
.rfq-tag { display: inline-block; margin-left: 0.35rem; padding: 0 0.4rem; border-radius: 999px; background: var(--gold-soft); color: var(--gold-light); font-size: 0.68rem; font-weight: 700; vertical-align: 0.1em; }
.rfq-list { display: grid; gap: 0.6rem; }
.rfq-card {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    width: 100%; padding: 0.9rem 1rem; text-align: left;
    border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
    background: rgba(5, 8, 11, 0.4); color: inherit; cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
}
.rfq-card:hover, .rfq-card:focus-visible { border-color: rgba(var(--accent-rgb), 0.45); background: rgba(5, 8, 11, 0.55); }
.rfq-card-main { display: grid; gap: 0.25rem; min-width: 0; }
.rfq-card-main strong { color: var(--ivory); font-family: var(--serif); font-size: 1.3rem; font-weight: 400; letter-spacing: 0.03em; overflow-wrap: anywhere; }
.rfq-card small { color: var(--muted); font-size: 0.78rem; }
.rfq-card-side { display: grid; justify-items: end; gap: 0.3rem; flex-shrink: 0; text-align: right; }
.rfq-card .rfq-cta { color: var(--gold-light); font-weight: 700; }
.rfq-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.rfq-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.rfq-table th { padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line-strong); color: var(--muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.rfq-table td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--line); color: var(--ivory); vertical-align: top; }
.rfq-table tr:last-child td { border-bottom: 0; }
.rfq-table .num { text-align: right; white-space: nowrap; }
.rfq-table .rfq-notes { max-width: 320px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
.rfq-table .rfq-when { color: var(--muted); white-space: nowrap; }
.rfq-table tr.won td { background: rgba(var(--accent-rgb), 0.08); }
.rfq-mine { display: grid; gap: 0.35rem; padding: 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); color: var(--ivory); }
.rfq-mine strong { font-size: 1.25rem; }
.rfq-mine p { margin: 0; color: var(--muted); white-space: pre-wrap; }
.rfq-mine.won { border-color: var(--success); }
.rfq-outcome { color: var(--gold-light); font-weight: 600; font-size: 0.88rem; }
.rfq-confirm { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding: 0.7rem 0.9rem; border: 1px solid var(--danger); border-radius: var(--radius); background: var(--danger-soft); color: var(--ivory); font-size: 0.88rem; }
.rfq-confirm span { flex: 1; min-width: 200px; }
@media (max-width: 720px) {
    .rfq-card { flex-direction: column; align-items: stretch; }
    .rfq-card-side { justify-items: start; text-align: left; }
}

/* Deliverables tab: what each accepted quote must deliver, with sign-offs */
.dl-sets { display: grid; gap: 1rem; max-width: 980px; margin: 0 auto; }
.dl-set { display: grid; gap: 0.75rem; padding: 1rem 1.1rem; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: rgba(5, 8, 11, 0.4); }
.dl-set.complete { border-color: var(--success); }
.dl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.dl-head h4 { margin: 0; color: var(--ivory); font-family: var(--serif); font-size: 1.45rem; font-weight: 400; letter-spacing: 0.03em; overflow-wrap: anywhere; }
.dl-head .rfq-meta strong { color: var(--ivory); }
.dl-progress { display: grid; justify-items: end; gap: 0.35rem; min-width: 160px; }
.dl-count { color: var(--muted); font-size: 0.8rem; font-weight: 600; }
.dl-bar { display: block; width: 160px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.dl-bar > span { display: block; height: 100%; background: var(--gold); transition: width 0.25s; }
.dl-set.complete .dl-bar > span { background: var(--success); }
.dl-empty { margin: 0; color: var(--muted); font-size: 0.88rem; }
.dl-items { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.dl-item { display: flex; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.dl-check { display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin-top: 0.1rem; border: 1.5px solid var(--line-strong); border-radius: 6px; color: #10140c; }
.dl-item.signed_off .dl-check { border-color: var(--success); background: var(--success); }
.dl-item.delivered .dl-check { border-color: var(--gold); }
.dl-body { display: grid; gap: 0.3rem; flex: 1; min-width: 0; }
.dl-line { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.dl-line strong { color: var(--ivory); font-weight: 600; overflow-wrap: anywhere; }
.dl-item.signed_off .dl-line strong { color: var(--muted); }
.dl-chip { padding: 0.05rem 0.5rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; }
.dl-chip.delivered { border-color: rgba(var(--accent-rgb), 0.6); color: var(--gold-light); }
.dl-chip.changes { border-color: var(--danger); color: var(--danger); }
.dl-chip.signed_off { border-color: var(--success); color: var(--success); }
.dl-due { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--muted); font-size: 0.78rem; }
.dl-due.late { color: var(--danger); font-weight: 700; }
.dl-details { margin: 0; color: var(--muted); font-size: 0.86rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.dl-trail { margin: 0; color: var(--muted); font-size: 0.8rem; overflow-wrap: anywhere; }
.dl-trail.ok { color: var(--success); }
.dl-trail.warn { color: var(--danger); }
.dl-actions { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.2rem; }
.dl-actions .dl-remove { opacity: 0.7; }
.dl-actions .dl-remove:hover { opacity: 1; color: var(--danger); }
.dl-act { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.25rem; }
.dl-act input { flex: 1; min-width: 200px; height: 32px; padding: 0 0.7rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: rgba(5, 8, 11, 0.6); color: var(--ivory); font: inherit; font-size: 0.86rem; }
.dl-act input:focus { outline: none; border-color: rgba(var(--accent-rgb), 0.7); }
.dl-add { padding-top: 0.25rem; }
.dl-add-link { justify-self: start; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0; border: 0; background: none; color: var(--gold-light); font-size: 0.85rem; font-weight: 700; cursor: pointer; }
.dl-add-link:hover { text-decoration: underline; }
@media (max-width: 720px) { .dl-progress { justify-items: start; } }

/* Quote revision history */
.rfq-rev { display: inline-block; margin-left: 0.35rem; padding: 0 0.4rem; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-size: 0.68rem; font-weight: 700; vertical-align: 0.1em; }
.rfq-history { display: grid; gap: 0.5rem; margin-top: 0.25rem; }
.rfq-history h5 { margin: 0; color: var(--ivory); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.rfq-history h5 small { margin-left: 0.4rem; color: var(--muted-dim); font-weight: 500; letter-spacing: 0; text-transform: none; }
.rfq-history details { border: 1px solid var(--line); border-radius: var(--radius); background: rgba(5, 8, 11, 0.3); }
.rfq-history summary { padding: 0.55rem 0.8rem; color: var(--muted); font-size: 0.86rem; cursor: pointer; }
.rfq-history summary strong { color: var(--ivory); }
.rfq-history details .rev-list { padding: 0 0.8rem 0.6rem; }
.rev-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.rev { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.7rem; padding: 0.5rem 0; border-top: 1px solid var(--line); font-size: 0.86rem; }
.rev:first-child { border-top: 0; }
.rev-no { color: var(--gold-light); font-weight: 700; font-size: 0.78rem; min-width: 3.2rem; }
.rev-kind { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; min-width: 5.5rem; }
.rev.withdrawn .rev-kind { color: var(--danger); }
.rev-amount { color: var(--ivory); }
.rev-change { font-size: 0.78rem; font-weight: 700; }
.rev-change.down { color: var(--success); }
.rev-change.up { color: var(--danger); }
.rev-meta { color: var(--muted); font-size: 0.8rem; }
.rev-notes { flex-basis: 100%; margin: 0; padding-left: 3.9rem; color: var(--muted); font-size: 0.82rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.dl-history { margin-top: 0.15rem; font-size: 0.8rem; }
.dl-history summary { color: var(--gold-light); font-weight: 700; cursor: pointer; width: fit-content; }
.dl-history ol { display: grid; gap: 0.3rem; margin: 0.4rem 0 0.2rem; padding: 0 0 0 0.9rem; border-left: 2px solid var(--line-strong); list-style: none; }
.dl-history li { display: flex; flex-wrap: wrap; gap: 0.2rem 0.6rem; color: var(--muted); }
.dl-history-kind { min-width: 8.5rem; color: var(--ivory); font-weight: 600; }
.dl-history li.changes .dl-history-kind { color: var(--danger); }
.dl-history li.signed_off .dl-history-kind { color: var(--success); }
.dl-history q { flex-basis: 100%; padding-left: 9.1rem; color: var(--muted); font-style: italic; }
@media (max-width: 720px) { .dl-history q { padding-left: 0; } }

/* Owner reset of someone's sign-in codes, in the People dialog */
.reset-panel { display: grid; gap: 0.6rem; margin: -0.2rem 0 0.4rem; padding: 0.75rem 0.9rem; border: 1px solid var(--danger); border-radius: var(--radius); background: var(--danger-soft); font-size: 0.86rem; }
.reset-panel p { margin: 0; }
.reset-panel .invite-link { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.reset-panel code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 1rem; font-weight: 700; letter-spacing: 0.05em; user-select: all; }
.reset-panel .form-actions { margin: 0; }
