:root {
    --canvas:#f5f7fa; --panel:#fff; --line:#dde3eb; --ink:#202938;
    --muted:#526176; --accent:#087554; --soft:#e8eef5; --danger:#b2273b;
}
[data-bs-theme=dark] { --canvas:#171f2c }
[data-bs-theme=dark], [data-theme=basic] :is(.topbar, #sidebar) {
    --panel:#202938; --line:#394659; --ink:#edf2f8;
    --muted:#a8b6c8; --accent:#77e0b3; --soft:#34445a; --danger:#ffa0a9;
    color:var(--ink);
}
* { box-sizing:border-box }
body { margin:0; background:var(--canvas); color:var(--ink); font: 15px/1.55 system-ui,sans-serif }
a { color:var(--accent); text-decoration:none }
a:hover { text-decoration:underline }
button { cursor:pointer }
button:disabled { opacity:.65; cursor:wait }
[hidden] { display:none!important }
.topbar { height:66px; display:flex; align-items:center; gap:12px; padding:0 26px; background:var(--panel); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:3 }
.brand { display:flex; align-items:center }
.brand svg { display:block; width:184px; max-width:45vw; height:auto }
#top-actions { margin-left:auto; display:flex; align-items:center; gap:14px }
.layout { display:flex; min-height:calc(100dvh - 66px) }
#sidebar { width:224px; flex:none; background:var(--panel); border-right:1px solid var(--line); padding:22px 14px; overflow:auto; height:calc(100dvh - 66px); position:sticky; top:66px }
#sidebar nav { display:grid; gap:4px }
.nav-label { color:var(--muted); margin:20px 10px 6px; font-size:.77rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase }
.nav-item-link { display:flex; align-items:center; gap:10px; padding:8px 10px; color:var(--ink); border-radius:9px; overflow-wrap:anywhere }
.nav-item-link[aria-current=page], .nav-item-link:hover { background:var(--soft); color:var(--accent); text-decoration:none }
.project-status { background-color:var(--project-status-color); color:var(--project-status-ink, #111827) }
.project-status[data-status=ready] { --project-status-color:#facc15 }
.project-status[data-status=active] { --project-status-color:#14a679 }
.project-status[data-status=hold] { --project-status-color:#d1d5db }
.project-status[data-status=closed] { --project-status-color:#586474; --project-status-ink:#fff }
.project-dot { width:8px; height:8px; border-radius:50%; flex:none }
.main { min-width:0; flex:1; padding:34px clamp(18px,4vw,56px) }
.main:focus { outline:none }
h1 { font-size:clamp(1.8rem,4vw,2.55rem); font-weight:750; letter-spacing:-.05em; overflow-wrap:anywhere }
h2 { font-size:1.18rem; font-weight:700 }
.page-header { margin-bottom:24px; display:flex; gap:12px; align-items:center; justify-content:space-between; flex-wrap:wrap }
.page-header h1 { margin:0 }
.panel { background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:22px; min-width:0 }
.auth { max-width:430px; margin:6vh auto; padding:30px }
.muted, .loading { color:var(--muted) }
.loading { text-align:center; margin:10vh auto }
.cards { display:flex; flex-wrap:wrap; align-items:flex-start; gap:15px }
.project-card { flex:0 1 250px; max-width:250px; padding:16px }
.project-card h2 { overflow-wrap:anywhere; margin-bottom:12px }
.card-todo { display:flex; width:100%; text-align:left; gap:9px; border:0; border-top:1px solid var(--line); padding:8px 0; background:transparent; color:var(--ink); overflow-wrap:anywhere }
.card-todo > span { min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis }
.card-todo:hover { color:var(--accent) }
.card-todo::before { content:""; width:12px; height:12px; border:1px solid var(--muted); border-radius:50%; flex:none; margin-top:5px }
.actions { display:flex; flex-wrap:wrap; align-items:center; gap:9px }
.btn-app, .icon-button { border:1px solid var(--line); background:var(--panel); color:var(--ink); border-radius:8px; padding:7px 13px; white-space:nowrap; font-weight:600 }
.btn-app:hover, .icon-button:hover { background:var(--soft) }
.btn-primary-app { background:var(--accent); border-color:var(--accent); color:var(--panel) }
.btn-primary-app:hover { background:var(--accent); filter:brightness(1.12) }
.btn-danger-app { color:var(--danger) }
.tabs { display:flex; gap:6px; flex-wrap:wrap; border-bottom:1px solid var(--line); margin-bottom:20px }
.tabs a { padding:9px 12px; color:var(--muted); border-bottom:2px solid transparent }
.tabs a[aria-current=page] { border-color:var(--accent); color:var(--accent); font-weight:700 }
.form-fields { display:grid; gap:13px }
.form-fields label:not(.check-label) { display:grid; gap:5px; font-weight:600 }
input:not([type=checkbox]), select, textarea { width:100%; min-width:0; background:var(--panel); color:var(--ink); border:1px solid var(--line); border-radius:8px; padding:8px 10px; font:inherit }
input[type=checkbox] { accent-color:var(--accent) }
textarea { min-height:100px }
:focus-visible { outline:2px solid var(--accent); outline-offset:2px }
.todo-list { list-style:none; margin:0 0 14px; padding:0 }
.todo-row { display:flex; align-items:center; gap:8px; padding:7px 0; border-bottom:1px solid var(--line) }
.todo-title { text-align:left; background:none; border:0; color:var(--ink); flex:1; min-width:0; overflow-wrap:anywhere }
.todo-row.done .todo-title { color:var(--muted); opacity:.75 }
.drag { cursor:grab; color:var(--muted); padding:3px }
.todo-row.dragging { opacity:.55 }
.todo-create { display:flex; gap:8px }
.board { width:100%; border-collapse:collapse }
.board th, .board td { text-align:left; border-bottom:1px solid var(--line); padding:9px; overflow-wrap:anywhere }
.board-wrap { overflow-x:auto }
.link-button { color:var(--accent); background:none; border:0; padding:0; text-align:left; overflow-wrap:anywhere }
.link-button:hover { text-decoration:underline }
.wiki { display:grid; gap:14px }
.rich { overflow-wrap:anywhere; overflow-x:auto }
.comments { display:grid; gap:10px; margin:10px 0 }
.comment { border-left:2px solid var(--line); padding:6px 10px; overflow-wrap:anywhere }
.comment p { white-space:pre-wrap }
.replies { margin-left:20px }
dialog { width:min(640px,calc(100% - 24px)); max-height:calc(100dvh - 32px); color:var(--ink); background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:22px }
dialog::backdrop, .scrim { background:#11182775 }
.dialog-header { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:12px }
#notice { position:fixed; z-index:6; right:16px; bottom:16px; max-width:min(410px,calc(100vw - 32px)); background:var(--panel); border:1px solid var(--danger); color:var(--danger); padding:12px 16px; border-radius:8px }
dialog .form-error { margin:0 0 8px; color:var(--danger) }
.mobile-menu { display:none }
@media(max-width:700px) {
    .topbar { padding:0 12px; gap:6px }
    .mobile-menu { display:block }
    #sidebar { position:fixed; top:66px; bottom:0; left:0; width:min(300px,83vw); z-index:5; transform:translateX(-100%); visibility:hidden }
    .menu-open #sidebar { transform:none; visibility:visible }
    .scrim { position:fixed; inset:66px 0 0; z-index:4; border:0; width:100%; height:calc(100% - 66px) }
    .project-card { flex-basis:100%; width:100%; max-width:none }
    .main { padding:22px 14px }
    .panel { padding:15px }
    #top-actions .user-name { display:none }
}
@media(min-width:701px) { .scrim { display:none } }

.avatar {
    display:inline-grid; place-items:center; position:relative; flex:none;
    width:38px; height:38px; border-radius:50%; overflow:hidden;
    border:1px solid var(--line); background:var(--soft); color:var(--accent); font-weight:750;
}
.avatar img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover }
.avatar:has(img) > span { visibility:hidden }
.profile-menu { position:relative }
.profile-menu summary { display:flex; border-radius:50%; cursor:pointer; list-style:none }
.profile-menu summary::-webkit-details-marker { display:none }
.profile-popup {
    position:absolute; top:calc(100% + 10px); right:0; min-width:190px;
    padding:8px; border:1px solid var(--line); border-radius:12px;
    background:var(--panel); box-shadow:0 8px 26px #11182735;
}
.profile-popup .profile-identity { padding:6px 10px 9px }
.profile-popup strong { font-size:1.25rem }
.profile-identity { display:flex; align-items:center; flex-wrap:wrap; gap:6px 8px; min-width:0 }
.profile-identity strong { min-width:0; overflow-wrap:anywhere }
.plan-badge { background:var(--soft); color:var(--accent); border:1px solid var(--line); font-size:.72rem }
.drawer-profile .profile-identity { justify-content:center; text-align:center }
.profile-popup button { width:100%; text-align:left; border-color:transparent; margin-top:3px }
.create-project { display:grid; place-items:center; width:38px; height:38px; padding:0; font-size:1.5rem; line-height:1 }
.mobile-profile, .drawer-profile, .drawer-sign-out, #sidebar .drawer-account { display:none }
.account-preferences .form-actions, .account-password .form-actions { justify-content:flex-end }
#password-status { margin-top:12px; color:var(--accent) }
.project-settings { display:grid; place-items:center; width:38px; height:38px; padding:0 }
.project-settings svg { width:21px; height:21px }
.project-settings[aria-current=page] { background:var(--soft); color:var(--accent) }
.project-header { flex-wrap:nowrap }
.project-heading { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; min-width:0 }
.project-heading h1 { min-width:0 }
.project-header .project-settings { flex:none }
.profile-upload-row { display:flex; align-items:flex-start; gap:16px }
.profile-upload-row .avatar { width:64px; height:64px; font-size:1.4rem }
.profile-upload-row form { min-width:0 }
@media(max-width:700px) {
    .profile-menu { display:none }
    .mobile-profile { display:flex }
    .drawer-profile { display:grid; justify-items:center; gap:8px; padding:8px 12px 18px; overflow-wrap:anywhere }
    .drawer-profile .avatar { width:62px; height:62px; font-size:1.4rem }
    #sidebar .drawer-account { display:flex }
    .drawer-sign-out { display:block }
    .drawer-sign-out button { border-color:transparent; text-align:left; width:100% }
}

.profile-menu summary { align-items:center; gap:8px }
.profile-chevron {
    width:0; height:0; border:5px solid transparent;
    border-bottom:0; border-top-color:var(--ink);
}
.profile-menu[open] .profile-chevron { transform:rotate(180deg) }
.close-dialog { font-size:1.4rem; line-height:1; padding:5px 10px }
.form-actions { display:flex; justify-content:space-between; gap:8px }
.auth-header { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:16px }
.auth-header h1 { margin:0 }
.auth .form-actions { justify-content:flex-end }
#delete-project, #delete-post { color:var(--danger); text-decoration:underline; text-underline-offset:3px }
.dashboard-empty { display:grid; min-height:40vh; justify-items:center; align-content:center; gap:14px; text-align:center }
.dashboard-empty img { width:min(100%,340px); height:auto }
.dashboard-empty p { color:var(--muted); font-size:1.05rem; margin:0 }
.dashboard-empty button { padding:12px 24px; font-size:1.15rem }
.post-row { cursor:pointer }
.post-row:hover, .post-row:focus-within { background:var(--soft) }
.priority-icon { display:inline-grid; place-items:center; width:1.2rem; font-size:1.05rem; font-weight:750; line-height:1 }
.priority-highest, .priority-high { color:var(--danger) }
.priority-medium { color:#a35e00 }
.priority-low, .priority-lowest { color:#087554 }
[data-bs-theme=dark] .priority-medium { color:#ffd166 }
[data-bs-theme=dark] :is(.priority-low,.priority-lowest) { color:#77e0b3 }
.issue-badge { background:#e5eaf0; color:#344255; font-weight:650 }
.issue-badge[data-status=received], .issue-badge[data-status=done] { background:#def4e9; color:#0b6248 }
.issue-badge[data-status=review] { background:#eee8fb; color:#54358e }
.issue-badge[data-status=active] { background:#deedff; color:#204d85 }
.issue-badge[data-status=hold] { background:#fff0cf; color:#794b06 }
.home-icon { flex:none }
.priority-options { display:flex; flex-wrap:wrap; gap:7px }
.form-fields .priority-option { position:relative; display:block }
.priority-option input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; margin:0 }
.priority-option .priority-icon { width:40px; height:36px; border:1px solid var(--line); border-radius:8px }
.priority-option input:checked + .priority-icon { background:var(--soft); border-color:var(--accent) }
.priority-option input:focus-visible + .priority-icon { outline:2px solid var(--accent); outline-offset:2px }
.form-fields legend { font:inherit; font-weight:600; margin-bottom:5px }
.comment-image { display:block; max-width:100%; max-height:320px; border-radius:8px; margin:6px 0 }

.post-page { max-width:940px }
:is(.post-editor, .project-settings-panel) .form-actions { align-items:center }
:is(.post-editor, .project-settings-panel) .form-actions > .btn-primary-app { margin-inline-start:auto }
.post-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:14px }
.post-title { font-size:clamp(1.35rem,3vw,1.8rem); overflow-wrap:anywhere }
.post-comments, .post-section-title { margin-top:18px }
.post-section-title { font-size:1.12rem }
.rich img { display:block; max-width:100%; height:auto; max-height:440px; object-fit:contain; margin:6px 0 }
.comment-rich p { margin-bottom:5px }

.public-site { min-height:100dvh; display:flex; flex-direction:column; background:#fff }
.public-site .topbar {
    width:min(100%, 1360px); height:auto; min-height:84px; margin:0 auto;
    padding:16px clamp(16px,4vw,56px); border:0; position:static;
}
.public-site .brand svg { width:215px; max-width:41vw }
.public-site #top-actions { gap:8px }
.public-site .layout { flex:1; min-height:0; width:100% }
.public-site .main { padding:0 clamp(16px,4vw,56px) }
.public-button {
    display:inline-flex; align-items:center; justify-content:center; gap:10px;
    min-height:42px; padding:8px 17px; border:1px solid transparent; border-radius:999px;
    font:inherit; font-weight:650; text-align:center;
}
.public-button:hover { text-decoration:none }
.public-outline { background:#fff; color:#087554; border-color:#087554 }
.public-outline:hover { background:#eaf8f1; color:#064e3b }
.public-primary { background:#087554; color:#fff }
.public-primary:hover { background:#065b42; color:#fff }
.landing-hero { position:relative; max-width:1248px; margin:18px auto 28px; min-height:480px; display:flex; align-items:center }
.landing-copy { z-index:1; width:min(100%, 390px); padding:28px 0 }
.landing-copy h1 { color:#153e32; line-height:1.1; font-size:clamp(2.45rem,5vw,4rem); margin:0 0 24px }
.landing-copy p { margin:20px 0 0 }
.landing-copy p a { text-decoration:underline; text-underline-offset:3px }
.landing-banner { width:100%; height:auto; display:block }
.landing-hero.with-banner { min-height:0 }
.with-banner .landing-copy { position:absolute; top:16%; left:0; width:31% }
.public-options { display:grid; gap:9px }
.social-button { width:100%; position:relative }
.social-google { background:#1767cf; color:#fff; padding-inline:39px }
.social-google:hover { background:#1056b2; color:#fff }
.google-mark { position:absolute; left:10px; width:25px; height:25px; padding:3px; border-radius:50%; background:#fff }
.social-apple { background:#fff; color:#202938; border-color:#96a1af }
.social-apple:hover { background:#f5f7fa; color:#202938 }
.public-auth { margin:30px auto 44px; border-color:#dce5e1 }
.public-auth .auth-header > a { white-space:nowrap }
.public-divider { margin:16px 0; font-size:.88rem; color:var(--muted); text-align:center }
.oauth-feedback { margin:8px 0 14px; color:var(--ink) }
#public-footer {
    width:min(100%,1360px); margin:0 auto; padding:16px clamp(16px,4vw,56px) 24px;
    display:flex; justify-content:space-between; align-items:center; color:var(--muted); gap:12px;
}
.language-menu { position:relative }
.language-menu summary { cursor:pointer; font-weight:650; color:var(--ink) }
.language-menu > div {
    position:absolute; z-index:2; right:0; bottom:calc(100% + 8px); min-width:122px;
    background:#fff; border:1px solid var(--line); border-radius:10px; padding:4px;
}
.language-menu button { display:block; width:100%; padding:7px 10px; color:var(--ink); text-align:left; border:0; background:none }
.language-menu button[aria-pressed=true] { color:var(--accent); font-weight:700 }
@media(max-width:960px) {
    .landing-hero.with-banner { flex-direction:column; align-items:flex-start }
    .with-banner .landing-copy { position:static; order:-1; width:min(100%,390px) }
}
@media(max-width:560px) {
    .public-site .topbar { min-height:70px }
    .public-site #top-actions .public-button { padding:6px 10px; font-size:.84rem; min-height:36px }
    .landing-hero { min-height:0; margin-top:10px }
    .landing-copy { padding:20px 0 }
    .public-auth { margin-top:14px }
}


.project-key-field { display:grid; gap:5px }
.project-key-heading { position:relative; display:flex; align-items:center; gap:8px }
.project-key-heading summary {
    display:grid; place-items:center; width:20px; height:20px; border:1px solid var(--line);
    border-radius:50%; list-style:none; color:var(--accent); font-size:.75rem; font-weight:700; cursor:pointer;
}
.project-key-heading summary::-webkit-details-marker { display:none }
.project-key-heading details p {
    position:absolute; top:100%; left:0; z-index:1; margin:4px 0 0; border:1px solid var(--line);
    border-radius:8px; padding:8px 12px; background:var(--panel); box-shadow:0 6px 18px #11182725;
}

.user-actions { display:flex; align-items:center; gap:6px }
.user-delete { display:grid; place-items:center; padding:8px }


#sidebar { display:flex; flex-direction:column }
.sidebar-storage { margin-top:auto; padding:16px 10px 0; font-size:.82rem; color:var(--muted) }
.sidebar-storage strong { display:block; color:var(--ink); margin-bottom:4px }
.sidebar-storage progress { display:block; width:100%; height:8px; margin-top:5px; accent-color:var(--accent) }
.user-plan { min-width:76px }


.storage-heading { display:flex; justify-content:space-between; align-items:center; gap:8px }
.storage-link { display:grid; place-items:center; width:28px; height:28px; border-radius:6px }
.storage-link:hover { background:var(--soft) }
.storage-size { white-space:nowrap }
.attachment-list { list-style:none; margin:0; padding:0 }
.attachment-list li { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:7px }
.attachment-list li span { min-width:0; overflow-wrap:anywhere }
.attachment-list li button { flex:none }


.storage-summary { display:flex; align-items:center; gap:10px; font-size:.85rem }
.storage-summary progress { width:clamp(90px,16vw,170px); height:9px; accent-color:var(--accent) }
.storage-summary span { white-space:nowrap }

.landing-site .topbar { position:sticky; top:0; background:#fff }
.pricing-nav {
    display:inline-flex; align-items:center; min-height:40px; padding:6px 12px;
    color:#202938; font-weight:700; border-radius:999px; white-space:nowrap;
}
.pricing-nav[aria-current=location], .pricing-nav:hover { color:#087554; background:#e8f5ef; text-decoration:none }
.landing-pricing {
    max-width:1248px; margin:0 auto 32px; padding:clamp(20px,4vw,52px);
    border-radius:22px; background:#f3f8f5; scroll-margin-top:100px;
}
.pricing-intro { text-align:center; margin:0 auto 25px }
.pricing-intro h2 { color:#153e32; font-size:clamp(1.8rem,4vw,2.65rem); letter-spacing:-.035em; margin:0 0 8px }
.pricing-intro p, .pricing-note { color:var(--muted); margin:0 }
.pricing-table-wrap { overflow-x:auto; contain:paint; background:#fff; border:1px solid var(--line); border-radius:14px }
.pricing-table { width:100%; min-width:620px; border-collapse:collapse; text-align:center }
.pricing-table th, .pricing-table td { padding:10px 14px; border-bottom:1px solid var(--line) }
.pricing-table thead th { padding:15px; color:#153e32; font-size:1.12rem }
.pricing-table th[scope=row] { text-align:left; font-weight:650 }
.pricing-table tfoot td { border:0; padding:14px }
.pricing-table td { color:var(--muted) }
.pricing-price { font-size:clamp(1.5rem,3vw,2.2rem); color:#153e32 }
.pricing-check { color:#087554; font-weight:800 }
.pricing-soon { color:var(--muted); font-weight:650; white-space:nowrap }
.pricing-note { margin:14px 0 0; text-align:center; font-size:.88rem }
@media(max-width:560px) {
    .landing-site .brand svg { max-width:33vw }
    .landing-site #top-actions { gap:4px; flex-wrap:wrap; justify-content:flex-end }
    .landing-site .landing-header-signup { display:none }
    .pricing-nav { padding:5px 7px; font-size:.84rem; min-height:36px }
    .landing-pricing { padding:18px 12px }
}


.landing-preview { max-width:1248px; margin:0 auto 32px; overflow-x:auto; contain:paint }
.landing-preview img { display:block; width:100%; min-width:720px; height:auto }

#top-create:empty { display:none }
.account-security { display:grid; gap:16px; margin-top:16px }
.account-security > .panel { min-width:0 }
.billing-history { margin-top:16px }
@media(min-width:1000px) {
    .account-security:has(.account-password) { grid-template-columns:repeat(2,minmax(0,1fr)) }
}
@media(max-width:700px) {
    .topbar #top-actions { gap:6px }
    #top-create .create-project { width:32px; height:32px }
}
