:root {
    color-scheme: light;
    --bg: #f5f7fa;
    --surface: #ffffff;
    --text: #18202a;
    --muted: #667085;
    --line: #dfe4ea;
    --primary: #2f5bea;
    --primary-hover: #2448bd;
    --danger: #b42318;
    --success-bg: #ecfdf3;
    --success-text: #027a48;
    --shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    line-height: 1.65;
}

a { color: var(--link-color, var(--primary)); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar__inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand { font-size: 1.2rem; font-weight: 800; color: var(--text); }
.brand:hover { text-decoration: none; }

.topbar__nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.user-name { color: var(--muted); }

.inline-form { display: inline; margin: 0; }
.link-button {
    border: 0;
    background: none;
    color: var(--primary);
    padding: 0;
    font: inherit;
    cursor: pointer;
}
.link-button:hover { text-decoration: underline; }

.page-shell { max-width: 1180px; margin: 0 auto; padding: 40px 24px 80px; }
.narrow-column { max-width: 720px; margin: 0 auto; }

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

h1, h2 { line-height: 1.3; }
h1 { margin: 4px 0 8px; font-size: clamp(1.8rem, 4vw, 2.5rem); }
h2 { margin: 0 0 10px; font-size: 1.25rem; }

.eyebrow {
    margin: 0;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}
.muted { color: var(--muted); }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 24px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.board-card { min-height: 190px; }
.card-meta { margin-top: 22px; color: var(--muted); font-size: 0.88rem; }

.hero { padding: clamp(30px, 6vw, 70px); }
.hero p { max-width: 720px; }

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid var(--primary);
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.button:hover { background: var(--primary-hover); text-decoration: none; }
.button--secondary { background: var(--surface); color: var(--text); border-color: var(--line); }
.button--secondary:hover { background: #f9fafb; }
.button--wide { width: 100%; }

.form-card { padding: 28px; }
.form-group { margin-bottom: 22px; }
.form-group label { display: block; margin-bottom: 7px; font-weight: 700; }
.form-control,
.form-card input[type="email"],
.form-card input[type="password"],
.form-card input[type="text"] {
    width: 100%;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    padding: 11px 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
}
.form-control:focus,
.form-card input:focus,
.form-card textarea:focus {
    outline: 3px solid rgba(47, 91, 234, 0.16);
    border-color: var(--primary);
}
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 28px; }
.field-error, .errorlist { color: var(--danger); }
.errorlist { padding-left: 20px; }

.empty-state { text-align: center; padding: 52px 28px; }
.messages { margin-bottom: 20px; }
.message { border-radius: 9px; padding: 12px 14px; border: 1px solid var(--line); background: #fff; }
.message--success { background: var(--success-bg); color: var(--success-text); border-color: #abefc6; }

.divider { display: flex; align-items: center; gap: 12px; margin: 24px 0; color: var(--muted); }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

@media (max-width: 720px) {
    .topbar__inner, .page-heading { flex-direction: column; align-items: stretch; }
    .topbar__nav { gap: 12px; }
    .page-shell { padding: 28px 16px 60px; }
    .form-actions { flex-direction: column-reverse; }
    .button { width: 100%; }
}

.section-card { margin-bottom: 22px; }
.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}
.section-heading h2, .section-heading p { margin-top: 0; }
.count-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3448a5;
    font-weight: 700;
    white-space: nowrap;
}
.invite-grid {
    display: grid;
    grid-template-columns: minmax(240px, 2fr) minmax(180px, 1fr) auto;
    gap: 16px;
    align-items: end;
}
.form-group--compact { margin-bottom: 0; }
.invite-submit { padding-bottom: 1px; }
.table-scroll { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}
.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}
.data-table th {
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.compact-form,
.action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.compact-select {
    min-width: 140px;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
}
.button--small {
    min-height: 36px;
    padding: 7px 12px;
    font-size: 0.9rem;
}
.button--danger {
    background: #fff;
    color: var(--danger);
    border-color: #f0b6b1;
}
.button--danger:hover { background: #fff3f2; }
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}
.badge--success { background: #ecfdf3; color: #027a48; }
.badge--warning { background: #fffaeb; color: #b54708; }
.badge--neutral { background: #f2f4f7; color: #475467; }
.small-text { font-size: 0.86rem; }
.message--error { background: #fff3f2; color: var(--danger); border-color: #f0b6b1; }
.audit-list { display: grid; gap: 0; }
.audit-item {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 0.8fr) auto;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    align-items: center;
}
.audit-item:last-child { border-bottom: 0; }
.audit-item time { color: var(--muted); white-space: nowrap; }

@media (max-width: 860px) {
    .invite-grid { grid-template-columns: 1fr; }
    .invite-submit .button { width: 100%; }
    .audit-item { grid-template-columns: 1fr; gap: 3px; }
}

.heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}
.board-filter,
.category-grid {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(180px, 1fr) minmax(150px, 1fr) auto;
    gap: 16px;
    align-items: end;
}
.filter-actions { padding-bottom: 1px; }
.post-list { display: grid; gap: 16px; }
.post-card { padding: 20px 22px; }
.post-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 12px;
}
.post-card__header h2 { margin-top: 8px; }
.post-card__header time { color: var(--muted); white-space: nowrap; }
.post-card__body { margin: 0 0 14px; }
.post-card__meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}
.post-detail-card { margin-bottom: 24px; }
.post-detail-card,
.reply-card {
    scroll-margin-top: 96px;
}
.post-body {
    white-space: normal;
    overflow-wrap: anywhere;
}
.reply-list { display: grid; gap: 14px; }
.reply-card { padding: 18px 20px; }
.compact-input {
    width: 90px;
    border: 1px solid #cfd6df;
    border-radius: 8px;
    padding: 8px 10px;
    background: #fff;
    color: var(--text);
    font: inherit;
}
.compact-input--wide { width: min(100%, 280px); }
.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}
.checkbox-input { width: auto; }

@media (max-width: 900px) {
    .board-filter,
    .category-grid { grid-template-columns: 1fr; }
    .heading-actions { justify-content: stretch; }
    .heading-actions .button { width: 100%; }
    .post-card__header { flex-direction: column; gap: 4px; }
}

.view-switch {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f9fafb;
}
.view-switch__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 14px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
}
.view-switch__item:hover {
    text-decoration: none;
    background: #fff;
}
.view-switch__item--active {
    background: var(--primary);
    color: #fff;
}
.view-switch__item--active:hover {
    background: var(--primary-hover);
}
.post-card--thread-root {
    padding-bottom: 0;
    overflow: hidden;
}
.thread-preview {
    margin: 18px -22px 0;
    border-top: 1px solid var(--line);
    background: #fbfcfe;
}
.thread-preview__reply {
    padding: 16px 22px;
    border-bottom: 1px solid var(--line);
}
.thread-preview__reply:last-child { border-bottom: 0; }
.thread-preview__meta {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}
.thread-preview__meta strong { color: var(--text); }
.thread-preview__meta time { white-space: nowrap; }
.thread-preview__body {
    overflow-wrap: anywhere;
}

@media (max-width: 720px) {
    .view-switch { display: flex; width: 100%; }
    .view-switch__item { flex: 1; }
    .thread-preview__meta { flex-direction: column; gap: 2px; }
}

/* v8: post actions and favorites */
.post-card__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 160px;
}
.post-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.button--small {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
}
.favorite-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.favorite-button:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.favorite-button--active {
    border-color: #f5b700;
    background: #fff8db;
    color: #b77900;
}
.favorite-filter {
    padding-bottom: 10px;
}
.favorite-filter__label {
    min-height: 44px;
}
.thread-preview__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}
.thread-preview__header .thread-preview__meta {
    margin-bottom: 0;
}
.thread-preview__actions {
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .post-card__side {
        align-items: flex-start;
        min-width: 0;
        width: 100%;
    }
    .post-actions {
        justify-content: flex-start;
    }
    .thread-preview__header {
        flex-direction: column;
        gap: 8px;
    }
}

/* v9: Gmail-like personal categories */
.board-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.board-sidebar {
    position: sticky;
    top: 82px;
    padding: 18px;
}
.board-sidebar h2 {
    margin-bottom: 12px;
    font-size: 1rem;
}
.category-nav {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
}
.category-nav__item {
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 7px 10px;
    border-radius: 9px;
    color: var(--text);
    font-weight: 700;
}
.category-nav__item:hover {
    background: #f2f4f7;
    text-decoration: none;
}
.category-nav__item--active {
    background: #eef2ff;
    color: #3448a5;
}
.category-nav__separator {
    height: 1px;
    background: var(--line);
    margin: 8px 0;
}
.board-filter--search-only {
    grid-template-columns: minmax(220px, 1fr) auto;
}
.filter-summary {
    margin: 14px 0 0;
}
.post-category-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}
.post-category-form label {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}
.post-category-form--reply {
    margin-top: 10px;
    padding-top: 10px;
}

@media (max-width: 900px) {
    .board-layout { grid-template-columns: 1fr; }
    .board-sidebar { position: static; }
    .board-filter--search-only { grid-template-columns: 1fr; }
}


/* v12: board settings and trash */
.board-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.button--danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.button--danger:hover {
    background: #912018;
    border-color: #912018;
}
.danger-zone {
    margin-top: 64px;
    border-color: #f4b4ae;
    box-shadow: none;
}
.danger-zone h2 { color: var(--danger); }
.confirmation-name {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 8px;
    background: #f2f4f7;
}
.board-card--trashed { border-style: dashed; }
.trash-meta {
    display: grid;
    gap: 4px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.9rem;
}

/* v13.2: styled social login confirmation */
.auth-confirm-shell {
    min-height: calc(100vh - 190px);
    display: grid;
    place-items: center;
    padding: 20px 0 54px;
}
.auth-confirm-card {
    position: relative;
    isolation: isolate;
    width: min(100%, 620px);
    overflow: hidden;
    padding: clamp(30px, 6vw, 52px);
    border: 1px solid rgba(47, 91, 234, 0.16);
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(238, 242, 255, 0.82), rgba(255, 255, 255, 0) 42%),
        var(--surface);
    box-shadow: 0 24px 64px rgba(16, 24, 40, 0.12);
    text-align: center;
}
.auth-confirm-card__decoration {
    position: absolute;
    z-index: -1;
    top: -130px;
    right: -110px;
    width: 280px;
    height: 280px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(47, 91, 234, 0.18), rgba(47, 91, 234, 0));
}
.auth-confirm-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 30px;
    text-align: left;
}
.auth-confirm-brand__mark {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(145deg, var(--primary), #6d83ef);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 900;
    box-shadow: 0 9px 20px rgba(47, 91, 234, 0.25);
}
.auth-confirm-brand strong,
.auth-confirm-brand small {
    display: block;
}
.auth-confirm-brand strong {
    color: var(--text);
    font-size: 1.08rem;
    line-height: 1.3;
}
.auth-confirm-brand small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 0.73rem;
}
.auth-provider-mark {
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    margin: 0 auto 22px;
    border: 1px solid var(--line);
    border-radius: 21px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.09);
    color: var(--primary);
    font-size: 1.65rem;
    font-weight: 900;
}
.auth-provider-mark svg {
    width: 34px;
    height: 34px;
}
.auth-confirm-card h1 {
    max-width: 500px;
    margin: 8px auto 12px;
    font-size: clamp(1.7rem, 4.5vw, 2.35rem);
}
.auth-confirm-lead {
    max-width: 470px;
    margin: 0 auto 26px;
    color: var(--muted);
    font-size: 1.02rem;
}
.auth-confirm-points {
    display: grid;
    gap: 10px;
    margin: 0 auto 28px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(249, 250, 251, 0.82);
    text-align: left;
}
.auth-confirm-point {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #475467;
    font-size: 0.91rem;
}
.auth-confirm-point__icon {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success-text);
    font-size: 0.75rem;
    font-weight: 900;
}
.auth-confirm-form {
    margin: 0;
}
.auth-provider-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    padding: 12px 20px;
    border: 1px solid #cfd6df;
    border-radius: 12px;
    background: #fff;
    color: #202124;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.06);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.auth-provider-button:hover {
    transform: translateY(-1px);
    border-color: #aeb7c3;
    box-shadow: 0 9px 24px rgba(16, 24, 40, 0.11);
}
.auth-provider-button:focus-visible {
    outline: 3px solid rgba(47, 91, 234, 0.18);
    outline-offset: 2px;
}
.auth-provider-button svg {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}
.auth-confirm-back {
    display: inline-block;
    margin-top: 20px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
}
.auth-confirm-note {
    margin: 24px 0 0;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
}
@media (max-width: 720px) {
    .auth-confirm-shell {
        min-height: auto;
        padding: 0 0 36px;
    }
    .auth-confirm-card {
        padding: 30px 22px;
        border-radius: 18px;
    }
    .auth-confirm-brand {
        margin-bottom: 24px;
    }
    .auth-confirm-brand small {
        display: none;
    }
}


/* v14: Google / Microsoft login choices */
.login-card__lead {
    margin-bottom: 1.35rem;
}

.login-provider-list {
    display: grid;
    gap: 0.8rem;
}

.login-provider-button {
    align-items: center;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: #172033;
    display: flex;
    font-weight: 700;
    gap: 0.85rem;
    justify-content: center;
    min-height: 52px;
    padding: 0.8rem 1rem;
    text-decoration: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.login-provider-button:hover {
    border-color: #8da2bd;
    box-shadow: 0 8px 22px rgba(23, 32, 51, 0.1);
    transform: translateY(-1px);
}

.login-provider-button:focus-visible {
    outline: 3px solid rgba(49, 130, 206, 0.3);
    outline-offset: 2px;
}

.login-provider-button svg {
    flex: 0 0 24px;
    height: 24px;
    width: 24px;
}

.login-provider-button--microsoft {
    border-color: #b8c7da;
}

.login-card__note {
    color: #64748b;
    font-size: 0.83rem;
    line-height: 1.65;
    margin: 1.25rem 0 0;
    text-align: center;
}

/* Diggy v15 brand */
:root {
    --primary: #1557d6;
    --primary-hover: #0f46b5;
    --bg: #f6f9ff;
    --brand-deep: #0b2f79;
    --brand-soft: #eaf2ff;
}
.topbar { background: linear-gradient(90deg, #0f4bc4, #1557d6); border-bottom: 0; box-shadow: 0 4px 18px rgba(14, 65, 160, .18); }
.topbar__inner { min-height: 66px; }
.topbar a, .topbar .link-button { color: #fff; }
.topbar .user-name { color: rgba(255,255,255,.82); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: #fff; font-size: 1.48rem; letter-spacing: -.02em; }
.brand__dog { width: 29px; height: 29px; display: inline-flex; color: #fff; }
.brand__dog svg, .brand__dog img { width: 100%; height: 100%; object-fit: contain; }
.login-stage { position: relative; max-width: 760px; margin: 0 auto; border-radius: 30px; overflow: hidden; background: #fff; border: 1px solid #dce7fa; box-shadow: 0 26px 70px rgba(17, 70, 160, .15); }
.login-brand-panel { position: relative; z-index: 2; padding: clamp(36px, 7vw, 68px) clamp(24px, 7vw, 76px) 150px; text-align: center; }
.login-brand-panel__glow { position: absolute; inset: -220px -100px auto; height: 330px; background: radial-gradient(circle, rgba(50,111,235,.15), transparent 68%); pointer-events: none; }
.login-lockup { position: relative; }
.login-lockup__dog { display: inline-flex; width: 88px; height: 88px; color: #1557d6; }
.login-lockup__dog svg, .login-lockup__dog img { width: 100%; height: 100%; object-fit: contain; }
.login-lockup h1 { margin: 4px 0 4px; color: var(--brand-deep); font-size: clamp(3.2rem, 10vw, 5.4rem); letter-spacing: -.055em; }
.login-lockup__full-name { margin: 0 auto; max-width: 470px; color: #1557d6; font-size: clamp(.92rem, 2.5vw, 1.18rem); letter-spacing: .025em; line-height: 1.45; }
.login-tagline { margin: 34px 0 8px; color: var(--brand-deep); font-size: clamp(1.45rem, 4vw, 2rem); font-weight: 800; letter-spacing: .04em; }
.login-description { max-width: 560px; margin: 0 auto 28px; color: var(--muted); }
.login-provider-list { display: grid; gap: 14px; max-width: 470px; margin: 0 auto; }
.login-provider-button { min-height: 58px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 20px; font-weight: 750; font-size: 1.05rem; box-shadow: 0 7px 18px rgba(15, 62, 145, .1); transition: transform .15s ease, box-shadow .15s ease; }
.login-provider-button:hover { transform: translateY(-1px); box-shadow: 0 11px 24px rgba(15, 62, 145, .15); text-decoration: none; }
.login-provider-button svg { width: 25px; height: 25px; flex: 0 0 auto; }
.login-provider-button--google { background: #fff; border: 1px solid #cbd5e1; color: #172033; }
.login-provider-button--microsoft { background: linear-gradient(135deg, #1663e6, #0645c4); border: 1px solid #0645c4; color: #fff; }
.login-card__note { margin: 22px 0 0; color: var(--muted); font-size: .84rem; }
.login-landscape { position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; height: 140px; background: linear-gradient(165deg, transparent 0 25%, #d8e8ff 25.5% 42%, #9fc5ff 42.5% 61%, #4d8cec 61.5% 79%, #1557d6 79.5%); }
.login-landscape__dog { position: absolute; right: 12%; bottom: 17px; width: 54px; height: 54px; color: #0b3c9b; }
.login-landscape__dog svg, .login-landscape__dog img { width: 100%; height: 100%; object-fit: contain; }
.diggy-hero { position: relative; overflow: hidden; background: linear-gradient(135deg, #fff 0 64%, #e8f1ff); }
.diggy-hero::after { content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%; right: -90px; bottom: -160px; background: #cfe1ff; }
.diggy-hero__logo { display: flex; align-items: center; gap: 14px; color: var(--brand-deep); }
.diggy-hero__logo span { width: 54px; height: 54px; color: #1557d6; }
.diggy-hero__logo span svg, .diggy-hero__logo span img { width: 100%; height: 100%; object-fit: contain; }
.diggy-hero__logo strong { font-size: 2.4rem; letter-spacing: -.04em; }
.auth-confirm-brand__mark { display: inline-flex !important; align-items: center; justify-content: center; background: transparent !important; color: #1557d6 !important; }
.auth-confirm-brand__mark svg, .auth-confirm-brand__mark img { width: 44px; height: 44px; object-fit: contain; }
@media (max-width: 720px) {
  .topbar__inner { flex-direction: row; align-items: center; }
  .topbar__nav { justify-content: flex-end; }
  .login-brand-panel { padding-bottom: 125px; }
  .login-landscape { height: 112px; }
}

.diggy-dog-image { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }

/* Diggy v15.2 image corrections */
.brand__dog {
    width: 32px;
    height: 32px;
    overflow: hidden;
}
.brand__dog .diggy-dog-image--header {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.login-landscape {
    height: 210px;
    background: #fff;
}
.login-landscape__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
}
@media (max-width: 720px) {
    .login-brand-panel { padding-bottom: 180px; }
    .login-landscape { height: 165px; }
}

/* Diggy v15.3 login footer layout corrections */
.login-stage {
    display: flex;
    flex-direction: column;
}

.login-brand-panel {
    padding-bottom: clamp(36px, 6vw, 56px);
}

.login-card__note {
    position: relative;
    z-index: 2;
    margin: 24px auto 0;
    max-width: 560px;
    color: #53657f;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.7;
    text-align: center;
}

.login-landscape {
    position: relative;
    z-index: 1;
    left: auto;
    right: auto;
    bottom: auto;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    background: #fff;
}

.login-landscape__image {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    object-position: center bottom;
}

@media (max-width: 720px) {
    .login-brand-panel {
        padding-bottom: 34px;
    }

    .login-card__note {
        margin-top: 20px;
        padding: 0 4px;
        font-size: 0.82rem;
    }

    .login-landscape {
        height: auto;
    }
}

.attachment-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;margin-top:16px}.attachment-card{border:1px solid var(--border-color,#e2e8f0);border-radius:12px;padding:10px;display:flex;flex-direction:column;gap:6px}.attachment-thumbnail{width:100%;height:140px;object-fit:cover;border-radius:8px;background:#f8fafc}.attachment-edit-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid #e2e8f0}


.notification-settings-card { max-width: 760px; }
.notification-mode-list { display: grid; gap: 14px; }
.notification-mode-option { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px solid var(--border-color, #dbe4f0); border-radius: 14px; cursor: pointer; background: #fff; }
.notification-mode-option:hover { border-color: #2563eb; background: #f8fbff; }
.notification-mode-option strong { display: block; margin-bottom: 5px; }
.notification-mode-option small { display: block; color: #64748b; line-height: 1.6; }
.notification-mode-radio { padding-top: 2px; }


/* Diggy v16.3 reactions and drag-and-drop attachments */
.reaction-bar{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}.reaction-button{display:inline-flex;align-items:center;gap:4px;min-height:34px;padding:5px 9px;border:1px solid #d7e1ee;border-radius:999px;background:#fff;cursor:pointer;font-size:1rem;transition:.15s ease}.reaction-button:hover{border-color:#2563eb;background:#f4f8ff;transform:translateY(-1px)}.reaction-button--active{border-color:#2563eb;background:#eaf2ff;box-shadow:0 0 0 1px #2563eb inset}.reaction-count{font-size:.78rem;font-weight:700;color:#475569}.attachment-dropzone{position:relative;border:2px dashed #cbd8e8;border-radius:14px;padding:16px;transition:.15s ease;background:#fbfdff}.attachment-dropzone--active{border-color:#2563eb;background:#edf5ff;box-shadow:0 0 0 4px rgba(37,99,235,.1)}.attachment-dropzone__hint{margin:9px 0 0;color:#64748b;font-size:.84rem;font-weight:600}.attachment-dropzone__files{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}.attachment-dropzone__file{max-width:100%;padding:5px 9px;border-radius:8px;background:#e8f1ff;color:#1e4f9f;font-size:.8rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Diggy v16.4 Discord-style compact reaction picker */
.reaction-bar{
  position:relative;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
  margin-top:12px;
}
.reaction-bar__selected{display:flex;align-items:center;flex-wrap:wrap;gap:7px}
.reaction-picker{position:relative;display:inline-flex}
.reaction-picker__trigger{
  display:inline-grid;
  place-items:center;
  width:34px;
  height:34px;
  padding:5px;
  border:1px solid #d7e1ee;
  border-radius:999px;
  background:#fff;
  cursor:pointer;
  transition:.15s ease;
}
.reaction-picker__trigger:hover,
.reaction-picker__trigger[aria-expanded="true"]{
  border-color:#2563eb;
  background:#f4f8ff;
  transform:translateY(-1px);
}
.reaction-picker__trigger img{display:block;width:22px;height:22px;object-fit:contain}
.reaction-picker__menu{
  position:absolute;
  z-index:40;
  left:0;
  bottom:calc(100% + 8px);
  display:flex;
  align-items:center;
  gap:4px;
  padding:7px;
  border:1px solid #d8e1ed;
  border-radius:12px;
  background:#fff;
  box-shadow:0 12px 30px rgba(15,23,42,.18);
  white-space:nowrap;
}
.reaction-picker__menu[hidden]{display:none}
.reaction-picker__choice{
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  padding:0;
  border:0;
  border-radius:9px;
  background:transparent;
  cursor:pointer;
  font-size:1.25rem;
  line-height:1;
  transition:.12s ease;
}
.reaction-picker__choice:hover,
.reaction-picker__choice:focus-visible{background:#edf4ff;transform:scale(1.12);outline:none}
.reaction-picker__choice--active{background:#dceaff;box-shadow:0 0 0 1px #2563eb inset}
@media (max-width:600px){
  .reaction-picker__menu{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);max-width:calc(100vw - 24px);overflow-x:auto;padding:10px;border-radius:16px}
  .reaction-picker__choice{width:42px;height:42px;font-size:1.35rem}
}


/* Diggy v16.5 expanded reaction palette */
.reaction-picker__menu{flex-direction:column;align-items:stretch;gap:8px;min-width:300px;max-width:min(430px,calc(100vw - 24px))}
.reaction-picker__group{display:flex;align-items:center;flex-wrap:wrap;gap:4px}
.reaction-picker__divider{height:1px;background:#dbe4ef;margin:1px 2px}
.reaction-picker__group--numbers{display:grid;grid-template-columns:repeat(10,minmax(30px,1fr));gap:3px}
.reaction-picker__group--numbers .inline-form{min-width:0}
.reaction-picker__group--numbers .reaction-picker__choice{width:100%;min-width:30px}
@media (max-width:640px){.reaction-picker__menu{min-width:0;width:calc(100vw - 24px);max-height:50vh;overflow-y:auto}.reaction-picker__group--numbers{grid-template-columns:repeat(5,1fr)}}

/* v16.6: compact board toolbar */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.board-toolbar {
    margin-bottom: 16px;
    padding: 12px 14px;
}
.board-toolbar__row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.board-toolbar .view-switch {
    flex: 0 0 auto;
    margin: 0;
    padding: 3px;
}
.board-toolbar .view-switch__item {
    min-height: 32px;
    padding: 5px 12px;
    font-size: 0.9rem;
}
.board-toolbar__status {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3448a5;
    font-size: 0.88rem;
    font-weight: 700;
}
.board-toolbar__search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}
.board-toolbar__input {
    min-width: 160px;
    height: 38px;
    padding: 8px 12px;
}
.board-toolbar__submit {
    min-height: 38px;
    padding: 7px 14px;
    white-space: nowrap;
}
.board-toolbar__clear {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    white-space: nowrap;
}
.board-toolbar__summary {
    margin: 8px 0 0;
    font-size: 0.86rem;
}

@media (max-width: 760px) {
    .board-toolbar {
        padding: 12px;
    }
    .board-toolbar__row {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }
    .board-toolbar .view-switch {
        width: 100%;
    }
    .board-toolbar .view-switch__item {
        flex: 1;
    }
    .board-toolbar__search {
        width: 100%;
    }
    .board-toolbar__input {
        flex: 1 1 auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .board-toolbar__search {
        flex-wrap: wrap;
    }
    .board-toolbar__input {
        flex-basis: calc(100% - 72px);
    }
    .board-toolbar__clear {
        width: 100%;
    }
}


/* v17: Diggy UI v2 — compact board workspace */
.board-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    margin: 6px 0 22px;
}
.board-hero__copy {
    min-width: 0;
}
.board-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 3.4vw, 3.2rem);
    letter-spacing: -0.035em;
    line-height: 1.08;
}
.board-hero__description {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.65;
}
.board-hero__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.board-hero__actions .button {
    min-height: 38px;
    padding: 7px 13px;
    border-radius: 10px;
    font-size: 0.92rem;
}
.board-hero__primary {
    box-shadow: 0 8px 18px rgba(21, 87, 214, 0.18);
}
.board-layout {
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 16px;
}
.board-sidebar {
    top: 76px;
    padding: 14px;
    border-radius: 16px;
}
.board-sidebar h2 {
    margin: 2px 8px 10px;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.category-nav {
    gap: 2px;
    margin-bottom: 10px;
}
.category-nav__item {
    gap: 10px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.94rem;
}
.category-nav__icon {
    display: inline-flex;
    width: 20px;
    justify-content: center;
    color: #75829a;
    font-size: 0.92rem;
}
.category-nav__item--active .category-nav__icon {
    color: currentColor;
}
.category-edit-link {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    padding: 10px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}
.category-edit-link:hover {
    color: var(--primary);
    text-decoration: none;
}
.board-commandbar {
    margin: 0 0 14px;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.045);
}
.board-commandbar__row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.board-commandbar .view-switch {
    flex: 0 0 auto;
    margin: 0;
    padding: 2px;
    border: 0;
    border-radius: 10px;
    background: #f0f3f8;
}
.board-commandbar .view-switch__item {
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
}
.board-commandbar__status {
    flex: 0 0 auto;
    padding: 7px 11px;
    border-radius: 9px;
    background: #eef3ff;
    color: var(--primary);
    font-size: 0.86rem;
    font-weight: 800;
}
.board-commandbar__search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 1 1 auto;
    min-width: 0;
}
.board-commandbar__search-icon {
    position: absolute;
    left: 12px;
    z-index: 1;
    color: #8591a6;
    font-size: 1.1rem;
    pointer-events: none;
}
.board-commandbar__input {
    flex: 1 1 auto;
    min-width: 140px;
    height: 36px;
    padding: 7px 10px 7px 34px;
    border-color: #d8dee8;
    border-radius: 9px;
    background: #fbfcfe;
}
.board-commandbar__input:focus {
    background: #fff;
}
.board-commandbar__submit {
    min-height: 36px;
    padding: 6px 13px;
    border-radius: 9px;
    font-size: 0.88rem;
    white-space: nowrap;
}
.board-commandbar__clear {
    flex: 0 0 auto;
    padding: 0 4px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}
.board-commandbar__summary {
    margin: 7px 4px 0;
    font-size: 0.82rem;
}
.post-list {
    gap: 12px;
}
.post-card {
    padding: 17px 19px;
    border-radius: 14px;
}
.post-card__header {
    margin-bottom: 9px;
}
.post-card__header h2 {
    margin-top: 4px;
}
.post-card__body {
    margin-bottom: 11px;
}
.thread-preview {
    margin-top: 14px;
}

@media (max-width: 900px) {
    .board-hero {
        flex-direction: column;
        gap: 14px;
    }
    .board-hero__actions {
        justify-content: flex-start;
    }
    .board-hero__actions .button {
        width: auto;
    }
    .board-layout {
        grid-template-columns: 1fr;
    }
    .board-sidebar {
        position: static;
    }
    .category-nav {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 3px;
    }
    .category-nav__item {
        flex: 0 0 auto;
    }
    .category-nav__separator {
        width: 1px;
        height: 30px;
        margin: 4px 2px;
    }
}

@media (max-width: 700px) {
    .board-commandbar__row {
        align-items: stretch;
        flex-direction: column;
    }
    .board-commandbar .view-switch {
        display: flex;
        width: 100%;
    }
    .board-commandbar .view-switch__item {
        flex: 1;
    }
    .board-commandbar__search {
        width: 100%;
    }
    .board-hero__actions {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .board-hero__actions .button {
        flex: 1 1 auto;
    }
    .board-commandbar__search {
        flex-wrap: wrap;
    }
    .board-commandbar__input {
        flex-basis: calc(100% - 70px);
    }
    .board-commandbar__clear {
        width: 100%;
    }
}


/* Diggy v17.2: other boards quick navigation */
.board-layout {
    align-items: start;
}

.other-boards-card {
    grid-column: 1;
    padding: 18px;
    margin-top: 16px;
}

.other-boards-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.other-boards-card__header h2 {
    margin: 0;
    font-size: 1rem;
}

.other-boards-card__header a {
    font-size: .82rem;
    text-decoration: none;
}

.other-board-nav {
    display: grid;
    gap: 4px;
}

.other-board-nav__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 9px;
    color: var(--text, #172033);
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.other-board-nav__item:hover,
.other-board-nav__item:focus-visible {
    background: #eef4ff;
    color: #1557d6;
}

.other-board-nav__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.other-board-nav__unread {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #e53935;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, .12);
}

.other-boards-card__empty {
    margin: 8px 2px 0;
}

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

    .board-layout > main {
        grid-column: 2;
        grid-row: 1 / span 2;
    }
}

@media (max-width: 840px) {
    .other-boards-card {
        margin-top: 0;
    }
}


/* Diggy v17.3: sticky sidebar stack */
.board-sidebar-stack {
    display: grid;
    gap: 16px;
    align-self: start;
}

.board-sidebar-stack .other-boards-card {
    margin-top: 0;
}

@media (min-width: 841px) {
    .board-sidebar-stack {
        position: sticky;
        top: 88px;
        max-height: calc(100vh - 104px);
        overflow-y: auto;
        scrollbar-width: thin;
        padding-bottom: 2px;
    }

    .board-sidebar-stack .board-sidebar {
        position: static;
    }

    .board-layout > main {
        grid-column: 2;
        grid-row: 1;
    }
}

@media (max-width: 840px) {
    .board-sidebar-stack {
        position: static;
        max-height: none;
        overflow: visible;
    }
}

/* Diggy v17.4: prevent sticky sidebar clipping and wrap long board names */
.board-sidebar-stack {
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.board-sidebar-stack > .card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.other-board-nav__item {
    min-width: 0;
}

.other-board-nav__name {
    display: -webkit-box;
    min-width: 0;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    line-height: 1.45;
}

@media (min-width: 841px) {
    .board-sidebar-stack {
        overflow-x: hidden;
        padding-right: 4px;
        scrollbar-gutter: stable;
    }
}


/* =========================================================
   Login provider buttons
   POSTフォーム化後もGoogle・Microsoftボタンを同じ幅で中央配置
   ========================================================= */

.login-provider-list {
    width: min(100%, 360px);
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
}

.login-provider-form {
    width: 100%;
    margin: 0;
    padding: 0;
}

.login-provider-button {
    width: 100%;
    min-height: 68px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin: 0;
    padding: 14px 24px;
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

.login-provider-button svg {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
}

@media (max-width: 520px) {
    .login-provider-list {
        width: 100%;
    }

    .login-provider-button {
        min-height: 62px;
        padding-inline: 18px;
        font-size: 1rem;
    }
}

/* Diggy: reaction picker viewport positioning */
.post-card--thread-root.reaction-menu-open {
    overflow: visible;
}

@media (min-width: 641px) {
    .reaction-picker__menu {
        position: fixed;
        z-index: 1200;
        top: 0;
        right: auto;
        bottom: auto;
        left: 0;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
        visibility: hidden;
        transform: none;
    }

    .reaction-picker__menu[data-positioned="true"] {
        visibility: visible;
    }
}

@media (max-width: 640px) {
    .reaction-picker__menu {
        position: fixed;
        z-index: 1200;
        top: auto;
        right: auto;
        bottom: 18px;
        left: 50%;
        width: calc(100vw - 24px);
        min-width: 0;
        max-width: calc(100vw - 24px);
        max-height: 50vh;
        overflow-y: auto;
        visibility: visible;
        transform: translateX(-50%);
    }
}
/* End Diggy: reaction picker viewport positioning */

/* Diggy: additional attachment file inputs */
.attachment-file-inputs {
    display: grid;
    gap: 0.75rem;
}

.attachment-file-inputs input[type="file"] {
    width: 100%;
}

.attachment-file-inputs input[type="file"] + input[type="file"] {
    margin-top: 0;
}

.attachment-dropzone__selection-status {
    margin: 0.65rem 0 0;
}

.attachment-dropzone__limit-error {
    margin: 0.65rem 0 0;
}
/* End Diggy: additional attachment file inputs */

/* Diggy: image reactions */
.reaction-image {
    display: block;
    object-fit: contain;
}

.reaction-image--selected {
    width: 20px;
    height: 20px;
}

/*
 * 画像リアクションも通常リアクションと
 * 見た目の大きさが揃うよう少し小さめに表示する。
 */
.reaction-picker__choice--image {
    overflow: hidden;
}

.reaction-image--picker {
    width: 24px;
    height: 24px;
}

@media (max-width: 640px) {
    .reaction-image--picker {
        width: 24px;
        height: 24px;
    }
}
/* End Diggy: image reactions */

/* Diggy: open boards */
.board-list-section + .board-list-section {
    margin-top: 2.5rem;
}

.board-list-section--open {
    padding-top: 2rem;
    border-top: 1px solid #dce5f3;
}

.board-card__title-row,
.board-hero__title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.board-card__title-row h2,
.board-hero__title-row h1 {
    margin: 0;
}

.badge--open {
    border: 1px solid #7aa8ff;
    background: #eaf2ff;
    color: #1149ae;
    white-space: nowrap;
}

.board-card--open {
    border-color: #b7cff7;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.alert--open-board {
    border: 1px solid #9bbcf3;
    background: #eef5ff;
    color: #173b72;
}

.alert--open-board p {
    margin: 0.35rem 0 0;
}

.open-board-notice,
.open-board-notification-note {
    margin-bottom: 1rem;
}

.open-board-compose-warning {
    margin-bottom: 1rem;
}

.access-mode-options {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.access-mode-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
    border: 1px solid #ccd7e8;
    border-radius: 0.75rem;
    background: #fff;
}

.access-mode-option:hover {
    border-color: #7aa8ff;
    background: #f8fbff;
}

.access-mode-option:has(input:checked) {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}

.access-mode-option__radio {
    padding-top: 0.15rem;
}

.access-mode-option__copy {
    display: grid;
    gap: 0.25rem;
}

.access-mode-option__copy small {
    color: #5f6f86;
    line-height: 1.55;
}

.access-mode-modal[hidden] {
    display: none;
}

.access-mode-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.access-mode-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
}

.access-mode-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(36rem, 100%);
    padding: 1.4rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.access-mode-modal__dialog h2 {
    margin-top: 0;
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 640px) {
    .board-card__title-row,
    .board-hero__title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .access-mode-modal__dialog .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }
}
/* End Diggy: open boards */

/* Diggy: open board card width and create advanced settings */

/*
 * オープン掲示板も、通常の掲示板カードと同程度の幅で表示する。
 * 複数ある場合は左から横並びにし、入りきらなければ折り返す。
 */
.board-list-section--open .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 440px));
    justify-content: start;
    align-items: stretch;
}

.board-list-section--open .board-card {
    width: 100%;
}

/*
 * 新規掲示板作成画面の詳細設定。
 */
.board-create-advanced {
    margin: 0 0 1.5rem;
    overflow: visible;
    border: 1px solid #d6deea;
    border-radius: 0.8rem;
    background: #f8fafc;
}

.board-create-advanced__summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.5rem;
    padding: 0.9rem 1rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.board-create-advanced__summary::-webkit-details-marker {
    display: none;
}

.board-create-advanced__summary::before {
    content: "›";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    color: #2563eb;
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1;
    transform: rotate(0deg);
    transition: transform 0.18s ease;
}

.board-create-advanced[open] > .board-create-advanced__summary::before {
    transform: rotate(90deg);
}

.board-create-advanced__summary:hover {
    background: #f1f5f9;
}

.board-create-advanced__summary:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.22);
    outline-offset: 2px;
}

.board-create-advanced__title {
    font-weight: 700;
}

.board-create-advanced__description {
    color: #66758a;
    font-size: 0.9rem;
}

.board-create-advanced__body {
    padding: 0.25rem 1rem 1rem;
    border-top: 1px solid #dbe3ee;
    background: #fff;
    border-radius: 0 0 0.8rem 0.8rem;
}

.board-create-advanced__body .access-mode-control {
    margin-top: 1rem;
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .board-list-section--open .card-grid {
        grid-template-columns: 1fr;
    }

    .board-create-advanced__summary {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .board-create-advanced__description {
        width: calc(100% - 2.25rem);
        margin-left: 2.25rem;
    }
}

/* End Diggy: open board card width and create advanced settings */

/* Diggy: unified board card width */
.card-grid.board-card-grid {
    grid-template-columns: repeat(
        auto-fill,
        minmax(240px, 360px)
    );
    justify-content: start;
    align-items: stretch;
    gap: 1.5rem;
}

.card-grid.board-card-grid > .board-card {
    box-sizing: border-box;
    width: 100%;
    max-width: 360px;
}

@media (max-width: 640px) {
    .card-grid.board-card-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .card-grid.board-card-grid > .board-card {
        max-width: none;
    }
}
/* End Diggy: unified board card width */

/* Diggy: hashtags */
.hashtag-card {
    padding: 1rem;
}

.hashtag-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.hashtag-card__header h2 {
    margin: 0;
    font-size: 1rem;
}

.hashtag-nav {
    display: grid;
    gap: 0.25rem;
}

.hashtag-nav__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.48rem 0.55rem;
    border-radius: 0.45rem;
    color: inherit;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.hashtag-nav__item:hover,
.hashtag-nav__item--active {
    background: #eef4ff;
    color: #174ea6;
}

.hashtag-nav__count {
    flex: 0 0 auto;
    min-width: 1.6rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: #edf1f7;
    color: #5b687a;
    font-size: 0.75rem;
    text-align: center;
}

.hashtag-card__more {
    margin-top: 0.45rem;
}

.hashtag-card__more summary {
    cursor: pointer;
    color: #1557d6;
    font-weight: 700;
    list-style: none;
}

.hashtag-card__more summary::-webkit-details-marker {
    display: none;
}

.hashtag-card__close-label,
.hashtag-card__more[open] .hashtag-card__more-label {
    display: none;
}

.hashtag-card__more[open] .hashtag-card__close-label {
    display: inline;
}

.hashtag-nav--more {
    margin-top: 0.4rem;
}

.hashtag-link,
.post-hashtag-chip {
    color: #1557d6;
    font-weight: 700;
    text-decoration: none;
}

.hashtag-link:hover,
.post-hashtag-chip:hover {
    text-decoration: underline;
}

.post-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.55rem 0;
}

.post-hashtag-chip {
    padding: 0.22rem 0.48rem;
    border-radius: 999px;
    background: #eef4ff;
    font-size: 0.82rem;
}

.hashtag-suggest {
    position: fixed;
    z-index: 1600;
    max-height: 18rem;
    overflow-y: auto;
    padding: 0.35rem;
    border: 1px solid #cfd8e6;
    border-radius: 0.65rem;
    background: #fff;
    box-shadow: 0 14px 34px rgba(20, 37, 63, 0.2);
}

.hashtag-suggest__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.58rem 0.65rem;
    border: 0;
    border-radius: 0.45rem;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.hashtag-suggest__item:hover,
.hashtag-suggest__item[aria-selected="true"] {
    background: #eef4ff;
}

.hashtag-suggest__name {
    color: #1557d6;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.hashtag-suggest__count {
    flex: 0 0 auto;
    color: #66758a;
    font-size: 0.78rem;
}
/* End Diggy: hashtags */


/* Diggy: board post pagination */
.post-pagination {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.post-pagination__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.post-pagination__status {
    min-width: 180px;
    padding: 6px 10px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted-text, #5f6b7a);
}

.post-pagination__disabled {
    opacity: 0.45;
    pointer-events: none;
    cursor: default;
}

@media (max-width: 640px) {
    .post-pagination__inner {
        width: 100%;
    }

    .post-pagination__status {
        order: -1;
        width: 100%;
    }
}

/* Diggy: board workspace tabs and note wiki */
.board-workspace-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 0 24px;
}

.board-workspace-tabs {
    display: inline-flex;
    max-width: 100%;
    min-width: 0;
    padding: 4px;
    overflow-x: auto;
    border: 1px solid #d7dfed;
    border-radius: 14px;
    background: #eef3fb;
    scrollbar-width: thin;
}

.board-workspace-tabs__item {
    flex: 0 0 auto;
    min-width: 92px;
    padding: 11px 18px;
    border-radius: 10px;
    color: #43516a;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.board-workspace-tabs__item:hover {
    background: rgba(255, 255, 255, 0.72);
}

.board-workspace-tabs__item--active {
    background: #1557d6;
    color: #fff;
    box-shadow: 0 5px 14px rgba(21, 87, 214, 0.2);
}

.board-workspace-tabs__item--active:hover {
    background: #1557d6;
}


.board-workspace-tabs__item--external {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.board-workspace-tabs__external-mark {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.board-workspace-tabs__external-icon {
    display: block;
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.board-workspace-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.board-hero--compact {
    margin-bottom: 14px;
}

.note-commandbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    padding: 22px 24px;
    border: 1px solid #dce4f1;
    border-radius: 18px;
    background: #fff;
}

.note-commandbar h2 {
    margin: 2px 0 4px;
    font-size: 1.55rem;
}

.note-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(100%, 620px);
}

.note-search .form-control {
    flex: 1;
    min-width: 220px;
}

.note-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.note-card {
    display: flex;
    min-width: 0;
    min-height: 210px;
    flex-direction: column;
    padding: 22px;
}

.note-card__header,
.note-detail__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.note-card h3 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.45;
}

.note-card h3 a {
    color: #1055c8;
    text-decoration: none;
}

.note-card h3 a:hover {
    text-decoration: underline;
}

.note-version {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 28px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #edf3ff;
    color: #3a5f9e;
    font-size: 0.78rem;
    font-weight: 700;
}

.note-card__summary {
    margin: 16px 0;
    color: #344057;
    line-height: 1.75;
}

.note-card__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 14px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid #e5eaf2;
    color: #6d7789;
    font-size: 0.82rem;
}

.note-alias-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 2px 0 16px;
}

.note-alias {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border: 1px solid #d9e2f1;
    border-radius: 999px;
    background: #f7f9fd;
    color: #536178;
    font-size: 0.78rem;
}

.note-empty-state {
    grid-column: 1 / -1;
}

.note-detail {
    padding: 30px clamp(22px, 4vw, 52px);
}

.note-detail__header {
    padding-bottom: 22px;
    border-bottom: 1px solid #e2e8f1;
}

.note-detail__header h2 {
    margin: 4px 0 8px;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.3;
}

.note-detail__summary {
    margin: 8px 0 0;
    color: #59667b;
    font-size: 1.02rem;
    line-height: 1.75;
}

.note-detail__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.note-alias-list--detail {
    margin-top: 20px;
}

.wiki-note-body {
    padding: 30px 0;
    color: #202a38;
    font-size: 1rem;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.wiki-note-body > :first-child {
    margin-top: 0;
}

.wiki-note-body > :last-child {
    margin-bottom: 0;
}

.wiki-note-body h1,
.wiki-note-body h2,
.wiki-note-body h3,
.wiki-note-body h4,
.wiki-note-body h5,
.wiki-note-body h6 {
    margin: 1.75em 0 0.65em;
    color: #152238;
    line-height: 1.4;
}

.wiki-note-body h1 {
    padding-bottom: 0.35em;
    border-bottom: 2px solid #dce5f3;
    font-size: 1.85rem;
}

.wiki-note-body h2 {
    padding-bottom: 0.3em;
    border-bottom: 1px solid #e0e7f1;
    font-size: 1.5rem;
}

.wiki-note-body h3 {
    font-size: 1.25rem;
}

.wiki-note-body p,
.wiki-note-body ul,
.wiki-note-body ol,
.wiki-note-body blockquote,
.wiki-note-body pre {
    margin: 0 0 1.25em;
}

.wiki-note-body ul,
.wiki-note-body ol {
    padding-left: 1.8em;
}

.wiki-note-body blockquote {
    padding: 12px 18px;
    border-left: 4px solid #7da4ea;
    background: #f4f7fd;
    color: #536078;
}

.wiki-note-body pre {
    overflow: auto;
    padding: 18px;
    border-radius: 12px;
    background: #172033;
    color: #f2f5fb;
    line-height: 1.65;
}

.wiki-note-body code {
    padding: 0.15em 0.35em;
    border-radius: 5px;
    background: #eef2f8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
}

.wiki-note-body pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

.wiki-note-link {
    color: #0d5bd7;
    font-weight: 650;
    text-decoration: underline;
    text-decoration-color: rgba(13, 91, 215, 0.34);
    text-underline-offset: 3px;
}

.wiki-note-link::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 4px;
    vertical-align: -2px;
    background: url("../images/external-link-rich.a517ffcf4419.png") center / contain no-repeat;
    text-decoration: none;
}

.note-detail__footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f1;
    color: #68758a;
    font-size: 0.86rem;
}

.note-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 9px;
    border: 1px solid #ccd7e7;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    background: #f4f7fb;
}

.note-editor-toolbar button {
    padding: 6px 10px;
    border: 1px solid #cdd7e6;
    border-radius: 7px;
    background: #fff;
    color: #35445c;
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 650;
}

.note-editor-toolbar button:hover {
    border-color: #8eabe0;
    background: #edf3ff;
}

.note-editor__textarea {
    min-height: 460px;
    border-radius: 0 0 10px 10px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    line-height: 1.65;
    resize: vertical;
}

.note-history-list {
    display: grid;
    gap: 8px;
}

.note-history-row {
    display: grid;
    grid-template-columns: 70px minmax(180px, 1fr) minmax(130px, auto) minmax(130px, auto) auto;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid #e0e6f0;
    border-radius: 10px;
    color: #26344a;
    text-decoration: none;
}

.note-history-row:hover {
    border-color: #aac1e9;
    background: #f6f9ff;
}

.note-recent-history {
    margin-top: 22px;
}

@media (max-width: 1050px) {
    .note-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .board-workspace-toolbar,
    .note-commandbar {
        align-items: stretch;
        flex-direction: column;
    }

    .board-workspace-actions {
        justify-content: flex-start;
    }

    .note-search {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .board-workspace-tabs {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(120px, 1fr);
        grid-template-columns: none;
        width: 100%;
        overflow-x: auto;
    }

    .board-workspace-tabs__item {
        min-width: 0;
        white-space: nowrap;
    }

    .board-workspace-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .board-workspace-actions .button {
        width: 100%;
        justify-content: center;
    }

    .note-grid {
        grid-template-columns: 1fr;
    }

    .note-search {
        align-items: stretch;
        flex-direction: column;
    }

    .note-search .form-control {
        min-width: 0;
    }

    .note-detail__header {
        flex-direction: column;
    }

    .note-detail__actions {
        justify-content: flex-start;
    }

    .note-history-row {
        grid-template-columns: 60px 1fr;
    }

    .note-history-row > *:nth-child(n + 3) {
        grid-column: 2;
    }
}


/* Diggy: note attachments */
.note-attachments {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #e2e8f0);
}
.note-attachments h3 {
    margin: 0 0 12px;
    font-size: 1rem;
}
.note-attachment-manager {
    margin-top: 20px;
}
.attachment-edit-list {
    display: grid;
}
.attachment-edit-row > div {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
}
.attachment-edit-row a {
    overflow-wrap: anywhere;
}
/* End Diggy: note attachments */

/* Diggy: attachment open/download actions */
.attachment-card__name {
    font-weight: 700;
    overflow-wrap: anywhere;
}
.attachment-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding-top: 6px;
    border-top: 1px solid var(--border-color, #e2e8f0);
    font-size: 0.84rem;
}
.attachment-card__actions a,
.attachment-edit-row__actions a {
    white-space: nowrap;
}
.attachment-edit-row__actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 0.84rem;
}
/* End Diggy: attachment open/download actions */


/* Diggy: board-wide theme colors */
.page-shell.board-theme {
    --primary-contrast: #ffffff;
    --primary-text: #1557d6;
    --link-color: #1557d6;
    --primary-soft: #eaf2ff;
    --primary-soft-text: #174ea6;
    --primary-border: #9bbcf3;
    --primary-shadow: rgba(21, 87, 214, 0.2);
    --primary-focus: rgba(21, 87, 214, 0.18);
}

.page-shell.board-theme--blue {
    --primary: #1557d6;
    --primary-hover: #0f46b5;
}

.page-shell.board-theme--red {
    --primary: #ff3c1e;
    --primary-hover: #d92f17;
    --primary-contrast: #120705;
    --primary-text: #b92712;
    --link-color: #b92712;
    --primary-soft: #fff0ed;
    --primary-soft-text: #9f2512;
    --primary-border: #ffaaa0;
    --primary-shadow: rgba(255, 60, 30, 0.22);
    --primary-focus: rgba(255, 60, 30, 0.2);
}

.page-shell.board-theme--yellow {
    --primary: #fff000;
    --primary-hover: #e3d600;
    --primary-contrast: #222222;
    --primary-text: #756e00;
    --link-color: #756e00;
    --primary-soft: #fffbd1;
    --primary-soft-text: #665f00;
    --primary-border: #dfd200;
    --primary-shadow: rgba(255, 240, 0, 0.28);
    --primary-focus: rgba(223, 210, 0, 0.24);
}

.page-shell.board-theme--green {
    --primary: #32c83c;
    --primary-hover: #28a532;
    --primary-contrast: #102a12;
    --primary-text: #187421;
    --link-color: #187421;
    --primary-soft: #ebfaed;
    --primary-soft-text: #176b1d;
    --primary-border: #92df98;
    --primary-shadow: rgba(50, 200, 60, 0.22);
    --primary-focus: rgba(50, 200, 60, 0.2);
}

.board-theme .board-hero {
    padding-left: 18px;
    border-left: 5px solid var(--primary);
}

.board-theme .button:not(.button--secondary):not(.button--danger),
.board-theme .view-switch__item--active,
.board-theme .board-workspace-tabs__item--active {
    color: var(--primary-contrast);
}

.board-theme .board-hero__primary,
.board-theme .board-workspace-tabs__item--active {
    box-shadow: 0 6px 16px var(--primary-shadow);
}

.board-theme .board-workspace-tabs__item--active,
.board-theme .board-workspace-tabs__item--active:hover {
    background: var(--primary);
}

.board-theme .category-nav__item--active,
.board-theme .hashtag-nav__item--active,
.board-theme .hashtag-nav__item:hover,
.board-theme .other-board-nav__item:hover,
.board-theme .other-board-nav__item:focus-visible,
.board-theme .board-toolbar__status {
    background: var(--primary-soft);
    color: var(--primary-soft-text);
}

.board-theme .count-badge,
.board-theme .post-hashtag-chip {
    background: var(--primary-soft);
    color: var(--primary-soft-text);
}

.board-theme .hashtag-link,
.board-theme .post-hashtag-chip,
.board-theme .hashtag-card__more summary,
.board-theme .category-edit-link:hover {
    color: var(--primary-text);
}

.board-theme .eyebrow {
    color: var(--primary-text);
}

.board-theme .form-control:focus,
.board-theme .form-card input:focus,
.board-theme .form-card textarea:focus,
.board-theme .compact-select:focus {
    outline: 3px solid var(--primary-focus);
    border-color: var(--primary);
}

/* Theme indicator on board list cards */
.board-card[class*="board-card--theme-"] {
    position: relative;
    overflow: hidden;
}
.board-card[class*="board-card--theme-"]::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 6px;
    background: var(--board-card-theme, #1557d6);
}
.board-card--theme-blue { --board-card-theme: #1557d6; }
.board-card--theme-red { --board-card-theme: #ff3c1e; }
.board-card--theme-yellow { --board-card-theme: #fff000; }
.board-card--theme-green { --board-card-theme: #32c83c; }

/* Board theme selection */
.theme-color-control {
    margin-top: 1rem;
}
.theme-color-control__help {
    margin: -2px 0 12px;
}
.theme-color-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.theme-color-option {
    --theme-choice: #1557d6;
    position: relative;
    display: grid !important;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 76px;
    margin: 0 !important;
    padding: 12px 14px;
    border: 2px solid #d8e0eb;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.theme-color-option:hover {
    border-color: var(--theme-choice);
    transform: translateY(-1px);
}
.theme-color-option:has(input:checked) {
    border-color: var(--theme-choice);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-choice) 18%, transparent);
}
.theme-color-option__input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.theme-color-option__swatch {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(15, 23, 42, .16);
    border-radius: 9px;
    background: var(--theme-choice);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .28);
}
.theme-color-option__copy {
    display: grid;
    gap: 2px;
}
.theme-color-option__copy small {
    color: var(--muted);
    font-weight: 500;
}
.theme-color-option--blue { --theme-choice: #1557d6; }
.theme-color-option--red { --theme-choice: #ff3c1e; }
.theme-color-option--yellow { --theme-choice: #fff000; }
.theme-color-option--green { --theme-choice: #32c83c; }

/* Nested public-range disclosure */
.board-advanced-subsection {
    margin-top: 18px;
    border: 1px solid #dbe3ee;
    border-radius: 12px;
    background: #f8fafc;
}
.board-advanced-subsection__summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    padding: 11px 14px;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
}
.board-advanced-subsection__summary::-webkit-details-marker { display: none; }
.board-advanced-subsection__summary::before {
    content: "›";
    color: var(--primary-text, var(--primary));
    font-size: 1.35rem;
    line-height: 1;
    transition: transform .16s ease;
}
.board-advanced-subsection[open] > .board-advanced-subsection__summary::before {
    transform: rotate(90deg);
}
.board-advanced-subsection__summary small {
    margin-left: auto;
    color: var(--muted);
    font-weight: 500;
}
.board-advanced-subsection__summary:hover { background: #f1f5f9; }
.board-advanced-subsection__summary:focus-visible {
    outline: 3px solid var(--primary-focus, rgba(21, 87, 214, .18));
    outline-offset: 2px;
}
.board-advanced-subsection__body {
    padding: 4px 14px 14px;
    border-top: 1px solid #dbe3ee;
    background: #ffffff;
    border-radius: 0 0 12px 12px;
}
.board-advanced-subsection__body .access-mode-control,
.board-advanced-subsection__body .access-mode-current {
    margin: 14px 0 0;
}

@media (max-width: 640px) {
    .theme-color-options { grid-template-columns: 1fr; }
    .board-advanced-subsection__summary { align-items: flex-start; flex-wrap: wrap; }
    .board-advanced-subsection__summary small { width: 100%; margin-left: 29px; }
}
/* End Diggy: board-wide theme colors */


/* Diggy: board theme on topbar */
.topbar.board-theme--blue {
    background: #1557d6;
}

.topbar.board-theme--red {
    background: #ff3c1e;
}

.topbar.board-theme--yellow {
    background: #fff000;
}

.topbar.board-theme--green {
    background: #32c83c;
}

/* 青・赤・緑テーマは白文字 */
.topbar.board-theme--blue .brand,
.topbar.board-theme--blue .topbar__nav a,
.topbar.board-theme--blue .topbar__nav .link-button,
.topbar.board-theme--blue .topbar__nav .user-name,
.topbar.board-theme--red .brand,
.topbar.board-theme--red .topbar__nav a,
.topbar.board-theme--red .topbar__nav .link-button,
.topbar.board-theme--red .topbar__nav .user-name,
.topbar.board-theme--green .brand,
.topbar.board-theme--green .topbar__nav a,
.topbar.board-theme--green .topbar__nav .link-button,
.topbar.board-theme--green .topbar__nav .user-name {
    color: #ffffff;
}

/* 黄色テーマは濃い文字 */
.topbar.board-theme--yellow .brand,
.topbar.board-theme--yellow .topbar__nav a,
.topbar.board-theme--yellow .topbar__nav .link-button,
.topbar.board-theme--yellow .topbar__nav .user-name {
    color: #172033;
}

/* 黄色背景では白い犬ロゴを濃色化 */
.topbar.board-theme--yellow .diggy-dog-image--header {
    filter: brightness(0) saturate(100%);
}

/* 青・赤・緑へ戻した際は通常の白ロゴ */
.topbar.board-theme--blue .diggy-dog-image--header,
.topbar.board-theme--red .diggy-dog-image--header,
.topbar.board-theme--green .diggy-dog-image--header {
    filter: none;
}

.topbar.board-theme--blue .topbar__nav a:hover,
.topbar.board-theme--blue .topbar__nav .link-button:hover,
.topbar.board-theme--red .topbar__nav a:hover,
.topbar.board-theme--red .topbar__nav .link-button:hover,
.topbar.board-theme--green .topbar__nav a:hover,
.topbar.board-theme--green .topbar__nav .link-button:hover {
    background: rgba(255, 255, 255, 0.14);
}

.topbar.board-theme--yellow .topbar__nav a:hover,
.topbar.board-theme--yellow .topbar__nav .link-button:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* Diggy: filled theme controls text contrast */

/*
 * 青・赤・緑テーマ
 * テーマ色で塗られた主要ボタン・選択中タブだけ白文字にする。
 */
.page-shell:is(
    .board-theme--blue,
    .board-theme--red,
    .board-theme--green
) .button:not(.button--secondary):not(.button--danger),
.page-shell:is(
    .board-theme--blue,
    .board-theme--red,
    .board-theme--green
) .board-hero__primary,
.page-shell:is(
    .board-theme--blue,
    .board-theme--red,
    .board-theme--green
) .board-workspace-tabs__item--active,
.page-shell:is(
    .board-theme--blue,
    .board-theme--red,
    .board-theme--green
) [aria-pressed="true"],
.page-shell:is(
    .board-theme--blue,
    .board-theme--red,
    .board-theme--green
) [aria-current="page"].button,
.page-shell:is(
    .board-theme--blue,
    .board-theme--red,
    .board-theme--green
) [aria-current="true"],
.page-shell:is(
    .board-theme--blue,
    .board-theme--red,
    .board-theme--green
) .is-active {
    color: #ffffff !important;
}

/* 色付き要素の中にあるアイコンや子要素も同じ文字色にする */
.page-shell:is(
    .board-theme--blue,
    .board-theme--red,
    .board-theme--green
) .button:not(.button--secondary):not(.button--danger) *,
.page-shell:is(
    .board-theme--blue,
    .board-theme--red,
    .board-theme--green
) .board-hero__primary *,
.page-shell:is(
    .board-theme--blue,
    .board-theme--red,
    .board-theme--green
) .board-workspace-tabs__item--active *,
.page-shell:is(
    .board-theme--blue,
    .board-theme--red,
    .board-theme--green
) [aria-pressed="true"] * {
    color: inherit !important;
}

/*
 * 黄色テーマは黒系文字を維持する。
 */
.page-shell.board-theme--yellow
.button:not(.button--secondary):not(.button--danger),
.page-shell.board-theme--yellow
.board-hero__primary,
.page-shell.board-theme--yellow
.board-workspace-tabs__item--active,
.page-shell.board-theme--yellow
[aria-pressed="true"],
.page-shell.board-theme--yellow
[aria-current="page"].button,
.page-shell.board-theme--yellow
[aria-current="true"],
.page-shell.board-theme--yellow
.is-active {
    color: #172033 !important;
}


/* Diggy: active view switch theme contrast */

/* 青・赤・緑は選択中を白文字にする */
.page-shell.board-theme--blue
.board-commandbar
.view-switch__item.view-switch__item--active,
.page-shell.board-theme--red
.board-commandbar
.view-switch__item.view-switch__item--active,
.page-shell.board-theme--green
.board-commandbar
.view-switch__item.view-switch__item--active {
    color: #ffffff !important;
}

/* 黄色だけは濃い文字を維持する */
.page-shell.board-theme--yellow
.board-commandbar
.view-switch__item.view-switch__item--active {
    color: #172033 !important;
}


/* Diggy: resizable category cards and common categories */
.resizable-sidebar-card {
    position: relative;
    min-height: 180px;
    max-height: 70vh;
    overflow: auto;
    resize: vertical;
}

.resizable-sidebar-card::after {
    content: "";
    position: sticky;
    display: block;
    width: 42px;
    height: 4px;
    margin: 12px auto 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary, #1557d6) 35%, transparent);
    pointer-events: none;
}

.sidebar-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sidebar-card-heading h2 {
    margin: 0;
}

.card-height-reset {
    border: 0;
    background: transparent;
    color: var(--muted-text, #667085);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 7px;
    border-radius: 8px;
}

.card-height-reset:hover {
    background: rgba(15, 23, 42, 0.07);
}

.category-card-empty {
    display: block;
    padding: 8px 10px;
}

.post-category-form--common {
    border-top: 1px dashed var(--border-color, #dbe2ea);
    padding-top: 10px;
}

.post-common-category-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 0;
    color: var(--muted-text, #667085);
    font-size: 0.9rem;
}

.post-common-category-label span {
    font-weight: 700;
}

.category-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.common-category-create-form {
    margin-bottom: 20px;
}

.common-category-card {
    padding: 14px;
    border-radius: 16px;
}

.common-category-card .sidebar-card-heading {
    margin: 2px 8px 10px;
}

.common-category-card .sidebar-card-heading h2 {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


/* Diggy: collapsible post category settings */
.post-category-settings {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.post-category-settings > summary {
    width: fit-content;
    color: var(--muted-text, #667085);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.5;
    user-select: none;
}

.post-category-settings > summary:hover {
    color: var(--text, #172033);
}

.post-category-settings > summary:focus-visible {
    outline: 3px solid var(--focus-ring, rgba(21, 87, 214, 0.24));
    outline-offset: 4px;
    border-radius: 4px;
}

.post-category-settings[open] > summary {
    margin-bottom: 2px;
}

.post-category-settings__body > .post-category-form:first-child {
    margin-top: 10px;
    padding-top: 0;
    border-top: 0;
}

.post-category-settings__body > .post-common-category-label:first-child {
    margin-top: 10px;
}

/* Diggy: page loading overlay */
body.page-loading-active {
    cursor: progress;
}

.page-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(245, 247, 250, 0.82);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.page-loading-overlay[hidden] {
    display: none !important;
}

.page-loading-overlay__panel {
    width: min(360px, 100%);
    min-height: 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 30px;
    border: 1px solid color-mix(
        in srgb,
        var(--primary, #1557d6) 24%,
        #dfe4ea
    );
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(16, 24, 40, 0.2);
    text-align: center;
}

.page-loading-overlay__dog {
    width: 72px;
    height: 72px;
    object-fit: contain;
    margin-bottom: 12px;
}

.page-loading-overlay__spinner {
    width: 34px;
    height: 34px;
    border: 4px solid color-mix(
        in srgb,
        var(--primary, #1557d6) 20%,
        transparent
    );
    border-top-color: var(--primary, #1557d6);
    border-radius: 50%;
    animation: diggy-loading-spin 0.8s linear infinite;
}

.page-loading-overlay__message {
    margin: 14px 0 0;
    color: var(--text);
    font-size: 1.05rem;
    font-weight: 800;
}

.page-loading-overlay__slow {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

@keyframes diggy-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-loading-overlay__spinner {
        animation-duration: 1.8s;
    }
}

@media (max-width: 640px) {
    .page-loading-overlay {
        padding: 18px;
    }

    .page-loading-overlay__panel {
        width: min(310px, 100%);
        min-height: 210px;
        padding: 24px;
    }

    .page-loading-overlay__dog {
        width: 64px;
        height: 64px;
    }
}

/* Diggy: content switch tab settings */
.content-tab-settings {
    display: grid;
    gap: 22px;
}

.content-tab-settings__standard,
.content-tab-settings__extras {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.content-tab-settings__extra {
    min-width: 0;
    margin: 0;
    padding: 18px;
    border: 1px solid #dce4f1;
    border-radius: 14px;
    background: #f8fafc;
}

.content-tab-settings__extra legend {
    padding: 0 8px;
    color: #27364f;
    font-weight: 800;
}

.content-tab-settings__extra .form-group:last-child {
    margin-bottom: 0;
}

@media (max-width: 700px) {
    .content-tab-settings__standard,
    .content-tab-settings__extras {
        grid-template-columns: 1fr;
    }
}
/* End Diggy: content switch tab settings */

/* Diggy: common category access management */
.category-access-notice p:last-child {
    margin-bottom: 0;
}

.common-category-access-form {
    display: grid;
    gap: 24px;
}

.category-access-mode {
    margin: 0;
    padding: 0;
    border: 0;
}

.category-access-mode legend {
    margin-bottom: 12px;
    font-size: 1.05rem;
    font-weight: 800;
}

.category-access-mode ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-access-mode label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #d7deea;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
}

.category-access-mode input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.category-access-restricted {
    display: grid;
    gap: 20px;
    padding: 20px;
    border: 1px solid #dce4f1;
    border-radius: 16px;
    background: #f8fafc;
}

.category-access-restricted[hidden] {
    display: none;
}

.category-access-search {
    position: relative;
}

.category-access-search > label {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
}

.category-access-search__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.category-access-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 80;
    max-height: 320px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid #cfd8e6;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 36px rgba(16, 24, 40, 0.18);
}

.category-access-suggestion {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.category-access-suggestion:hover,
.category-access-suggestion:focus-visible {
    background: #eef4ff;
}

.category-access-suggestion__type {
    align-self: start;
    padding: 3px 7px;
    border-radius: 999px;
    background: #e8eef8;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.category-access-suggestion__copy,
.category-access-selected__copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.category-access-suggestion__copy span,
.category-access-selected__copy span {
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 0.88rem;
}

.category-access-selected h3 {
    margin-bottom: 10px;
}

.category-access-selected__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.category-access-selected__item:first-child {
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 640px) {
    .category-access-search__row {
        grid-template-columns: 1fr;
    }

    .category-access-selected__item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .category-access-selected__item .button {
        grid-column: 1 / -1;
        justify-self: end;
    }
}
/* End Diggy: common category access management */

/* Diggy privileged admin */
.diggy-admin-heading {
    align-items: flex-start;
}

.diggy-admin-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.diggy-admin-summary__card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1.1rem;
}

.diggy-admin-summary__label {
    color: #4b5563;
    font-size: 0.9rem;
    font-weight: 700;
}

.diggy-admin-summary__value {
    color: #111827;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1;
}

.diggy-admin-filter {
    display: grid;
    grid-template-columns: minmax(16rem, 2fr) repeat(3, minmax(9rem, 1fr)) auto;
    gap: 0.9rem;
    align-items: end;
    margin: 1rem 0 1.25rem;
}

.diggy-admin-filter__actions {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    padding-bottom: 0.05rem;
}

.diggy-admin-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
}

.diggy-admin-table {
    width: 100%;
    min-width: 72rem;
    border-collapse: collapse;
    background: #fff;
}

.diggy-admin-table th,
.diggy-admin-table td {
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: middle;
}

.diggy-admin-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    color: #374151;
    font-size: 0.85rem;
    white-space: nowrap;
}

.diggy-admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.diggy-admin-table tbody tr:hover {
    background: #f8fbff;
}

.diggy-admin-table__email {
    display: block;
    margin-top: 0.18rem;
    color: #6b7280;
    font-size: 0.86rem;
    word-break: break-all;
}

@media (max-width: 1100px) {
    .diggy-admin-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .diggy-admin-filter {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .diggy-admin-filter__search,
    .diggy-admin-filter__actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .diggy-admin-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.7rem;
    }

    .diggy-admin-summary__card {
        padding: 0.9rem;
    }

    .diggy-admin-filter {
        grid-template-columns: 1fr;
    }

    .diggy-admin-filter__search,
    .diggy-admin-filter__actions {
        grid-column: auto;
    }

    .diggy-admin-filter__actions {
        flex-wrap: wrap;
    }
}



/* Diggy: per-user hidden boards and board card menu */
.board-card {
    position: relative;
}

.board-card--menu-enabled .board-card__title-row {
    padding-right: 2.4rem;
}

.board-card--menu-open {
    z-index: 10;
}

.board-card__options {
    position: absolute;
    z-index: 8;
    top: 0.8rem;
    right: 0.8rem;
}

.board-card__menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    cursor: pointer;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1;
}

.board-card__menu-trigger:hover,
.board-card__menu-trigger:focus-visible,
.board-card__menu-trigger[aria-expanded="true"] {
    background: #eef2f7;
    color: var(--text);
}

.board-card__menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    width: max-content;
    min-width: 13rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    background: var(--surface);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
}

.board-card__menu[hidden] {
    display: none;
}

.board-card__menu form {
    margin: 0;
}

.board-card__menu-item {
    width: 100%;
    padding: 0.75rem 0.9rem;
    cursor: pointer;
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-weight: 700;
    text-align: left;
}

.board-card__menu-item:hover,
.board-card__menu-item:focus-visible {
    background: #f2f5f9;
}

.board-card--hidden {
    border-style: dashed;
}

@media (max-width: 640px) {
    .board-card__options {
        top: 0.65rem;
        right: 0.65rem;
    }

    .board-card__menu-trigger {
        width: 2.65rem;
        height: 2.65rem;
    }

    .board-card__menu {
        max-width: calc(100vw - 3rem);
    }
}
/* End Diggy: per-user hidden boards and board card menu */


/* Diggy: board description links and four-line card clamp */
.board-card__description,
.board-hero__description {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.board-card__description a,
.board-hero__description a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.board-card__description--clamped {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
}
/* End Diggy: board description links and four-line card clamp */
