/**
 * Default Board Skin — Primer Design System aligned
 *
 * Uses Primer design tokens (colors, spacing, typography) for visual
 * consistency with the admin panel. Self-contained CSS — does NOT
 * require Primer CSS to be loaded.
 */

:root {
    /* Primer color tokens (light mode) — values verified against the
       shipped public/css/primer.css (2026-09-06 audit: --color-fg-danger
       and --color-border-default were stale pre-refresh values, corrected
       here to match the current admin/frontend Primer palette). */
    --color-fg-default: #1f2328;
    --color-fg-muted: #59636e;
    --color-fg-subtle: #6e7781;
    --color-fg-accent: #0969da;
    --color-fg-success: #1a7f37;
    --color-fg-attention: #9a6700;
    --color-fg-danger: #d1242f;
    --color-fg-on-emphasis: #ffffff;

    --color-bg-default: #ffffff;
    --color-bg-subtle: #f6f8fa;
    --color-bg-inset: #f6f8fa;
    --color-bg-emphasis: #25292e;
    --color-bg-accent-emphasis: #0969da;
    --color-bg-success-emphasis: #1f883d;
    --color-bg-attention-emphasis: #bf8700;
    --color-bg-danger-emphasis: #d1242f;
    --color-bg-neutral-muted: rgba(175, 184, 193, 0.2);

    --color-border-default: #d1d9e0;
    --color-border-muted: rgba(209, 217, 224, 0.7);

    /* Primer scale: 4 8 16 24 32 */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
}

/* Dark mode — toggled via skin_config.dark_mode (see layout.html), same
   admin-configurable-boolean pattern the carbon skin uses (.cds--g100).
   Values pulled directly from the shipped public/css/primer.css dark
   theme block ([data-color-mode=dark][data-dark-theme=dark]), not
   approximated. */
.dark-mode {
    --color-fg-default: #f0f6fc;
    --color-fg-muted: #9198a1;
    --color-fg-subtle: #9198a1;
    --color-fg-accent: #4493f8;
    --color-fg-success: #3fb950;
    --color-fg-attention: #d29922;
    --color-fg-danger: #f85149;
    --color-fg-on-emphasis: #ffffff;

    --color-bg-default: #0d1117;
    --color-bg-subtle: #151b23;
    --color-bg-inset: #010409;
    --color-bg-emphasis: #3d444d;
    --color-bg-accent-emphasis: #1f6feb;
    --color-bg-success-emphasis: #238636;
    --color-bg-attention-emphasis: #9e6a03;
    --color-bg-danger-emphasis: #da3633;
    --color-bg-neutral-muted: rgba(110, 118, 129, 0.4);

    --color-border-default: #3d444d;
    --color-border-muted: rgba(61, 68, 77, 0.7);

    background: var(--color-bg-default);
    color: var(--color-fg-default);
}

/* ============================================================
   RESET & BASE
   ============================================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-fg-default);
    background-color: var(--color-bg-subtle);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

a {
    color: var(--color-fg-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================================
   SITE HEADER
   ============================================================ */

.site-header {
    background: var(--color-bg-default);
    border-bottom: 1px solid var(--color-border-default);
    padding: 16px 0;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header .logo {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-fg-default);
}

.main-nav {
    display: flex;
    gap: 16px;
    align-items: center;
}

.main-nav a {
    color: var(--color-fg-muted);
    font-size: 14px;
}

.main-nav a:hover {
    color: var(--color-fg-default);
    text-decoration: none;
}

.main-nav .user-info {
    font-weight: 600;
    color: var(--color-fg-default);
}

/* ============================================================
   SITE CONTENT & FOOTER
   ============================================================ */

.site-content {
    padding: 32px 0;
    min-height: calc(100vh - 150px);
}

.site-footer {
    background: var(--color-bg-default);
    border-top: 1px solid var(--color-border-default);
    padding: 20px 0;
    text-align: center;
    color: var(--color-fg-muted);
    font-size: 12px;
}

/* ============================================================
   BOARD CONTAINER (Box pattern)
   ============================================================ */

.board-container {
    background: var(--color-bg-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.board-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border-default);
}

.board-header h1 {
    font-size: 20px;
    font-weight: 600;
}

.board-header .description {
    color: var(--color-fg-muted);
    font-size: 14px;
    margin-top: 4px;
}

.board-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--color-fg-muted);
    font-size: 12px;
}

/* ============================================================
   CATEGORIES
   ============================================================ */

.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.categories a {
    padding: 4px 12px;
    border: 1px solid var(--color-border-default);
    border-radius: 20px;
    font-size: 12px;
    color: var(--color-fg-muted);
    transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
}

.categories a:hover,
.categories a.active {
    background: var(--color-bg-accent-emphasis);
    border-color: var(--color-bg-accent-emphasis);
    color: var(--color-fg-on-emphasis);
    text-decoration: none;
}

/* ============================================================
   SEARCH FORM
   ============================================================ */

.search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-form select,
.search-form input[type="text"] {
    padding: 5px 12px;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-fg-default);
    background: var(--color-bg-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 80ms;
}

.search-form select {
    width: 120px;
}

.search-form input[type="text"] {
    flex: 1;
    max-width: 300px;
}

.search-form select:focus,
.search-form input[type="text"]:focus {
    border-color: var(--color-fg-accent);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.3);
}

/* ============================================================
   BOARD TABLE
   ============================================================ */

.board-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.board-table th,
.board-table td {
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-muted);
}

.board-table th {
    background: var(--color-bg-subtle);
    font-weight: 600;
    font-size: 12px;
    color: var(--color-fg-muted);
    border-bottom: 1px solid var(--color-border-default);
}

.board-table .no { width: 70px; text-align: center; }
.board-table .category { width: 100px; }
.board-table .author { width: 100px; }
.board-table .date { width: 120px; white-space: nowrap; color: var(--color-fg-muted); font-size: 13px; }
.board-table .hit { width: 60px; text-align: center; color: var(--color-fg-muted); }
.board-table .vote { width: 60px; text-align: center; color: var(--color-fg-muted); }

.board-table tr.notice {
    background: rgba(191, 135, 0, 0.08);
}

.board-table tr.secret {
    background: var(--color-bg-subtle);
}

.board-table tr.deleted {
    background: var(--color-bg-subtle);
}

.board-table tr.deleted .deleted-text {
    color: var(--color-fg-muted);
    font-style: italic;
}

.board-table tbody tr:hover {
    background: var(--color-bg-subtle);
}

.board-table .subject a {
    color: var(--color-fg-default);
    font-weight: 500;
}

.board-table .subject a:hover {
    color: var(--color-fg-accent);
    text-decoration: none;
}

/* ============================================================
   BADGES (Primer Label pattern)
   ============================================================ */

.badge {
    display: inline-block;
    padding: 0 7px;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
    border: 1px solid transparent;
    border-radius: 2em;
    white-space: nowrap;
}

.badge-notice {
    color: var(--color-fg-on-emphasis);
    background: var(--color-bg-attention-emphasis);
    border-color: var(--color-bg-attention-emphasis);
}

.badge-secret {
    color: var(--color-fg-on-emphasis);
    background: var(--color-fg-muted);
    border-color: var(--color-fg-muted);
}

.badge-new {
    color: var(--color-fg-on-emphasis);
    background: var(--color-bg-danger-emphasis);
    border-color: var(--color-bg-danger-emphasis);
    margin-left: 4px;
}

.comment-count {
    color: var(--color-fg-accent);
    font-weight: 600;
    font-size: 12px;
    margin-left: 4px;
}

/* ============================================================
   REPLY INDENT
   ============================================================ */

.reply-indent {
    display: inline-block;
}

.reply-indent[data-depth="1"] { margin-left: 16px; }
.reply-indent[data-depth="2"] { margin-left: 32px; }
.reply-indent[data-depth="3"] { margin-left: 48px; }
.reply-indent[data-depth="4"] { margin-left: 64px; }
.reply-indent[data-depth="5"] { margin-left: 80px; }
.reply-indent[data-depth="6"] { margin-left: 96px; }
.reply-indent[data-depth="7"] { margin-left: 112px; }
.reply-indent[data-depth="8"] { margin-left: 128px; }
.reply-indent[data-depth="9"] { margin-left: 144px; }
.reply-indent[data-depth="10"] { margin-left: 160px; }

.reply-icon {
    color: var(--color-fg-muted);
}

.icon {
    display: inline-flex;
    align-items: center;
    margin-right: 4px;
    vertical-align: text-bottom;
}

.icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.icon-secret {
    color: var(--color-fg-muted);
}

.icon-attach {
    color: var(--color-fg-muted);
}

.empty {
    text-align: center;
    color: var(--color-fg-muted);
    padding: 40px !important;
}

/* ============================================================
   PAGINATION (Primer pattern)
   ============================================================ */

.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 20px 0;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 14px;
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    color: var(--color-fg-default);
    background: var(--color-bg-default);
    text-decoration: none;
    transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
}

.pagination a:hover {
    background: var(--color-bg-subtle);
    text-decoration: none;
}

.pagination .current {
    color: var(--color-fg-on-emphasis);
    background: var(--color-bg-accent-emphasis);
    border-color: var(--color-bg-accent-emphasis);
    font-weight: 600;
}

.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    color: var(--color-fg-muted);
    font-size: 14px;
}

.pagination .page-link:hover {
    background: var(--color-bg-subtle);
    text-decoration: none;
}

.pagination .page-link.current {
    background: var(--color-bg-accent-emphasis);
    border-color: var(--color-bg-accent-emphasis);
    color: var(--color-fg-on-emphasis);
    font-weight: 600;
}

.pagination .page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================================
   BUTTONS (Primer button pattern)
   ============================================================ */

.board-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    background: var(--color-bg-default);
    color: var(--color-fg-default);
    text-align: center;
    text-decoration: none;
    transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
    box-shadow: 0 1px 0 rgba(31, 35, 40, 0.04);
}

.btn:hover {
    background: var(--color-bg-subtle);
    text-decoration: none;
}

.btn-primary {
    color: var(--color-fg-on-emphasis);
    background: var(--color-bg-success-emphasis);
    border-color: var(--color-bg-success-emphasis);
    box-shadow: 0 1px 0 rgba(31, 35, 40, 0.1);
}

.btn-primary:hover {
    background: #1a7f37;
    border-color: #1a7f37;
}

.btn-secondary {
    color: var(--color-fg-muted);
}

.btn-danger {
    color: var(--color-fg-on-emphasis);
    background: var(--color-bg-danger-emphasis);
    border-color: var(--color-bg-danger-emphasis);
}

.btn-danger:hover {
    background: #a40e26;
    border-color: #a40e26;
}

.btn-sm {
    padding: 3px 12px;
    font-size: 12px;
    line-height: 20px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ============================================================
   POST VIEW
   ============================================================ */

.post-view {
    margin-bottom: 24px;
}

.post-header {
    margin-bottom: 16px;
}

.post-header h1 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 8px;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 0;
    border-top: 1px solid var(--color-border-default);
    border-bottom: 1px solid var(--color-border-default);
    color: var(--color-fg-muted);
    font-size: 12px;
}

.post-meta .author {
    font-weight: 600;
    color: var(--color-fg-default);
}

/* ============================================================
   ATTACHMENTS
   ============================================================ */

.attachments {
    margin: 16px 0;
    padding: 16px;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
}

.attachments h4 {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
}

.attachments ul {
    list-style: none;
}

.attachments li {
    padding: 4px 0;
}

.attachments .download-count {
    color: var(--color-fg-muted);
    font-size: 12px;
    margin-left: 8px;
}

/* ============================================================
   POST CONTENT
   ============================================================ */

.post-content {
    padding: 24px 0;
    line-height: 1.8;
}

.post-content:empty {
    padding: 0;
}

.post-content img {
    max-width: 100%;
    height: auto;
}

/* ============================================================
   VOTING
   ============================================================ */

.post-vote {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid var(--color-border-default);
    border-bottom: 1px solid var(--color-border-default);
}

.btn-vote {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    background: var(--color-bg-default);
    color: var(--color-fg-default);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: 80ms cubic-bezier(0.33, 1, 0.68, 1);
}

.btn-vote:hover {
    background: var(--color-bg-subtle);
    border-color: var(--color-fg-accent);
    color: var(--color-fg-accent);
}

.btn-vote svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.btn-vote .count {
    font-weight: 600;
}

.btn-vote-down:hover {
    border-color: var(--color-fg-danger);
    color: var(--color-fg-danger);
}

/* ============================================================
   POST ACTIONS & NAVIGATION
   ============================================================ */

.post-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0;
}

.inline-form {
    display: inline;
}

.post-navigation {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0;
    border-top: 1px solid var(--color-border-default);
}

.post-navigation a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border-muted);
    border-radius: var(--radius-md);
    color: var(--color-fg-default);
    transition: 80ms;
}

.post-navigation a:hover {
    background: var(--color-bg-default);
    border-color: var(--color-border-default);
    text-decoration: none;
}

.post-navigation .label {
    font-weight: 600;
    color: var(--color-fg-muted);
    min-width: 60px;
    font-size: 12px;
}

/* ============================================================
   COMMENTS
   ============================================================ */

.comments {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-default);
}

.comments h3 {
    font-size: 16px;
    margin-bottom: 16px;
}

.comments .count {
    color: var(--color-fg-accent);
    font-weight: 600;
}

.comment-list {
    list-style: none;
}

.comment {
    padding: 16px;
    border-bottom: 1px solid var(--color-border-muted);
}

.comment:last-child {
    border-bottom: none;
}

.comment-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 12px;
}

.comment-meta .author {
    font-weight: 600;
    color: var(--color-fg-default);
}

.comment-meta .date {
    color: var(--color-fg-muted);
}

.comment-content {
    line-height: 1.6;
    font-size: 14px;
}

.no-comments {
    text-align: center;
    padding: 32px;
    color: var(--color-fg-muted);
}

.comment-form {
    margin-top: 16px;
    padding: 16px;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
}

.comment-form .guest-fields {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-form .guest-fields input {
    flex: 1;
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    margin-bottom: 8px;
    padding: 8px 12px;
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    color: var(--color-fg-default);
    background: var(--color-bg-default);
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-fg-accent);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.3);
}

/* ============================================================
   WRITE / EDIT FORM
   ============================================================ */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-fg-default);
}

.form-group .required {
    color: var(--color-fg-danger);
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 5px 12px;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-fg-default);
    background: var(--color-bg-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    box-shadow: inset 0 1px 0 rgba(208, 215, 222, 0.2);
    transition: border-color 80ms;
}

.form-group textarea {
    min-height: 300px;
    resize: vertical;
    line-height: 1.5;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-fg-accent);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.3);
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .half {
    flex: 1;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
}

.file-upload {
    padding: 24px;
    border: 2px dashed var(--color-border-default);
    border-radius: var(--radius-md);
    text-align: center;
    color: var(--color-fg-muted);
}

.file-upload small {
    display: block;
    margin-top: 8px;
    color: var(--color-fg-muted);
}

.existing-files {
    margin-top: 12px;
}

.existing-files h5 {
    margin-bottom: 8px;
}

.existing-files ul {
    list-style: none;
}

.existing-files li {
    padding: 6px 0;
}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--color-border-default);
}

/* ============================================================
   ALERTS (Primer Flash pattern)
   ============================================================ */

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: #ffebe9;
    border: 1px solid rgba(207, 34, 46, 0.4);
    color: var(--color-fg-danger);
}

.alert-success {
    background: #dafbe1;
    border: 1px solid rgba(31, 136, 61, 0.4);
    color: var(--color-fg-success);
}

.alert ul {
    margin-left: 20px;
}

/* ============================================================
   AUTH PAGES (Login, etc.)
   ============================================================ */

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.auth-box {
    width: 100%;
    max-width: 400px;
    padding: 32px;
    background: var(--color-bg-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 24px;
}

.auth-links {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-default);
    font-size: 14px;
}

.auth-links .divider {
    color: var(--color-border-default);
    margin: 0 8px;
}

/* ============================================================
   ERROR PAGES
   ============================================================ */

.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.error-box {
    text-align: center;
    padding: 40px;
    background: var(--color-bg-default);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.error-box h1 {
    margin-bottom: 12px;
}

.error-message {
    color: var(--color-fg-muted);
    margin-bottom: 16px;
}

.error-details {
    text-align: left;
    padding: 16px;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    overflow-x: auto;
}

.error-details pre {
    font-size: 12px;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
    white-space: pre-wrap;
}

.error-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .site-header .container {
        flex-direction: column;
        gap: 12px;
    }

    .main-nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .search-form {
        flex-wrap: wrap;
    }

    .search-form select,
    .search-form input[type="text"] {
        width: 100%;
        max-width: none;
    }

    .board-table {
        font-size: 13px;
    }

    .board-table .category,
    .board-table .hit,
    .board-table .vote {
        display: none;
    }

    .board-table th,
    .board-table td {
        padding: 8px 12px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .post-meta {
        flex-direction: column;
        gap: 4px;
    }

    .board-actions {
        flex-direction: column;
    }

    .post-vote {
        flex-direction: column;
        align-items: center;
    }
}

/* Accessibility: keyboard focus (Primer-style) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.page-link:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-fg-accent, #0969da);
    outline-offset: 2px;
}

/* Shared board layout: main + sidebar (skin-neutral shell) */
.zb-layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 24px;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}
.zb-layout-grid--full {
    grid-template-columns: 1fr;
}
.zb-layout-main { min-width: 0; }
.zb-layout-sidebar { position: sticky; top: 16px; }
.zb-layout-sidebar .auth-box {
    padding: 16px;
    max-width: none;
}
.zb-layout-sidebar .auth-links {
    font-size: 12px;
    margin-top: 12px;
    padding-top: 12px;
}
@media (max-width: 860px) {
    .zb-layout-grid { grid-template-columns: 1fr; }
    .zb-layout-sidebar { position: static; order: -1; }
}

.password-check {
    max-width: 420px;
    margin: 32px auto;
}
.password-check .description {
    color: var(--color-fg-muted);
    margin-bottom: 16px;
}

/* Submit loading */
button[type="submit"][aria-busy="true"],
button.is-loading {
    position: relative;
    opacity: 0.75;
    pointer-events: none;
}
button[type="submit"][aria-busy="true"]::after,
button.is-loading::after {
    content: "";
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-left: 0.4em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -0.1em;
    animation: zb-spin 0.6s linear infinite;
}
@keyframes zb-spin { to { transform: rotate(360deg); } }
