:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0d0c1b;
    color: #f0edf4;
    --bg: #0d0c1b;
    --panel: #11101d;
    --panel-strong: #171624;
    --panel-soft: #141320;
    --border: #302c3c;
    --border-soft: #252232;
    --text: #f0edf4;
    --muted: #a29bab;
    --subtle: #777181;
    --accent: #adb861;
    --accent-strong: #c1cc73;
    --accent-soft: #252917;
    --accent-secondary: #c485bd;
    --accent-secondary-soft: #2d1c30;
    --weekly: #d39acb;
    --weekly-bg: #301c33;
    --danger: #ff9090;
    --danger-bg: #32191d;
    --success: #83d6a2;
    --radius: 14px;
    --left-width: 278px;
    --right-width: 320px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
}

body {
    min-height: 100vh;
}

button,
input,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

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

/* Authentication */
.auth-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 18% 10%, rgba(173, 184, 97, 0.15), transparent 34rem),
        radial-gradient(circle at 85% 82%, rgba(196, 133, 189, 0.14), transparent 32rem),
        var(--bg);
}

.auth-shell {
    width: min(100%, 430px);
}

.auth-card {
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(17, 16, 29, 0.96);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

.auth-brand,
.brand-link {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #39577d;
    border-radius: 10px;
    background: linear-gradient(145deg, #1a2c44, #101a28);
    color: #bcd7ff;
    font-weight: 800;
}

.auth-heading {
    margin: 42px 0 26px;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.auth-heading h1,
.feed-heading h1,
.chat-heading h1 {
    margin: 0;
    letter-spacing: -0.035em;
}

.auth-heading h1 {
    font-size: 2rem;
}

.auth-heading p:not(.eyebrow),
.chat-heading p,
.feed-heading p:not(.eyebrow) {
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.auth-form {
    display: grid;
    gap: 18px;
}

.auth-form label {
    display: grid;
    gap: 8px;
    color: #c7d0da;
    font-size: 0.86rem;
    font-weight: 650;
}

.auth-form input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #2a3542;
    border-radius: 10px;
    outline: none;
    background: #0a0e13;
    color: var(--text);
}

.auth-form input:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px rgba(173, 184, 97, 0.13);
}

.auth-form .auth-remember {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 9px;
    cursor: pointer;
}

.auth-form .auth-remember input {
    width: 17px;
    height: 17px;
    margin: 0;
    padding: 0;
    accent-color: var(--accent);
}

.password-requirements {
    display: grid;
    gap: 6px;
    margin: -9px 0 0;
    padding: 0;
    color: var(--muted);
    font-size: 0.78rem;
    list-style: none;
}

.password-requirements li {
    display: grid;
    grid-template-columns: 16px 1fr auto;
    align-items: center;
    gap: 7px;
}

.password-requirements li[data-met="true"] {
    color: #a9e4be;
}

.password-requirement-icon {
    font-weight: 800;
    text-align: center;
}

.password-requirement-state {
    font-size: 0.72rem;
    font-weight: 700;
}

.auth-form .auth-legal {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    line-height: 1.5;
    cursor: pointer;
}

.auth-form .auth-legal input {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    padding: 0;
    accent-color: var(--accent);
}

.auth-legal a {
    color: var(--accent);
}

.auth-submit {
    width: 100%;
    margin-top: 3px;
}

.auth-footnote {
    margin: 24px 0 0;
    color: var(--subtle);
    font-size: 0.78rem;
    line-height: 1.5;
}

.auth-footnote a {
    color: var(--accent);
}

.setup-claiming {
    display: none;
}

html[data-web-setup-claiming="true"] .setup-claiming {
    display: block;
}

html[data-web-setup-claiming="true"] .setup-state {
    display: none;
}

.form-error,
.notice {
    margin-bottom: 18px;
    padding: 11px 12px;
    border-radius: 9px;
    font-size: 0.84rem;
}

.form-error {
    border: 1px solid #633039;
    background: var(--danger-bg);
    color: #ffb4b4;
}

.notice {
    border: 1px solid #315442;
    background: #14261d;
    color: #a9e4be;
}

.notice.notice-warning {
    border-color: #725c24;
    background: #2a2413;
    color: #f0d889;
}

/* Shared buttons */
.primary-button,
.secondary-button,
.text-button,
.icon-button {
    border: 0;
    cursor: pointer;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 13px;
    border-radius: 9px;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 700;
}

.primary-button {
    background: linear-gradient(135deg, #c5cf78, #d5a0ce);
    color: #17131c;
}

.primary-button:hover {
    background: linear-gradient(135deg, #d7df91, #e3b2dc);
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.secondary-button {
    border: 1px solid #41452a;
    background: #191b15;
    color: #d9e29c;
}

.secondary-button:hover {
    border-color: #717946;
    background: #20241a;
}

.text-button {
    padding: 0;
    background: none;
    color: var(--muted);
    font-size: 0.78rem;
}

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

/* Application shell */
.app-body {
    overflow: hidden;
}

.workspace-shell {
    display: grid;
    grid-template-columns: var(--left-width) minmax(0, 1fr) var(--right-width);
    width: 100%;
    height: 100vh;
}

.left-sidebar,
.right-sidebar,
.workspace-main {
    min-height: 0;
}

.left-sidebar,
.right-sidebar {
    background: var(--panel);
}

.left-sidebar {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-soft);
}

.right-sidebar {
    overflow-y: auto;
    border-left: 1px solid var(--border-soft);
}

.workspace-main {
    overflow-y: auto;
    background: #0c0b18;
}

.sidebar-brand {
    padding: 18px 17px 15px;
}

.brand-link strong,
.brand-link small {
    display: block;
}

.brand-link strong {
    font-size: 0.9rem;
}

.brand-link small {
    margin-top: 2px;
    color: var(--subtle);
    font-size: 0.7rem;
}

.main-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 10px 20px;
}

.nav-home,
.nav-tabular,
.agent-nav-link,
.conversation-link {
    text-decoration: none;
}

.nav-home,
.nav-tabular {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 9px;
    color: #bbc5d0;
    font-size: 0.85rem;
}

.nav-home:hover,
.nav-home.is-active,
.nav-tabular:hover,
.nav-tabular.is-active {
    background: #171d24;
    color: #fff;
}

.nav-section-label {
    padding: 24px 10px 8px;
    color: #5e6a78;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.agent-nav-group {
    margin-bottom: 4px;
    border-radius: 10px;
}

.agent-nav-group.is-selected {
    background: #121820;
}

.agent-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 9px;
}

.agent-nav-link:hover {
    background: #171d24;
}

.agent-avatar,
.user-avatar {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    font-weight: 800;
}

.agent-avatar {
    width: 30px;
    height: 30px;
    overflow: hidden;
    border: 1px solid rgba(171, 187, 88, 0.34);
    border-radius: 9px;
    background: #0e0e19;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.018), 0 3px 10px rgba(0, 0, 0, 0.2);
}

.agent-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar {
    border: 1px solid #555c31;
    background: linear-gradient(145deg, #272b1a, #211523);
    color: #d8dfa0;
}

.agent-nav-copy {
    min-width: 0;
}

.agent-nav-copy strong,
.agent-nav-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-nav-copy strong {
    color: #d9e0e8;
    font-size: 0.82rem;
}

.agent-nav-copy small {
    margin-top: 2px;
    color: #697687;
    font-size: 0.67rem;
}

.conversation-tree {
    padding: 0 8px 7px 20px;
}

.conversation-link {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    padding: 5px 6px;
    border-radius: 6px;
    color: #768393;
    font-size: 0.72rem;
}

.conversation-link span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-link:hover,
.conversation-link.is-active {
    background: #171f29;
    color: #c6d4e4;
}

.tree-line {
    color: #3f4a57;
}

.new-conversation {
    color: #6687ae;
}

.sidebar-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 14px;
    border-top: 1px solid var(--border-soft);
    background: #0c1015;
}

.user-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.user-avatar {
    width: 29px;
    height: 29px;
    border-radius: 50%;
    font-size: 0.7rem;
}

.user-meta strong,
.user-meta small {
    display: block;
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta strong {
    font-size: 0.75rem;
}

.user-meta small {
    margin-top: 2px;
    color: var(--subtle);
    font-size: 0.64rem;
}

.sidebar-empty {
    margin: 8px 10px;
    color: var(--subtle);
    font-size: 0.77rem;
    line-height: 1.5;
}

/* Feed */
.feed-page,
.chat-page {
    width: min(100%, 880px);
    margin: 0 auto;
    padding: 42px 34px 72px;
}

.feed-heading,
.chat-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.feed-heading h1,
.chat-heading h1 {
    font-size: clamp(1.8rem, 4vw, 2.45rem);
}

.feed-count,
.draft-badge {
    flex: 0 0 auto;
    margin-top: 2px;
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #11161c;
    color: var(--muted);
    font-size: 0.72rem;
}

.feed-list {
    display: grid;
    gap: 15px;
}

.brief-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-strong);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.13);
}

.brief-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-soft);
}

.brief-agent {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brief-agent a,
.brief-agent span {
    display: block;
}

.brief-agent a {
    color: #dce8f6;
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 750;
}

.brief-agent a:hover {
    color: #fff;
}

.brief-agent div > span {
    margin-top: 2px;
    color: var(--subtle);
    font-size: 0.67rem;
}

.brief-avatar {
    width: 32px;
    height: 32px;
}

.brief-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--subtle);
    font-size: 0.66rem;
}

.brief-type {
    padding: 4px 7px;
    border-radius: 999px;
    font-weight: 750;
}

.brief-type.is-daily {
    background: var(--accent-soft);
    color: #9fc5ff;
}

.brief-type.is-weekly {
    background: var(--weekly-bg);
    color: var(--weekly);
}

.brief-body {
    padding: 21px 20px 23px;
    color: #d7dee7;
    font-size: 0.89rem;
    line-height: 1.72;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.brief-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 18px 17px;
}

.empty-feed {
    padding: 70px 24px;
    border: 1px dashed #27313c;
    border-radius: var(--radius);
    text-align: center;
    color: var(--muted);
}

.empty-feed > span {
    display: block;
    margin-bottom: 14px;
    color: #526173;
    font-size: 2rem;
}

.empty-feed h2 {
    margin: 0 0 8px;
    color: #d2dae3;
    font-size: 1.08rem;
}

.empty-feed p {
    margin: 0;
    font-size: 0.82rem;
}

.agent-heading-row {
    display: flex;
    align-items: center;
    gap: 13px;
}

.heading-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.agent-objective {
    max-width: 670px;
}

.feed-section-title,
.topic-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.feed-section-title {
    margin: 0 0 13px;
}

.feed-section-title h2,
.topic-panel-heading h3 {
    margin: 0;
    font-size: 0.82rem;
    letter-spacing: 0.01em;
}

.feed-section-title span,
.topic-panel-heading span {
    color: var(--subtle);
    font-size: 0.7rem;
}

/* Right panel */
.right-sidebar {
    padding: 22px 16px 32px;
}

.right-panel-header {
    padding: 5px 5px 20px;
    border-bottom: 1px solid var(--border-soft);
}

.right-panel-header h2 {
    margin: 0;
    font-size: 1.08rem;
}

.right-panel-header > p:last-child {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

.topic-panel-heading {
    padding: 20px 5px 11px;
}

.topic-list {
    display: grid;
    gap: 8px;
}

.topic-item {
    padding: 11px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: #11161c;
}

.topic-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.topic-name-row strong {
    font-size: 0.8rem;
}

.topic-name-row > span {
    color: #6f7d8e;
    font-size: 0.62rem;
    font-weight: 800;
}

.topic-item > p {
    margin: 7px 0 0;
    color: #8491a0;
    font-size: 0.7rem;
    line-height: 1.45;
}

.topic-rule {
    display: grid;
    gap: 3px;
    margin-top: 8px;
    padding-top: 7px;
    border-top: 1px solid #1d252e;
    font-size: 0.68rem;
    line-height: 1.4;
}

.topic-rule small {
    font-weight: 750;
}

.topic-rule.preferred small {
    color: var(--success);
}

.topic-rule.avoid small {
    color: #e6a0a0;
}

.topic-rule span {
    color: #8995a4;
}

.right-empty {
    display: grid;
    min-height: 50vh;
    align-content: center;
    padding: 20px;
    text-align: center;
}

.right-empty-icon {
    color: #4f5d6c;
    font-size: 1.8rem;
}

.right-empty h2 {
    margin: 14px 0 7px;
    font-size: 0.95rem;
}

.right-empty p {
    margin: 0;
    color: var(--subtle);
    font-size: 0.75rem;
    line-height: 1.5;
}

/* Chat shell */
.chat-thread {
    display: grid;
    gap: 14px;
    min-height: 320px;
    margin-bottom: 18px;
}

.context-message,
.chat-message {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--panel-strong);
}

.context-message {
    border-color: #2c4260;
    background: #101925;
}

.message-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
    color: var(--subtle);
    font-size: 0.67rem;
}

.context-message .brief-body {
    padding: 0;
}

.chat-message {
    max-width: 84%;
    color: #d5dde7;
    font-size: 0.86rem;
    line-height: 1.6;
    white-space: pre-wrap;
}

.chat-message.is-user {
    justify-self: end;
    background: #282d1a;
}

.chat-message.is-assistant {
    justify-self: start;
}

.message-status {
    display: block;
    margin-top: 8px;
    color: #d1a36b;
}

.chat-welcome {
    align-self: center;
    justify-self: center;
    max-width: 480px;
    padding: 40px;
    text-align: center;
}

.chat-welcome .heading-avatar {
    margin: 0 auto 15px;
}

.chat-welcome h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.chat-welcome p {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.55;
}

.composer-shell {
    position: sticky;
    bottom: 18px;
    padding: 10px;
    border: 1px solid #2a333e;
    border-radius: 14px;
    background: rgba(15, 19, 24, 0.97);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.composer-shell textarea {
    width: 100%;
    min-height: 86px;
    resize: vertical;
    padding: 10px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.composer-shell textarea::placeholder {
    color: #596574;
}

.composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 3px 1px 8px;
    color: var(--subtle);
    font-size: 0.7rem;
}

/* Mobile */
.mobile-bar,
.panel-backdrop {
    display: none;
}

@media (max-width: 1180px) {
    :root {
        --right-width: 285px;
        --left-width: 250px;
    }
}

@media (max-width: 940px) {
    .app-body {
        overflow: auto;
    }

    .mobile-bar {
        position: fixed;
        z-index: 50;
        top: 0;
        right: 0;
        left: 0;
        display: flex;
        height: 52px;
        align-items: center;
        justify-content: space-between;
        padding: 0 10px;
        border-bottom: 1px solid var(--border-soft);
        background: rgba(10, 13, 17, 0.96);
        backdrop-filter: blur(12px);
    }

    .mobile-brand {
        text-decoration: none;
        font-size: 0.83rem;
        font-weight: 750;
    }

    .icon-button {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        background: #151b22;
        color: #bdc8d4;
    }

    .workspace-shell {
        display: block;
        height: auto;
        min-height: 100vh;
        padding-top: 52px;
    }

    .workspace-main {
        min-height: calc(100vh - 52px);
        overflow: visible;
    }

    .left-sidebar,
    .right-sidebar {
        position: fixed;
        z-index: 70;
        top: 52px;
        bottom: 0;
        width: min(86vw, 320px);
        transition: transform 160ms ease;
    }

    .left-sidebar {
        left: 0;
        transform: translateX(-102%);
    }

    .right-sidebar {
        right: 0;
        transform: translateX(102%);
    }

    .left-panel-open .left-sidebar,
    .right-panel-open .right-sidebar {
        transform: translateX(0);
    }

    .panel-backdrop {
        position: fixed;
        z-index: 60;
        inset: 52px 0 0;
        background: rgba(0, 0, 0, 0.56);
    }

    .left-panel-open .panel-backdrop,
    .right-panel-open .panel-backdrop {
        display: block;
    }
}

@media (max-width: 640px) {
    .feed-page,
    .chat-page {
        padding: 28px 15px 60px;
    }

    .feed-heading,
    .chat-heading,
    .brief-card-header {
        flex-direction: column;
    }

    .feed-count,
    .draft-badge {
        align-self: flex-start;
    }

    .brief-meta {
        width: 100%;
        justify-content: space-between;
    }

    .brief-actions {
        justify-content: stretch;
    }

    .brief-actions .secondary-button {
        width: 100%;
    }

    .agent-feed-heading .primary-button {
        width: 100%;
    }

    .chat-message {
        max-width: 95%;
    }

    .composer-footer {
        align-items: flex-end;
    }
}

/* Brand assets */
.auth-logo-link {
    display: block;
    width: min(100%, 330px);
    margin: 0 auto;
}

.auth-logo,
.sidebar-logo {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.auth-logo {
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.sidebar-brand {
    padding: 12px 14px 8px;
}

.sidebar-logo {
    width: 200px;
    max-width: 100%;
}

.mobile-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mobile-brand img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

/* Sanitized brief HTML */
.brief-body a,
.message-brief-html a {
    color: #cbd67f;
    text-decoration-color: rgba(203, 214, 127, 0.5);
    text-underline-offset: 3px;
}

.brief-body a:hover,
.message-brief-html a:hover {
    color: #e1e8aa;
}

.brief-body ul,
.brief-body ol,
.message-brief-html ul,
.message-brief-html ol {
    padding-left: 1.35rem;
}

.brief-body blockquote,
.message-brief-html blockquote {
    margin-left: 0;
    padding-left: 12px;
    border-left: 3px solid var(--accent-secondary);
    color: #c9c2ce;
}

.message-brief-html {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Topics & Companies */
.topic-add-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
    padding: 11px;
    border: 1px dashed #59602f;
    border-radius: 10px;
    background: #171a12;
    color: #cbd67f;
    text-align: left;
}

.topic-add-item:disabled {
    cursor: not-allowed;
    opacity: 0.78;
}

/* Conversation write/delete controls */
.danger-button {
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid #67353e;
    border-radius: 9px;
    background: #261519;
    color: #f0a5ae;
    cursor: pointer;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
}

.danger-button:hover {
    background: #32191f;
}

.workspace-notice {
    width: min(calc(100% - 68px), 812px);
    margin: 18px auto -18px;
    padding: 10px 12px;
    border: 1px solid #4f582b;
    border-radius: 9px;
    background: #181c11;
    color: #d0d994;
    font-size: 0.78rem;
}

/* v4 workspace refinements */
.app-body {
    --left-current: var(--left-width);
    --right-current: var(--right-width);
}

.left-panel-collapsed {
    --left-current: 0px;
}

.right-panel-collapsed {
    --right-current: 0px;
}

.workspace-shell {
    grid-template-columns: var(--left-current) minmax(0, 1fr) var(--right-current);
    transition: grid-template-columns 160ms ease;
}

.workspace-main {
    position: relative;
}


.desktop-panel-controls {
    position: fixed;
    z-index: 24;
    top: 12px;
    right: calc(var(--right-current) + 10px);
    left: calc(var(--left-current) + 10px);
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    transition: right 160ms ease, left 160ms ease;
}

.desktop-panel-toggle {
    display: inline-grid;
    width: 32px;
    height: 32px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(87, 82, 98, 0.72);
    border-radius: 9px;
    background: rgba(15, 14, 26, 0.76);
    color: #aaa3b1;
    cursor: pointer;
    opacity: 0.72;
    pointer-events: auto;
    backdrop-filter: blur(9px);
}

.desktop-panel-toggle:hover {
    border-color: #717946;
    color: #e4e9b1;
    opacity: 1;
}

.desktop-panel-toggle svg,
.icon-button svg,
.agent-new-chat svg,
.message-action-button svg,
.jump-latest svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.agent-nav-row {
    display: flex;
    align-items: center;
    gap: 3px;
}

.agent-nav-row .agent-nav-link {
    min-width: 0;
    flex: 1;
}

.agent-new-chat {
    display: inline-grid;
    flex: 0 0 auto;
    width: 31px;
    height: 31px;
    place-items: center;
    margin-right: 5px;
    border-radius: 8px;
    color: #687484;
    text-decoration: none;
}

.agent-new-chat:hover {
    background: #1a2028;
    color: #d9e29c;
}

/* The current brief header stays visible while its content scrolls underneath it. */
.brief-card-header {
    position: sticky;
    z-index: 8;
    top: 0;
    border-radius: var(--radius) var(--radius) 0 0;
    background: rgba(23, 22, 36, 0.94);
    backdrop-filter: blur(11px);
}

.brief-type.is-daily {
    background: var(--accent-soft);
    color: #d8e39a;
}

.brief-date-stack {
    display: grid;
    gap: 2px;
    text-align: right;
}

.brief-date-stack time {
    color: #c9c3ce;
    font-size: 0.69rem;
    font-weight: 650;
}

.brief-date-stack small {
    color: var(--subtle);
    font-size: 0.61rem;
}

.jump-latest {
    position: fixed;
    z-index: 35;
    bottom: 28px;
    left: calc(var(--left-current) + (100vw - var(--left-current) - var(--right-current)) / 2);
    display: inline-grid;
    width: 46px;
    height: 46px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(173, 184, 97, 0.48);
    border-radius: 50%;
    background: rgba(25, 26, 18, 0.78);
    color: #dce59d;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: opacity 140ms ease, transform 140ms ease, left 160ms ease;
    backdrop-filter: blur(10px);
}

.has-composer .jump-latest {
    bottom: 154px;
}

.jump-latest.is-visible {
    opacity: 0.88;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.jump-latest:hover {
    opacity: 1;
}

/* Compact chat rows prevent CSS grid from stretching a few messages to fill the viewport. */
.chat-thread {
    align-content: start;
    gap: 10px;
}

.chat-message-row {
    width: min(84%, 720px);
}

.chat-message-row.is-user {
    justify-self: end;
}

.chat-message-row.is-assistant {
    justify-self: start;
}

.chat-message-line {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chat-message-row .chat-message {
    width: 100%;
    max-width: none;
    padding: 11px 13px;
    line-height: 1.48;
}

.chat-message-row.is-user .chat-message-line {
    justify-content: flex-end;
}

.message-label {
    margin-bottom: 7px;
}

.message-text,
.message-brief-html {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.message-text a {
    color: #cbd67f;
    text-decoration-color: rgba(203, 214, 127, 0.5);
    text-underline-offset: 3px;
}

.message-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 3px;
    padding-bottom: 3px;
}

.message-actions form {
    margin: 0;
}

.message-action-button {
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #746e7c;
    cursor: pointer;
}

.message-action-button:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #d8d2dd;
}

.message-action-button.is-danger:hover {
    background: rgba(255, 144, 144, 0.08);
    color: #f0a5ae;
}

.message-edit-form {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: rgba(17, 16, 29, 0.92);
}

.message-edit-form[hidden] {
    display: none;
}

.message-edit-form textarea {
    width: 100%;
    min-height: 82px;
    resize: vertical;
    padding: 10px;
    border: 1px solid #34303f;
    border-radius: 9px;
    outline: 0;
    background: #0d0c17;
    color: var(--text);
}

.message-edit-form textarea:focus {
    border-color: #717946;
}

.message-edit-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.ai-disclaimer {
    margin: 0;
    padding: 5px 8px 8px;
    color: #8f8997;
    font-size: 0.67rem;
    line-height: 1.45;
}

/* External link confirmation uses the native dialog for focus management and keyboard escape. */
.external-link-dialog {
    width: min(calc(100% - 32px), 560px);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #12111e;
    color: var(--text);
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.52);
}

.external-link-dialog::backdrop {
    background: rgba(4, 4, 8, 0.72);
    backdrop-filter: blur(4px);
}

.external-link-card {
    padding: 22px;
}

.external-link-card h2 {
    margin: 0 0 14px;
    font-size: 1.18rem;
}

.external-link-card p {
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.55;
}

.external-link-url {
    max-height: 130px;
    overflow: auto;
    padding: 11px 12px;
    border: 1px solid #35313e;
    border-radius: 9px;
    background: #0b0a13;
    color: #d7d1dd;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.74rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.external-link-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 20px;
}

/* Authentication/footer placeholders establish stable URLs before final policy/support copy exists. */
.auth-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px 14px;
    margin-top: 17px;
    padding-top: 16px;
    border-top: 1px solid var(--border-soft);
}

.auth-footer-links a {
    color: #938b9a;
    font-size: 0.72rem;
    text-decoration: none;
}

.auth-footer-links a:hover {
    color: #d9e29c;
}

.info-card .secondary-button {
    margin-top: 4px;
}

.legal-document-version {
    font-size: 0.78rem;
}

.legal-document-body {
    margin: -6px 0 24px;
    color: var(--muted);
    line-height: 1.65;
}

.legal-document-body h1,
.legal-document-body h2,
.legal-document-body h3,
.legal-document-body h4,
.legal-document-body h5,
.legal-document-body h6 {
    margin: 1.4em 0 0.55em;
    color: var(--text);
    line-height: 1.25;
}

.legal-document-body p,
.legal-document-body ul,
.legal-document-body ol,
.legal-document-body table {
    margin: 0 0 1em;
}

.legal-document-body ul,
.legal-document-body ol {
    padding-left: 1.5em;
}

.legal-document-body a {
    color: var(--accent);
}

.legal-document-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
}

.legal-document-body th,
.legal-document-body td {
    padding: 8px 10px;
    border: 1px solid var(--border-soft);
    text-align: left;
    vertical-align: top;
}

.legal-document-body th {
    color: var(--text);
}


@media (min-width: 941px) {
    .left-panel-collapsed .left-sidebar,
    .right-panel-collapsed .right-sidebar {
        visibility: hidden;
        overflow: hidden;
        opacity: 0;
        pointer-events: none;
    }
}

@media (max-width: 940px) {
    .desktop-panel-controls {
        display: none;
    }

    .jump-latest {
        left: 50%;
    }

    .has-composer .jump-latest {
        bottom: 145px;
    }
}

@media (max-width: 640px) {
    .brief-date-stack {
        text-align: left;
    }

    .chat-message-row {
        width: 96%;
    }

    .message-actions {
        flex-direction: column;
    }
}

/* v5 chat density: keep messages content-sized and make the composer compact. */
.feed-page {
    padding-bottom: 36px;
}

.chat-page {
    padding-top: 32px;
    padding-bottom: 14px;
}

.chat-thread {
    display: flex;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 12px;
}

.chat-message-row {
    flex: 0 0 auto;
}

.chat-message-row.is-user {
    align-self: flex-end;
}

.chat-message-row.is-assistant {
    align-self: flex-start;
}

.chat-message,
.chat-message-row .chat-message {
    min-height: 0;
    height: auto;
}

.chat-message.is-user .message-text {
    white-space: pre-wrap;
}

.chat-message.is-assistant .message-text,
.message-brief-html,
.brief-body {
    white-space: normal;
}

.message-placeholder {
    margin: 0;
    color: var(--muted);
    font-style: italic;
}

.message-placeholder.is-error {
    color: #e5a2aa;
}

/* Markdown generated from summaries/assistant replies gets predictable spacing after sanitization. */
.brief-body > :first-child,
.message-brief-html > :first-child,
.chat-message.is-assistant .message-text > :first-child {
    margin-top: 0;
}

.brief-body > :last-child,
.message-brief-html > :last-child,
.chat-message.is-assistant .message-text > :last-child {
    margin-bottom: 0;
}

.brief-body p,
.message-brief-html p,
.chat-message.is-assistant .message-text p {
    margin: 0 0 0.9em;
}

.brief-body ul,
.brief-body ol,
.message-brief-html ul,
.message-brief-html ol,
.chat-message.is-assistant .message-text ul,
.chat-message.is-assistant .message-text ol {
    margin: 0.5em 0 0.95em;
    padding-left: 1.45em;
}

.brief-body li,
.message-brief-html li,
.chat-message.is-assistant .message-text li {
    margin: 0.24em 0;
}

.brief-body h1,
.brief-body h2,
.brief-body h3,
.brief-body h4,
.message-brief-html h1,
.message-brief-html h2,
.message-brief-html h3,
.message-brief-html h4,
.chat-message.is-assistant .message-text h1,
.chat-message.is-assistant .message-text h2,
.chat-message.is-assistant .message-text h3,
.chat-message.is-assistant .message-text h4 {
    margin: 1.05em 0 0.48em;
    color: #edf0f4;
    line-height: 1.3;
}

.brief-body pre,
.message-brief-html pre,
.chat-message.is-assistant .message-text pre {
    overflow: auto;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    background: #0c0b14;
}

.composer-dock {
    position: sticky;
    z-index: 20;
    bottom: 8px;
    margin-top: 6px;
}

.composer-dock .ai-disclaimer {
    margin: 0 0 6px;
    padding: 0 8px;
    text-align: center;
}

.composer-shell {
    position: static;
    bottom: auto;
    padding: 7px 8px 7px 10px;
}

.composer-shell textarea {
    display: block;
    min-height: 42px;
    max-height: 160px;
    padding: 10px 8px 7px;
    resize: none;
    overflow-y: auto;
    line-height: 1.45;
}

.composer-footer {
    min-height: 34px;
    padding: 2px 2px 0 8px;
}

.has-composer .jump-latest {
    bottom: 118px;
}

@media (max-width: 940px) {
    .chat-page {
        padding-bottom: 10px;
    }

    .has-composer .jump-latest {
        bottom: 114px;
    }
}

/* v6 conversation polish: compact bubbles, stable bottom composer, hover-only actions. */
.chat-page {
    display: flex;
    min-height: 100%;
    flex-direction: column;
    padding-bottom: 0;
}

.chat-heading {
    flex: 0 0 auto;
}

.chat-thread {
    flex: 1 0 auto;
    justify-content: flex-start;
    padding-bottom: 8px;
}

.chat-message-row {
    position: relative;
    width: min(78%, 690px);
}

.chat-message-line {
    position: relative;
    display: block;
}

.chat-message,
.chat-message-row .chat-message {
    display: block;
    width: 100%;
    min-height: 0;
    height: auto;
    padding: 10px 13px;
}

.message-label {
    margin-bottom: 5px;
}

.chat-message.is-user .message-text,
.chat-message.is-user .message-text > :first-child,
.chat-message.is-user .message-text > :last-child {
    margin-top: 0;
    margin-bottom: 0;
}

/* Action controls live outside the user bubble and never alter bubble width/alignment. */
.message-actions {
    position: absolute;
    right: calc(100% + 7px);
    bottom: 3px;
    display: flex;
    gap: 2px;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(4px);
    transition: opacity 120ms ease, transform 120ms ease;
}

.chat-message-row:hover .message-actions,
.chat-message-row:focus-within .message-actions {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}

.assistant-thinking {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 24px;
    color: var(--muted);
    font-size: 0.78rem;
}

.thinking-disc {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #f3f1ef;
    box-shadow: 0 0 0 0 rgba(243, 241, 239, 0.34);
    animation: alan-thinking 1.45s ease-in-out infinite;
}

@keyframes alan-thinking {
    0%, 100% {
        opacity: 0.42;
        transform: scale(0.82);
        box-shadow: 0 0 0 0 rgba(243, 241, 239, 0.24);
    }
    50% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 0 7px rgba(243, 241, 239, 0.03);
    }
}

/* The dock occupies layout space when content is short and sticks to the viewport bottom when long. */
.composer-dock {
    position: sticky;
    z-index: 20;
    bottom: 0;
    flex: 0 0 auto;
    margin-top: auto;
    padding: 8px 0 5px;
    background: linear-gradient(to bottom, rgba(12, 11, 24, 0), #0c0b18 28%);
}

.composer-dock .ai-disclaimer {
    margin: 0 0 5px;
    padding: 0 8px;
    text-align: center;
}

.composer-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    padding: 6px 7px 6px 10px;
}

.composer-shell textarea {
    min-height: 38px;
    max-height: 160px;
    padding: 8px 5px 7px;
    line-height: 1.42;
}

.composer-footer {
    min-height: 0;
    padding: 0;
    align-self: end;
}

.composer-footer > span {
    display: none;
}

.composer-footer .primary-button {
    min-height: 36px;
}

.composer-shell.is-submitting textarea,
.composer-shell.is-submitting button {
    opacity: 0.62;
}

.composer-shell.is-submitting button {
    cursor: wait;
}

/* Keep the jump control above the entire composer, even while the textarea grows. */
.has-composer .jump-latest {
    bottom: calc(var(--alan-composer-height, 82px) + 18px);
}

@media (max-width: 640px) {
    .chat-message-row {
        width: 92%;
    }

    /* Touch devices cannot rely on hover, so keep message actions discoverable. */
    .message-actions {
        right: auto;
        left: -35px;
        opacity: 0.78;
        pointer-events: auto;
        transform: none;
    }
}

.assistant-thinking.is-error {
    color: #e5a2aa;
}

@media (max-width: 640px) {
    .message-actions {
        flex-direction: row;
    }
}

/* Keep Blade indentation from becoming visible blank lines; only user content preserves line breaks. */
.chat-message,
.chat-message-row .chat-message {
    white-space: normal;
}

/* v7 chat streaming + navigation refinements. */
.chat-message-row.has-actions::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -46px;
    width: 46px;
}

/* Keep the action rail immediately beside the user bubble so hover remains continuous. */
.message-actions {
    right: calc(100% + 2px);
    z-index: 2;
}

.message-label time {
    white-space: nowrap;
}

.message-text.is-streaming {
    overflow-wrap: anywhere;
}

.message-text.is-streaming.is-raw-stream,
.streaming-markdown-tail {
    white-space: pre-wrap;
}

.streaming-markdown-tail {
    overflow-wrap: anywhere;
}

.assistant-failed {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.assistant-failed .message-placeholder {
    margin: 0;
}

.retry-button {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 5px 10px;
    font-size: 0.72rem;
}

.stream-inline-error {
    margin: 7px 0 0;
    color: #e5a2aa;
    font-size: 0.72rem;
}

.conversation-load-more {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.conversation-load-more:disabled {
    cursor: wait;
    opacity: 0.62;
}

@media (max-width: 640px) {
    .chat-message-row.has-actions::before {
        display: none;
    }
}

/* Tabular news workspace */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tabular-page {
    width: 100%;
    padding: 38px 30px 54px;
}

.tabular-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.tabular-heading h1 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.45rem);
    letter-spacing: -0.035em;
}

.tabular-heading p:not(.eyebrow) {
    max-width: 680px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.tabular-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.tabular-search {
    position: relative;
    display: flex;
    min-width: 180px;
    max-width: 560px;
    flex: 1 1 240px;
    align-items: center;
}

.tabular-search input,
.company-search input {
    width: 100%;
    border: 1px solid var(--border);
    background: #11101d;
    color: var(--text);
    outline: none;
}

.tabular-search input {
    min-height: 40px;
    padding: 8px 38px 8px 36px;
    border-radius: 999px;
    font-size: 0.79rem;
}

.tabular-search input:focus,
.company-search input:focus {
    border-color: rgba(220, 229, 157, 0.55);
    box-shadow: 0 0 0 3px rgba(173, 184, 97, 0.1);
}

.tabular-search input::-webkit-search-cancel-button,
.company-search input::-webkit-search-cancel-button {
    display: none;
}

.tabular-search-icon {
    position: absolute;
    z-index: 1;
    left: 14px;
    color: var(--subtle);
    font-size: 1rem;
    pointer-events: none;
}

.tabular-search-clear,
.company-search button {
    position: absolute;
    z-index: 1;
    right: 10px;
    display: inline-grid;
    width: 24px;
    height: 24px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 1.1rem;
    cursor: pointer;
}

.tabular-search-clear:hover,
.company-search button:hover {
    background: rgba(255, 255, 255, 0.055);
    color: var(--text);
}

.tabular-search-clear[hidden],
.company-search button[hidden],
[data-company-agent-group][hidden],
[data-company-item][hidden],
.company-search-empty[hidden] {
    display: none;
}

.tabular-toolbar-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.segmented-control {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #11101d;
}

.segmented-option {
    min-width: 92px;
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

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

.segmented-option.is-active {
    background: var(--accent-soft);
    color: #dce69f;
    box-shadow: inset 0 0 0 1px rgba(173, 184, 97, 0.24);
}

.agent-filter {
    position: relative;
    z-index: 12;
}

.agent-filter > summary,
.tabular-menu > summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #11101d;
    color: #d7d1dc;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
}

.agent-filter > summary::-webkit-details-marker,
.tabular-menu > summary::-webkit-details-marker {
    display: none;
}

.agent-filter > summary::before,
.tabular-menu > summary::before {
    content: "▾";
    color: var(--accent);
}

.agent-filter[open] > summary::before,
.tabular-menu[open] > summary::before {
    transform: rotate(180deg);
}

.agent-filter > summary span,
.tabular-menu > summary span {
    color: var(--subtle);
    font-size: 0.7rem;
}

.tabular-menu {
    position: relative;
    z-index: 13;
}

.tabular-menu-options {
    position: absolute;
    z-index: 3;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    min-width: 170px;
    gap: 3px;
    padding: 7px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #171624;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

.tabular-menu-options a {
    padding: 8px 9px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
}

.tabular-menu-options a:hover,
.tabular-menu-options a.is-active {
    background: rgba(173, 184, 97, 0.1);
    color: #dce59d;
}

.agent-filter-form {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(290px, calc(100vw - 30px));
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #171624;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

.agent-filter-form fieldset {
    display: grid;
    max-height: 280px;
    gap: 3px;
    margin: 8px 0 12px;
    padding: 0;
    overflow-y: auto;
    border: 0;
}

.agent-filter-form label {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 6px;
    border-radius: 7px;
    color: #d7d1dc;
    font-size: 0.78rem;
    cursor: pointer;
}

.agent-filter-form label:hover {
    background: rgba(255, 255, 255, 0.035);
}

.agent-filter-form input,
.actionable-toggle input {
    accent-color: var(--accent);
}

.agent-filter-shortcuts {
    display: flex;
    gap: 12px;
}

.agent-filter-shortcuts button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #aeb879;
    font-size: 0.7rem;
    cursor: pointer;
}

.agent-filter-form > .secondary-button {
    width: 100%;
}

.tabular-table-shell {
    overflow-x: auto;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: #11101d;
}

.news-table {
    width: 100%;
    min-width: 1050px;
    border-collapse: collapse;
    table-layout: fixed;
}

.news-table th,
.news-table td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border-soft);
    text-align: left;
    vertical-align: top;
}

.news-table th {
    position: sticky;
    z-index: 2;
    top: 0;
    background: #171624;
    color: #8f8997;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.news-table td {
    color: #c9c3ce;
    font-size: 0.76rem;
    line-height: 1.5;
}

.news-table tr:last-child td {
    border-bottom: 0;
}

.news-table th:nth-child(1) { width: 11%; }
.news-table th:nth-child(2) { width: 14%; }
.news-table th:nth-child(3) { width: 20%; }
.news-table th:nth-child(4) { width: 13%; }
.news-table th:nth-child(5) { width: 30%; }
.news-table th:nth-child(6) { width: 12%; }

.table-agent-link,
.news-title-cell a {
    color: #dce59d;
    font-weight: 700;
    text-decoration-color: rgba(220, 229, 157, 0.42);
    text-underline-offset: 3px;
}

.table-agent-link:hover,
.news-title-cell a:hover {
    color: #eef4b9;
}

.published-cell {
    color: #97909f;
    white-space: nowrap;
}

.summary-cell {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.actionable-cell form {
    display: grid;
    gap: 5px;
}

.actionable-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #d3cdd8;
    font-weight: 650;
    cursor: pointer;
}

.actionable-save {
    justify-self: start;
    padding: 3px 7px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #171624;
    color: var(--muted);
    font-size: 0.68rem;
    cursor: pointer;
}

.js .actionable-save {
    display: none;
}

.actionable-status {
    min-height: 1em;
    color: var(--subtle);
    font-size: 0.65rem;
}

.actionable-saved-at {
    color: var(--subtle);
    font-size: 0.65rem;
    line-height: 1.4;
}

.actionable-status.is-error {
    color: var(--danger);
}

.tabular-empty {
    padding: 42px 20px !important;
    color: var(--subtle) !important;
    text-align: center !important;
}

.tabular-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
}

.tabular-page-link {
    min-width: 84px;
    padding: 8px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #11101d;
    color: #dce59d;
    font-size: 0.76rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.tabular-page-link:hover {
    border-color: rgba(220, 229, 157, 0.42);
    color: #eef4b9;
}

.tabular-page-link.is-disabled {
    color: #706a76;
    cursor: default;
}

.tabular-page-number {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
}

.tabular-company-panel .right-panel-header {
    padding-inline: 1px;
}

.company-filter-shortcuts {
    display: flex;
    gap: 14px;
    padding: 16px 1px 10px;
}

.company-filter-shortcuts button,
.company-agent-shortcuts button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #aeb879;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.company-filter-shortcuts button:hover,
.company-agent-shortcuts button:hover {
    color: #dce59d;
}

.company-filter-shortcuts button:disabled,
.company-agent-shortcuts button:disabled {
    color: #625e68;
    cursor: default;
}

.company-filter-status {
    min-height: 1em;
    margin: 0 1px 9px;
    color: var(--subtle);
    font-size: 0.68rem;
    line-height: 1.3;
}

.company-filter-status.is-error {
    color: var(--danger);
}

.company-filter-tools {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 16px;
}

.company-search {
    position: relative;
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
}

.company-search input {
    min-height: 36px;
    padding: 7px 34px 7px 11px;
    border-radius: 9px;
    font-size: 0.75rem;
}

.company-sort-menu {
    flex: 0 0 auto;
}

.company-sort-menu > summary {
    min-height: 36px;
    padding: 6px 9px;
    border-radius: 9px;
    font-size: 0.72rem;
}

.company-sort-menu .tabular-menu-options {
    min-width: 145px;
}

.company-filter-form,
.company-agent-list {
    display: grid;
    gap: 12px;
}

.company-agent-group {
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    background: #11101d;
}

.company-agent-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    padding: 10px;
    border-bottom: 1px solid var(--border-soft);
    background: #151421;
}

.company-agent-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.company-agent-heading strong {
    min-width: 0;
    overflow: hidden;
    color: #ddd7e2;
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-agent-avatar {
    flex: 0 0 auto;
    width: 27px;
    height: 27px;
    border-radius: 8px;
}

.company-agent-shortcuts {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.company-agent-shortcuts button {
    font-size: 0.63rem;
}

.company-checklist {
    display: grid;
    padding: 5px;
}

.company-checklist label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 7px;
    border-radius: 7px;
    color: #c9c3ce;
    font-size: 0.74rem;
    line-height: 1.35;
    cursor: pointer;
}

.company-checklist label:hover {
    background: rgba(255, 255, 255, 0.035);
}

.company-checklist input {
    flex: 0 0 auto;
    margin-top: 2px;
    accent-color: var(--accent);
}

.company-agent-empty,
.company-search-empty {
    margin: 0;
    padding: 12px;
    color: var(--subtle);
    font-size: 0.72rem;
    line-height: 1.4;
}

.company-search-empty {
    text-align: center;
}

.company-filter-fallback {
    width: 100%;
}

[data-tabular-table].is-filtering {
    opacity: 0.58;
    transition: opacity 120ms ease;
}

@media (max-width: 640px) {
    .tabular-page {
        padding: 28px 15px 48px;
    }

    .tabular-heading,
    .tabular-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .tabular-search {
        width: 100%;
        max-width: none;
    }

    .tabular-toolbar-actions {
        justify-content: space-between;
        margin-left: 0;
    }

    .tabular-heading .feed-count {
        align-self: flex-start;
    }

    .segmented-control {
        align-self: flex-start;
    }

    .agent-filter > summary {
        justify-content: center;
    }

    .agent-filter-form {
        right: auto;
        left: 0;
        width: 100%;
    }

    .tabular-table-shell {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .news-table,
    .news-table tbody,
    .news-table tr,
    .news-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .news-table thead {
        display: none;
    }

    .news-table tr {
        margin-bottom: 12px;
        padding: 8px 12px;
        border: 1px solid var(--border-soft);
        border-radius: 12px;
        background: #11101d;
    }

    .news-table td {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 10px;
        padding: 8px 0;
    }

    .news-table td::before {
        content: attr(data-label);
        color: #777181;
        font-size: 0.64rem;
        font-weight: 800;
        letter-spacing: 0.05em;
        text-transform: uppercase;
    }

    .news-table .tabular-empty {
        display: block;
    }

    .tabular-pagination {
        gap: 8px;
    }

    .tabular-page-link {
        min-width: 74px;
        padding-inline: 10px;
    }
}
