.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
/* ---- App design tokens (from the mockups) ---- */
:root {
    --accent: #2563eb;
    --ink: #1c1f24;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #ffffff;
    --open-bg: #e0ecff;   --open-fg: #2563eb;
    --waiting-bg: #fff4d6; --waiting-fg: #a16207;
    --done-bg: #eef0f2;   --done-fg: #4b5563;
    --danger: #b91c1c;
}

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.4;
}

main { max-width: 640px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: 0.5rem 0 0.75rem; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.stack { display: flex; flex-direction: column; gap: 8px; max-width: 360px; }
input[type=email], input[type=text] {
    font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
}
.btn {
    display: inline-block; font: inherit; font-weight: 600; padding: 10px 14px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: 0.6; cursor: default; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.chip.open { background: var(--open-bg); color: var(--open-fg); }
.chip.waiting { background: var(--waiting-bg); color: var(--waiting-fg); }
.chip.done { background: var(--done-bg); color: var(--done-fg); }
.btn.small { font-size: 13px; padding: 6px 10px; }
/* Buttons with an icon before the text (Icon.razor) */
.icon-svg {
    width: 15px; height: 15px; vertical-align: -3px; margin-right: 5px; fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---- Page header ---- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---- Conversations list ---- */
.conv-list { list-style: none; margin: 0; padding: 0; }
.conv-row {
    display: flex; gap: 12px; padding: 12px 8px; margin: 0 -8px; border-bottom: 1px solid var(--line);
    color: inherit; text-decoration: none; border-radius: 10px;
}
a.conv-row:hover { background: #f6f7f9; }
.avatar {
    flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--open-bg); color: var(--accent); font-weight: 700; font-size: 15px;
}
.conv-main { flex: 1; min-width: 0; }
.conv-top, .conv-bottom { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.conv-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { flex: none; font-size: 13px; }
.conv-meta { font-size: 13px; }
.conv-last { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.conv-thread { font-weight: 600; }
.badge {
    flex: none; min-width: 20px; height: 20px; padding: 0 6px; box-sizing: border-box; border-radius: 999px;
    background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ---- Threads screen ---- */
.back { display: inline-block; color: var(--accent); text-decoration: none; font-weight: 600; margin-bottom: 4px; }
.page-head h1 { margin-bottom: 2px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.filter-chip {
    font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--line); color: var(--ink); text-decoration: none; background: #fff;
}
.filter-chip .count { color: var(--muted); font-weight: 500; margin-left: 2px; }
.filter-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter-chip.active .count { color: #d1d5db; }
.thread-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.thread-card {
    display: block; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
    color: inherit; text-decoration: none;
}
a.thread-card:hover { border-color: #c7cdd6; }
.thread-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.thread-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-time { flex: none; font-size: 13px; }
.thread-status { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.thread-decision {
    font-size: 13px; background: var(--open-bg); color: var(--accent); border-radius: 8px; padding: 4px 8px; margin-bottom: 6px;
}
.thread-last { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-counts { font-size: 13px; margin-top: 4px; }

/* ---- Thread view ---- */
.thread-page { display: flex; flex-direction: column; height: calc(100dvh - 32px); }
.thread-head-row { display: flex; align-items: center; gap: 10px; }
.thread-head-row h1 { margin: 2px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.decision-banner {
    display: flex; gap: 8px; align-items: baseline; width: 100%; text-align: left; cursor: pointer;
    font: inherit; font-size: 14px; border: 1px solid #bfd3fb; background: var(--open-bg); color: var(--ink);
    border-radius: 10px; padding: 8px 12px; margin-bottom: 8px;
}
.decision-label { font-weight: 700; color: var(--accent); flex: none; }
.decision-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-scroll { flex: 1; overflow-y: auto; padding: 4px 2px 8px; }
.load-earlier { text-align: center; margin: 4px 0 8px; }
.empty-thread { text-align: center; margin-top: 24px; }
.day-sep { text-align: center; margin: 14px 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.msg { display: flex; flex-direction: column; max-width: 80%; margin: 2px 0; border-radius: 16px; }
.msg.mine { margin-left: auto; align-items: flex-end; }
.msg.theirs { margin-right: auto; align-items: flex-start; }
.msg-sender { font-size: 12px; color: var(--muted); font-weight: 600; margin: 6px 10px 2px; }
.bubble {
    border-radius: 16px; padding: 8px 12px; background: #f1f3f5; color: var(--ink);
    display: flex; flex-direction: column; gap: 6px; max-width: 100%; box-sizing: border-box;
}
.msg.mine .bubble { background: var(--accent); color: #fff; }
.bubble.deleted { background: transparent; border: 1px dashed var(--line); color: var(--muted); font-style: italic; }
.msg.mine .bubble.deleted { color: var(--muted); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-foot { font-size: 11px; color: var(--muted); margin: 2px 10px 4px; display: flex; gap: 6px; align-items: center; }
.decision-tag { background: var(--open-bg); color: var(--accent); font-weight: 700; border-radius: 999px; padding: 0 6px; }
.photo-grid { display: grid; grid-template-columns: repeat(2, 120px); gap: 4px; }
.photo-grid.single { grid-template-columns: 200px; }
.photo-tile {
    aspect-ratio: 1; border-radius: 10px; background: #dfe3e8; color: var(--muted);
    display: flex; align-items: flex-end; padding: 6px; box-sizing: border-box; font-size: 11px; overflow: hidden;
}
.photo-tile span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card, .link-card {
    display: flex; gap: 10px; align-items: center; background: #fff; color: var(--ink);
    border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; text-decoration: none; min-width: 200px;
}
.link-card { flex-direction: column; align-items: flex-start; gap: 2px; }
.file-card.replaced { opacity: 0.55; }
.file-icon {
    flex: none; width: 36px; height: 36px; border-radius: 8px; background: var(--open-bg); color: var(--accent);
    display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700;
}
.file-info { display: flex; flex-direction: column; min-width: 0; }
.file-name, .link-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.file-meta, .link-domain, .link-desc { font-size: 12px; color: var(--muted); }
.composer { display: flex; gap: 8px; align-items: flex-end; padding-top: 8px; border-top: 1px solid var(--line); }
.composer textarea {
    flex: 1; font: inherit; resize: none; padding: 10px 12px; border: 1px solid var(--line); border-radius: 18px;
    max-height: 140px; field-sizing: content; min-height: 42px; box-sizing: border-box;
}
.send-error { margin: 4px 0 0; font-size: 13px; }
.head-spacer { flex: 1; }
.grow { flex: 1; min-width: 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.small-note { font-size: 13px; margin: 4px 0; }
.form-wide { max-width: 480px; }
.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.field small { font-weight: 400; }
.field input { font-weight: 400; }
.new-thread-form, .invite-form { display: flex; gap: 8px; margin: 8px 0; }
.new-thread-form input, .invite-form input {
    flex: 1; min-width: 0; font: inherit; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px;
}
.invites { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.invite-card {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
    border: 1px solid #bfd3fb; background: var(--open-bg); border-radius: 12px; padding: 10px 12px;
}
.invite-actions { display: flex; gap: 6px; }
.people-panel { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin: 8px 0; }
.people-panel h2 { font-size: 15px; margin: 2px 0 6px; }
.people-panel h3 { font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.people-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.people-list li { display: flex; align-items: center; gap: 8px; }
.people-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-role { font-size: 12px; }
.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;
}
.status-row { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.status-select {
    font: inherit; font-size: 13px; font-weight: 600; border: 0; border-radius: 999px; padding: 4px 10px; cursor: pointer;
}
.status-select.open { background: var(--open-bg); color: var(--open-fg); }
.status-select.waiting { background: var(--waiting-bg); color: var(--waiting-fg); }
.status-select.done { background: var(--done-bg); color: var(--done-fg); }
/* Status colors (028): chips and the thread's status picker. blue / amber / gray are the built-ins' defaults. */
.chip.c-blue, .status-select.c-blue { background: var(--open-bg); color: var(--open-fg); }
.chip.c-amber, .status-select.c-amber { background: var(--waiting-bg); color: var(--waiting-fg); }
.chip.c-gray, .status-select.c-gray { background: var(--done-bg); color: var(--done-fg); }
.chip.c-green, .status-select.c-green { background: #dcfce7; color: #15803d; }
.chip.c-red, .status-select.c-red { background: #fee2e2; color: #b91c1c; }
.chip.c-purple, .status-select.c-purple { background: #f3e8ff; color: #7e22ce; }
.chip.c-teal, .status-select.c-teal { background: #ccfbf1; color: #0f766e; }
.chip.c-pink, .status-select.c-pink { background: #fce7f3; color: #be185d; }
.filter-chip.edit-chip { font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); border-style: dashed; background: none; }
.status-editor .row-list input[type=text] { font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; width: 150px; }
.status-editor .row-list select, .status-editor .push-row select { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.status-editor .push-row input[type=text] { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; flex: 1 1 160px; max-width: 240px; }
.status-editor .chip { min-width: 70px; text-align: center; }
.decision-wrap { display: flex; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.decision-wrap .decision-banner { margin-bottom: 0; flex: 1; min-width: 0; }
.bubble[role=button] { cursor: pointer; }
.bubble.selected { outline: 2px solid #93b4f5; outline-offset: 1px; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 6px 6px; align-items: center; }
.action-form { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.action-form input {
    flex: 1; min-width: 180px; font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px;
}
.msg-note { margin: 0 8px 6px; }
/* ---- Desktop sidebar (rendered only at >= 1000px, signed in) ---- */
.app-shell.with-sidebar { display: flex; align-items: flex-start; }
.app-shell.with-sidebar main, .app-shell.with-rail main { flex: 1; min-width: 0; max-width: 760px; }
.app-shell.with-rail main { margin-left: max(56px, calc((100vw - 760px) / 2)); margin-right: auto; }
.sidebar {
    width: 280px; box-sizing: border-box; height: 100dvh; display: flex; flex-direction: column;
    background: #f7f8fa; border-right: 1px solid var(--line); padding: 12px 10px;
}
.sidebar.pinned { position: sticky; top: 0; flex: none; }
.sidebar.overlay {
    position: fixed; top: 0; left: 0; z-index: 50; box-shadow: 4px 0 24px rgba(15, 23, 42, .14);
    animation: sidebar-in .14s ease-out;
}
@keyframes sidebar-in { from { transform: translateX(-24px); opacity: 0; } to { transform: none; opacity: 1; } }
/* ---- Phones and small windows (< 1000px, signed in): top bar + drawer ---- */
.mobile-bar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 6px;
    padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top));
    background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line);
}
.drawer-backdrop { position: fixed; inset: 0; z-index: 49; background: rgba(15, 23, 42, .35); animation: fade-in .14s ease-out; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.sidebar.drawer {
    position: fixed; top: 0; left: 0; z-index: 50; width: min(320px, 86vw);
    padding-top: max(12px, env(safe-area-inset-top)); padding-bottom: max(12px, env(safe-area-inset-bottom));
    box-shadow: 4px 0 24px rgba(15, 23, 42, .2); animation: sidebar-in .14s ease-out;
}
.sidebar.drawer .sidebar-item { padding: 10px 8px; font-size: 15px; } /* bigger touch targets */
.sidebar-rail {
    position: fixed; top: 0; left: 0; bottom: 0; width: 44px; z-index: 40;
    display: flex; flex-direction: column; align-items: center; padding-top: 12px;
    border-right: 1px solid var(--line); background: #f7f8fa;
}
.rail-btn, .pin-btn {
    border: 1px solid transparent; background: none; border-radius: 8px; cursor: pointer;
    font-size: 18px; line-height: 1; padding: 6px 8px; color: var(--ink);
}
.rail-btn:hover, .pin-btn:hover, .rail-btn:focus-visible, .pin-btn:focus-visible { background: #e9ecf1; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 8px; }
.sidebar-brand { font-weight: 700; color: var(--ink); text-decoration: none; }
.sidebar-actions { display: flex; gap: 6px; padding: 0 4px 10px; }
.sidebar-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar-item {
    display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px;
    color: var(--ink); text-decoration: none; font-size: 14px;
}
.sidebar-item:hover { background: #eceff3; }
.sidebar-item.active { background: var(--open-bg); color: var(--accent); font-weight: 600; }
.sidebar-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- People picker, groups ---- */
.picker-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 6px; }
.pick-chip {
    display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
    border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 3px 10px 3px 4px;
}
.pick-chip.group { padding-left: 10px; font-weight: 600; }
.pick-chip.group small { color: var(--muted); font-weight: 500; }
.pick-chip.on { border-color: var(--accent); background: var(--open-bg); color: var(--accent); }
.pick-chip.static { cursor: default; }
.pick-chip.via { cursor: default; }
.pick-chip.via small { color: var(--muted); font-weight: 500; }
.picker-filter { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; max-width: 280px; }
.avatar.tiny { flex: 0 0 22px; width: 22px; height: 22px; font-size: 9px; }
.field select { font: inherit; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; max-width: 320px; }
.group-name { font-size: 16px; margin: 0; }
/* ---- People panel and group page: sections, rows, add panel ---- */
.section-head { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; }
.section-head h2, .section-head h3 { margin: 0; }
.section-head h2 { font-size: 16px; }
.section-head h3 { font-size: 13px; color: var(--muted); margin-top: 12px; }
.panel-section { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 12px 0; }
.row-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.row-list > li {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 0;
    border-top: 1px solid var(--line);
}
.row-list > li:first-child { border-top: 0; }
.row-list > li.confirm-row, .row-list > li.row-actions { border-top: 0; padding: 6px 8px; margin: 0 0 4px; }
.row-list > li.row-actions { background: #f6f7f9; border-radius: 8px; }
.row-list > li.pending .row-name { color: var(--muted); }
.row-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); text-decoration: none; }
a.row-name { color: var(--accent); font-weight: 600; }
.row-list > li > .row-name:first-child { flex: 1; }
.row-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; white-space: nowrap; }
.row-tag.owner { color: var(--accent); border-color: #bfd3fb; background: var(--open-bg); }
.btn.quiet { background: none; border-color: transparent; color: var(--muted); }
.btn.quiet:hover { border-color: var(--line); color: var(--ink); }
.avatar.dashed { background: none; border: 1px dashed var(--line); color: var(--muted); }
.add-panel { border: 1px solid #bfd3fb; background: #f7faff; border-radius: 12px; padding: 4px 12px 10px; margin: 4px 0 10px; }
.add-block h3 { font-size: 13px; color: var(--ink); margin: 10px 0 4px; }
.add-block + .add-block { border-top: 1px solid #dfe8fb; margin-top: 8px; }
.add-block input[type=text] { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; flex: 1 1 220px; max-width: 420px; }
.title-input { font: inherit; font-size: 20px; font-weight: 700; padding: 4px 8px; border: 1px solid var(--line); border-radius: 10px; flex: 1 1 200px; max-width: 420px; }
.card-form input { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; flex: 1 1 200px; max-width: 320px; }

/* ---- Groups list ---- */
.group-cards { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.group-card {
    display: block; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px;
    color: var(--ink); text-decoration: none; background: #fff;
}
.group-card:hover { border-color: #bfd3fb; background: #f7faff; }
.group-card-top { display: flex; justify-content: space-between; align-items: center; }
.avatar-row { display: flex; align-items: center; gap: 4px; margin-top: 6px; }

/* ---- Add-ons: tasks, checklists, polls (027) ---- */
.tool-card {
    background: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px;
    min-width: 220px; max-width: 420px; display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: auto;
}
.tool-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.tool-kind { font-weight: 700; text-transform: uppercase; letter-spacing: .04em; flex: 1; }
.tool-kind .icon-svg { width: 13px; height: 13px; margin-right: 4px; }
.tool-progress { font-size: 12px; color: var(--muted); }
.tool-title { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.tool-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; }
.overdue { color: #b91c1c; font-weight: 600; }
.tool-check { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 14px; }
.tool-check input { margin-top: 3px; width: 16px; height: 16px; flex: none; }
.tool-check.done > span, .tool-check.done .tool-title { text-decoration: line-through; color: var(--muted); }
.tool-items { list-style: none; margin: 2px 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tool-items li { display: flex; align-items: center; gap: 4px; }
.tool-items li .tool-check { flex: 1; }
.tool-items .chip-x { opacity: .4; }
.tool-items li:hover .chip-x, .tool-items .chip-x:focus-visible { opacity: 1; }
.tool-add { display: flex; gap: 6px; }
.tool-add input, .tool-edit input[type=text] {
    flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px;
}
.tool-edit { display: flex; flex-direction: column; gap: 4px; }
.tool-edit select, .tool-edit input[type=date] { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; }
.tool-bar { height: 6px; border-radius: 999px; background: #eef0f3; overflow: hidden; }
.tool-bar-fill { display: block; height: 100%; background: #16a34a; }
.poll-options { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.poll-option {
    position: relative; display: flex; align-items: center; gap: 8px; width: 100%; overflow: hidden;
    font: inherit; font-size: 14px; text-align: left; cursor: pointer; color: var(--ink);
    background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px;
}
.poll-option:disabled { cursor: default; }
.poll-option.mine { border-color: var(--accent); }
.poll-fill { position: absolute; inset: 0 auto 0 0; background: var(--open-bg); z-index: 0; }
.poll-option > :not(.poll-fill) { position: relative; z-index: 1; }
.poll-mark { color: var(--accent); width: 16px; text-align: center; }
.poll-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.poll-count { font-weight: 700; color: var(--muted); }
.poll-voters { font-size: 12px; color: var(--muted); margin: 2px 0 0 34px; }
/* Bar widths without inline styles (CSP style-src 'self'); TaskGroups.WidthStep picks one. */
.w-0 { width: 0; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; }
.w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; }
.w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; }
.w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; }
.tool-composer {
    border: 1px solid #bfd3fb; background: #f7faff; border-radius: 12px; padding: 8px 10px; margin: 0 8px 6px;
    display: flex; flex-direction: column; gap: 6px;
}
.tool-composer input[type=text], .tool-composer textarea {
    font: inherit; font-size: 14px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; width: 100%; box-sizing: border-box;
}
.tool-composer select, .tool-composer input[type=date], .tool-composer input[type=datetime-local] {
    font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.tool-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tool-tabs .icon-svg { width: 13px; height: 13px; margin-right: 4px; }
.tool-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.poll-edit-row { display: flex; gap: 6px; align-items: center; }
.tool-btn .icon-svg { margin-right: 0; }
.tool-list { list-style: none; margin: 4px 0 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 4px; }
.tool-list li { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.tool-list li.closed { opacity: .6; }
.link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }
/* Tasks page */
.task-group h2 { font-size: 15px; margin: 16px 0 4px; }
.task-group.overdue h2 { color: #b91c1c; }
.task-row input[type=checkbox] { width: 18px; height: 18px; flex: none; }
.task-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.task-title { color: var(--ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.task-title:hover { text-decoration: underline; }
.task-row.done .task-title { text-decoration: line-through; color: var(--muted); }

/* ---- Labels (022) ---- */
.label-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.label-chips.in-sidebar { margin: 2px 8px 8px; gap: 4px; }
.label-chip {
    display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
    border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 3px 10px;
}
.label-chips.in-sidebar .label-chip { font-size: 12px; padding: 2px 8px; }
.label-chip.on { border-color: var(--accent); background: var(--open-bg); color: var(--accent); font-weight: 600; }
.label-unread { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.label-tag {
    display: inline-block; margin-left: 6px; font-size: 11px; color: var(--muted);
    border: 1px solid var(--line); border-radius: 999px; padding: 0 7px;
}
.pick-chip.label { padding-left: 10px; }
.pick-chip.label.new { color: var(--muted); border-style: dashed; }
.label-new { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.label-new input { font: inherit; font-size: 13px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; }
.labels-panel { margin: -4px 0 10px; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 8px; }
.labels-block h4 { font-size: 13px; margin: 8px 0 2px; }
.labels-block h4 .muted { font-weight: 400; margin-left: 4px; }
.labels-block + .labels-block { border-top: 1px solid var(--line); margin-top: 6px; }
.shared-label {
    display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
    border: 1px solid var(--accent); background: var(--open-bg); color: var(--accent); border-radius: 999px; padding: 2px 4px 2px 10px;
}
.shared-label.is-hidden { border-color: var(--line); background: #fff; color: var(--muted); font-weight: 500; text-decoration: line-through; }
.shared-label.is-hidden .chip-link, .shared-label.is-hidden .chip-x { text-decoration: none; }
.chip-link, .chip-x {
    font: inherit; font-size: 12px; font-weight: 500; background: none; border: 0; cursor: pointer;
    color: var(--muted); padding: 2px 4px; border-radius: 6px;
}
.chip-link:hover, .chip-x:hover { color: var(--ink); background: rgba(0, 0, 0, .05); }
/* "+ N more" labels: a short searchable list under the chips */
.label-chip.more { color: var(--muted); border-style: dashed; }
.label-more { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 6px; margin: -4px 0 10px; max-width: 360px; }
.label-more.in-sidebar { margin: -4px 8px 8px; }
.label-more input { font: inherit; font-size: 13px; width: 100%; box-sizing: border-box; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 4px; }
.label-more ul { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.label-more-item {
    display: flex; align-items: center; gap: 8px; width: 100%; font: inherit; font-size: 13px; text-align: left;
    background: none; border: 0; border-radius: 8px; padding: 6px 8px; cursor: pointer; color: var(--ink);
}
.label-more-item:hover { background: #f1f3f6; }
.label-more-item.on { background: var(--open-bg); color: var(--accent); font-weight: 600; }
.label-more-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-row { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 400; }
.update-banner {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 10px;
    padding: 8px 12px; border-radius: 12px; border: 1px solid #bfd3fb; background: var(--open-bg); font-size: 14px;
}
.update-banner span { flex: 1; min-width: 180px; }
.sidebar-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 8px 2px; border-top: 1px solid var(--line); font-size: 13px; }
.sidebar-foot a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.sidebar-foot .icon-svg { width: 14px; height: 14px; margin-right: 3px; }
.sidebar-foot a:hover { color: var(--ink); text-decoration: underline; }

/* ---- Search ---- */
.search-form { display: flex; gap: 8px; margin: 4px 0 8px; }
.search-form input {
    flex: 1; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
}
.search-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 12px; font-size: 14px; }
.search-filters select, .search-filters input {
    font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.type-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.filter-chip.small { font-size: 13px; padding: 4px 10px; }
.search-results { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.search-result {
    display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px;
    padding: 10px 12px; color: var(--ink); text-decoration: none;
}
.search-result:hover { border-color: #c7cdd6; }
.kind-badge {
    flex: none; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px; margin-top: 2px;
    background: var(--done-bg); color: var(--done-fg);
}
.kind-badge.decision { background: var(--open-bg); color: var(--accent); }
.kind-badge.photo, .kind-badge.file { background: var(--waiting-bg); color: var(--waiting-fg); }
.search-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.search-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-snippet { font-size: 14px; overflow-wrap: anywhere; }
.search-snippet mark { background: #fde68a; color: inherit; border-radius: 3px; padding: 0 1px; }
.search-meta { font-size: 12px; color: var(--muted); }
.confirm-row { background: #fff7ed; border-radius: 8px; padding: 6px 8px; flex-wrap: wrap; }

/* ---- Shelf ---- */
.date-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: 14px; }
.date-filter select, .date-filter input {
    font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.shelf-month h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 16px 0 8px; }
.shelf-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.shelf-photo { margin: 0; }
.shelf-photo img, .shelf-photo .photo-tile {
    width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block;
}
.shelf-photo figcaption { font-size: 12px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-photo figcaption a, .shelf-meta { color: var(--muted); text-decoration: none; }
.shelf-photo figcaption a:hover, .shelf-meta:hover { text-decoration: underline; }
.shelf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.shelf-row { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.shelf-row.replaced { opacity: 0.55; }
.shelf-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; flex: 1; }
.shelf-action { flex: none; align-self: center; white-space: nowrap; }
/* Shelf pins (026) */
.pin-toggle {
    flex: none; align-self: center; background: none; border: 1px solid transparent; border-radius: 8px;
    padding: 4px 6px; cursor: pointer; color: var(--muted); line-height: 0;
}
.pin-toggle .icon-svg { margin-right: 0; }
.pin-toggle:hover { border-color: var(--line); color: var(--ink); }
.pin-toggle.on { color: var(--accent); }
.pin-toggle.on .icon-svg { fill: var(--open-bg); }
.shelf-pinned { background: #f7faff; border: 1px solid #bfd3fb; border-radius: 14px; padding: 6px 12px 10px; }
.shelf-pinned h2 .icon-svg { color: var(--accent); }
.shelf-photo figcaption { display: flex; align-items: center; gap: 4px; }
.shelf-photo figcaption > a { flex: 1; min-width: 0; }
.btn.disabled { opacity: .6; pointer-events: none; }
.shelf-title { font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.shelf-title:hover { text-decoration: underline; }
.shelf-sub, .shelf-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-decision-tag { flex: none; margin-top: 2px; }
.hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.attach-btn { font-size: 20px; line-height: 1; padding: 8px 12px; align-self: flex-end; }
.pending-files { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 2px; }
.pending-chip {
    display: inline-flex; align-items: center; gap: 6px; font-size: 13px; border: 1px solid var(--line);
    border-radius: 999px; padding: 3px 4px 3px 10px; max-width: 100%;
}
.pending-chip.failed { border-color: var(--danger); }
.chip-x { border: 0; background: none; font-size: 16px; line-height: 1; cursor: pointer; color: var(--muted); padding: 0 6px; }
.photo-tile.has-img { padding: 0; display: block; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 10px; }
a.file-name { color: var(--ink); text-decoration: none; }
a.file-name:hover { text-decoration: underline; }
.file-new-version { margin-left: auto; flex: none; font-size: 12px; padding: 4px 8px; }
.mention { font-weight: 600; color: var(--accent); }
.msg.mine .mention { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.mention.me { background: #fef3c7; color: #92400e; border-radius: 4px; padding: 0 2px; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 8px 4px; }
.reaction {
    font: inherit; font-size: 13px; border: 1px solid var(--line); background: #fff; border-radius: 999px;
    padding: 1px 8px; cursor: pointer; line-height: 1.5;
}
.reaction span { font-size: 12px; color: var(--muted); margin-left: 2px; }
.reaction.mine { border-color: #93b4f5; background: var(--open-bg); }
.react-bar { display: inline-flex; gap: 2px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 4px; }
.reaction-pick { border: 0; background: none; font-size: 17px; cursor: pointer; padding: 2px 3px; border-radius: 6px; }
.reaction-pick:hover, .reaction-pick:focus-visible { background: #eef0f3; }
.edit-form textarea {
    flex: 1 1 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; resize: vertical;
}
.mention-suggest {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0 2px;
}
.mention-option {
    display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; cursor: pointer;
    border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px 3px 4px;
}
.mention-option:hover, .mention-option:focus-visible { border-color: #93b4f5; background: var(--open-bg); }
.forked-to { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: var(--muted); margin: 0 10px 6px; }
.forked-to a { color: var(--accent); font-weight: 600; text-decoration: none; }
.forked-from {
    display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink);
    border-left: 3px solid var(--accent); background: #f6f8fc; border-radius: 8px; padding: 6px 10px; margin-bottom: 8px;
}
.forked-label { font-size: 12px; font-weight: 700; color: var(--accent); }
.forked-quote { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soft-prompt, .settings-section {
    border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 8px 0 12px;
}
.soft-prompt { border-color: #bfd3fb; background: var(--open-bg); }
.settings-section h2 { font-size: 16px; margin: 0 0 8px; }
.push-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0; }
.ios-steps ol { margin: 6px 0; padding-left: 20px; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.quiet-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.quiet-row input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.avatar.small { flex: 0 0 28px; width: 28px; height: 28px; font-size: 11px; }
.live-dot { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.live-dot::before {
    content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    background: #9ca3af; margin-right: 5px; vertical-align: 1px;
}
.live-dot.live::before { background: #16a34a; }
.live-dot.connecting::before { background: #f59e0b; }
@keyframes flash { from { box-shadow: 0 0 0 3px #93b4f5; } to { box-shadow: 0 0 0 3px transparent; } }
.flash .bubble { animation: flash 1.6s ease-out; }
