:root {
    --bg: #090a0c;
    --panel: rgba(14, 15, 19, .96);
    --panel-soft: rgba(20, 22, 28, .92);
    --line: #24272f;
    --line-soft: rgba(255, 255, 255, .08);
    --ink: #f1f2f4;
    --text: #c9ccd3;
    --muted: #777d88;
    --muted-2: #545965;
    --accent: #9b8cff;
    --mint: #78e6d2;
    --warn: #ffce8a;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans KR",
        sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100svh;
}

[v-cloak] {
    display: none !important;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

a {
    color: inherit;
}

#board-p5 {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

#app {
    position: relative;
    z-index: 1;
    min-height: 100svh;
}

.board-layout {
    min-height: 100svh;
}

.board-list {
    height: 100svh;
    min-height: 0;
    max-height: 100svh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
}

.board-layout.show-document .board-list {
    display: none;
}

.list-header {
    position: sticky;
    top: 0;
    z-index: 4;
    flex: 0 0 auto;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    background: rgba(12, 13, 16, .98);
}

.list-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
}

.list-title span {
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .12em;
}

.list-title small {
    color: var(--muted-2);
    font-size: 11px;
}

.list-toggle,
.document-close {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
}

.list-toggle:hover,
.document-close:hover {
    background: #1a1d24;
    color: var(--ink);
}

.list-search {
    flex: 0 0 auto;
    padding: 14px 14px 8px;
}

.list-search input,
.write-row input,
.write-row textarea,
.write-row select {
    width: 100%;
    outline: none;
    border: 1px solid #2a2e38;
    border-radius: var(--radius);
    background: #101218;
    color: var(--ink);
}

.list-search input {
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
}

.list-search input::placeholder,
.write-row input::placeholder,
.write-row textarea::placeholder {
    color: #555b67;
}

.list-search input:focus,
.write-row input:focus,
.write-row textarea:focus,
.write-row select:focus {
    border-color: rgba(155, 140, 255, .72);
    box-shadow: 0 0 0 3px rgba(155, 140, 255, .12);
}

.write-button {
    flex: 0 0 auto;
    width: calc(100% - 28px);
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px 14px 10px;
    border: 1px solid rgba(120, 230, 210, .3);
    border-radius: var(--radius);
    background: rgba(120, 230, 210, .08);
    color: #9deee1;
    font-size: 13px;
    font-weight: 700;
}

.write-button:hover {
    border-color: rgba(120, 230, 210, .58);
    background: rgba(120, 230, 210, .12);
}

.category-filter-panel {
    padding: 0 14px 10px;
}

.category-popup-button {
    width: 100%;
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "label count"
        "name count";
    align-items: center;
    gap: 2px 12px;
    padding: 11px 13px;
    border: 1px solid rgba(155, 140, 255, .26);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(155, 140, 255, .12), rgba(120, 230, 210, .06)),
        #151820;
    color: var(--ink);
    text-align: left;
}

.category-popup-button:hover {
    border-color: rgba(155, 140, 255, .54);
    background:
        linear-gradient(135deg, rgba(155, 140, 255, .18), rgba(120, 230, 210, .09)),
        #191d27;
}

.category-popup-button:disabled {
    opacity: .55;
    cursor: wait;
}

.category-popup-button span {
    grid-area: label;
    color: #8c92a1;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
}

.category-popup-button strong {
    grid-area: name;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.category-popup-button em {
    grid-area: count;
    min-width: 52px;
    padding: 7px 8px;
    border-radius: 999px;
    background: rgba(120, 230, 210, .1);
    color: #9deee1;
    font-style: normal;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.tag-filter-panel {
    padding-top: 0;
}

.tag-popup-button {
    border-color: rgba(255, 206, 138, .25);
    background:
        linear-gradient(135deg, rgba(255, 206, 138, .11), rgba(155, 140, 255, .07)),
        #151820;
}

.tag-popup-button:hover {
    border-color: rgba(255, 206, 138, .52);
    background:
        linear-gradient(135deg, rgba(255, 206, 138, .16), rgba(155, 140, 255, .1)),
        #191d27;
}

.tag-popup-button em {
    background: rgba(255, 206, 138, .12);
    color: #ffdda6;
}

.category-section,
.document-list-section {
    padding: 0 10px 14px;
}

.category-section {
    display: none;
}

.document-list-section {
    order: 5;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 10px 14px;
}

.section-title {
    display: flex;
    align-items: center;
    min-height: 32px;
    padding: 0 4px;
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
}

.category-item,
.post-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    gap: 5px;
    padding: 12px 12px 12px 14px;
    color: #adb2bd;
    text-align: left;
}

.category-item {
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 10px;
    color: #9ca1ac;
}

.category-item:hover,
.category-item.active {
    background: #1a1d24;
    color: var(--ink);
}

.category-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}

.category-count {
    color: var(--muted-2);
    font-size: 11px;
}

.post-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    gap: 5px;
    padding: 12px 12px 12px 14px;
    color: #adb2bd;
    text-align: left;
}

.post-item:hover,
.post-item.active {
    background: #191c23;
    color: var(--ink);
}

.post-item.active {
    box-shadow: inset 2px 0 0 var(--accent);
}

.post-title {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    color: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-info {
    width: 100%;
    min-width: 0;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    color: var(--muted-2);
    font-size: 11px;
    text-align: left;
}

.post-info span {
    min-width: 0;
    max-width: 62%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-info span:last-child {
    flex: 0 0 auto;
    max-width: 38%;
}

.post-empty {
    padding: 28px 12px;
    color: var(--muted-2);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 520px) {
    .post-info span:first-child {
        display: none;
    }

    .post-info span:last-child {
        max-width: 100%;
    }
}

.pagination {
    order: 4;
    position: static;
    flex: 0 0 auto;
    z-index: 1;
    display: flex;
    justify-content: flex-start;
    gap: 4px;
    max-width: 100%;
    margin: 0 10px 10px;
    padding: 8px 0 10px;
    overflow-x: auto;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
}

.pagination button {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 12px;
}

.pagination button:hover:not(:disabled),
.pagination button.active {
    background: #262a34;
    color: var(--ink);
}

.pagination button:disabled {
    opacity: .3;
    cursor: default;
}

.board-main {
    min-height: 100svh;
}

.open-list-button {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 12;
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: rgba(13, 15, 20, .9);
    color: #cbd0da;
    font-size: 13px;
    backdrop-filter: blur(10px);
}

.open-list-button:hover {
    background: #1b1e26;
    color: var(--ink);
}

.empty-document {
    min-height: 100svh;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 32px 20px;
    text-align: center;
}

.empty-title {
    color: #454b57;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: .16em;
}

.empty-text {
    margin-top: 12px;
    color: #565c68;
    font-size: 13px;
}

.document,
.write-document {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 64px 18px 80px;
}

.document-header {
    position: relative;
    padding-bottom: 24px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--line);
}

.document-category {
    margin-bottom: 10px;
    color: #878d99;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.document-header h1 {
    margin: 0;
    padding-right: 42px;
    color: var(--ink);
    font-size: clamp(24px, 8vw, 36px);
    font-weight: 800;
    line-height: 1.32;
    letter-spacing: -.03em;
}

.document-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 12px;
    margin-top: 14px;
    color: #676e7a;
    font-size: 12px;
}

.document-meta span + span::before {
    content: "·";
    margin-right: 12px;
    color: #3d424c;
}

.document-close {
    position: absolute;
    top: -4px;
    right: 0;
}

.document-body {
    min-width: 0;
}

.board-content {
    color: #c9ccd3;
    font-size: 15px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.board-content-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid rgba(143, 151, 166, .16);
}

.board-content-tag {
    --tag-hue: 270;
    --tag-delay: 0s;
    min-height: 30px;
    padding: 0 12px;
    border: 1px solid hsl(var(--tag-hue) 85% 70% / .45);
    border-radius: 999px;
    background: #202020;
    color: hsl(var(--tag-hue) 90% 78%);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 14px hsl(var(--tag-hue) 90% 65% / .12);
    animation: contentTagFlicker 5.8s ease-in-out var(--tag-delay) infinite;
}

.board-content-tag:hover,
.board-content-tag:focus-visible {
    border-color: hsl(var(--tag-hue) 92% 74% / .8);
    color: hsl(var(--tag-hue) 96% 86%);
    box-shadow: 0 0 22px hsl(var(--tag-hue) 92% 68% / .26);
    opacity: 1;
    filter: saturate(1.3) brightness(1.18);
    transform: translateY(-1px);
}

@keyframes contentTagFlicker {
    0%, 100% {
        opacity: .48;
        filter: saturate(.65) brightness(.75);
        box-shadow: 0 0 14px hsl(var(--tag-hue) 90% 65% / .12);
    }
    12%, 38% {
        opacity: 1;
        filter: saturate(1.25) brightness(1.15);
        box-shadow: 0 0 24px hsl(var(--tag-hue) 90% 65% / .22);
    }
    52%, 72% {
        opacity: .22;
        filter: saturate(.5) brightness(.7);
        box-shadow: 0 0 10px hsl(var(--tag-hue) 90% 65% / .08);
    }
    84% {
        opacity: .78;
        filter: saturate(1) brightness(1);
        box-shadow: 0 0 18px hsl(var(--tag-hue) 90% 65% / .16);
    }
}

@media (prefers-reduced-motion: reduce) {
    .board-content-tag {
        animation: none;
    }
}

.board-content + .board-content {
    margin-top: 48px;
}

.board-content h1,
.board-content h2,
.board-content h3,
.board-content h4 {
    color: var(--ink);
    font-weight: 800;
    line-height: 1.4;
}

.board-content h1 {
    margin: 38px 0 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    font-size: 24px;
}

.board-content h2 {
    margin: 34px 0 15px;
    font-size: 21px;
}

.board-content h3 {
    margin: 28px 0 11px;
    font-size: 18px;
}

.board-content h4 {
    margin: 24px 0 10px;
    font-size: 16px;
}

.board-content p {
    margin: 0 0 18px;
}

.board-content strong {
    color: var(--ink);
}

.board-content a {
    color: #b7c0ff;
    text-decoration: none;
}

.board-content a:hover {
    text-decoration: underline;
}

.board-content ul,
.board-content ol {
    margin: 0 0 20px;
    padding-left: 24px;
}

.board-content li {
    margin: 5px 0;
}

.board-content blockquote {
    margin: 22px 0;
    padding: 12px 16px;
    border-left: 3px solid #4b5160;
    background: rgba(17, 19, 24, .88);
    color: #9ba1ad;
}

.board-content hr {
    margin: 34px 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.board-content table {
    width: 100%;
    min-width: 540px;
    margin: 24px 0;
    border-collapse: collapse;
    font-size: 13px;
}

.board-content th,
.board-content td {
    padding: 9px 11px;
    border: 1px solid var(--line);
    text-align: left;
}

.board-content th {
    background: #151821;
    color: #e2e5ec;
    font-weight: 700;
}

.board-content td {
    color: #bdc1ca;
}

.board-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 24px auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #111318;
}

.board-content figure {
    margin: 24px 0;
}

.board-content > table,
.board-content .table-wrap {
    overflow-x: auto;
}

.code-block,
.board-content > pre {
    margin: 24px -4px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #0d0f13;
}

.code-header {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px 0 13px;
    border-bottom: 1px solid var(--line);
    background: #151821;
}

.code-language {
    color: #7f8794;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
}

.code-copy {
    min-height: 26px;
    padding: 0 9px;
    border-radius: 6px;
    color: #858c99;
    font-size: 11px;
}

.code-copy:hover {
    background: #252a34;
    color: var(--ink);
}

.code-block pre,
.board-content > pre {
    margin: 0;
    padding: 15px;
    overflow-x: auto;
    background: transparent;
}

.code-block code,
.board-content > pre code {
    font-family:
        "Cascadia Code",
        "Consolas",
        monospace;
    font-size: 12.5px;
    line-height: 1.65;
}

.write-form {
    display: grid;
    gap: 15px;
}

.write-row {
    display: grid;
    gap: 7px;
}

.write-row label {
    color: #a9aeb9;
    font-size: 12px;
    font-weight: 700;
}

.write-row input,
.write-row select {
    min-height: 42px;
    padding: 0 12px;
}

.write-row textarea {
    min-height: 260px;
    padding: 12px;
    resize: vertical;
    line-height: 1.65;
}

.write-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 5px;
}

.write-actions button {
    min-height: 44px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    background: #171a21;
    color: #c4c9d3;
    font-weight: 700;
}

.write-actions button.primary {
    border-color: rgba(155, 140, 255, .65);
    background: var(--accent);
    color: #171521;
}

.write-actions button:disabled {
    opacity: .55;
    cursor: default;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #090a0c;
}

::-webkit-scrollbar-thumb {
    background: #2a2f3a;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3b414d;
}

@media (min-width: 801px) {
    .board-layout {
        display: grid;
        grid-template-columns: 320px minmax(0, 1fr);
        min-height: 100vh;
        transition: grid-template-columns .24s ease;
    }

    .board-layout.list-collapsed {
        grid-template-columns: 0 minmax(0, 1fr);
    }

    .board-layout.show-document .board-list {
        display: flex;
    }

    .board-list {
        position: sticky;
        top: 0;
        height: 100vh;
        min-height: 0;
        max-height: 100vh;
        overflow: hidden;
        border-right: 1px solid var(--line);
        border-bottom: 0;
    }

    .board-layout.list-collapsed .board-list {
        opacity: 0;
        border-right-color: transparent;
        pointer-events: none;
    }

    .category-section {
        display: none;
    }

    .document-list-section {
        order: 5;
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0 10px 14px;
    }

    .pagination {
        position: static;
        left: auto;
        right: auto;
        bottom: auto;
        margin: 0 10px 10px;
        padding: 8px 0 10px;
        border: 0;
        border-bottom: 1px solid var(--line-soft);
        border-radius: 0;
        background: transparent;
    }

    .board-main {
        position: relative;
        min-width: 0;
        min-height: 100vh;
        padding-bottom: 100px;
    }

    .open-list-button {
        display: none;
    }

    .board-layout.list-collapsed .open-list-button {
        display: inline-flex;
    }

    .empty-document {
        display: flex;
    }

    .document,
    .write-document {
        padding: 70px 50px 120px;
    }

    .code-block,
    .board-content pre {
        margin-left: -4px;
        margin-right: -4px;
    }
}

@media (min-width: 1180px) {
    .board-layout {
        grid-template-columns: 340px minmax(0, 1fr);
    }

    .document,
    .write-document {
        padding-left: 64px;
        padding-right: 64px;
    }
}


.document-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-bottom: 12px; }
.document-actions button { padding: 7px 12px; border: 1px solid #b94b4b; border-radius: 6px; background: transparent; color: #b94b4b; cursor: pointer; }
.document-actions button:disabled { opacity: 0.5; cursor: wait; }

.board-auth { padding: 12px 16px; border-bottom: 1px solid rgba(128,128,128,.2); }
.board-auth form { display: grid; gap: 8px; }
.board-auth input { width: 100%; min-width: 0; box-sizing: border-box; padding: 8px; border: 1px solid #aaa; border-radius: 6px; }
.board-auth button { padding: 7px 12px; border: 1px solid #888; border-radius: 6px; cursor: pointer; }
.board-auth button:disabled { opacity: .5; cursor: wait; }
.board-auth small { opacity: .7; }
.board-auth p { color: #b94b4b; font-size: 13px; }

/* Confirmation and feedback */
.board-dialog {
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100svh - 48px);
    padding: 28px;
    margin: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #14161c;
    color: var(--text);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}
.board-dialog[open] { animation: board-pop-in .18s ease-out; }
.board-dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(5px); }
.board-dialog-icon {
    display: grid; place-items: center;
    width: 48px; height: 48px; margin-bottom: 20px;
    border-radius: 14px; background: rgba(255, 117, 128, .1); color: #ff939b;
}
.board-dialog h2 { margin: 0 0 14px; color: var(--ink); font-size: 21px; letter-spacing: -.5px; }
.board-dialog p { margin: 0; font-size: 14px; line-height: 1.7; color: #a7adb9; }
.board-dialog .board-dialog-document {
    margin-bottom: 8px; color: var(--ink);
    overflow-wrap: anywhere; max-height: 96px; overflow: auto;
}
.board-dialog-actions { display: flex; gap: 10px; margin-top: 28px; }
.board-dialog-actions button {
    flex: 1; min-height: 44px; border: 1px solid var(--line);
    border-radius: 9px; background: #20232c; font-size: 14px;
}
.board-dialog-actions button:hover { background: #2b2f3a; }
.board-dialog-actions .danger { border-color: transparent; background: #ed8590; color: #241114; font-weight: 700; }
.board-dialog-actions .danger:hover { background: #ff9ba5; }
.board-dialog button:focus-visible, .board-toast button:focus-visible,
.category-dialog button:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 3px;
}

.category-dialog {
    width: min(760px, calc(100vw - 28px));
    height: min(650px, calc(100svh - 32px));
    padding: 0;
    margin: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #11141b;
    color: var(--text);
    box-shadow: 0 28px 90px rgba(0, 0, 0, .58);
    overflow: hidden;
}

.category-dialog[open] { animation: board-pop-in .18s ease-out; }
.category-dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(6px); }
.category-dialog-shell {
    position: relative;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.category-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--line);
}

.category-dialog-header span {
    display: block;
    margin-bottom: 7px;
    color: #8c92a1;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
}

.category-dialog-header h2 {
    margin: 0;
    color: var(--ink);
    font-size: 22px;
    letter-spacing: -.04em;
}

.category-dialog-header p {
    margin: 6px 0 0;
    color: #9ca5b6;
    font-size: 13px;
}

.category-dialog-header button {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #1b1f29;
    color: #b8bfcd;
    font-size: 24px;
    line-height: 1;
}

.category-dialog-header button:hover {
    background: #262b38;
    color: var(--ink);
}

.category-bubble-canvas {
    position: relative;
    min-height: 330px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(155, 140, 255, .05), transparent 36%),
        #0d1017;
}

.category-bubble-canvas canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    cursor: pointer;
}

.category-bubble-empty {
    position: absolute;
    inset: 92px 24px 92px;
    display: grid;
    place-items: center;
    color: #8c92a1;
    pointer-events: none;
}

.category-bubble-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 18px 18px;
    border-top: 1px solid var(--line);
    background: #141821;
}

.category-bubble-list button {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid #303745;
    border-radius: 999px;
    background: #1b202b;
    color: #b8c0ce;
    font-size: 12px;
}

.category-bubble-list button:hover,
.category-bubble-list button.active {
    border-color: rgba(120, 230, 210, .6);
    background: rgba(120, 230, 210, .1);
    color: #dffffa;
}

.category-bubble-list span {
    margin-left: 4px;
    color: #83dccc;
    font-weight: 800;
}

.board-toast-region {
    position: fixed; bottom: calc(24px + env(safe-area-inset-bottom));
    left: 50%; transform: translateX(-50%);
    width: min(460px, calc(100vw - 32px)); z-index: 1000; pointer-events: none;
}
.board-toast {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    background: #1b1e26; color: var(--ink);
    border: 1px solid #554049; border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
    pointer-events: auto; animation: board-pop-in .18s ease-out;
    font-size: 14px; line-height: 1.5; overflow-wrap: anywhere;
}
.board-toast.is-success { border-color: #34534e; }
.board-toast-icon { flex-shrink: 0; color: #ff939b; font-weight: 700; font-size: 18px; }
.board-toast.is-success .board-toast-icon { color: var(--mint); }
.board-toast button { margin-left: auto; flex-shrink: 0; min-width: 36px; min-height: 36px; font-size: 22px; color: #a7adb9; }
@keyframes board-pop-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
    .board-dialog[open], .category-dialog[open], .board-toast { animation: none; }
}

.document-actions .edit-button { border-color: #537da9; color: #537da9; }

/* Shared write/edit tools */
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }
.editor-toolbar button, .editor-uploads button { padding: 8px 12px; border: 1px solid #3b4658; border-radius: 6px; background: #1b2230; color: #d6dfed; cursor: pointer; }
.editor-toolbar button:hover, .editor-uploads button:hover { background: #29364a; }
.editor-toolbar button:focus-visible, .editor-uploads button:focus-visible { outline: 2px solid #8bbcff; outline-offset: 2px; }
.editor-toolbar button:disabled { opacity: .5; cursor: wait; }
.editor-toolbar input[hidden] { display: none; }
.editor-help { margin: 0; font-size: 12px; line-height: 1.6; color: #9ba8ba; }
.editor-uploads { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.editor-uploads li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px; border: 1px solid #3b4658; border-radius: 6px; }
.editor-uploads span { flex: 1 1 180px; overflow-wrap: anywhere; font-size: 13px; }
.editor-preview { width: 100%; height: 420px; border: 1px solid #3b4658; border-radius: 8px; background: #111318; }
#board-content-input { font-family: Consolas, monospace; tab-size: 4; }
/* Markdown inline code and read-only task lists */
.board-content :not(pre) > code { padding: 2px 5px; border-radius: 4px; background: #252c38; color: #dde6f5; font-family: Consolas, monospace; font-size: .9em; }
.board-content li:has(> input[type="checkbox"]) { list-style: none; }
.board-content input[type="checkbox"] { margin-right: 8px; accent-color: #8bbcff; vertical-align: middle; }
.board-content h5, .board-content h6 { color: var(--ink); line-height: 1.4; }
.board-content table { display: block; width: max-content; max-width: 100%; min-width: 0; overflow-x: auto; }
.editor-templates { padding: 12px; border: 1px solid #344158; border-radius: 8px; background: #141b27; }
.editor-template-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 9px; }
.editor-template-heading span { color: #d6dfed; font-size: 12px; font-weight: 700; }
.editor-template-heading small { color: #9ba8ba; font-size: 11px; }
/* Replies share an idx; rep is a sequence number, not a nesting depth. */
.post-item.is-reply { padding-left: 22px; border-left: 2px solid #425e7f; }
.reply-label { display: inline-block; margin-right: 5px; color: #91b9e8; font-size: 11px; font-weight: 700; }
.thread-summary { margin: 0 0 22px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px; color: #a8b7cc; font-size: 12px; }
.document-part { min-width: 0; scroll-margin-top: 24px; }
.document-part + .document-part { margin-top: 36px; padding-top: 26px; border-top: 1px solid #354051; }
.document-part.is-reply { margin-left: 24px; padding-left: 20px; border-left: 3px solid #425e7f; }
.document-part.is-reply.is-selected { border-left-color: #91b9e8; }
.document-part:focus-visible { outline: 2px solid #91b9e8; outline-offset: 5px; }
.document-part-header { margin-bottom: 18px; }
.part-badge { display: inline-block; padding: 3px 8px; border: 1px solid #455064; border-radius: 5px; color: #a8b7cc; font-size: 11px; font-weight: 700; }
.part-badge.is-reply { color: #a9cbf3; border-color: #425e7f; background: #182638; }
.document-part-header h2 { margin: 10px 0 8px; color: var(--ink); font-size: 20px; line-height: 1.45; overflow-wrap: anywhere; }
.part-meta { display: flex; flex-wrap: wrap; gap: 12px; color: #8b96a8; font-size: 12px; }
@media (max-width: 600px) {
    .category-dialog {
        width: calc(100vw - 18px);
        height: calc(100svh - 18px);
        border-radius: 14px;
    }
    .category-dialog-header {
        padding: 18px 18px 14px;
    }
    .category-bubble-list {
        max-height: 132px;
        overflow: auto;
        padding: 12px;
    }
    .document-part.is-reply { margin-left: 8px; padding-left: 12px; }
    .document-part-header h2 { font-size: 18px; }
}