/* FKM FlowNote — shared presentation for desktop and mobile. */
:root {
    color-scheme: light;
    --ink: #263b36;
    --muted: #657670;
    --accent: #245c49;
    --accent-hover: #174532;
    --line: #dce3dc;
    --paper: #fffefa;
    --surface: #f1f4ed;
    --radius: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: #e9eee6;
    font-synthesis: none;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-width: 280px;
    min-height: 100vh;
    padding: 32px 40px 56px;
    background: radial-gradient(ellipse at 95% 0%, #dce7d3 0, transparent 48%), #edf0e9;
    font-size: 14px;
    line-height: 1.55;
}
.app-shell { max-width: 1180px; margin: 0 auto; }
.site-footer { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px; max-width: 1180px; margin: 24px auto 0; padding: 14px 0; color: var(--muted); font-size: 12px; }
.site-footer a { display: inline-block; }
body:has(.auth-shell) .site-footer { max-width: 500px; margin-top: 16px; }
.legal-page { max-width: 800px; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.legal-page h2 { margin: 24px 0 8px; font-size: 23px; letter-spacing: -.025em; }
.legal-page h2:first-child { margin-top: 0; }
.legal-page p, .legal-page li { overflow-wrap: anywhere; }
.legal-page .meta { margin-top: 30px; color: var(--muted); font-size: 12px; }
a { color: var(--accent); text-underline-offset: 4px; }
a:hover { color: var(--accent-hover); }
.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 36px;
    font-size: 12px;
    letter-spacing: .025em;
}
.topbar a {
    text-decoration: none;
    padding: 7px 14px;
    border: 1px solid #cbd6ca;
    border-radius: 999px;
}
.topbar strong { font-weight: 500; background: #dde8d5; padding: 7px 14px; border-radius: 999px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 24px 0 32px; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 750; letter-spacing: .19em; margin: 0 0 10px; }
h1, h2 { font-size: clamp(30px, 4vw, 46px); line-height: 1.15; font-weight: 400; letter-spacing: -.055em; margin: 0; }
h1 span, h2 span { font-weight: 700; }
h1 small { display: inline-block; font-size: 11px; letter-spacing: .02em; vertical-align: middle; background: #dce7d3; border-radius: 6px; padding: 6px 9px; }
.intro { color: var(--muted); margin: 10px 0 0; font-size: 14px; }
.brand-mark { display: grid; place-items: center; width: 64px; height: 64px; flex-shrink: 0; border-radius: 20px 20px 20px 5px; background: var(--accent); color: #f0f3dc; font-family: Georgia, serif; font-size: 48px; font-style: italic; line-height: 1; padding-bottom: 10px; box-shadow: 0 8px 24px #245c4912; }
label { font-size: 12px; font-weight: 600; color: var(--muted); }
input, select, button { font: inherit; }
input, select {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 10px 12px;
    color: var(--ink);
    background: var(--paper);
    max-width: 100%;
}
select { cursor: pointer; padding-right: 28px; }
input[type="checkbox"] { min-height: auto; width: auto; }
input::placeholder { color: #829087; }
button {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 18px;
    background: var(--paper);
    color: var(--ink);
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
button:hover:not(:disabled) { background: #edf2e8; border-color: #a9bcae; }
:where(a, button, input, select):focus-visible { outline: 3px solid #80aa81; outline-offset: 3px; }
button:disabled, input:disabled, select:disabled { opacity: .55; cursor: not-allowed; }
.note-picker { background: #e2e9dd; border: 1px solid #d3decd; border-radius: 14px; padding: 16px 20px; margin-bottom: 20px; }
.note-picker label { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--accent); }
.note-picker select { width: min(400px, 55%); background: #f7f9f2; }
.editor-panel { border: 1px solid #d5dfd3; border-radius: var(--radius); background: var(--paper); padding: 26px; box-shadow: 0 12px 48px #293e2910; }
.editor-panel > label:first-child { display: flex; flex-direction: column; gap: 8px; }
.editor-panel input[name="filename"] { width: 100%; background: transparent; font-size: 21px; font-weight: 600; letter-spacing: -.025em; border-radius: 0; border-width: 0 0 1px; padding: 8px 0 14px; }
.editor-panel > br { display: none; }
.toolbar { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; background: var(--surface); padding: 16px; border: 1px solid #e5e9df; border-radius: 12px; margin: 22px 0 0; }
.toolbar label { display: flex; flex: 1 1 120px; flex-direction: column; gap: 6px; font-size: 11px; }
.toolbar select { width: 100%; font-size: 13px; }
#clearFormatBtn { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; font-size: 19px; align-self: flex-end; }
.char-counter-row, .char-clear-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin: 16px 0; font-size: 12px; color: var(--muted); }
.char-counter-row label, .char-counter-combined label { display: flex; align-items: center; gap: 10px; }
.char-counter-row input, .char-counter-combined input { width: 112px; min-height: 36px; padding: 6px 10px; font-size: 12px; }
.char-counter-combined { display: flex; flex: 1; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.remaining-info strong, .char-counter-combined strong { font-weight: 500; }
#remainingChars { display: inline-block; min-width: 30px; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
#editor { min-height: 380px; padding: 28px 32px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 15px; line-height: 1.85; overflow-wrap: anywhere; overflow-y: auto; outline: none; transition: border-color .15s, box-shadow .15s; }
#editor:focus { border-color: #7c9c80; box-shadow: 0 0 0 3px #245c490d; }
#editor p:first-child { margin-top: 0; }
#editor p:last-child { margin-bottom: 0; }
#editor img { max-width: 100%; height: auto; }
.button-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.button-row button { aspect-ratio: auto; height: auto; font-size: 13px; }
.button-row button[type="submit"]:not([name="delete"]) { background: var(--accent); border-color: var(--accent); color: #fff; padding-inline: 26px; }
.button-row button[type="submit"]:not([name="delete"]):hover:not(:disabled) { background: var(--accent-hover); }
.button-row button:last-child { margin-left: auto; }
.button-row button[name="delete"] { color: #9c4d3b; border-color: #ecd9d2; background: #fffaf7; }
.message { padding: 14px 18px; margin-top: 18px; border-radius: 10px; background: #dfeada; border: 1px solid #cbdcc3; color: var(--accent); }
/* Login uses the same identity and comfortable touch targets. */
.app-shell:has(> h2) { max-width: 440px; margin: clamp(32px, 10vh, 100px) auto; background: var(--paper); padding: 36px; border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 16px 60px #293e2910; }
.app-shell > .brand-mark { margin-bottom: 28px; }
.app-shell > h2 { font-size: 35px; }
.app-shell > h2 ~ form { margin-top: 28px; }
.app-shell > h2 ~ form label { display: flex; flex-direction: column; gap: 8px; }
.app-shell > h2 ~ form button { width: 100%; margin-top: 16px; background: var(--accent); color: white; }
.app-shell > h2 ~ p:last-of-type { font-size: 12px; }
@media (min-width: 1440px) { body { padding-top: 44px; } #editor { min-height: 430px; } }
@media (max-width: 900px) {
    body { padding: 20px 24px 40px; }
    .page-heading { margin-top: 20px; }
    .editor-panel { padding: 20px; }
    .toolbar { gap: 10px; padding: 12px; }
    .toolbar label { flex-basis: 130px; }
    #editor { min-height: 350px; padding: 24px; }
}
@media (max-width: 600px) {
    body { padding: 12px 14px max(24px, env(safe-area-inset-bottom)); }
    .legal-page { padding: 20px; }
    .topbar { min-height: 32px; }
    .page-heading { margin: 22px 2px 24px; gap: 14px; }
    h1 { font-size: 32px; }
    .eyebrow { font-size: 9px; letter-spacing: .14em; }
    .intro { font-size: 12px; }
    .brand-mark { width: 46px; height: 46px; border-radius: 14px 14px 14px 4px; font-size: 36px; padding-bottom: 7px; }
    .note-picker { padding: 13px 14px; margin-bottom: 14px; }
    .note-picker label { align-items: stretch; flex-direction: column; gap: 8px; }
    .note-picker select { width: 100%; }
    .editor-panel { padding: 14px; border-radius: 16px; }
    .editor-panel > label:first-child { font-size: 11px; }
    .editor-panel input[name="filename"] { font-size: 20px; }
    .app-shell:not(.mobile-editor) .toolbar { margin-top: 16px; gap: 10px; }
    .app-shell:not(.mobile-editor) .toolbar label { flex: 1 1 calc(50% - 10px); min-width: 0; }
    input, select, .toolbar select { font-size: 16px; }
    .char-counter-row, .char-clear-row { font-size: 11px; gap: 10px; }
    .char-counter-row label, .char-counter-combined label { font-size: 11px; gap: 7px; }
    .char-counter-row input, .char-counter-combined input { width: 102px; font-size: 16px; min-height: 44px; }
    #editor { min-height: 330px; padding: 18px 16px; font-size: 16px; line-height: 1.75; border-radius: 9px; }
    .button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
    .button-row button { width: 100%; padding: 12px 8px; font-size: 12px; }
    .button-row button:last-child { margin-left: 0; }
    .button-row button[name="delete"] { grid-column: 1 / -1; grid-row: 2; }
    .app-shell:has(> h2) { padding: 26px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
/* Accounts and administration */
.topbar { gap: 10px; flex-wrap: wrap; }
.topbar form { margin: 0; }
.topbar button { font-size: 12px; min-height: 34px; padding: 7px 14px; border-radius: 999px; background: transparent; border-color: #cbd6ca; font-weight: 400; }
.account-name { color: var(--muted); margin-right: auto; font-size: 12px; }
.auth-shell { max-width: 500px; margin: 7vh auto 0; padding: 32px; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 16px 60px #293e2910; }
.auth-shell h1 { font-size: 34px; }
.auth-shell .brand-mark { width: 48px; height: 48px; font-size: 36px; }
.auth-shell .page-heading { margin-top: 0; }
.stack-form { display: flex; flex-direction: column; gap: 18px; margin-top: 24px; }
.stack-form label { display: flex; flex-direction: column; gap: 7px; }
.stack-form input { width: 100%; }
.stack-form small { font-weight: 400; }
button.primary { background: var(--accent); border-color: var(--accent); color: white; }
button.primary:hover { background: var(--accent-hover); }
.auth-links { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; }
.error { color: #873c2f; background: #fff0e9; border-color: #eccdc1; }
.admin-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 22px; margin-top: 24px; }
.section-title { font-size: 20px; font-weight: 600; letter-spacing: -.025em; line-height: 1.3; }
.section-title small { color: var(--muted); font-size: 12px; margin-left: 7px; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; color: var(--accent); background: #e2ecdc; font-size: 11px; font-weight: 600; }
.badge.inactive { color: #873c2f; background: #fae7dc; }
.section-tabs { display: flex; gap: 8px; margin: 24px 0; border-bottom: 1px solid #ced8ca; padding-bottom: 12px; }
.section-tabs a { text-decoration: none; padding: 10px 15px; border-radius: 9px; font-size: 13px; }
.section-tabs .selected { background: var(--accent); color: #fff; }
.section-tabs span { opacity: .7; padding-left: 8px; }
.member-list { display: grid; gap: 14px; margin-top: 18px; }
.member-card { display: flex; gap: 24px; align-items: center; justify-content: space-between; }
.member-identity { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.member-identity p { margin: 5px 0 9px; overflow-wrap: anywhere; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; flex-shrink: 0; border-radius: 13px; background: #e4ecdc; color: var(--accent); font-weight: 700; }
.member-controls { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.member-controls label { display: flex; flex-direction: column; gap: 6px; }
.switch-label, .member-controls .switch-label { display: flex; flex-direction: row; align-items: center; gap: 9px; min-height: 44px; }
.switch-label input { width: 20px; height: 20px; min-height: 20px; accent-color: var(--accent); }
.setting-row { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 32px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.setting-row:first-of-type { padding-top: 0; }
.setting-row p { max-width: 650px; margin-bottom: 0; }
.setting-row > label:not(.switch-label) { display: flex; flex-direction: column; gap: 6px; }
.settings-form > button { margin-top: 24px; }
.create-member { margin-top: 24px; }
.create-member summary { cursor: pointer; font-weight: 600; padding: 3px 0; }
.create-member .stack-form { max-width: 500px; }
@media (max-width: 900px) { .member-card { align-items: flex-start; flex-direction: column; } .member-controls { width: 100%; } }
@media (max-width: 600px) {
    .auth-shell { margin: 24px auto 0; padding: 22px; }
    .auth-shell h1 { font-size: 28px; }
    .admin-grid { grid-template-columns: 1fr; }
    .setting-row { grid-template-columns: 1fr; gap: 12px; }
    .section-tabs a { padding: 10px; font-size: 12px; }
    .member-controls { align-items: stretch; flex-direction: column; gap: 10px; }
    .topbar { gap: 7px; }
    .topbar a, .topbar button { font-size: 11px; }
    .topbar .account-name { flex-basis: 100%; }
}

/* Shared view controls stay reachable in both fullscreen implementations. */
.view-controls { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.view-controls button { font-size: 12px; }
.view-controls button[aria-pressed="true"] { background: var(--surface); border-color: var(--accent); color: var(--accent); }
:root[data-theme="dark"] {
    color-scheme: dark;
    --ink: #e8e8e8;
    --muted: #b5b5b5;
    --accent: #d4d4d4;
    --accent-hover: #ffffff;
    --line: #454545;
    --paper: #222222;
    --surface: #2c2c2c;
    background: #161616;
}
[data-theme="dark"] body { background: radial-gradient(ellipse at 95% 0%, #292929 0, transparent 48%), #191919; }
[data-theme="dark"] .topbar a, [data-theme="dark"] .topbar button,
[data-theme="dark"] .editor-panel, [data-theme="dark"] .toolbar { border-color: var(--line); }
[data-theme="dark"] .topbar strong, [data-theme="dark"] h1 small,
[data-theme="dark"] .note-picker, [data-theme="dark"] .message { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .note-picker select { background: var(--paper); }
[data-theme="dark"] button:hover:not(:disabled) { background: #383838; border-color: #858585; }
[data-theme="dark"] .brand-mark { background: #383838; color: #f0f0f0; }
[data-theme="dark"] #editor { background: #161616; color: var(--ink); }
[data-theme="dark"] input::placeholder { color: #999999; }
[data-theme="dark"] :where(a, button, input, select):focus-visible { outline-color: #bdbdbd; }
[data-theme="dark"] #editor:focus { border-color: #999999; box-shadow: 0 0 0 3px #ffffff12; }
[data-theme="dark"] .editor-panel, [data-theme="dark"] .brand-mark { box-shadow: 0 12px 36px #00000026; }
[data-theme="dark"] .button-row button[type="submit"]:not([name="delete"]) { color: #181818; }
[data-theme="dark"] .button-row button[name="delete"] { background: #39251f; border-color: #765045; color: #ffb19f; }
/* Focus view: only the text card and its exit control remain visible. */
#fullscreenExit { display: none; }
html.editor-fullscreen {
    position: fixed; inset: 0; width: 100%; height: 100%;
    overflow: hidden; overscroll-behavior: none;
}
.editor-fullscreen body {
    position: fixed; inset: 0; width: 100%; height: 100%; min-height: 0;
    padding: 0; overflow: hidden; overscroll-behavior: none;
}
.editor-fullscreen .app-shell { max-width: none; margin: 0; }
.editor-fullscreen .app-shell > :not(.editor-panel),
.editor-fullscreen .editor-panel > :not(#textCard) { display: none; }
.editor-fullscreen #textCard {
    position: fixed; inset: 0; margin: 0; padding: 0;
    width: 100%; height: 100%; overflow: hidden; background: var(--paper);
    border: 0; border-radius: 0; box-shadow: none;
}
.editor-fullscreen #textCard > br { display: none; }
.editor-fullscreen #editor {
    touch-action: pan-y;
    width: 100%; height: 100%; min-height: 0; margin: 0;
    padding: max(28px, env(safe-area-inset-top)) max(64px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
    border: 0; border-radius: 0; box-shadow: none;
    overscroll-behavior: none;
}
.editor-fullscreen #fullscreenExit {
    display: grid; place-items: center; position: absolute;
    top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right));
    width: 44px; height: 44px; padding: 0; font-size: 24px;
    color: var(--muted); background: var(--paper); border-color: var(--line);
}

/* Keep all note navigation actions together on wide screens. */
.workspace-bar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1.35fr); align-items: end; gap: 14px; margin-bottom: 20px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.project-controls { display: contents; }
.workspace-bar .project-switcher { order: 1; min-width: 0; }
.workspace-bar > .note-picker { order: 2; }
.workspace-bar .move-note-form { order: 3; }
.workspace-bar .project-create { order: 4; grid-column: 4; }
.workspace-bar .note-picker, .workspace-bar .project-create, .workspace-bar .move-note-form { display: flex; align-items: end; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.workspace-bar label { display: flex; flex: 1; flex-direction: column; align-items: stretch; gap: 6px; min-width: 0; font-size: 12px; white-space: nowrap; }
.workspace-bar select, .workspace-bar input { width: 100%; min-width: 0; height: 40px; }
.workspace-bar button { flex: none; height: 40px; padding-inline: 12px; }
.workspace-bar .note-picker select { background: var(--paper); }
@media (max-width: 1100px) { .workspace-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); } .workspace-bar .project-create { grid-column: 2; } }
@media (max-width: 600px) { .workspace-bar { grid-template-columns: minmax(0, 1fr); } .workspace-bar .project-create { grid-column: 1; } }

.project-switcher .workspace-label { display: block; margin-bottom: 6px; font-size: 12px; color: var(--accent); }
.project-switcher details { position: relative; }
.project-switcher summary, .project-menu a { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 9px 12px; min-height: 40px; color: var(--ink); font-size: 13px; text-decoration: none; }
.project-switcher summary { cursor: pointer; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); list-style: none; }
.project-switcher summary::-webkit-details-marker { display: none; }
.project-switcher summary::after { content: '⌄'; grid-column: 2; grid-row: 1; margin-left: 8px; }
.project-switcher .project-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-switcher .project-count { grid-column: 2; grid-row: 1; margin-right: 18px; font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; }
.project-menu { position: absolute; z-index: 10; top: calc(100% + 4px); left: 0; right: 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); box-shadow: 0 12px 24px #0002; }
.project-menu a:hover, .project-menu a:focus-visible, .project-menu a[aria-current="page"] { background: var(--surface); }

/* The editor uses one compact application header. */
.editor-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 22px; }
.editor-header h1 { margin: 0; flex: none; font-size: clamp(22px, 2.4vw, 31px); line-height: 1.2; letter-spacing: -.04em; }
.editor-header h1 small { font-size: 12px; letter-spacing: 0; }
.editor-header .header-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; min-width: 0; }
.editor-header .topbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-height: 0; margin: 0; }
.editor-header .topbar .account-name { flex-basis: auto; white-space: nowrap; }
.editor-header .view-controls { margin: 0; flex-wrap: nowrap; }
.editor-header .topbar a, .editor-header .topbar button, .editor-header .view-controls button { white-space: nowrap; }
@media (max-width: 950px) { .editor-header { align-items: flex-start; } .editor-header .header-actions { gap: 8px; } }
@media (max-width: 600px) { .editor-header { flex-direction: column; gap: 12px; } .editor-header .header-actions, .editor-header .topbar { justify-content: flex-start; } }

/* The dedicated mobile editor keeps navigation behind compact controls. */
.mobile-editor .editor-header { align-items: center; flex-direction: row; gap: 10px; margin-bottom: 14px; }
.mobile-editor .editor-header h1 { min-width: 0; font-size: clamp(23px, 6vw, 31px); white-space: nowrap; }
.mobile-menu { position: relative; margin-left: auto; flex: none; }
.mobile-menu > summary, .project-create-menu > summary { display: flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; }
.mobile-menu > summary::-webkit-details-marker, .project-create-menu > summary::-webkit-details-marker { display: none; }
.mobile-menu-panel { position: absolute; z-index: 20; top: calc(100% + 8px); right: 0; width: min(320px, calc(100vw - 28px)); padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 16px 36px #0003; }
.mobile-editor .mobile-menu-panel .topbar { display: flex; flex-direction: column; align-items: stretch; gap: 8px; margin: 0; }
.mobile-editor .mobile-menu-panel .topbar .account-name { flex-basis: auto; padding: 4px 2px; }
.mobile-editor .mobile-menu-panel .topbar a, .mobile-editor .mobile-menu-panel .topbar button { display: block; width: 100%; text-align: left; }
.mobile-editor .mobile-menu-panel .view-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.mobile-editor .mobile-menu-panel .view-controls button { padding-inline: 5px; }
.mobile-editor .workspace-bar { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; margin-bottom: 12px; }
.mobile-editor .workspace-bar .project-create-menu { order: 4; grid-column: 1; }
.mobile-editor .workspace-bar .project-create-menu > summary { width: 100%; }
.mobile-editor .workspace-bar .project-create { margin-top: 10px; }
.mobile-editor .workspace-bar .project-create label { flex: 1; }
.mobile-editor .workspace-bar .move-note-form { order: 3; }
.mobile-editor .editor-panel { padding: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Keep formatting controls in one swipeable row in the mobile editor. */
.mobile-editor .toolbar { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 10px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding: 12px; }
.mobile-editor .toolbar label { flex: 0 0 140px; min-width: 140px; white-space: nowrap; }
.mobile-editor .toolbar select { width: 100%; }

.mobile-editor .toolbar #clearFormatBtn { flex: 0 0 44px; align-self: flex-end; margin: 0; }
.mobile-editor .char-clear-row { display: block; margin: 12px 0; }
.mobile-editor .char-counter-combined { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.mobile-editor .char-counter-combined label { display: flex; flex: 0 1 auto; align-items: center; white-space: nowrap; }
.mobile-editor .char-counter-combined > div { flex: none; white-space: nowrap; text-align: right; }
.mobile-editor .char-counter-combined input { width: min(100px, 22vw); min-width: 62px; }

.editor-workspace-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; }
.editor-workspace-bar .project-manage-link { display: inline-flex; align-items: center; justify-content: center; order: 3; min-height: 40px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); text-decoration: none; font-size: 13px; font-weight: 600; white-space: nowrap; }
.mobile-editor .editor-workspace-bar { grid-template-columns: minmax(0, 1fr); }
.mobile-editor .editor-workspace-bar .project-manage-link { width: 100%; }
.projects-back { margin: 0 0 20px; }
.project-management-create { margin-bottom: 16px; }
.project-management-create h2, .project-management-card h2 { font-size: 23px; }
.project-management-form { display: flex; align-items: end; gap: 10px; }
.project-management-form label { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; }
.project-management-form input { width: 100%; }
.project-management-list { display: grid; gap: 16px; }
.project-management-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.project-management-heading span { color: var(--muted); white-space: nowrap; }
.project-management-actions { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.project-management-actions > form:first-child { flex: 1; max-width: 550px; }
.project-management-notes { border-top: 1px solid var(--line); }
.project-management-note { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.project-management-note > a { min-width: 0; overflow-wrap: anywhere; }
.project-management-move { display: flex; gap: 8px; flex: 0 1 430px; }
.project-management-move label { flex: 1; min-width: 0; }
.project-management-move select { width: 100%; }
@media (max-width: 760px) { .editor-workspace-bar { grid-template-columns: minmax(0, 1fr); } .project-management-actions, .project-management-note { align-items: stretch; flex-direction: column; } .project-management-move { flex: none; width: 100%; } }

.projects-page-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 20px; }
.projects-page-actions button { font-size: 12px; }
.projects-page-actions button[aria-pressed="true"] { background: var(--surface); border-color: var(--accent); color: var(--accent); }

.mobile-editor .mobile-menu-panel { max-height: calc(100dvh - 90px); overflow-y: auto; }
.mobile-editor .mobile-menu-panel .editor-workspace-bar { margin: 14px 0 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.mobile-editor .mobile-menu-panel .project-menu { position: static; margin-top: 4px; box-shadow: none; }

.mobile-editor .toolbar { gap: 6px; padding: 8px; margin-top: 12px; }
.mobile-editor .toolbar label { flex-basis: 112px; min-width: 112px; gap: 3px; font-size: 11px; }
.mobile-editor .toolbar select { min-height: 36px; height: 36px; padding: 5px 22px 5px 8px; font-size: 16px; }
.mobile-editor .toolbar #clearFormatBtn { flex-basis: 36px; width: 36px; height: 36px; min-height: 36px; font-size: 17px; }

.mobile-editor .toolbar { gap: 5px; padding: 6px; }
.mobile-editor .toolbar label { flex-basis: 100px; min-width: 100px; font-size: 10px; }
.mobile-editor .toolbar select { height: 32px; min-height: 32px; padding: 4px 20px 4px 7px; font-size: 13px; }
.mobile-editor .toolbar #clearFormatBtn { flex-basis: 32px; width: 32px; height: 32px; min-height: 32px; font-size: 15px; }

.mobile-editor .mobile-menu-panel .editor-workspace-bar { margin: 0 0 14px; padding: 0 0 14px; border: 0; border-bottom: 1px solid var(--line); }
.mobile-editor button, .mobile-editor .mobile-menu > summary, .mobile-editor .project-manage-link, .mobile-editor .project-switcher summary, .mobile-editor .project-menu a { font-size: 11px; }
.mobile-editor .toolbar #clearFormatBtn { font-size: 15px; }
@media (max-width: 600px) {
    .project-management-create button, .project-management-card button, .projects-page-actions button { font-size: 11px; }
}

.mobile-editor .mobile-project-controls { display: block; margin: 0 0 12px; }
.mobile-editor .mobile-project-switcher { position: relative; }
.mobile-editor .mobile-project-switcher .project-menu { z-index: 30; }
.mobile-editor .mobile-project-switcher summary, .mobile-editor .mobile-project-switcher .project-menu a { font-size: 11px; }
.mobile-editor .mobile-menu-panel .editor-workspace-bar { margin: 0 0 12px; padding: 0 0 12px; }

/* Match the mobile note picker to the account action text. */
.mobile-editor .mobile-menu-panel .note-picker select { font-size: 11px; }

.mobile-editor .save-toast { position: fixed; z-index: 50; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 28px); margin: 0; padding: 10px 14px; box-shadow: 0 10px 28px #0003; }
.mobile-editor .save-toast[hidden] { display: none; }

.mobile-editor .button-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mobile-editor .button-row button[name="delete"] { grid-column: auto; grid-row: auto; }
.mobile-editor .button-row button:last-child { grid-column: 1 / -1; }
.mobile-editor .button-row button { min-width: 0; padding-inline: 5px; white-space: nowrap; }

/* Project list and project detail follow the native app's two-level layout. */
.project-list-header, .project-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.project-list-header p { margin: 0; color: var(--muted); }
.project-create-disclosure { position: relative; flex: none; }
.project-create-disclosure > summary, .project-new-note { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); text-decoration: none; font-weight: 600; cursor: pointer; list-style: none; }
.project-create-disclosure > summary::-webkit-details-marker, .project-row-actions > summary::-webkit-details-marker { display: none; }
.project-create-disclosure form { position: absolute; z-index: 5; top: calc(100% + 6px); right: 0; width: min(380px, calc(100vw - 28px)); padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 12px 28px #0002; }
.project-folder-list, .project-note-list { overflow: visible; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.project-folder-row, .project-note-row { position: relative; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.project-folder-row:last-child, .project-note-row:last-child { border-bottom: 0; }
.project-folder-link, .project-note-link { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 15px 18px; color: var(--ink); text-decoration: none; }
.project-folder-link:hover, .project-note-link:hover { background: var(--surface); }
.project-folder-link strong, .project-note-link { overflow-wrap: anywhere; }
.project-folder-link > span:first-child, .project-note-link > span:first-child { color: var(--accent); font-size: 23px; line-height: 1; }
.project-folder-count { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.project-row-actions { position: relative; flex: none; margin-right: 10px; }
.project-row-actions > summary { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 20px; list-style: none; }
.project-row-actions > div { position: absolute; z-index: 8; top: calc(100% + 5px); right: 0; width: min(390px, calc(100vw - 28px)); padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: 0 12px 28px #0002; }
.project-row-actions form + form { margin-top: 10px; }
.project-empty { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--muted); }
.project-note-link > span:first-child { flex: none; }
.note-card-header { display: flex; align-items: center; gap: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.note-card-header .note-title-field { flex: 1; min-width: 0; }
.note-card-header input[name="filename"] { width: 100%; min-height: 42px; padding: 4px 0; border: 0; border-radius: 0; border-bottom: 1px solid transparent; background: transparent; font-size: 21px; font-weight: 650; letter-spacing: -.025em; }
.note-card-header input[name="filename"]:focus { border-bottom-color: var(--accent); outline: none; }
.note-card-actions { display: flex; align-items: center; gap: 7px; flex: none; }
.note-card-actions button { min-height: 36px; padding: 7px 10px; font-size: 12px; }
.note-card-actions button[name="delete"] { color: #9c4d3b; }
.note-secondary-actions { display: flex; justify-content: flex-start; }
.mobile-editor .note-card-header { flex-wrap: wrap; gap: 8px; }
.mobile-editor .note-card-header .note-title-field { flex-basis: 100%; }
.mobile-editor .note-card-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mobile-editor .note-card-actions button { min-width: 0; padding-inline: 4px; font-size: 11px; }
.mobile-editor .note-secondary-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mobile-editor .note-secondary-actions button:last-child { grid-column: auto; }
@media (max-width: 650px) { .project-list-header, .project-detail-header { align-items: stretch; flex-direction: column; } .project-create-disclosure > summary, .project-new-note { width: 100%; } .note-card-header { flex-wrap: wrap; } .note-card-actions { width: 100%; } }

.editor-back-link { display: inline-flex; align-items: center; margin: 0 0 14px; color: var(--muted); text-decoration: none; font-size: 13px; }
.editor-back-link:hover { color: var(--accent); }
.mobile-editor .mobile-menu-panel .view-controls { grid-template-columns: 1fr; }

/* The mobile editor is a focused sheet; navigation and account controls live on Projects. */
body.mobile-editor-page { padding: max(8px, env(safe-area-inset-top)) 0 0; background: var(--surface); }
.mobile-editor-page .mobile-editor { max-width: none; width: 100%; margin: 0; }
.mobile-editor-page .mobile-editor .editor-panel { display: flex; flex-direction: column; min-height: calc(100dvh - max(8px, env(safe-area-inset-top))); padding: 16px; border: 0; border-radius: 28px 28px 0 0; box-shadow: none; }
.mobile-editor-page .mobile-editor .note-card-header { flex-wrap: nowrap; align-items: center; gap: 8px; padding-bottom: 16px; border-bottom: 0; }
.mobile-editor-page .mobile-editor .note-card-header .note-title-field { flex: 1 1 auto; min-width: 0; flex-basis: auto; }
.mobile-editor-page .mobile-editor .note-card-header input[name="filename"] { min-height: 40px; padding: 0; font-size: 19px; }
.mobile-editor-page .mobile-editor .note-card-actions { display: flex; flex: none; width: auto; gap: 6px; }
.mobile-editor-page .mobile-editor .note-card-actions button { display: grid; place-items: center; width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--accent); font-size: 20px; }
.mobile-editor-page .mobile-editor .toolbar { margin-top: 12px; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; }
.mobile-editor-page .mobile-editor .char-clear-row { margin: 8px 0 10px; }
.mobile-editor-page .mobile-editor #textCard { flex: 1; min-height: 38vh; }
.mobile-editor-page .mobile-editor #editor { min-height: 100%; height: 100%; padding: 20px 6px; border: 0; border-radius: 0; box-shadow: none; background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.6; }
.mobile-editor-page .mobile-editor #editor:focus { border: 0; box-shadow: none; }
.mobile-editor-page .mobile-editor .note-secondary-actions { margin-top: 16px; }

.mobile-editor-page .mobile-editor .note-card-actions svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* The focused mobile editor keeps every formatting control on one scrollable row. */
.mobile-editor-page .mobile-editor .editor-panel .toolbar {
    display: flex;
    flex-flow: row nowrap;
    align-items: flex-end;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}
.mobile-editor-page .mobile-editor .editor-panel .toolbar > label {
    flex: 0 0 104px;
    width: 104px;
    min-width: 104px;
}
.mobile-editor-page .mobile-editor .editor-panel .toolbar > select,
.mobile-editor-page .mobile-editor .editor-panel .toolbar > label select {
    width: 100%;
    min-width: 0;
}
.mobile-editor-page .mobile-editor .editor-panel .toolbar > #clearFormatBtn {
    flex: 0 0 32px;
}

/* A single editor layout: compact desktop actions, focused mobile sheet. */
.mobile-project-back { display: none; }
.unified-editor .note-card-actions svg { display: none; }
@media (max-width: 600px) {
    body.editor-page { padding: max(8px, env(safe-area-inset-top)) 0 0; background: var(--surface); }
    .editor-page .unified-editor { max-width: none; width: 100%; margin: 0; }
    .editor-page .editor-header, .editor-page .editor-back-link, .editor-page .site-footer { display: none; }
    .editor-page .unified-editor .editor-panel { display: flex; flex-direction: column; min-height: calc(100dvh - max(8px, env(safe-area-inset-top))); padding: 16px; border: 0; border-radius: 28px 28px 0 0; box-shadow: none; }
    .editor-page .unified-editor .mobile-project-back { display: flex; align-items: center; justify-content: center; gap: 5px; width: max-content; min-width: 90px; height: 28px; margin: -10px auto 6px; color: var(--muted); text-decoration: none; font-size: 12px; line-height: 1; touch-action: manipulation; }
    .editor-page .unified-editor .note-card-header { flex-wrap: nowrap; align-items: center; gap: 8px; padding-bottom: 16px; border-bottom: 0; }
    .editor-page .unified-editor .note-card-header .note-title-field { flex: 1 1 auto; min-width: 0; }
    .editor-page .unified-editor .note-card-header input[name="filename"] { min-height: 40px; padding: 0; font-size: 19px; }
    .editor-page .unified-editor .note-card-actions { display: flex; flex: none; width: auto; gap: 6px; }
    .editor-page .unified-editor .note-card-actions button { display: grid; place-items: center; width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); color: var(--accent); }
    .editor-page .unified-editor .note-card-actions .action-label { display: none; }
    .editor-page .unified-editor .note-card-actions svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .editor-page .unified-editor .editor-panel .toolbar { display: flex; flex-flow: row nowrap; align-items: flex-end; gap: 5px; width: 100%; min-width: 0; margin-top: 12px; padding: 6px 0 10px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
    .editor-page .unified-editor .editor-panel .toolbar > label { flex: 0 0 104px; width: 104px; min-width: 104px; gap: 3px; white-space: nowrap; font-size: 10px; }
    .editor-page .unified-editor .editor-panel .toolbar > label select { width: 100%; min-width: 0; height: 32px; min-height: 32px; padding: 4px 20px 4px 7px; font-size: 13px; }
    .editor-page .unified-editor .editor-panel .toolbar > #clearFormatBtn { flex: 0 0 32px; width: 32px; height: 32px; min-height: 32px; padding: 0; font-size: 15px; }
    .editor-page .unified-editor .char-counter-row { flex-wrap: nowrap; margin: 8px 0 10px; }
    .editor-page .unified-editor .char-counter-row label, .editor-page .unified-editor .remaining-info { white-space: nowrap; }
    .editor-page .unified-editor .char-counter-row input { width: min(100px, 22vw); min-width: 62px; min-height: 36px; font-size: 13px; }
    .editor-page .unified-editor #textCard { flex: 1; min-height: 38vh; }
    .editor-page .unified-editor #editor { min-height: 100%; height: 100%; padding: 20px 6px; border: 0; border-radius: 0; box-shadow: none; background: var(--paper); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.6; }
    .editor-page .unified-editor #editor:focus { border: 0; box-shadow: none; }
    .editor-page .unified-editor .note-secondary-actions { display: flex; margin-top: 16px; }
    .editor-page .unified-editor .note-secondary-actions button { width: auto; }
    .editor-page .unified-editor .save-toast { position: fixed; z-index: 50; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100vw - 28px); margin: 0; padding: 10px 14px; box-shadow: 0 10px 28px #0003; }
    .editor-page .unified-editor .save-toast[hidden] { display: none; }
}

/* Keep the browser's pull-to-refresh from taking the editor sheet gesture. */
@media (max-width: 600px) {
    html:has(body.editor-page), body.editor-page { overscroll-behavior-y: none; }
    .editor-page .unified-editor .mobile-project-back { touch-action: none; }
    .editor-page .unified-editor .note-card-header { touch-action: pan-x; }
}

@media (max-width: 600px) {
    .editor-page .unified-editor .mobile-project-back { display: grid; place-items: center; flex: 0 0 36px; width: 36px; min-width: 36px; height: 36px; margin: 0; border-radius: 50%; background: var(--surface); color: var(--accent); font-size: 28px; font-weight: 300; line-height: 1; }
    .editor-page .unified-editor .note-card-header { flex-wrap: nowrap; }
}

@media (max-width: 600px) {
    .editor-page .unified-editor .mobile-project-back[aria-disabled="true"] { color: var(--muted); opacity: .35; cursor: not-allowed; }
}

/* Standalone appearance setup. */
.setup-card { max-width: 520px; }
.setup-card .section-title { margin-bottom: 22px; }
.setup-card label { display: block; margin-bottom: 7px; }
.setup-card select { width: min(100%, 300px); }

/* Shared page header: app icon and name share the navigation row. */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.site-brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); font-size: 23px; letter-spacing: -.045em; white-space: nowrap; }
.site-brand strong { font-weight: 700; }
.site-brand .brand-mark { width: 36px; height: 36px; border-radius: 11px 11px 11px 3px; padding-bottom: 5px; font-size: 28px; }
.site-header .topbar { flex: 0 0 auto; }
.site-header + .page-heading { margin: 0 0 24px; }
.project-list-header h1 { font-size: clamp(26px, 3vw, 38px); }
@media (max-width: 600px) {
    .site-header { flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
    .site-brand { gap: 7px; font-size: 17px; }
    .site-brand .brand-mark { width: 30px; height: 30px; border-radius: 9px 9px 9px 3px; padding-bottom: 4px; font-size: 23px; }
    .site-header .topbar { margin-left: auto; gap: 5px; }
    .site-header .topbar a { padding: 5px 9px; font-size: 11px; }
}

.project-detail-header { justify-content: flex-end; }

.member-delete-form { margin: 0; }
.member-delete-form .danger { color: #9c4d3b; border-color: #ecd9d2; background: #fffaf7; }
@media (max-width: 900px) { .member-delete-form { width: 100%; } }

/* Desktop projects follow the Mac/iPad split view: folders stay beside notes. */
body:has(.project-split) { padding: 0; background: var(--surface); }
body:has(.project-split) .app-shell { width: 100%; max-width: none; margin: 0; }
body:has(.project-split) .site-header { display: none; }
body:has(.project-split) .app-shell > .message { margin: 12px 20px; }
.project-split { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); min-height: calc(100dvh - 52px); }
.project-sidebar { min-width: 0; padding: 12px 0 20px; border-right: 1px solid var(--line); background: var(--surface); }
.project-sidebar-top { display: flex; align-items: center; gap: 8px; padding: 0 16px 18px; }
.project-sidebar-brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; white-space: nowrap; font-size: 20px; letter-spacing: -.04em; }
.project-sidebar-brand strong { font-weight: 700; }
.project-sidebar-brand .brand-mark { width: 36px; height: 36px; border-radius: 10px 10px 10px 3px; padding-bottom: 5px; font-size: 28px; }
.project-sidebar-actions { display: flex; align-items: center; gap: 3px; margin-left: auto; }
.project-sidebar-actions > a, .project-sidebar-actions .project-create-disclosure > summary { display: grid; place-items: center; width: 33px; height: 33px; min-height: 33px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--accent); font-size: 20px; font-weight: 400; text-decoration: none; }
.project-sidebar-actions svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.project-sidebar-actions > a:hover, .project-sidebar-actions .project-create-disclosure > summary:hover { background: var(--line); }
.project-sidebar h1 { margin: 0 16px 8px; font-size: 27px; font-weight: 700; letter-spacing: -.035em; }
.project-sidebar .project-folder-list { border: 0; border-radius: 0; background: transparent; }
.project-sidebar .project-folder-row { margin: 0 8px; border: 0; border-radius: 8px; }
.project-sidebar .project-folder-row:hover, .project-sidebar .project-folder-row:has(.project-folder-link[aria-current="page"]) { background: color-mix(in srgb, var(--accent) 13%, transparent); }
.project-sidebar .project-folder-link { gap: 10px; padding: 10px 8px; }
.project-sidebar .project-folder-link:hover { border-radius: 8px; background: transparent; }
.project-sidebar .project-folder-link > span:first-child { font-size: 21px; }
.project-sidebar .project-folder-count { font-size: 12px; }
.project-sidebar .project-row-actions { margin-right: 4px; }
.project-sidebar .project-row-actions > summary { width: 30px; height: 30px; border: 0; font-size: 18px; }
.project-sidebar .project-folder-row.drop-target { outline: 2px solid var(--accent); outline-offset: -2px; }
.project-detail { min-width: 0; padding: 20px; background: color-mix(in srgb, var(--surface) 60%, var(--paper)); }
.project-detail-header { justify-content: space-between; margin-bottom: 14px; }
.project-detail-header h2 { margin: 0; font-size: 31px; font-weight: 700; letter-spacing: -.035em; }
.project-detail .project-new-note { min-height: 36px; padding: 6px 12px; background: transparent; }
.project-detail .project-note-list { border-radius: 14px; }
.project-detail .project-note-row { min-height: 48px; }
.project-detail .project-note-link { padding: 11px 16px; }
.project-detail .project-note-link > span:first-child { font-size: 21px; }
.project-mobile-back { display: none; }

@media (max-width: 760px) {
    .project-split { display: block; min-height: calc(100dvh - 52px); }
    .project-split[data-explicit-selection="false"] .project-detail,
    .project-split[data-explicit-selection="true"] .project-sidebar { display: none; }
    .project-sidebar, .project-detail { min-height: calc(100dvh - 52px); border: 0; }
    .project-detail { padding: 16px; }
    .project-mobile-back { display: inline-block; margin-bottom: 12px; color: var(--muted); text-decoration: none; }
    .project-detail-header { flex-direction: row; align-items: center; gap: 10px; }
    .project-detail-header h2 { font-size: 26px; }
    .project-detail .project-new-note { width: auto; flex: none; }
}
