:root {
    color-scheme: light;
    --ink: #1f2a24; --muted: #6b766f; --faint: #98a29b; --line: #e6e8e1; --paper: #ffffff; --card: #fff;
    --side: #f6f7f4; --tint: #e4eee6; --hover: #edf1eb;
    --green: #2f5d4a; --green-dark: #234838; --mint: #e7f0e8; --amber: #b9852f; --red: #9a4a3d;
    --sans: Inter, "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    --radius: 12px; --sidebar: 276px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid #d2aa5d; outline-offset: 2px; }

/* Shell */
.app-body { overflow: hidden; }
.app-shell { display: flex; height: 100vh; height: 100dvh; }
.sidebar { display: flex; flex: 0 0 var(--sidebar); flex-direction: column; width: var(--sidebar); padding: 20px 14px 14px; background: var(--side); border-right: 1px solid var(--line); overflow: hidden; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 18px; font-weight: 800; font-size: 19px; letter-spacing: -.5px; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; background: var(--green); border-radius: 12px 12px 12px 4px; font: 600 23px Georgia, serif; }
.brand small { display: block; margin-top: 1px; color: #7d8a82; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; }
.new-chat { width: 100%; margin-bottom: 14px; }
.main-nav { display: grid; gap: 3px; }
.nav-link { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 11px; border-radius: 9px; color: #55625a; font-weight: 600; font-size: 14px; transition: background .15s; }
.nav-link:hover { background: var(--hover); }
.nav-link.active { color: var(--green-dark); background: var(--tint); }
.nav-icon { width: 18px; text-align: center; color: #78877e; }
.nav-count { margin-left: auto; min-width: 22px; padding: 0 6px; text-align: center; color: #5e6c63; background: #e2e5dc; border-radius: 7px; font-size: 12px; }
.sidebar-label { margin: 22px 11px 8px; color: #94a098; font-size: 11px; font-weight: 700; letter-spacing: 1.4px; }
.convo-list { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 2px; padding-bottom: 8px; }
.convo-link { display: block; padding: 8px 11px; overflow: hidden; color: #4d5a52; border-radius: 8px; font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.convo-link:hover { background: var(--hover); }
.convo-link.active { color: var(--green-dark); background: var(--tint); font-weight: 600; }
.convo-empty { margin: 4px 11px; color: var(--faint); font-size: 13px; }
.sidebar-bottom { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid #e1e3da; }
.sidebar-bottom .nav-link { min-height: 36px; }
.status-row { display: flex; align-items: center; gap: 8px; margin: 0 4px 10px; color: var(--muted); font-size: 12.5px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #d8ad63; }
.status-dot.is-ready { background: #5f9a6e; }
.user-row { display: flex; align-items: center; gap: 9px; padding: 0 4px; }
.user-row form { margin: 0 0 0 auto; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; color: #fff; background: #6f8f78; border-radius: 50%; font-size: 13px; font-weight: 700; }
.user-name { overflow: hidden; font-size: 13.5px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.main-content { display: flex; flex: 1; flex-direction: column; min-width: 0; height: 100%; overflow-y: auto; }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 12px; flex: 0 0 auto; min-height: 58px; padding: 0 28px; background: color-mix(in srgb, var(--paper) 94%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.page-title { flex: 1; min-width: 0; margin: 0; overflow: hidden; font-size: 17px; font-weight: 700; letter-spacing: -.2px; text-overflow: ellipsis; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-actions form { margin: 0; }
.menu-button { display: none; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; font-size: 18px; }
.scrim { position: fixed; inset: 0; z-index: 9; background: rgba(20,30,25,.4); }
.page-wrap { width: 100%; max-width: 900px; margin: 0 auto; padding: 26px 28px 60px; }
.flash-stack { display: grid; gap: 8px; width: 100%; max-width: 900px; margin: 14px auto 0; padding: 0 28px; }
.flash { padding: 11px 14px; border-radius: 9px; font-size: 14px; }
.flash-success { color: #2f5b3d; border: 1px solid #d5e7d6; background: #edf6ec; }
.flash-error { color: #86493d; border: 1px solid #efd7d1; background: #fcf0ed; }
.flash-warning { color: #735a2c; border: 1px solid #efe3c6; background: #fbf5e8; }
.flash-info { color: #48627a; border: 1px solid #dae6ef; background: #f0f6fa; }

/* Buttons & controls */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 14px; font-weight: 650; transition: background .15s, transform .15s; }
.button-small { min-height: 32px; padding: 0 12px; font-size: 13px; }
.button-primary { color: #fff; background: var(--green); }
.button-primary:hover { background: var(--green-dark); }
.button-outline { color: #44594d; border-color: #d8dfd5; background: #fff; }
.button-outline:hover { background: #eef2ea; }
.button-dark { color: #fff; background: #34473b; }
.button-danger { color: #86392d; border-color: #ebd2cd; background: #fff6f4; }
.button:disabled { cursor: not-allowed; opacity: .55; }
.text-button { padding: 0; color: var(--green); border: 0; background: none; cursor: pointer; font-size: 13px; font-weight: 650; }
.text-button.danger, .danger { color: var(--red); }
.text-link { color: var(--green); font-weight: 650; }
.button-spinner { display: none; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .button-spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.muted { color: var(--muted); }
textarea, input[type="text"], input[type="password"], input[type="email"], input[type="search"], input:not([type]) { width: 100%; padding: 11px 13px; color: var(--ink); border: 1px solid #dfe3dc; border-radius: 9px; outline: none; background: #fff; font-size: 15px; }
textarea { resize: vertical; }
textarea:focus, input:focus { border-color: #8fae96; box-shadow: 0 0 0 3px rgba(79,128,95,.13); }
label { display: block; margin-bottom: 7px; font-size: 13.5px; font-weight: 650; }

/* Chat */
.page-chat .main-content { overflow: hidden; }
.chat { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.chat-scroll { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.chat-thread, .chat-empty { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 24px; }
.chat-thread { display: flex; flex-direction: column; gap: 22px; padding-top: 26px; padding-bottom: 24px; }
.chat-empty { padding-top: 11vh; text-align: center; }
.empty-mark { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto 16px; color: #fff; background: var(--green); border-radius: 18px 18px 18px 6px; font: 600 34px Georgia, serif; }
.chat-empty h2 { margin-bottom: 6px; font-size: 26px; letter-spacing: -.5px; }
.chat-empty p { color: var(--muted); }
.suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 22px; }
.suggestion { padding: 9px 14px; color: #3f5646; border: 1px solid #dbe3d8; border-radius: 999px; background: #fff; cursor: pointer; font-size: 13.5px; }
.suggestion:hover { background: var(--mint); }
.msg { display: flex; gap: 12px; }
.msg-user { justify-content: flex-end; }
.bubble { max-width: 82%; padding: 11px 16px; color: #fff; background: var(--green); border-radius: 18px 18px 4px 18px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-mark { display: grid; flex: 0 0 32px; place-items: center; width: 32px; height: 32px; margin-top: 2px; color: var(--green); background: var(--mint); border-radius: 10px 10px 10px 3px; font: 600 19px Georgia, serif; }
.ai-body { flex: 1; min-width: 0; }
.ai-meta { margin-bottom: 5px; color: var(--faint); font-size: 12px; font-weight: 650; letter-spacing: .2px; }
.ai-actions { display: flex; gap: 14px; margin-top: 8px; }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; background: #8fae96; border-radius: 50%; animation: blink 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.error-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 10px 13px; color: #86493d; border: 1px solid #efd7d1; border-radius: 9px; background: #fcf0ed; font-size: 14px; }
.error-box.is-info { color: #48627a; border-color: #dae6ef; background: #f0f6fa; }
.sources { margin-top: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.sources summary { padding: 8px 12px; color: var(--muted); cursor: pointer; font-size: 13px; font-weight: 650; }
.source-list { display: grid; gap: 8px; margin: 0; padding: 0 12px 12px; list-style: none; }
.source-list li { padding: 9px 11px; border-radius: 8px; background: #f7f8f4; font-size: 13px; }
.source-list p { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.source-list small { margin-left: 6px; color: var(--faint); }
.cite { display: inline-grid; place-items: center; min-width: 17px; height: 17px; margin: 0 2px; padding: 0 4px; color: var(--green-dark); background: #dbe9dc; border-radius: 5px; font-size: 10.5px; font-weight: 700; vertical-align: baseline; position: relative; top: -2px; line-height: 1; }
.source-list .cite { top: 0; margin: 0 7px 0 0; }

.composer-wrap { flex: 0 0 auto; padding: 8px 24px 18px; background: linear-gradient(to top, var(--paper) 78%, transparent); }
.composer { width: 100%; max-width: 820px; margin: 0 auto; padding: 10px 12px 12px; border: 1px solid #dbe0d7; border-radius: 16px; background: #fff; box-shadow: 0 6px 24px rgba(40,64,50,.07); }
.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea { flex: 1; min-height: 44px; max-height: 200px; padding: 10px 6px; border: 0; box-shadow: none; resize: none; line-height: 1.5; }
.composer textarea:focus, .composer textarea:focus-visible { outline: none; box-shadow: none; }
.composer:focus-within { border-color: #8fae96; box-shadow: 0 6px 24px rgba(40,64,50,.1), 0 0 0 3px rgba(79,128,95,.13); }
.send-button { display: grid; flex: 0 0 40px; place-items: center; width: 40px; height: 40px; color: #fff; border: 0; border-radius: 12px; background: var(--green); cursor: pointer; font-size: 18px; font-weight: 700; }
.send-button:hover:not(:disabled) { background: var(--green-dark); }
.send-button:disabled { background: #c4cdc6; cursor: not-allowed; }
.stop-button { background: #8a4338; font-size: 13px; }
.composer-hint { min-height: 0; margin: 6px 4px 0; color: var(--red); font-size: 13px; }
.composer-hint:empty { display: none; }

/* Scope picker */
.scope { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 0 2px 8px; border-bottom: 1px solid #f0f1ec; margin-bottom: 4px; }
.scope-toggle { display: inline-flex; padding: 3px; border-radius: 10px; background: #eef0ea; }
.scope-option { padding: 5px 12px; color: #5b695f; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 13px; font-weight: 650; }
.scope-option[aria-checked="true"] { color: var(--green-dark); background: #fff; box-shadow: 0 1px 3px rgba(30,50,40,.14); }
.scope-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 4px; max-width: 220px; padding: 3px 4px 3px 10px; overflow: hidden; color: #35513f; background: var(--mint); border-radius: 999px; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.chip-remove { width: 20px; height: 20px; color: #5d7a66; border: 0; border-radius: 50%; background: transparent; cursor: pointer; font-size: 14px; line-height: 1; }
.chip-remove:hover { background: #cfe0d1; }
.scope-popover { position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 8; width: min(420px, calc(100vw - 40px)); padding: 12px; border: 1px solid #d9dfd5; border-radius: 13px; background: #fff; box-shadow: 0 14px 44px rgba(30,50,40,.2); }
.page-planning .scope-popover { bottom: auto; top: calc(100% + 6px); }
.scope-filter { padding: 8px 11px; font-size: 14px; }
.scope-actions { display: flex; gap: 14px; margin: 9px 2px 5px; }
.scope-list { max-height: 240px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.scope-list li { display: flex; align-items: flex-start; gap: 9px; padding: 7px 6px; border-radius: 8px; }
.scope-list li:hover { background: #f4f6f1; }
.scope-list input { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 3px; padding: 0; accent-color: var(--green); }
.scope-list label { margin: 0; flex: 1; min-width: 0; cursor: pointer; font-weight: 550; }
.scope-title { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scope-list small { color: var(--faint); font-size: 12px; font-weight: 400; }
.scope-none { display: block !important; color: var(--faint); font-size: 13px; }
.scope-foot { display: flex; justify-content: flex-end; margin-top: 8px; }

/* Markdown content */
.md { overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: .6em 0; }
.md h2, .md h3, .md h4, .md h5, .md h6 { margin: 1.15em 0 .4em; color: #26392e; line-height: 1.3; letter-spacing: -.2px; }
.md h2 { font-size: 1.3em; } .md h3 { font-size: 1.15em; } .md h4, .md h5, .md h6 { font-size: 1.02em; }
.md ul, .md ol { margin: .55em 0; padding-left: 1.6em; } .md li { margin: .22em 0; }
.md blockquote { margin: .8em 0; padding: .2em 1em; color: #5f6f65; border-left: 3px solid #9ab09b; background: #f3f6f0; border-radius: 0 6px 6px 0; }
.md code { padding: .12em .35em; border-radius: 5px; background: #eceee7; font: .9em ui-monospace, Menlo, monospace; }
.md pre { overflow: auto; padding: 12px 14px; border-radius: 9px; background: #eceee7; white-space: pre-wrap; } .md pre code { padding: 0; background: none; }
.md a { color: var(--green); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.md hr { margin: 1.2em 0; border: 0; border-top: 1px solid var(--line); }
.table-wrap { overflow-x: auto; margin: .8em 0; }
.md table { width: 100%; border-collapse: collapse; font-size: .95em; }
.md th, .md td { padding: 8px 10px; text-align: left; vertical-align: top; border: 1px solid #dde3dc; }
.md th { color: #35503f; background: #eef3eb; } .md tr:nth-child(even) td { background: #fafbf8; }

/* Library / planning / settings */
.section-title { margin: 34px 0 12px; font-size: 18px; }
.panel { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.panel h2 { margin-bottom: 4px; font-size: 19px; }
.plan-form { display: grid; gap: 12px; margin-top: 14px; }
.plan-form .scope { padding-left: 0; border-bottom: 0; }
.plan-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.plan-actions .composer-hint { flex: 1; margin: 0; }
.plan-output { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.brief-list { display: grid; gap: 10px; }
.brief-card { padding: 4px 16px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.brief-card summary { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-height: 44px; cursor: pointer; }
.brief-card summary strong { flex: 1; min-width: 160px; font-size: 14px; }
.brief-date { color: var(--faint); font-size: 12px; }
.upload-form { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border: 1px dashed #cfd8cb; border-radius: 11px; background: #fcfcf9; }
.upload-copy, .upload-actions { display: flex; align-items: center; gap: 12px; }
.upload-copy strong, .upload-copy small { display: block; } .upload-copy small { margin-top: 2px; color: var(--faint); font-size: 12.5px; }
.upload-icon { display: grid; place-items: center; width: 38px; height: 38px; color: #4e7a5c; background: var(--mint); border-radius: 10px; font-size: 20px; }
input[type="file"] { max-width: 240px; color: var(--muted); font-size: 13px; }
input[type="file"]::file-selector-button { margin-right: 8px; padding: 7px 10px; color: #4a6152; border: 1px solid #dbe2d8; border-radius: 6px; background: #fff; cursor: pointer; }
.upload-progress { display: grid; gap: 8px; margin-top: 10px; }
.upload-job { padding: 11px 14px; border: 1px solid #e0e5dd; border-radius: 9px; background: #fff; }
.upload-job-heading { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; } .upload-job-heading span { color: var(--faint); font-variant-numeric: tabular-nums; }
.upload-job small { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.progress-track { height: 6px; margin-top: 8px; overflow: hidden; border-radius: 10px; background: #e8ece6; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: #65836a; transition: width .35s ease; }
.upload-job.is-failed { border-color: #efd7d1; background: #fff8f6; } .upload-job.is-failed .progress-track i { background: #b46b5e; } .upload-job.is-completed .progress-track i { background: #4f8a60; }
.progress-refresh { justify-self: end; }
.retrieval-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; padding: 12px 15px; border: 1px solid #e0e7dd; border-radius: 10px; background: #f3f6f0; }
.retrieval-status strong, .retrieval-status small { display: block; } .retrieval-status small { color: var(--muted); font-size: 12.5px; }
.journal-search { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.journal-list { display: grid; gap: 9px; }
.journal-item { border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.journal-item summary { display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 10px 14px; cursor: pointer; list-style: none; }
.journal-item summary::-webkit-details-marker, .brief-card summary::-webkit-details-marker { display: none; }
.file-icon { display: grid; flex: 0 0 30px; place-items: center; width: 30px; height: 36px; color: #fff; background: #6f9378; border-radius: 5px; font-size: 12px; font-weight: 700; }
.journal-title { flex: 1; min-width: 0; overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.journal-title small { display: block; margin-top: 2px; color: var(--faint); font-size: 12px; font-weight: 400; }
.journal-body { padding: 0 18px 16px 56px; }
.journal-body pre { max-height: 340px; margin: 0 0 12px; overflow: auto; color: #55635a; font: 13px/1.65 var(--sans); white-space: pre-wrap; overflow-wrap: anywhere; }
.journal-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.journal-actions form { display: flex; align-items: center; gap: 6px; margin: 0; } .journal-actions input { width: min(280px, 50vw); padding: 7px 10px; font-size: 14px; }
.empty-state { padding: 38px 16px; text-align: center; border: 1px dashed #dce2d8; border-radius: 11px; background: #fcfcf9; }
.empty-illustration { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 12px; color: #5f8567; border-radius: 12px; background: var(--mint); font-size: 22px; }
.empty-state p { max-width: 380px; margin: 0 auto; color: var(--muted); }
.workspace-warning { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 18px; padding: 12px 14px; color: #6f5729; border: 1px solid #efe3c6; border-radius: 10px; background: #fbf5e8; font-size: 14px; }
.setup-guide { margin: 14px 0; padding: 18px 20px; border: 1px solid #dfe8dc; border-radius: 11px; background: #f1f5ee; }
.setup-guide-heading { display: flex; align-items: center; gap: 10px; } .setup-guide-heading strong, .setup-guide-heading small { display: block; } .setup-guide-heading small { color: var(--muted); font-size: 12.5px; }
.setup-step-icon { display: grid; place-items: center; width: 28px; height: 28px; color: #fff; border-radius: 8px; background: #6b8a6d; font-weight: 700; }
.setup-guide ol { display: grid; gap: 8px; margin: 14px 0 0; padding-left: 20px; font-size: 14px; }
.setup-guide a { color: #3b704b; font-weight: 700; text-decoration: underline; }
.setup-guide code, .backend-note code { padding: 1px 5px; border-radius: 4px; background: #e5eadf; font-size: .92em; }
.setup-alternative { margin: 14px 0 0; padding-top: 12px; color: var(--muted); border-top: 1px solid #dfe8dc; font-size: 13px; }
.credential-status { display: grid; gap: 6px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.credential-status > div { display: flex; align-items: center; gap: 10px; min-height: 28px; font-size: 14px; } .credential-status strong { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 600; }
.backend-note { margin: 10px 2px; color: var(--muted); font-size: 13px; }
.settings-card { display: grid; gap: 14px; margin-top: 16px; padding: 20px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.settings-card form { display: grid; gap: 8px; }

/* Auth */
.auth-page { min-height: 100vh; overflow: auto; background: radial-gradient(circle at 70% 15%, #e4eee2, transparent 36%), var(--paper); }
.auth-shell { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.auth-card { width: min(440px, 100%); padding: 36px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.95); box-shadow: 0 22px 70px rgba(41,65,50,.12); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 30px; font-size: 19px; font-weight: 800; } .auth-brand small { display: block; color: #7d8a82; font-size: 9px; letter-spacing: 1.5px; }
.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: #829088; font-size: 11px; font-weight: 700; letter-spacing: 1.6px; }
.auth-card h1 { margin-bottom: 8px; font-size: 28px; letter-spacing: -.8px; } .auth-card > p { color: var(--muted); }
.auth-form { display: grid; gap: 10px; margin-top: 22px; } .auth-form label { margin: 6px 0 -2px; } .auth-form small { color: var(--muted); font-size: 12.5px; } .auth-form .button { margin-top: 10px; }
.auth-switch { margin: 20px 0 0; text-align: center; font-size: 14px; } .auth-switch a { color: var(--green); font-weight: 700; }

/* Responsive */
@media (max-width: 860px) {
    .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 10; transform: translateX(-102%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.18); }
    .sidebar.is-open { transform: none; }
    .menu-button { display: grid; place-items: center; }
    .topbar { padding: 0 14px; }
    .page-wrap { padding: 18px 14px 50px; } .flash-stack { padding: 0 14px; }
    .chat-thread, .chat-empty { padding-left: 14px; padding-right: 14px; } .composer-wrap { padding: 6px 10px 12px; }
    .bubble { max-width: 92%; } .upload-form, .upload-actions { align-items: stretch; flex-direction: column; } input[type="file"] { max-width: 100%; }
    .journal-body { padding-left: 16px; } .journal-item summary { flex-wrap: wrap; } .ask-journal { margin-left: 42px; }
    .journal-actions { align-items: stretch; flex-direction: column; } .journal-actions form { width: 100%; } .journal-actions input { flex: 1; width: auto; }
    .scope-popover { position: fixed; bottom: 80px; left: 12px; right: 12px; width: auto; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.delete-journal { margin: 0; }
@media (max-width: 860px) { .delete-journal { margin-left: 8px; } }

/* ---------- Planner ---------- */
.planner-wrap { max-width: 1120px; }
.planner-tabs { display: flex; align-items: center; gap: 4px; margin: 0 0 20px; padding-bottom: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.planner-tabs::-webkit-scrollbar { display: none; }
.p-tab { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; padding: 9px 13px; color: #55625a; border-bottom: 2px solid transparent; font-size: 14px; font-weight: 650; white-space: nowrap; }
.p-tab:hover { color: var(--green-dark); }
.p-tab.active { color: var(--green-dark); border-bottom-color: var(--green); }
.p-search-row { margin: -6px 0 16px; }
.p-search { max-width: 320px; padding: 8px 12px; font-size: 14px; }
.p-gap { gap: 12px; }
.p-stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.p-task, .p-task-body, .p-task-line, .p-task-meta { min-width: 0; }
.p-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.p-head h2 { margin: 0 0 2px; font-size: 21px; letter-spacing: -.3px; }
.p-head p { margin: 0; }
.p-head-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.p-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.p-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.p-span { grid-column: span 2; }
.p-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.p-panel-head h3, .p-card h3, .p-proposal h3 { margin: 0; font-size: 15.5px; }
.p-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.p-stat { display: grid; gap: 1px; padding: 16px 18px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; }
.p-stat:hover { border-color: #c9d6c9; }
.p-stat-value { font-size: 30px; font-weight: 750; letter-spacing: -1px; line-height: 1.1; }
.p-stat-label { font-weight: 650; font-size: 14px; }
.p-stat-note { color: var(--muted); font-size: 12.5px; }
.p-stat.tone-green .p-stat-value { color: var(--green); } .p-stat.tone-red .p-stat-value { color: var(--red); }
.p-stat.tone-blue .p-stat-value { color: #3f6a8c; } .p-stat.tone-amber .p-stat-value { color: var(--amber); }
.p-list { display: grid; gap: 0; }
.panel.p-list { padding: 6px 18px; }
.p-task { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid #eff1ea; }
.p-list > .p-task:last-child, .p-list > :last-child { border-bottom: 0; }
.p-check { flex: 0 0 22px; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; padding: 0; color: #fff; border: 2px solid #b9c5bb; border-radius: 50%; background: #fff; cursor: pointer; font-size: 12px; font-weight: 800; }
.p-check:hover { border-color: var(--green); }
.is-done > .p-check, .is-done .p-check { background: var(--green); border-color: var(--green); }
.p-task-body { flex: 1; min-width: 0; }
.p-task-title { display: block; max-width: 100%; padding: 0; color: var(--ink); border: 0; background: none; cursor: pointer; font-size: 15px; font-weight: 650; text-align: left; overflow-wrap: anywhere; }
.p-task-title:hover { color: var(--green); }
.is-done .p-task-title { color: var(--faint); text-decoration: line-through; }
.p-task-desc { margin: 2px 0 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-task-meta, .p-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 12.5px; }
.p-meta-row { margin-top: 0; }
.p-task-actions { display: flex; gap: 14px; flex: 0 0 auto; padding-top: 2px; }
.p-due.overdue { color: var(--red); font-weight: 700; }
.p-link { color: var(--green); font-weight: 600; }
.p-source { padding: 1px 8px; color: #4d6256; border-radius: 999px; background: #eef2ea; font-size: 12px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-source:hover { background: var(--mint); }
.p-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #eceee7; color: #55625a; font-size: 11.5px; font-weight: 700; }
.tone-high, .tone-overdue, .tone-very-important { color: #8f3f33; background: #f7e3de; }
.tone-medium, .tone-moderate, .tone-in-progress, .tone-exploring, .tone-new-task { color: #7a5a1e; background: #f6ecd2; }
.tone-low, .tone-less-important, .tone-unexplored, .tone-upcoming { color: #4d6256; background: #e6eee6; }
.tone-completed, .tone-converted { color: #2f5b3d; background: #dcecde; }
.tone-postponed, .tone-on-hold { color: #48627a; background: #e1ecf5; }
.p-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.p-chip { padding: 6px 12px; color: #4a5d51; border: 1px solid #dbe3d8; border-radius: 999px; background: #fff; cursor: pointer; font-size: 13px; font-weight: 600; }
.p-chip:hover { background: var(--mint); }
.p-chip.active { color: #fff; border-color: var(--green); background: var(--green); }
.p-chip.habit-missed.active { background: var(--red); border-color: var(--red); } .p-chip.habit-partial.active { background: var(--amber); border-color: var(--amber); }
.p-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.p-selects { display: flex; flex-wrap: wrap; gap: 8px 12px; max-width: 100%; }
.p-select select { max-width: 170px; }
.p-select { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.p-select select, .p-field select { padding: 7px 10px; color: var(--ink); border: 1px solid #dfe3dc; border-radius: 9px; background: #fff; font-size: 14px; }
.p-quick { display: flex; gap: 8px; }
.p-quick input { flex: 1; }
.p-foot { margin: 0; font-size: 13px; }
.p-empty { padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed #d6dcd2; border-radius: var(--radius); }
.p-empty strong { color: var(--ink); } .p-empty p { margin: 4px 0 12px; }
.p-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.p-card { display: grid; gap: 8px; align-content: start; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.p-card.static { cursor: default; }
button.p-card:hover { border-color: #c4d3c5; }
.p-card p { margin: 0; font-size: 13.5px; }
.p-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 4px; }
.p-progress { position: relative; display: flex; align-items: center; height: 8px; margin: 4px 0; border-radius: 999px; background: #e8ebe3; }
.p-progress span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.p-progress em { position: absolute; right: 0; top: 10px; color: var(--muted); font-size: 11.5px; font-style: normal; }
.p-progress { margin-bottom: 20px; }
.p-mini { display: grid; gap: 4px; width: 100%; padding: 10px 0; text-align: left; border: 0; border-bottom: 1px solid #eff1ea; background: none; font: inherit; cursor: pointer; }
.p-mini.static { cursor: default; } .p-mini:last-child { border-bottom: 0; }
.p-mini strong { font-size: 14px; }
.p-upcoming { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14px; }
.p-date-chip { flex: 0 0 auto; min-width: 54px; padding: 2px 8px; text-align: center; color: var(--green-dark); border-radius: 7px; background: var(--mint); font-size: 12px; font-weight: 700; }
.p-big { margin: 0 0 8px; font-size: 28px; font-weight: 750; letter-spacing: -.8px; } .p-big small { color: var(--muted); font-size: 14px; font-weight: 500; letter-spacing: 0; }
.p-habit-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 14px; }
.p-habit-line .p-chip { padding: 3px 8px; font-size: 12px; }
.p-habit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid #eff1ea; }
.p-habit.inactive { opacity: .6; }
.p-habit-main { display: grid; gap: 4px; min-width: 200px; }
.p-habit-buttons { display: flex; gap: 6px; }
.p-dots { display: flex; align-items: center; gap: 5px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: #e3e7de; }
.dot.done { background: var(--green); } .dot.partial { background: #d8ad63; } .dot.missed { background: #d99a8f; }
.p-streak { margin-left: 8px; color: var(--muted); font-size: 12.5px; }
.p-timeline { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.p-milestone { display: flex; gap: 12px; }
.p-proposal { display: grid; gap: 8px; }
.p-action { margin: 0; padding: 8px 11px; color: #3f5646; border-radius: 8px; background: #f2f6ef; font-size: 13.5px; }
.p-conf { color: var(--muted); font-size: 12.5px; }
.p-activity { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.p-activity li { display: flex; gap: 11px; } .p-activity p { margin: 0; font-size: 13px; }
.p-act-icon { flex: 0 0 26px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #e8ece4; color: #55625a; font-size: 13px; font-weight: 800; }
.p-act-icon.completed { background: #dcecde; color: #2f5b3d; } .p-act-icon.rescheduled { background: #e1ecf5; color: #48627a; } .p-act-icon.dismissed { background: #f7e3de; color: #8f3f33; }
.p-toast { position: fixed; right: 22px; bottom: 22px; z-index: 30; max-width: min(420px, calc(100vw - 44px)); padding: 11px 16px; color: #fff; border-radius: 10px; background: #2c3d33; box-shadow: 0 8px 26px rgba(20,30,25,.25); font-size: 14px; }
.p-toast.is-error { background: #8a3b2e; }
.p-modal { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; color: var(--ink); border: 0; border-radius: 16px; background: #fff; box-shadow: 0 24px 70px rgba(20,30,25,.3); }
.p-modal::backdrop { background: rgba(20,30,25,.42); }
.p-form { display: grid; gap: 14px; padding: 20px 22px 18px; }
.p-modal-head { display: flex; align-items: center; justify-content: space-between; }
.p-modal-head h3 { margin: 0; font-size: 18px; }
.p-icon { width: 32px; height: 32px; border: 0; border-radius: 8px; background: #f1f3ee; cursor: pointer; }
.p-form-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.p-field { flex: 1 1 100%; margin: 0; }
.p-field.half { flex: 1 1 calc(50% - 6px); min-width: 150px; }
.p-field.check { display: flex; align-items: center; gap: 8px; }
.p-label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 650; }
.p-field select, .p-field input[type="date"], .p-field input[type="number"] { width: 100%; }
.p-field input[type="date"], .p-field input[type="number"] { padding: 9px 11px; border: 1px solid #dfe3dc; border-radius: 9px; font-size: 14.5px; }
.p-form-error { margin: 0; padding: 9px 12px; color: #86493d; border-radius: 8px; background: #fcf0ed; font-size: 13.5px; }
.p-modal-foot { display: flex; align-items: center; gap: 8px; }
.p-modal-foot .spacer { flex: 1; }
@media (max-width: 860px) {
    .p-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .p-grid, .p-grid.two { grid-template-columns: minmax(0, 1fr); }
    .p-span { grid-column: auto; }
    .p-task { flex-wrap: wrap; } .p-task-actions { flex-basis: 100%; padding-left: 34px; }
    .p-search { max-width: none; }
    .planner-wrap { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Planner: inline editing, habit grid, inbox ---------- */
.p-task-body { min-width: 0; }
.p-task-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.p-title-input { flex: 1 1 220px; min-width: 0; width: auto; padding: 5px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; font-size: 15px; font-weight: 650; }
.p-title-input:hover { border-color: #e3e7de; background: #fff; }
.p-title-input:focus { border-color: #8fae96; background: #fff; }
.is-done .p-title-input { color: var(--faint); text-decoration: line-through; }
.p-inline { width: auto; padding: 5px 8px; color: var(--ink); border: 1px solid #e3e7de; border-radius: 8px; background: #fff; font-size: 13px; }
.p-date { min-width: 128px; }
.p-date.overdue { color: var(--red); border-color: #e7c5bd; }
.p-est { width: 64px; }
.p-est-label { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.p-proj { max-width: 220px; }
.p-inline.prio-high { color: #8f3f33; background: #f7e3de; border-color: #efcfc8; }
.p-inline.prio-medium { color: #7a5a1e; background: #f6ecd2; border-color: #ebdcb4; }
.p-inline.prio-low { color: #4d6256; background: #e6eee6; border-color: #d3e0d3; }
.p-inline.stat-completed { color: #2f5b3d; background: #dcecde; }
.p-inline.stat-postponed { color: #48627a; background: #e1ecf5; }
.p-desc { display: block; width: 100%; min-height: 32px; margin-top: 4px; padding: 6px 8px; color: var(--muted); border: 1px solid transparent; border-radius: 8px; background: transparent; font-size: 13.5px; line-height: 1.45; resize: none; overflow: hidden; }
.p-desc:hover { border-color: #e3e7de; background: #fff; }
.p-desc:focus { color: var(--ink); border-color: #8fae96; background: #fff; }
.text-button.danger { color: var(--red); }
.p-lastscan { margin: -6px 0 0; font-size: 13px; }
.p-addto { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 4px; }
.p-addto .p-label { margin: 0; color: var(--muted); }
.p-addto .spacer { flex: 1; }
.p-docs { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.p-docs li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 14px; padding: 9px 0; border-bottom: 1px solid #eff1ea; font-size: 14px; }
.p-docs li:last-child { border-bottom: 0; }
.p-doc-state { color: var(--muted); font-size: 13px; }
.p-doc-state.done { color: #2f5b3d; } .p-doc-state.new { color: var(--amber); } .p-doc-state.changed { color: #48627a; }
.p-habit-wrap { padding: 0; overflow-x: auto; }
.p-habit-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.p-habit-table th, .p-habit-table td { padding: 6px 3px; text-align: center; border-bottom: 1px solid #eff1ea; }
.p-habit-table tr:last-child td { border-bottom: 0; }
.p-habit-table .p-habit-name { position: sticky; left: 0; z-index: 1; min-width: 210px; padding: 6px 10px; text-align: left; background: #fff; }
.p-habit-name { display: flex; align-items: center; gap: 4px; }
th.p-habit-name { display: table-cell; }
.p-habit-table td.p-habit-name { display: table-cell; }
.p-habit-namebox { display: flex; align-items: center; gap: 4px; }
.p-habit-namebox .p-title-input { flex: 1; }
.p-day { min-width: 40px; color: var(--muted); font-weight: 600; line-height: 1.2; }
.p-day span, .p-day small { display: block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; }
.p-day b { display: block; color: var(--ink); font-size: 14px; }
.p-day.today b { color: #fff; width: 24px; margin: 1px auto; border-radius: 50%; background: var(--green); line-height: 24px; }
.p-cell { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; color: #fff; border: 2px solid #e1e6dc; border-radius: 9px; background: #fff; cursor: pointer; font-size: 14px; font-weight: 800; }
.p-cell:hover:not(:disabled) { border-color: var(--green); }
.p-cell.today { border-color: #b9c5bb; }
.p-cell.done { background: var(--green); border-color: var(--green); }
.p-cell.partial { background: #d8ad63; border-color: #d8ad63; }
.p-cell.missed { background: #d99a8f; border-color: #d99a8f; }
.p-cell:disabled { cursor: default; opacity: .35; }
.p-streak-cell { min-width: 62px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.inactive .p-title-input { opacity: .55; }
@media (max-width: 860px) {
    .p-habit-table .p-habit-name { min-width: 150px; }
    .p-task-line .p-title-input { flex-basis: 100%; }
}

.p-journal-actions { display: inline-flex; gap: 12px; }
.p-journal-modal { width: min(720px, calc(100vw - 24px)); padding: 18px; }
.p-journal-tabs { margin: 10px 0; }
.p-journal-tabs .p-chip.active { background: var(--green, #2f5b3d); color: #fff; }
.p-journal-body { max-height: 60dvh; overflow: auto; display: grid; gap: 10px; }
.p-para { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; }
.p-para p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.p-para-n { color: var(--muted); font-size: 12px; padding-top: 3px; }
.p-explain p { margin: 0 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; }


/* ---------- Colour themes (light, low-saturation) and text size ---------- */
html[data-theme="sage"] { --paper: #f8fbf8; --side: #eef4ee; --tint: #dcebdf; --hover: #e5efe6; --green: #4f7a62; --green-dark: #3b5f4b; --line: #e0e8e0; }
html[data-theme="sky"] { --paper: #f7fafc; --side: #edf3f8; --tint: #dae7f1; --hover: #e3edf5; --green: #4f7595; --green-dark: #3a5a76; --line: #dfe7ee; }
html[data-theme="blush"] { --paper: #fcf8f8; --side: #f8eeee; --tint: #f1dddb; --hover: #f5e5e4; --green: #a1625f; --green-dark: #7f4a47; --line: #eddfde; }
html[data-theme="lavender"] { --paper: #faf9fd; --side: #f1eff8; --tint: #e2deef; --hover: #eae7f3; --green: #6d5f9a; --green-dark: #544880; --line: #e4e1ee; }
html[data-theme="sand"] { --paper: #fcfaf5; --side: #f7f2e8; --tint: #ece1c9; --hover: #f1e9d6; --green: #9a7a3f; --green-dark: #775c2d; --line: #ebe4d3; }
html[data-size="compact"] body { font-size: 14px; }
html[data-size="large"] body { font-size: 16.5px; }
.theme-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch, .chip-choice { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font-size: 13.5px; }
.swatch span { width: 18px; height: 18px; border: 2px solid var(--sw2); border-radius: 50%; background: var(--sw); }
.swatch[aria-pressed="true"], .chip-choice[aria-pressed="true"] { border-color: var(--green); background: var(--tint); font-weight: 650; }
.theme-card, .settings-card { flex-wrap: wrap; }

/* ---------- Journal library: compact tiles ---------- */
.journal-list { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); align-items: start; gap: 10px; }
.journal-item[open] { grid-column: 1 / -1; }
.journal-item summary { flex-wrap: wrap; align-content: flex-start; gap: 8px; min-height: 0; padding: 12px; }
.journal-item .file-icon { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; }
.journal-item .journal-title { flex: 1 1 calc(100% - 44px); min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.journal-item .journal-title small { display: block; font-size: 11.5px; }
.journal-item .ask-journal { margin-left: 0; }

/* ---------- Planner: quick wins, activity items, progress log ---------- */
.p-serial { flex: 0 0 26px; display: grid; place-items: center; width: 26px; height: 26px; margin-top: 4px; color: #7a5a1e; border-radius: 50%; background: #fbf1c7; font-size: 12.5px; font-weight: 750; }
.is-done > .p-serial { color: #fff; background: var(--green); }
.p-task.is-pending { background: linear-gradient(90deg, #fffbe9, transparent 55%); }
.p-task.is-overdue .p-serial { color: #8f3f33; background: #f7e3de; }
.p-warn { color: #c0392b; font-size: 17px; line-height: 1; cursor: help; }
.p-complete { white-space: nowrap; }
.p-resched { color: #7a5a1e; font-size: 12.5px; }
.tone-pending { color: #7a5a1e; background: #fbf1c7; }
.p-owner-label { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--muted); }
.p-owner-label .p-owner, input.p-owner[type="text"] { width: 130px; padding: 5px 8px; font-size: 13px; }
.p-activity small { display: block; }
.p-prop-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; margin: -2px -4px 2px; padding: 7px 10px; border-left: 4px solid var(--bar, #c9d3c9); border-radius: 8px; background: color-mix(in srgb, var(--bar, #c9d3c9) 14%, #fff); }
.p-prop-left, .p-prop-right { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.p-prop-right { margin-left: auto; justify-content: flex-end; }
.tone-bar-win { --bar: #d8ad63; } .tone-bar-goal { --bar: #6f95b8; } .tone-bar-idea { --bar: #8a9a74; } .tone-bar-habit { --bar: #b58ab0; }
.p-head { align-items: baseline; }
.p-head .p-lastscan { margin: 0 0 0 auto; text-align: right; font-size: 12.5px; }
.p-inbox-actions { margin-top: -4px; }
.p-done-group { margin-bottom: 12px; }
.p-done-group h4 { margin: 0 0 4px; color: var(--muted); font-size: 12px; letter-spacing: .6px; text-transform: uppercase; }
.p-done-list { display: grid; margin: 0; padding: 0; list-style: none; }
.p-done-line { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 13.5px; }
.p-done-mark { flex: 0 0 18px; color: var(--green); font-weight: 800; }
.p-done-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) { .p-prop-right { margin-left: 0; } }

.p-owner-wrap { position: relative; display: inline-block; }
.p-owner-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 30; display: grid; min-width: 210px; max-height: 240px; padding: 4px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 8px 24px rgba(30,40,35,.14); }
.p-owner-opt { display: block; width: 100%; padding: 7px 10px; color: var(--ink); text-align: left; border: 0; border-radius: 7px; background: none; cursor: pointer; font-size: 13.5px; }
.p-owner-opt:hover, .p-owner-opt:focus-visible { background: var(--hover); }
.p-owner-opt.create { color: var(--green-dark); font-weight: 650; }
.p-owner-opt.clear { color: var(--muted); }

/* ---- notifications bell, assignments, email settings ---- */
.bell-wrap { position: relative; }
.bell-button { position: relative; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: transparent; cursor: pointer; font-size: 17px; line-height: 1; }
.bell-button:hover, .bell-button:focus-visible { background: var(--hover); }
.bell-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; padding: 1px 5px; border-radius: 999px; background: #c0392b; color: #fff; font-size: 11px; font-weight: 700; line-height: 16px; text-align: center; }
.bell-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: min(360px, calc(100vw - 24px)); max-height: 70vh; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 12px 32px rgba(30,40,35,.18); }
.bell-panel[hidden] { display: none; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.bell-list { overflow-y: auto; }
.bell-item { display: grid; gap: 2px; padding: 10px 14px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.bell-item:hover, .bell-item:focus-visible { background: var(--hover); }
.bell-item.unread { background: color-mix(in srgb, var(--green-dark) 7%, #fff); font-weight: 600; }
.bell-empty { padding: 18px 14px; margin: 0; font-size: 13px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.inline-form input[type="email"] { flex: 1 1 220px; min-width: 0; }
.check-line { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; }
.p-ok { color: var(--green-dark); font-weight: 650; }
.p-warn-text { color: #a0561a; font-weight: 650; }
.p-assign-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--hover); color: var(--muted); }
.p-assign-chip.pending, .p-assign-chip.invited { background: #fff4dc; color: #8a5a00; }
.p-assign-chip.accepted { background: #e3f1e8; color: var(--green-dark); }
.p-assign-chip.completed { background: #e3f1e8; color: var(--green-dark); }
.p-assign-chip.declined { background: #fbe7e4; color: #a33a2d; }
.p-assign-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.p-owner-section { padding: 6px 10px 2px; color: var(--faint); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.p-owner-opt small { margin-left: 6px; color: var(--faint); }
.p-owner-opt.invite { color: var(--green-dark); font-weight: 650; }
.p-owner-hint { padding: 8px 10px; color: var(--muted); font-size: 12.5px; }
.p-assign-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.p-assign-row:last-child { border-bottom: 0; }
.button-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; }
.button-google:hover:not(:disabled), .button-google:focus-visible { background: var(--hover); }
.button-google:disabled { opacity: .6; cursor: progress; }
.auth-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; color: var(--faint); font-size: 12px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
