:root {
    --bg: #f7f7f5;
    --surface: #ffffff;
    --text: #1d1d1b;
    --muted: #6b6b66;
    --border: #e2e2dd;
    --ok: #1f7a3a;
    --warn: #9a6700;
    --bad: #b42318;
    --accent: #3d5afe;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(20, 20, 18, 0.04);
    --side-bg: #18191b;
    --side-text: #c9cac6;
    --side-muted: #7d7f7a;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
}

body {
    margin: 0;
}

h1:focus {
    outline: none;
}

/* Signed out (the login page): just the brand. */
.topbar {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: white;
    background: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Signed in: an admin panel with the navigation in a sidebar. */
.shell {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    box-sizing: border-box;
    padding: 1rem 0.75rem;
    color: var(--side-text);
    background: var(--side-bg);
}

.sidebar .brand {
    padding: 0.25rem 0.5rem 0.75rem;
    color: white;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-section {
    margin: 1rem 0.6rem 0.35rem;
    color: var(--side-muted);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 0.6rem;
    color: var(--side-text);
    border-radius: 8px;
    font-size: 0.92rem;
    text-decoration: none;
}

.side-nav a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.06);
}

.side-nav a.active {
    color: white;
    background: rgba(255, 255, 255, 0.11);
}

svg.icon {
    flex: none;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.side-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: auto;
    padding: 0.85rem 0.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.side-user form {
    margin: 0;
}

.avatar {
    display: grid;
    flex: none;
    place-items: center;
    width: 30px;
    height: 30px;
    color: white;
    background: #3a3c40;
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 600;
}

.side-user .name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    color: white;
    font-size: 0.9rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

button.icon-button {
    display: grid;
    place-items: center;
    padding: 0.35rem;
    color: var(--side-muted);
    background: none;
}

button.icon-button:hover {
    color: white;
}

@media (max-width: 860px) {
    .shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        z-index: 10;
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        height: auto;
        padding: 0.5rem 0.75rem;
    }

    .sidebar .brand {
        padding: 0;
    }

    .sidebar .brand span:last-child,
    .nav-section,
    .side-user .name {
        display: none;
    }

    .side-nav {
        flex: 1;
        flex-direction: row;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .side-nav::-webkit-scrollbar {
        display: none;
    }

    .side-nav a {
        flex: none;
        padding: 0.45rem 0.55rem;
    }

    .side-nav a span {
        display: none;
    }

    .side-user {
        margin: 0;
        padding: 0;
        border: 0;
    }
}

button {
    padding: 0.45rem 0.9rem;
    font: inherit;
    color: white;
    background: var(--text);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

button:disabled {
    opacity: 0.5;
    cursor: default;
}

button.link {
    padding: 0;
    color: var(--muted);
    background: none;
    text-decoration: underline;
}

input[type=email],
input[type=text],
input:not([type]) {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.6rem;
    font: inherit;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

form.stack,
.login form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 360px;
}

form.stack button,
.login form button {
    align-self: flex-start;
    margin-top: 0.5rem;
}

.login {
    max-width: 360px;
    margin: 3rem auto;
}

.login .hint {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.dev-login {
    margin-top: 2.5rem;
    padding: 1rem;
    border: 1px dashed var(--warn);
    border-radius: 8px;
}

.dev-login h2 {
    margin: 0 0 0.25rem;
    font-size: 0.9rem;
    color: var(--warn);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dev-login p {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: var(--muted);
}

select {
    width: 100%;
    padding: 0.45rem 0.5rem;
    font: inherit;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
}

.error,
.validation-message {
    color: var(--bad);
}

.notice {
    color: var(--ok);
}

/* The panel uses the whole width next to the sidebar; only reading text (.page-header p) keeps a measure. */
.content {
    width: 100%;
    padding: 2rem 2.25rem 3rem;
    box-sizing: border-box;
}

@media (max-width: 860px) {
    .content {
        padding: 1.25rem 1rem 2rem;
    }
}

/* Tables sit in a card, like everything else on the panel. */
table.status {
    width: 100%;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

table.status th,
table.status td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

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

table.status th {
    color: var(--muted);
    background: #fafaf8;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.state-healthy { color: var(--ok); }
.state-degraded { color: var(--warn); }
.state-unhealthy { color: var(--bad); }

.blazor-error-boundary {
    padding: 1rem;
    color: white;
    background: var(--bad);
}

.blazor-error-boundary::after {
    content: "A apărut o eroare.";
}

.muted {
    color: var(--muted);
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85em;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.page-head .key {
    color: var(--muted);
    font-weight: 500;
}

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

a.button {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    color: white;
    background: var(--text);
    border-radius: 6px;
    text-decoration: none;
}

button.secondary,
a.button.secondary {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
}

.filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filters select {
    width: auto;
}

/* Board */

.board {
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    gap: 0.75rem;
    overflow-x: auto;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 120px;
    padding: 0.5rem;
    background: #efefeb;
    border-radius: 8px;
}

.column h2 {
    margin: 0.25rem 0.25rem 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.column .count {
    color: var(--muted);
    font-weight: 400;
}

.card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.6rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    text-decoration: none;
}

.card:hover {
    border-color: var(--muted);
}

.card-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
}

.card-head .key {
    color: var(--muted);
}

.card-title {
    font-size: 0.9rem;
}

.card-meta {
    color: var(--muted);
    font-size: 0.75rem;
}

.badge {
    padding: 0.05rem 0.4rem;
    font-size: 0.7rem;
    border-radius: 999px;
    background: #e8e8e3;
}

.badge.type-userstory { background: #e4ecfb; color: #234a91; }
.badge.type-bug { background: #fbe6e4; color: var(--bad); }
.badge.priority-high { background: #fff1d6; color: var(--warn); }

/* Task details */

dl.meta {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.35rem 1rem;
    margin: 1rem 0 1.5rem;
}

dl.meta dt {
    color: var(--muted);
}

dl.meta dd {
    margin: 0;
}

.markdown {
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    line-height: 1.55;
}

.markdown pre,
.markdown code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85em;
}

.markdown pre {
    padding: 0.75rem;
    overflow-x: auto;
    background: var(--bg);
    border-radius: 6px;
}

.children {
    padding-left: 1.25rem;
}

table.history tr.selected {
    background: #fff8e6;
}

.diff {
    padding: 0.75rem;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.45;
}

.diff span {
    display: block;
    white-space: pre-wrap;
}

.diff .added { background: #e6f4ea; color: var(--ok); }
.diff .removed { background: #fbe9e7; color: var(--bad); }

.conflict {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #fff8e6;
    border: 1px solid var(--warn);
    border-radius: 8px;
}

/* Task form */

.work-item-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem 1rem;
}

.work-item-form .field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.work-item-form .wide {
    grid-column: 1 / -1;
}

textarea.body-editor {
    width: 100%;
    box-sizing: border-box;
    padding: 0.6rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.tabs {
    display: flex;
    gap: 0.25rem;
}

.tabs .tab {
    padding: 0.3rem 0.7rem;
    color: var(--muted);
    background: none;
    border: 1px solid transparent;
    border-radius: 6px 6px 0 0;
}

.tabs .tab.active {
    color: var(--text);
    border-color: var(--border);
    border-bottom-color: var(--surface);
    background: var(--surface);
}

.preview {
    min-height: 16rem;
}

/* Agents */

.panel {
    margin: 1rem 0 2rem;
    padding: 1.1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.token-once {
    margin: 0.5rem 0 1rem;
    padding: 0.75rem 1rem;
    background: #fff8e6;
    border: 1px solid var(--warn);
    border-radius: 8px;
}

.token-once pre {
    padding: 0.5rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    background: var(--surface);
    border-radius: 6px;
}

table.status tr.selected {
    background: #fff8e6;
}

/* Jobs, machines, thread */

.state-running { color: #234a91; }

pre.log {
    max-height: 32rem;
    padding: 0.75rem;
    overflow: auto;
    background: #1d1d1b;
    color: #e8e8e3;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

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

ol.thread {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

/* Events from bunvibe: one quiet line with an icon, so they read differently from people and agents talking. */
.thread .event {
    display: grid;
    grid-template-columns: 1.5rem 1fr auto;
    align-items: start;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    color: var(--muted);
    font-size: 0.9rem;
    border-left: 3px solid var(--border);
}

.thread .event p { margin: 0; }
.thread .event pre { margin: 0.4rem 0 0; white-space: pre-wrap; font-size: 0.8rem; }
.thread .event-icon { font-weight: 700; text-align: center; }
.thread .event-meta { font-size: 0.8rem; white-space: nowrap; }
.thread .event-ok { border-left-color: var(--ok); }
.thread .event-ok .event-icon { color: var(--ok); }
.thread .event-bad { border-left-color: var(--bad); color: var(--text); }
.thread .event-bad .event-icon { color: var(--bad); }
.thread .event-warn { border-left-color: var(--warn); }

.thread .message {
    padding: 0.6rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.thread .message.kind-question { border-color: var(--warn); background: #fffaf0; }
.thread .message-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; font-size: 0.9rem; }
.thread .message-body p:first-child { margin-top: 0; }
.thread .message-body p:last-child { margin-bottom: 0; }

.thread-form-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.thread-form-row select { width: auto; }

.thread-form-row textarea {
    flex: 1;
    padding: 0.5rem;
    font: inherit;
    border: 1px solid var(--border);
    border-radius: 6px;
    resize: vertical;
}

@media (max-width: 640px) {
    .thread-form-row { flex-direction: column; align-items: stretch; }
    .thread .event { grid-template-columns: 1.5rem 1fr; }
    .thread .event-meta { grid-column: 2; }
}

/* Projects and sessions */

.breadcrumb {
    margin: 0 0 0.25rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.small { font-size: 0.8rem; }

.inline-input {
    width: auto;
    min-width: 16rem;
    padding: 0.45rem 0.6rem;
    font: inherit;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.markdown.goal {
    margin-bottom: 1rem;
    background: #f3f6fd;
    border-color: #d9e2f6;
}

.session-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.session-side .panel {
    margin: 0 0 1rem;
}

.session-side h2 {
    margin-top: 0;
    font-size: 1rem;
}

ul.members {
    margin: 0 0 0.75rem;
    padding: 0;
    list-style: none;
}

ul.members li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.1rem 0.5rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
}

ul.members li > div:nth-child(2) { grid-column: 1; }
ul.members li > button { grid-row: 1 / span 2; grid-column: 2; align-self: center; }

.add-member { max-width: none; }

ul.checklist {
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

ul.checklist li { padding: 0.25rem 0; }

.task-chip {
    margin-right: 0.35rem;
    padding: 0.05rem 0.4rem;
    font-size: 0.75rem;
    color: #234a91;
    background: #e4ecfb;
    border-radius: 999px;
    text-decoration: none;
}

.thread .event-body .task-chip { float: left; margin-top: 0.1rem; }

.agent-context {
    max-height: 28rem;
    overflow: auto;
    font-size: 0.85rem;
}

.agent-context table { border-collapse: collapse; }
.agent-context th, .agent-context td { padding: 0.2rem 0.4rem; border-bottom: 1px solid var(--border); text-align: left; }

@media (max-width: 900px) {
    .session-layout { grid-template-columns: 1fr; }
}

/* The admin panel: page header, stat cards, project cards. */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.65rem;
    letter-spacing: -0.01em;
}

.page-header p {
    max-width: 46rem;
    margin: 0.4rem 0 0;
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.section-head h2 {
    margin: 0;
    font-size: 1.05rem;
}

.section-head a {
    color: var(--muted);
    font-size: 0.9rem;
    text-decoration: none;
}

.section-head a:hover {
    color: var(--text);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    margin-bottom: 2.25rem;
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 1rem 1.15rem;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
}

.stat-card:hover {
    border-color: #cfcfc8;
}

.stat-card .label {
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.stat-card .value small {
    color: var(--muted);
    font-size: 1.1rem;
    font-weight: 500;
}

.stat-card .hint {
    color: var(--muted);
    font-size: 0.85rem;
}

.dash-section {
    margin-bottom: 2.25rem;
}

.dash-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.dash-grid .panel {
    margin: 0;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.15rem 1.2rem;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

a.project-card:hover {
    border-color: #c9c9c2;
    box-shadow: 0 8px 22px rgba(20, 20, 18, 0.07);
    transform: translateY(-1px);
}

.project-card-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.project-card-head > div {
    flex: 1;
    min-width: 0;
}

.project-card h3 {
    margin: 0;
    overflow: hidden;
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-mark {
    display: grid;
    flex: none;
    place-items: center;
    width: 40px;
    height: 40px;
    color: white;
    background: hsl(var(--hue, 220) 52% 46%);
    border-radius: 10px;
    font-weight: 700;
}

.pill {
    flex: none;
    max-width: 9rem;
    overflow: hidden;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pill.live {
    color: var(--ok);
    background: #e7f4ea;
}

.project-card .excerpt {
    display: -webkit-box;
    min-height: calc(1.45em * 3);
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.project-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
}

.project-stats div {
    display: flex;
    flex-direction: column;
}

.project-stats .n {
    font-size: 1.15rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.project-stats .l {
    color: var(--muted);
    font-size: 0.75rem;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.chip {
    padding: 0.15rem 0.5rem;
    color: #45453f;
    background: #f0f0ec;
    border-radius: 999px;
    font-size: 0.75rem;
}

.new-card {
    align-items: center;
    justify-content: center;
    min-height: 230px;
    color: var(--muted);
    background: transparent;
    border: 1.5px dashed #cfcfc8;
    box-shadow: none;
    font: inherit;
    cursor: pointer;
}

.new-card:hover {
    color: var(--text);
    border-color: var(--muted);
}

.new-card .plus {
    font-size: 1.8rem;
    line-height: 1;
}

.new-card.open {
    align-items: stretch;
    justify-content: flex-start;
    color: var(--text);
    background: var(--surface);
    border-style: solid;
    cursor: default;
}

.new-card.open form.stack {
    max-width: none;
}

ul.item-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

ul.item-list li {
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
}

ul.item-list li:last-child {
    border-bottom: 0;
}

ul.item-list.health li {
    grid-template-columns: 1.25rem minmax(0, 1fr) auto auto;
}

ul.item-list li.problem {
    display: block;
    padding-top: 0;
}

button.small-button {
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
}

ul.item-list .job-what {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    min-width: 0;
}

@media (max-width: 860px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .stat-card .value {
        font-size: 1.6rem;
    }
}

/* Project page: tabs, buckets of documents. */
.page-tabs {
    display: flex;
    gap: 0.25rem;
    margin: -0.5rem 0 1.5rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
}

.page-tabs a {
    display: flex;
    flex: none;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 0.85rem;
    color: var(--muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    text-decoration: none;
}

.page-tabs a:hover {
    color: var(--text);
}

.page-tabs a.active {
    color: var(--text);
    border-bottom-color: var(--accent);
    font-weight: 500;
}

.page-tabs .count {
    padding: 0 0.45rem;
    color: var(--muted);
    background: #efefeb;
    border-radius: 999px;
    font-size: 0.75rem;
}

.bucket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.bucket-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.1rem 1.2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.bucket-card h3 {
    margin: 0;
    font-size: 1.05rem;
}

.bucket-card p {
    margin: 0;
}

.bucket-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.pill.mode-full {
    color: #234a91;
    background: #e4ecfb;
}

.pill.mode-list {
    color: var(--warn);
    background: #fff1d6;
}

.pill.mode-none {
    color: var(--muted);
    background: #efefeb;
}

ul.doc-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

ul.doc-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

ul.doc-list li:last-child {
    border-bottom: 0;
}

ul.doc-list a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bucket-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.4rem;
}

.bucket-card.new-bucket {
    background: transparent;
    border-style: dashed;
    box-shadow: none;
}

.bucket-card form.stack {
    max-width: none;
}
