:root {
    --text: #222;
    --muted: #737373;
    --muted-2: #666;
    --line: #e8e8e8;
    --panel: #fafafa;
    --card: #fafbfc;
    --accent: #258cfb;
    --link: #0071c1;
    --dark: #111;
    --bar: #24282f;
    --navigation-height: calc(64px + env(safe-area-inset-bottom, 0px));
    --mobile-header-height: calc(64px + env(safe-area-inset-top, 0px));
    --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --mono: Consolas, ui-monospace, SFMono-Regular, Menlo, Monaco, "Liberation Mono", "Courier New", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    display: flex;
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 16px;
    color: var(--text);
    background: #fff;
}

a { color: var(--accent); font-weight: 500; text-decoration: none; }
a:hover { text-decoration: underline; }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [contenteditable]:focus-visible {
    outline: 2px solid var(--link);
    outline-offset: 3px;
}

h1 { font-size: 30px; line-height: 36px; font-weight: 700; margin: 0 0 16px; }
h1:focus { outline: none; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.mini-icon { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: fixed;
    top: -100px;
    left: 16px;
    z-index: 2100;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
}
.skip-link:focus { top: 12px; }

.mobile-masthead, #appbar, .panel-close { display: none; }

#site-navigation {
    position: sticky;
    top: 0;
    display: flex;
    height: 100dvh;
    max-height: 100dvh;
    flex-shrink: 0;
}

#site-navigation > .column {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 220px;
    height: 100%;
    padding: 16px;
    overflow-y: auto;
    background: var(--panel);
    border-right: 1px solid #eeeeeeee;
    font-size: 13px;
    scrollbar-width: thin;
    scrollbar-color: #d1d1d1 transparent;
    overscroll-behavior: contain;
}
#site-navigation > .column.secondary { width: 300px; }

#site-navigation .sidebar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 14px;
    margin: 1px 0 24px 8px;
}

#site-navigation > .column > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 6px;
    color: #555;
    font-weight: 400;
    text-decoration: none;
    flex-shrink: 0;
}
#site-navigation > .column > a:hover:not(.active) { background: #eee; }
#site-navigation > .column > a.active { background: var(--dark); color: #fff; }
#site-navigation > .column > a > icon { width: 18px; font-size: 15px; }
#site-navigation > .column > a > icon svg { display: block; }
#site-navigation > .column > a > span { flex: 1; min-width: 0; }
#site-navigation > .column > a > external { display: inline-flex; color: #999; }

#site-navigation > .column > h2 {
    margin: 32px 0 16px;
    padding: 0 12px;
    font-size: 11.2px;
    font-weight: 700;
    color: #6b6b6b;
}

#site-navigation .bottom_bar {
    margin: auto -16px -16px;
    padding: 16px;
    border-top: 1px solid #e5e5e5;
    flex-shrink: 0;
}
.sidebar-sign-in { min-height: 44px; display: flex; align-items: center; }
.sidebar-sign-in .sign-in-link { color: #555; font-weight: 500; padding: 8px 12px; }
.sidebar-sign-in .signed-in { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; }
.sidebar-sign-in .signed-in .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sign-in-button { min-height: 44px; }
.legal-links { display: flex; gap: 6px; margin-top: 10px; padding: 0 12px; font-size: 12px; color: #999; }
.legal-links a { color: var(--muted); font-weight: 400; }
.legal-note { margin: 12px 0 0 !important; font-size: 12px; color: var(--muted); line-height: 1.5; }
.legal-note a { color: var(--muted-2); font-weight: 400; text-decoration: underline; text-underline-offset: 2px; }
.legal-page .content h2 { font-size: 1.15rem; }
.legal-page .content li { margin-bottom: 6px; }

#site-navigation .archive-toolbar {
    position: sticky;
    top: -16px;
    z-index: 2;
    background: var(--panel);
    margin: -16px 0 8px;
    padding: 16px 0 12px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 -16px 0 var(--panel);
    flex-shrink: 0;
}
.sidebar-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 24px;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 14px;
}
.sidebar-heading > .title { flex: 1; }

.post-search { display: block; position: relative; }
.post-search input {
    width: 100%;
    min-width: 0;
    border: 1px solid #dedede;
    border-radius: 6px;
    background: #fff;
    padding: 9px 10px;
    color: var(--text);
}
.post-search input::placeholder { color: var(--muted); }
.search-shortcut {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    padding: 0 5px;
    font-size: 11px;
    font-family: var(--font);
    color: var(--muted);
    pointer-events: none;
}
.post-search:focus-within .search-shortcut,
.post-search:has(input:not(:placeholder-shown)) .search-shortcut { display: none; }
.search-status { margin: 10px 0 0; color: var(--muted-2); font-size: 12px; }

#site-navigation > .column > h2.archive-year {
    margin: 20px 12px 4px;
    padding: 0;
    font-size: 11px;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

#site-navigation > .column > a.card { padding: 8px 12px; }
#site-navigation .card > .column {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 3px 12px;
    width: 100%;
    min-width: 0;
    line-height: 1.45;
}
#site-navigation .card .title { grid-column: 1 / -1; overflow-wrap: anywhere; color: var(--text); }
#site-navigation .card .meta { font-size: 12px; color: var(--muted); }
#site-navigation .card .right { font-size: 11px; color: var(--muted); }
#site-navigation .card .comments { display: inline-flex; align-items: center; gap: 3px; }
#site-navigation .card .comments icon { font-size: 13px; }
#site-navigation .card.active .title { color: #fff; }
#site-navigation .card.active .meta, #site-navigation .card.active .right { color: #ddd; }

#site-navigation .empty-search { padding: 12px; color: var(--muted-2); }
.empty-search p { margin: 0 0 12px; }
.empty-search button { min-height: 44px; padding: 8px 14px; border: 1px solid #ddd; border-radius: 6px; background: #fff; color: #333; }

#site-body { flex: 1; min-width: 0; margin-bottom: 6rem; }
#site-body:focus { outline: none; }
#site-body > article.page { width: 100%; min-width: 0; }

.page-content-normal {
    max-width: 740px;
    margin: clamp(3rem, 7vw, 7rem) auto;
    padding: 0 32px;
    line-height: 1.7;
}
.page-content-wide {
    max-width: 1100px;
    margin: clamp(2rem, 5vw, 4rem) auto;
    padding: 0 32px;
    line-height: 1.6;
}

.page-header .title { margin: 0 0 8px; font-size: 32px; line-height: 1.2; }
.page-header .lede { margin: 0; color: var(--muted-2); }
.page-header .meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 16px;
    font-size: 14px;
    color: var(--muted);
}
.page-header .meta a { color: var(--muted-2); font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }

.post-heading { display: flex; align-items: flex-start; gap: 12px; }
.post-heading .title { flex: 1; min-width: 0; }
.post-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 7px;
    color: var(--muted);
}
.post-edit:hover { background: #f0f2f5; }
.post-action svg, .post-edit svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.post-actions { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.post-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 9px 12px;
    border: 1px solid #e4e6ea;
    border-radius: 7px;
    background: var(--card);
    color: #555;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    text-decoration: none;
    cursor: pointer;
}
.post-action:hover { background: #f0f2f5; border-color: #cdd2da; text-decoration: none; }
.post-action:disabled { cursor: wait; opacity: 0.65; }
.post-action[data-success] { color: #276545; border-color: #bad8c7; background: #f1f8f4; }

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 9px 18px;
    border: 1px solid var(--dark);
    border-radius: 7px;
    background: var(--dark);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.primary-button:hover { background: #333; text-decoration: none; }
.primary-button:disabled { opacity: 0.5; cursor: default; }

.link-button { border: 0; background: none; padding: 4px 6px; color: var(--muted-2); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.link-button:hover { color: var(--text); }

.draft-banner {
    margin-bottom: 24px;
    padding: 10px 14px;
    border: 1px solid #f1d18a;
    border-radius: 7px;
    background: #fff8e6;
    color: #7a5600;
    font-size: 14px;
}

.page-content-normal > .content { padding-top: 20px; }
.content { overflow-wrap: break-word; }
.content p { margin: 0 0 1.25em; }
.content h2 { font-size: 1.3rem; line-height: 1.35; margin: 2.2rem 0 0.75rem; }
.content h3 { font-size: 1.1rem; margin: 1.8rem 0 0.6rem; }
.content a { color: var(--link); font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
.content img { max-width: 100%; height: auto; border-radius: 4px; cursor: zoom-in; display: block; }
.content figure { margin: 1.75em 0; }
.content figure img { margin: 0 auto; }
.content figcaption { margin-top: 8px; text-align: center; font-size: 13px; color: var(--muted); }
.content > img { margin: 1.75em 0; }
.content pre {
    margin: 1.5em 0;
    padding: 8px 16px;
    overflow-x: auto;
    border-radius: 4px;
    background: #222;
    color: #eee;
    font-size: 14px;
    line-height: 1.55;
    font-family: var(--mono);
}
.content pre code, .content pre code.hljs { padding: 0; background: transparent; font-size: inherit; color: inherit; }
.content pre code.hljs { color: #eee; }
.content :not(pre) > code { padding: 1px 5px; border-radius: 4px; background: #f1f2f4; font-family: var(--mono); font-size: 0.9em; }
.content blockquote { margin: 1.5em 0; padding: 4px 0 4px 18px; border-left: 3px solid #ddd; color: #555; }
.content blockquote p:last-child { margin-bottom: 0; }
.content blockquote cite { display: block; margin-top: 6px; font-size: 14px; font-style: normal; color: var(--muted); }
.content blockquote cite::before { content: "- "; }
.content ul, .content ol { padding-left: 1.4em; margin: 0 0 1.25em; }
.content table { border-collapse: collapse; margin: 1.5em 0; font-size: 14px; }
.content td, .content th { border: 1px solid var(--line); padding: 6px 10px; }
.content .embed iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 4px; }
.content .embed video { display: block; width: 100%; border-radius: 4px; }
.content iframe { max-width: 100%; }

.post-pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 36px 0 0; }
.post-pagination a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--panel);
    color: var(--text);
    text-decoration: none;
    line-height: 1.45;
}
.post-pagination a:hover { background: #f2f3f5; border-color: #d8dbe0; }
.post-pagination .direction { font-size: 12px; color: var(--muted); font-weight: 400; }
.post-pagination .post-link-title { font-weight: 600; }
.post-pagination .newer-post { grid-column: 2; text-align: right; }

.comments-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin: 56px 0 32px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}
.comments-heading { display: flex; align-items: center; gap: 10px; }
.comments-heading icon { width: 32px; height: 32px; border-radius: 50%; background: #eee; color: var(--muted); }
.comments-heading icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.comments-toolbar h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 20px; }
.comments-count { border-radius: 5px; background: #f0f0f0; padding: 2px 7px; color: var(--muted-2); font-size: 12px; font-weight: 400; }
.comment-sort select { min-height: 40px; padding: 8px 28px 8px 10px; border: 1px solid #ddd; border-radius: 6px; background: #fff; color: #555; font-size: 13px; cursor: pointer; }
.empty-comments { margin: 0; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--muted-2); }

.comment-entry { position: relative; margin: 0 0 32px; padding: 10px 0 0 60px; scroll-margin-top: 24px; }
.comment-entry[data-linked-comment] { background: #f4f7fa; box-shadow: 0 0 0 12px #f4f7fa; border-radius: 4px; }
.comment-entry > .avatar { position: absolute; left: 0; top: 10px; }
.comment-entry > .header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.comment-entry .displayname { font-weight: 700; }
.comment-entry .date { font-size: 14px; color: var(--muted); }
.comment-entry .date a { color: inherit; font-weight: 400; }
.comment-entry .body { padding-top: 4px; min-width: 0; line-height: 1.6; overflow-wrap: anywhere; }
.comment-entry .body .content img { max-height: 420px; width: auto; margin-top: 8px; }
.comment-admin { display: flex; gap: 6px; margin-left: auto; }
.comment-admin button, .row-actions button {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background: #fff;
    padding: 3px 9px;
    font-size: 12px;
    color: #555;
}
.comment-admin button:hover, .row-actions button:hover { background: #f4f4f4; }
.row-actions button.danger, .comment-admin button.danger { color: #b42318; border-color: #f2c9c4; }

.avatar-img { display: block; border-radius: 50%; object-fit: cover; }
.avatar-initial {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #eee;
    color: var(--muted-2);
    font-size: 20px;
    font-weight: 600;
}

.comment-compose { margin-top: 36px; padding-top: 24px; border-top: 1px solid #eee; }
.comment-compose h2 { margin: 0 0 8px; font-size: 20px; }
.compose-form { display: flex; flex-direction: column; gap: 10px; }
.compose-who { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted-2); }
.compose-form textarea {
    width: 100%;
    min-height: 110px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 7px;
    resize: vertical;
    line-height: 1.6;
}
.compose-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.compose-actions .spacer { flex: 1; }
.form-error { margin: 8px 0; color: #b42318; font-size: 14px; }

.post-footer { margin: 32px 0 0; text-align: right; }
.post-footer a { color: var(--muted-2); font-weight: 400; }

.home-intro p { margin: 0 0 1em; }
.home-intro a { font-weight: 500; }
.home-section { margin-top: 3rem; }
.home-section > h2 { margin: 0 0 12px; font-size: 14px; font-weight: 600; color: var(--muted-2); }
.home-section p { margin: 0 0 1em; }

.home-posts-list {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    overflow: hidden;
}
.home-post-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
}
.home-post-link:last-child { border-bottom: 0; }
.home-post-link:hover { background: #f2f4f7; text-decoration: none; }
.home-post-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.5; }
.home-post-title { font-weight: 500; font-size: 15px; }
.home-post-text time { font-size: 12px; color: var(--muted); font-weight: 400; }
.home-post-link svg { flex-shrink: 0; fill: none; stroke: #8a8a8a; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.home-empty { margin: 0; padding: 16px; color: var(--muted-2); }
.home-posts-links { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; }
.home-rss { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-2); font-weight: 400; }
.home-rss svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.home-map { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.home-map iframe { display: block; border: 0; }
.home-map figcaption { padding: 10px 14px; background: var(--card); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted-2); }

.archive-page .archive-year { margin: 32px 0 10px; font-size: 13px; letter-spacing: 0.05em; color: #6b6b6b; }

.places-page .page-header { margin-bottom: 28px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 28px; }
.stat-card { display: flex; flex-direction: column; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); line-height: 1.4; }
.stat-card h2 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.stat-card strong { font-size: 24px; }
.stat-card span { font-size: 13px; color: var(--muted-2); }
.map-legend { display: flex; gap: 18px; margin-bottom: 10px; font-size: 13px; color: var(--muted-2); }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.dot.visited { background: #2563eb; }
.dot.want { background: #f59e0b; }
.world-map { margin: 0 0 32px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f4f7fa; }
.world-map svg { display: block; width: 100%; height: auto; }
.world-map .pin circle { stroke: #fff; stroke-width: 1.5; }
.world-map .pin.visited circle { fill: #2563eb; }
.world-map .pin.want circle { fill: #f59e0b; }
.places-list h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 24px 0 10px; }
.places-list ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; }
.places-list li { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.places-list li span { color: var(--muted); font-size: 13px; }

.login-page .login-block { margin-top: 28px; padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.login-block h2 { margin: 0 0 8px; font-size: 16px; }
.login-block p { margin: 0 0 14px; color: var(--muted-2); }
.login-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.login-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted-2); flex: 1; min-width: 200px; }

input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
    padding: 9px 10px;
    border: 1px solid #dedede;
    border-radius: 6px;
    background: #fff;
    min-height: 40px;
}

.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-header-actions { display: flex; gap: 10px; }
.admin-page section { margin-bottom: 40px; }
.admin-page section > h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 0 0 12px; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--card); }
.admin-table th, .admin-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table td:first-child { white-space: normal; min-width: 220px; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .num { text-align: right; }
.row-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; font-size: 13px; }
.status { display: inline-block; padding: 2px 8px; border-radius: 5px; font-size: 12px; font-weight: 500; background: #f0f0f0; color: #555; }
.status.live { background: #e8f5ec; color: #276545; }
.status.draft { background: #fff3d6; color: #7a5600; }
.status.scheduled { background: #e6f0ff; color: #1d4f9c; }
.status.banned { background: #fdecea; color: #b42318; }
.admin-comments { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; }
.admin-comment { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.admin-comment:last-child { border-bottom: 0; }
.admin-comment-body { flex: 1; min-width: 0; font-size: 14px; }
.admin-comment-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; color: var(--muted); font-size: 13px; }
.admin-comment-meta strong { color: var(--text); }
.admin-comment-body p { margin: 4px 0 0; overflow-wrap: anywhere; }

.place-form { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted-2); }
.form-actions { display: flex; gap: 10px; margin-top: 12px; }
.hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.editor-page { max-width: 900px; }
.editor-topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0 -12px 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--line);
}
.editor-topbar .spacer { flex: 1; }
.save-state { font-size: 12px; color: var(--muted); }
.editor-meta { margin-bottom: 20px; }
.title-input {
    width: 100%;
    border: 0 !important;
    padding: 0 !important;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
    background: transparent !important;
}
.title-input:focus { outline: none; }
.meta-fields { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; align-items: flex-end; }
.meta-fields label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.meta-fields label.check { flex-direction: row; align-items: center; gap: 6px; min-height: 40px; font-size: 13px; color: #555; }

.format-bar {
    position: sticky;
    top: 70px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.format-bar button { min-width: 34px; min-height: 32px; padding: 4px 9px; border: 0; border-radius: 5px; background: transparent; color: #444; font-size: 13px; }
.format-bar button:hover { background: #f0f2f5; }
.format-bar .hint { margin: 0 0 0 auto; padding-right: 6px; }

.blocks { display: flex; flex-direction: column; gap: 6px; }
.block { position: relative; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; }
.block:hover, .block:focus-within { border-color: var(--line); background: #fcfcfd; }
.block-tools {
    position: absolute;
    top: -14px;
    right: 8px;
    display: none;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 2px 8px #0000000f;
    z-index: 3;
}
.block:hover .block-tools, .block:focus-within .block-tools { display: flex; }
.block-tools select { min-height: 28px !important; padding: 2px 6px !important; font-size: 12px; }
.block-tools button { min-width: 28px; min-height: 28px; border: 0; border-radius: 5px; background: transparent; color: #555; font-size: 13px; }
.block-tools button:hover:not(:disabled) { background: #f0f2f5; }
.block-tools button:disabled { opacity: 0.3; cursor: default; }
.block-tools button.danger { color: #b42318; }
.block-body { display: flex; flex-direction: column; gap: 8px; }
.rich { min-height: 1.7em; line-height: 1.7; outline: none; white-space: pre-wrap; overflow-wrap: break-word; }
.rich.is-empty::before { content: attr(data-placeholder); color: #aaa; pointer-events: none; position: absolute; }
.rich a { color: var(--link); text-decoration: underline; }
.rich code { padding: 1px 5px; border-radius: 4px; background: #f1f2f4; font-family: var(--mono); font-size: 0.9em; }
.rich.quote { padding-left: 16px; border-left: 3px solid #ddd; color: #555; }
.heading-input { border: 0 !important; padding: 0 !important; background: transparent !important; font-size: 1.3rem; font-weight: 700; min-height: auto !important; }
.heading-input:focus { outline: none; }
.code-input { width: 100%; font-family: var(--mono); font-size: 14px; line-height: 1.55; background: #222 !important; color: #eee; border-color: #222 !important; resize: vertical; tab-size: 4; }
.caption { font-size: 13px; }
.caption.lang { max-width: 320px; }
.image-preview { max-width: 100%; max-height: 420px; border-radius: 4px; display: block; }
.image-controls { display: flex; gap: 10px; flex-wrap: wrap; }
.image-controls input { flex: 1; min-width: 200px; }
.embed-preview { max-width: 560px; }
.add-blocks { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px dashed #ddd; }
.add-blocks > span { font-size: 12px; color: var(--muted); margin-right: 4px; }
.add-blocks .post-action { min-height: 34px; padding: 4px 10px; }
.editor-preview { margin: 0 auto; padding: 0; }

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3000;
    padding: 10px 20px;
    background: #fff4c5;
    box-shadow: 0 -1px 2px #0003;
    font-size: 14px;
}
#blazor-error-ui .dismiss { position: absolute; right: 16px; top: 10px; cursor: pointer; }

#components-reconnect-modal {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 3000;
    padding: 10px 16px;
    border-radius: 8px;
    background: var(--bar);
    color: #fff;
    font-size: 13px;
    box-shadow: 0 6px 20px #0003;
}
#components-reconnect-modal a { color: #9cc9ff; }
#components-reconnect-modal > div { display: none; }
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected { display: block; }
#components-reconnect-modal.components-reconnect-show .reconnect-show,
#components-reconnect-modal.components-reconnect-failed .reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected .reconnect-rejected { display: block; }

@media (min-width: 1500px) {
    .home-section {
        display: grid;
        grid-template-columns: 140px minmax(0, 1fr);
        gap: 24px;
        margin-left: -164px;
    }
    .home-section > h2 { margin: 0; padding-top: 4px; text-align: right; }
}

@media (max-width: 950px) {
    body { display: block; padding-top: var(--mobile-header-height); padding-bottom: var(--navigation-height); }

    .mobile-masthead {
        position: fixed;
        inset: 0 0 auto 0;
        z-index: 1000;
        display: flex;
        align-items: center;
        height: var(--mobile-header-height);
        padding: env(safe-area-inset-top, 0px) 20px 0;
        background: var(--bar);
    }
    .mobile-masthead a { color: #fff; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
    .mobile-masthead a span { color: #b9bec7; font-weight: 400; }

    #appbar {
        position: fixed;
        inset: auto 0 0 0;
        z-index: 1000;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        height: var(--navigation-height);
        padding: 7px max(16px, calc((100% - 460px) / 2)) calc(7px + env(safe-area-inset-bottom, 0px));
        background: var(--bar);
    }
    #appbar .button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        color: #e6e8eb;
        font-size: 11px;
        font-weight: 400;
        text-decoration: none;
    }
    #appbar .button.active { background: #eef0f3; color: var(--bar); }
    #appbar .nav-icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

    #site-navigation { display: none; position: static; height: auto; }
    #site-navigation.primary, #site-navigation.secondary {
        display: block;
        position: fixed;
        top: var(--mobile-header-height);
        bottom: var(--navigation-height);
        left: 0;
        right: 0;
        z-index: 900;
        height: auto;
        max-height: none;
    }
    #site-navigation > .column { display: none; width: 100% !important; border-right: 0; font-size: 15px; }
    #site-navigation.primary > .column.primary,
    #site-navigation.secondary > .column.secondary { display: flex; }
    #site-navigation .panel-close {
        display: grid;
        place-items: center;
        width: 40px;
        height: 40px;
        border: 0;
        border-radius: 8px;
        background: transparent;
        font-size: 16px;
        color: #555;
    }
    #site-navigation .panel-close:hover { background: #eee; }
    #site-navigation > .column > a { min-height: 46px; }
    #site-navigation .card .meta { font-size: 13px; }

    body.navigation-open { overflow: hidden; }

    .page-content-normal, .page-content-wide { margin: 2.25rem auto; padding: 0 20px; }
    .page-header .title { font-size: 28px; }
    .post-pagination { grid-template-columns: 1fr; }
    .post-pagination .newer-post { grid-column: 1; }
    .format-bar { top: calc(var(--mobile-header-height) + 66px); }
    .format-bar .hint { display: none; }
    .editor-topbar { top: var(--mobile-header-height); }
    .block-tools { display: flex; position: static; margin-bottom: 6px; width: fit-content; box-shadow: none; }
}
