/* ============================================================
   よこ糸 — Blue Design System
   ============================================================ */

/* ---- Variables ---- */
:root {
    --blue-50:  #EFF6FF;
    --blue-100: #DBEAFE;
    --blue-200: #BFDBFE;
    --blue-300: #93C5FD;
    --blue-400: #60A5FA;
    --blue-500: #3B82F6;
    --blue-600: #2563EB;
    --blue-700: #1D4ED8;
    --blue-800: #1E40AF;

    --gray-50:  #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-700: #334155;
    --gray-900: #0F172A;

    --green-500: #22C55E;
    --green-100: #DCFCE7;
    --green-800: #166534;
    --red-500:   #EF4444;
    --red-100:   #FEE2E2;
    --red-800:   #991B1B;
    --yellow-400: #FACC15;
    --yellow-100: #FEF9C3;
    --yellow-800: #854D0E;

    --orange-50:  #FFF7ED;
    --orange-100: #FFEDD5;
    --orange-500: #F97316;
    --orange-800: #9A3412;

    --indigo-50:  #EEF2FF;
    --indigo-100: #E0E7FF;
    --indigo-500: #6366F1;
    --indigo-800: #3730A3;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --shadow:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
    --transition: .18s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP",
                 system-ui, -apple-system, sans-serif;
    line-height: 1.65;
    color: var(--gray-900);
    background: var(--gray-50);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   Header / Navigation
   ============================================================ */
.site-header {
    background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-500) 100%);
    box-shadow: 0 2px 8px rgba(37,99,235,.35);
    position: sticky;
    top: 0;
    z-index: 200;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: .5rem;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    text-decoration: none;
    letter-spacing: -.01em;
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: opacity var(--transition);
    flex-shrink: 0;
}
.nav-logo:hover { opacity: .85; }

/* PC中央ナビリンク群 */
.nav-links {
    display: flex;
    align-items: center;
    gap: .15rem;
    flex: 1;
}

/* 右端エリア */
.nav-right {
    display: flex;
    align-items: center;
    gap: .15rem;
    flex-shrink: 0;
}

.nav-link {
    color: rgba(255,255,255,.9);
    text-decoration: none;
    font-size: .875rem;
    font-weight: 500;
    padding: .35rem .75rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    line-height: inherit;
}
.nav-link:hover {
    background: rgba(255,255,255,.18);
    color: #fff;
}

.nav-divider {
    width: 1px;
    height: 20px;
    background: rgba(255,255,255,.3);
    margin: 0 .5rem;
}

.nav-user {
    font-size: .875rem;
    font-weight: 600;
    color: var(--yellow-400);
    padding: 0 .5rem;
}

.nav-logout {
    color: rgba(255,255,255,.7);
    border: 1px solid rgba(255,255,255,.3);
}
.nav-logout:hover {
    background: rgba(255,255,255,.15);
    color: #fff;
    border-color: rgba(255,255,255,.5);
}

/* ── 管理ドロップダウン（PC）── */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-btn {
    display: flex;
    align-items: center;
    gap: .25rem;
}
.dropdown-arrow {
    font-size: .7rem;
    transition: transform .2s;
}
.nav-dropdown.open .dropdown-arrow { transform: rotate(180deg); }
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 4px 20px rgba(0,0,0,.15);
    min-width: 180px;
    padding: .4rem 0;
    z-index: 300;
}
.nav-dropdown.open .nav-dropdown-menu { display: block; }
.dropdown-item {
    display: block;
    padding: .55rem 1rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--gray-700);
    text-decoration: none;
    transition: background var(--transition);
    white-space: nowrap;
}
.dropdown-item:hover { background: var(--blue-50); color: var(--blue-700); }

/* ── ハンバーガーボタン（モバイル専用 — デフォルトは非表示）── */
.nav-hamburger {
    display: none;                          /* PCでは非表示 */
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.nav-hamburger:hover { background: rgba(255,255,255,.18); }
.nav-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
}

/* ── 表示切り替えヘルパー ── */
/* PC専用: デフォルト表示、モバイルで隠す */
.nav-pc-only { display: flex; }

/* ============================================================
   Bottom Navigation（モバイル専用 — デフォルトは非表示）
   ============================================================ */
.bottom-nav {
    display: none;                          /* PCでは非表示 */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    align-items: stretch;
    z-index: 200;
    box-shadow: 0 -2px 8px rgba(0,0,0,.07);
}
.bni {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: #6b7280;
    font-size: .68rem;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 6px 2px;
    transition: color .15s, background .15s;
    -webkit-tap-highlight-color: transparent;
}
.bni:hover, .bni:active { background: #f0f4ff; color: var(--blue-600); }
.bni-icon { font-size: 1.35rem; line-height: 1; }
.bni-label { font-size: .62rem; }

/* SOS ボタンを強調 */
.bni-sos {
    color: #dc2626;
    background: #fff5f5;
    margin: 4px 4px;
    border-radius: 12px;
    border: 1px solid #fee2e2;
}
.bni-sos:hover, .bni-sos:active { background: #fee2e2; color: #b91c1c; }
.bni-sos .bni-icon { font-size: 1.5rem; }

/* ボトムナビ用バッジ */
.bni-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--red-500);
    color: #fff;
    font-size: .55rem;
    font-weight: 700;
    min-width: 14px;
    height: 14px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

/* ============================================================
   Mobile Drawer
   ============================================================ */
.mobile-drawer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
}
.mobile-drawer.open { display: block; }
.drawer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    animation: fadeIn .2s ease;
}
.drawer-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 20px 20px 0 0;
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
    animation: slideUp .25s ease;
    max-height: 85dvh;
    overflow-y: auto;
}
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem .75rem;
    border-bottom: 1px solid #f0f0f0;
}
.drawer-username {
    font-weight: 700;
    font-size: .95rem;
    color: var(--gray-700);
}
.drawer-close {
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: .9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
}
.drawer-links {
    padding: .5rem 0 1rem;
}
.drawer-link {
    display: block;
    padding: .85rem 1.5rem;
    font-size: .95rem;
    font-weight: 500;
    color: var(--gray-700);
    text-decoration: none;
    transition: background .15s;
}
.drawer-link:hover, .drawer-link:active { background: var(--blue-50); color: var(--blue-700); }
.drawer-divider {
    height: 1px;
    background: #f0f0f0;
    margin: .5rem 0;
}
.drawer-section-label {
    display: block;
    padding: .25rem 1.5rem .1rem;
    font-size: .72rem;
    font-weight: 700;
    color: #9ca3af;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.drawer-logout { color: #dc2626; }
.drawer-logout:hover { background: #fff5f5; color: #b91c1c; }

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(60px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============================================================
   Main content
   ============================================================ */
main {
    flex: 1;
    max-width: 960px;
    width: 100%;
    margin: 2rem auto;
    padding: 0 1.25rem;
}

h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--blue-700);
    margin-bottom: 1.25rem;
    letter-spacing: -.02em;
    line-height: 1.3;
}
h2 { font-size: 1.35rem; font-weight: 700; color: var(--gray-700); margin-bottom: .75rem; }
h3 { font-size: 1.1rem;  font-weight: 700; color: var(--gray-700); }

/* ============================================================
   Flash messages
   ============================================================ */
.flash {
    padding: .85rem 1.1rem;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    animation: slideDown .25s ease;
}
.flash::before { font-size: 1.1rem; }
.flash.success {
    background: var(--green-100);
    color: var(--green-800);
    border-left: 4px solid var(--green-500);
}
.flash.success::before { content: "✅"; }
.flash.error {
    background: var(--red-100);
    color: var(--red-800);
    border-left: 4px solid var(--red-500);
}
.flash.error::before { content: "❌"; }
.flash.info {
    background: var(--blue-50);
    color: var(--blue-800);
    border-left: 4px solid var(--blue-400);
}
.flash.info::before { content: "ℹ️"; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary, .btn-secondary, .btn-danger, .btn-success {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem 1.1rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: .9rem;
    font-weight: 600;
    letter-spacing: .01em;
    transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
    box-shadow: var(--shadow-sm);
}
.btn-primary:hover, .btn-secondary:hover, .btn-danger:hover, .btn-success:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    filter: brightness(1.07);
}
.btn-primary:active, .btn-secondary:active, .btn-danger:active, .btn-success:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
    filter: brightness(.95);
}

.btn-primary   { background: var(--blue-600); color: #fff; }
.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-danger    { background: var(--red-500);  color: #fff; }
.btn-success   { background: var(--green-500); color: #fff; }
.btn-sm { padding: .3rem .7rem; font-size: .82rem; }

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: 1.1rem; }
.form-group label {
    display: block;
    margin-bottom: .35rem;
    font-weight: 600;
    font-size: .875rem;
    color: var(--gray-700);
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: .55rem .8rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: #fff;
    font-size: .9rem;
    color: var(--gray-900);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--blue-400);
    box-shadow: 0 0 0 3px rgba(96,165,250,.2);
}
.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check label { font-weight: 400; font-size: .9rem; }
.form-actions { margin-top: 1.5rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.required { color: var(--red-500); }
.hint { font-weight: 400; font-size: .82em; color: var(--gray-400); }

/* Form card wrapper */
form:not(.inline-form) {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    max-width: 540px;
}

/* ============================================================
   Home page
   ============================================================ */
.home-menu {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.home-menu li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1.5rem 1rem;
    background: #fff;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--blue-600);
    font-size: 1rem;
    font-weight: 700;
    box-shadow: var(--shadow);
    border: 2px solid transparent;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.home-menu li a:hover {
    border-color: var(--blue-300);
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    color: var(--blue-700);
}
.home-menu li a .menu-icon { font-size: 2rem; }

/* ============================================================
   Board / Post list
   ============================================================ */
.board-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}
.post-list { list-style: none; }
.post-item {
    background: #fff;
    border-radius: var(--radius);
    padding: .9rem 1.1rem;
    margin-bottom: .6rem;
    border: 1.5px solid var(--gray-200);
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.post-item:hover {
    border-color: var(--blue-200);
    box-shadow: var(--shadow);
    transform: translateX(3px);
}
.post-item a { color: var(--blue-600); text-decoration: none; font-weight: 600; }
.post-item a:hover { color: var(--blue-700); text-decoration: underline; }
.post-item.pinned {
    background: linear-gradient(90deg, var(--yellow-100) 0%, #fff 100%);
    border-color: var(--yellow-400);
}
.pin-badge { margin-right: .3rem; }
.post-meta { font-size: .82em; color: var(--gray-400); margin-left: .5rem; }
.pagination {
    margin-top: 1.25rem;
    display: flex;
    gap: .75rem;
    align-items: center;
    justify-content: center;
}
.empty { color: var(--gray-400); margin-top: 1rem; text-align: center; padding: 2rem; }
.pinned-posts { margin-bottom: 1.5rem; }
.normal-posts h2 { margin-bottom: .75rem; }

/* ============================================================
   User management table
   ============================================================ */
.user-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.user-table th,
.user-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    text-align: left;
    font-size: .9rem;
}
.user-table th {
    background: var(--blue-600);
    color: #fff;
    font-weight: 600;
    font-size: .82rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.user-table tr:last-child td { border-bottom: none; }
.user-table tbody tr:hover { background: var(--blue-50); }
.user-table tr.inactive { opacity: .5; }
.user-actions { white-space: nowrap; display: flex; gap: .35rem; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: .76em;
    font-weight: 700;
    letter-spacing: .03em;
}
.badge-admin   { background: var(--red-100); color: #DC2626; }
.badge-manager { background: #FEF3C7;        color: #D97706; }
.badge-member  { background: var(--gray-100); color: var(--gray-500); }

/* ============================================================
   Org management
   ============================================================ */
.org-section {
    margin-bottom: 1.25rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}
.org-section:hover { box-shadow: var(--shadow); }
.org-division-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .75rem;
}
.org-division-header h3 {
    margin: 0;
    flex: 1;
    color: var(--blue-700);
    font-size: 1.05rem;
}
.org-section-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 1.75rem 0 .75rem;
    padding-bottom: .35rem;
    border-bottom: 3px solid var(--blue-500);
    color: var(--blue-700);
}

/* ============================================================
   Profile page
   ============================================================ */
.profile-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    max-width: 560px;
}
.profile-dl {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: .6rem 1rem;
}
.profile-dl dt {
    font-weight: 700;
    color: var(--gray-500);
    font-size: .875rem;
    display: flex;
    align-items: center;
    gap: .35rem;
}
.profile-dl dd { color: var(--gray-900); font-size: .9rem; }

/* ============================================================
   Board (talknote style)
   ============================================================ */

/* main 要素のオーバーライド */
main.board-main-wrapper {
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    height: calc(100vh - 56px);
}

/* board-layout: サイドバー ＋ コンテンツを横並びにする本体 */
.board-layout {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ── サイドバー ── */
.board-sidebar {
    width: 160px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.board-sidebar-inner { padding: 0.75rem 0; }
.board-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--gray-400);
    padding: 0.5rem 1rem 0.25rem;
}
.board-nav-link {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.855rem;
    border-left: 3px solid transparent;
    transition: background var(--transition), color var(--transition);
}
.board-nav-link:hover { background: var(--blue-50); color: var(--blue-700); }
.board-nav-link.active {
    background: var(--blue-50);
    color: var(--blue-700);
    font-weight: 600;
    border-left-color: var(--blue-500);
}
.board-nav-icon { font-size: 0.9rem; flex-shrink: 0; }
.board-nav-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-nav-add {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    margin-top: 0.25rem;
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.8rem;
    transition: color var(--transition);
}
.board-nav-add:hover { color: var(--blue-600); }

/* PWA インストールボタン */
.board-pwa-install-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    margin: 0.75rem 0 0;
    padding: 0.5rem 1rem;
    background: var(--blue-50);
    border: 1px solid var(--blue-200);
    border-radius: 8px;
    color: var(--blue-700);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition);
}
.board-pwa-install-btn:hover { background: var(--blue-100); }

/* ── メインコンテンツ ── */
.board-content {
    flex: 1 1 auto;
    overflow-y: auto;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
}
.board-flashes { padding: 0.5rem 1.5rem 0; }

/* ── ノートヘッダー ── */
.note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 10;
}
.note-header-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
}
.note-header-actions { display: flex; gap: 0.5rem; }

/* ── 投稿入力 ── */
.post-input-area {
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    padding: 0.6rem 0 0;
    border-bottom: 1px solid #ebebeb;
    transition: background var(--transition);
}
.post-input-area form {
    display: block;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}
.post-input-area.drag-over {
    background: var(--blue-50);
}
.post-input-area textarea {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    border: none;
    padding: 0.25rem 0.75rem;
    min-height: 80px;
    resize: none;
    overflow: hidden;
    font-size: 0.93rem;
    font-family: inherit;
    line-height: 1.65;
    box-sizing: border-box;
    background: transparent;
    color: var(--gray-900);
}
.post-input-area textarea::placeholder { color: var(--gray-300); }
.post-input-area textarea:focus { outline: none; }
.post-input-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.4rem;
    padding: 0.4rem 0.75rem 0.6rem;
    border-top: 1px solid #f0f0f0;
}

/* ファイル添付テキストボタン（ドロップゾーン兼用） */
.attach-text-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    position: relative;
    transition: color var(--transition), background var(--transition);
    user-select: none;
}
.attach-text-btn:hover, .attach-text-btn.drag-over {
    color: var(--blue-600);
    background: var(--blue-50);
}
.attach-text-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

/* 投稿ボタン */
.btn-post {
    -webkit-appearance: none;
    appearance: none;
    background: var(--gray-700);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.4rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}
.btn-post:hover { background: var(--gray-900); }

/* 添付ファイルプレビュー（投稿前） */
.attach-preview {
    margin-top: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.attach-preview-chip {
    background: var(--blue-50);
    border: 1px solid var(--blue-200);
    border-radius: 4px;
    padding: 0.15rem 0.45rem;
    font-size: 0.75rem;
    color: var(--blue-700);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.attach-preview-chip button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--blue-400);
    padding: 0;
    line-height: 1;
}

/* 添付ファイル表示（投稿カード内） */
.post-attachments {
    padding-left: calc(38px + 0.6rem);
    margin-bottom: 0.3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.attach-file-card {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
    color: var(--gray-700);
    text-decoration: none;
    transition: background var(--transition);
    max-width: 260px;
    overflow: hidden;
}
.attach-file-card:hover { background: var(--blue-50); border-color: var(--blue-200); color: var(--blue-700); }
.attach-file-card .attach-icon { font-size: 1rem; flex-shrink: 0; }
.attach-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 投稿フィード ── */
.post-feed { flex: 1; }

/* ── 投稿カード ── */
.post-card {
    background: #fff;
    border-bottom: 1px solid #ebebeb;
    padding: 0.85rem 0.75rem 0.65rem;
}
.post-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
}

/* ── アバター ── */
.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    flex-shrink: 0;
}
.avatar.avatar-sm { width: 26px; height: 26px; font-size: 0.72rem; }
.av-0 { background: #E53E3E; } .av-1 { background: #3182CE; }
.av-2 { background: #38A169; } .av-3 { background: #D69E2E; }
.av-4 { background: #805AD5; } .av-5 { background: #00B5D8; }
.av-6 { background: #DD6B20; } .av-7 { background: #2D3748; }

/* ヘッダー内のメタ情報（名前＋バッジ） */
.post-meta {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
}
.post-author {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--gray-900);
    white-space: nowrap;
}
.post-note-badge {
    font-size: 0.72rem;
    color: var(--gray-400);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.post-time { font-size: 0.72rem; color: var(--gray-400); white-space: nowrap; flex-shrink: 0; }

/* 本文（フル幅・インデントなし） */
.post-body-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
    font-size: 0.9rem;
    color: var(--gray-900);
    margin: 0 0 0.6rem;
}

/* 添付ファイル（フル幅） */
.post-attachments {
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* アクション行 */
.post-footer {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    flex-wrap: wrap;
}

/* ノートヘッダーの削除ボタン */
.btn-danger-sm {
    all: unset;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--red-400);
    font-family: inherit;
    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    transition: color var(--transition), background var(--transition);
}
.btn-danger-sm:hover { color: var(--red-600); background: #fff0f0; }

/* いいね・削除・編集ボタン（all:unset で完全リセット） */
.btn-like, .btn-delete-link, .btn-edit-link {
    all: unset;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-family: inherit;
    line-height: 1;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.btn-like:hover { color: var(--red-500); background: #fff5f5; }
.btn-like.liked { color: var(--red-500); font-weight: 600; }
.btn-delete-link:hover { color: var(--red-400); background: #fff5f5; }
.btn-edit-link:hover { color: var(--blue-500); background: var(--blue-50); }

/* インライン編集エリア（投稿） */
.post-edit-area {
    margin: 0.3rem 0 0.4rem;
}
.post-edit-textarea {
    width: 100%;
    border: 1px solid var(--blue-300);
    border-radius: 6px;
    padding: 0.4rem 0.5rem;
    font-size: 0.93rem;
    font-family: inherit;
    line-height: 1.65;
    resize: vertical;
    min-height: 64px;
    box-sizing: border-box;
    background: #fff;
}
.post-edit-textarea:focus { outline: none; border-color: var(--blue-500); }
.post-edit-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.3rem;
}
.btn-edit-save {
    all: unset;
    cursor: pointer;
    font-size: 0.78rem;
    font-family: inherit;
    background: var(--blue-500);
    color: #fff;
    padding: 0.2rem 0.7rem;
    border-radius: 4px;
    transition: background 0.15s;
}
.btn-edit-save:hover { background: var(--blue-600); }
.btn-edit-cancel {
    all: unset;
    cursor: pointer;
    font-size: 0.78rem;
    font-family: inherit;
    color: var(--gray-400);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.btn-edit-cancel:hover { color: var(--gray-700); background: var(--gray-100); }

/* インライン編集エリア（コメント） */
.comment-edit-area {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.2rem;
    flex-wrap: wrap;
}
.comment-edit-input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--blue-300);
    border-radius: 12px;
    padding: 0.2rem 0.55rem;
    font-size: 0.84rem;
    font-family: inherit;
    background: #fff;
}
.comment-edit-input:focus { outline: none; border-color: var(--blue-500); }
.comment-edit-btn {
    all: unset;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 0.68rem;
    font-family: inherit;
    transition: color 0.15s;
    margin-left: 0.2rem;
}
.comment-edit-btn:hover { color: var(--blue-500); }

/* いいねした人 */
.like-who {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.74rem;
    color: var(--gray-400);
    margin-top: 0.2rem;
}
.like-who-avatars {
    display: flex;
    gap: 0.15rem;
}
.like-mini-av {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.like-who-names { color: var(--gray-400); }

/* ── コメント ── */
.comments-section {
    margin-top: 0.6rem;
    border-top: 1px solid #f0f0f0;
    padding-top: 0.5rem;
}
.comment-item {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
    align-items: flex-start;
}
/* コンテンツ＋アクションをインラインでまとめる */
.comment-content {
    font-size: 0.84rem;
    line-height: 1.55;
    color: var(--gray-800);
    min-width: 0;
}
.comment-author-name {
    font-weight: 700;
    color: var(--gray-900);
    margin-right: 0.35rem;
}
.comment-body-text { color: var(--gray-800); }
.comment-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.25rem;
}
/* アクション（いいね・削除）をコンテンツの後にインラインで */
.comment-actions {
    display: inline;
    margin-left: 0.5rem;
    white-space: nowrap;
}
.comment-like-btn {
    all: unset;
    cursor: pointer;
    color: var(--gray-300);
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    gap: 0.1rem;
    font-family: inherit;
    transition: color 0.15s;
    margin-left: 0.3rem;
}
.comment-like-btn:hover { color: var(--red-400); }
.comment-like-btn.liked { color: var(--red-400); font-weight: 600; }
.comment-delete-btn {
    all: unset;
    cursor: pointer;
    color: var(--gray-300);
    font-size: 0.68rem;
    font-family: inherit;
    transition: color 0.15s;
    margin-left: 0.25rem;
}
.comment-delete-btn:hover { color: var(--red-400); }

/* コメントいいねした人 */
.comment-like-who {
    display: inline;
    font-size: 0.68rem;
    color: var(--gray-400);
    margin-left: 0.25rem;
}

/* コメント入力 */
.comment-input-wrap { margin-top: 0.3rem; }
.comment-input-row {
    display: flex;
    align-items: center;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    background: var(--gray-50);
    padding: 0 0.5rem 0 0;
    transition: border var(--transition), background var(--transition);
}
.comment-input-row:focus-within,
.comment-input-row.drag-over { border-color: var(--blue-300); background: #fff; }
.comment-attach-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    font-size: 0.85rem;
    color: var(--gray-400);
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 50%;
    position: relative;
    transition: color var(--transition), background var(--transition);
}
.comment-attach-btn:hover, .comment-attach-btn.drag-over {
    color: var(--blue-500);
    background: var(--blue-50);
}
.comment-attach-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.comment-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.4rem 0.4rem;
    font-size: 0.85rem;
    font-family: inherit;
}
.comment-input:focus { outline: none; }
.comment-submit-btn {
    -webkit-appearance: none;
    appearance: none;
    background: none;
    border: none;
    box-shadow: none;
    cursor: pointer;
    color: var(--blue-500);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0 0.3rem;
    transition: color var(--transition);
    white-space: nowrap;
}
.comment-submit-btn:hover { color: var(--blue-700); }
.comment-file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.25rem;
    padding-left: 2rem;
}

/* 小さい添付カード（コメント用） */
.attach-file-card-sm {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
}

/* ── ページネーション ── */
.board-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    font-size: 0.85rem;
    color: var(--gray-500);
}
.board-pagination a {
    color: var(--blue-600);
    text-decoration: none;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.board-pagination a:hover { background: var(--blue-50); }

/* ── 空フィード ── */
.feed-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-400);
    font-size: 0.9rem;
}

/* ── メンバー一覧 ── */
.member-list { list-style: none; }
.member-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.member-role-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    background: var(--blue-100);
    color: var(--blue-700);
    font-weight: 600;
}
.member-role-badge.owner { background: var(--yellow-100); color: var(--yellow-800); }

/* ── select 汎用 ── */
.form-select {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: #fff;
    color: var(--gray-900);
}
.form-select:focus { outline: none; border-color: var(--blue-400); }

/* ─────────────────────────────────────────────
   Board Mobile / PWA — App Header
───────────────────────────────────────────── */
.board-app-header {
    display: none;
    align-items: center;
    height: 48px;
    padding: 0 0.5rem;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 200;
    flex-shrink: 0;
}
.board-app-hdr-left, .board-app-hdr-right {
    display: flex;
    align-items: center;
    min-width: 52px;
    flex-shrink: 0;
}
.board-app-hdr-right { justify-content: flex-end; gap: 0.15rem; }
.board-app-hdr-title {
    flex: 1;
    text-align: center;
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--gray-900);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 0.25rem;
}
.board-app-hdr-btn {
    all: unset;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--blue-600);
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition);
}
.board-app-hdr-btn:hover { background: var(--blue-50); }
.board-app-hdr-back { font-size: 1.3rem; }
.board-app-hdr-add { font-size: 1.5rem; font-weight: 300; line-height: 1; }
.board-pwa-install-icon {
    all: unset;
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-size: 1.1rem;
}

/* ─────────────────────────────────────────────
   Board Mobile / PWA — Bottom Nav
───────────────────────────────────────────── */
.board-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    z-index: 200;
    align-items: stretch;
    box-shadow: 0 -1px 6px rgba(0,0,0,.06);
}
.board-bni {
    all: unset;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    text-decoration: none;
    color: var(--gray-400);
    cursor: pointer;
    transition: color var(--transition);
    position: relative;
    padding: 0.2rem 0;
}
.board-bni:hover, .board-bni.active { color: var(--blue-600); }
.board-bni-icon { font-size: 1.3rem; line-height: 1; }
.board-bni-label { font-size: 0.62rem; }

/* ─────────────────────────────────────────────
   Board — Note List Home Screen
───────────────────────────────────────────── */
.bnote-home { background: var(--gray-50); min-height: 100%; }
.bnote-search-wrap { padding: 0.75rem 1rem 0.5rem; background: var(--gray-50); }
.bnote-search-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gray-200);
    border-radius: 12px;
    padding: 0.55rem 0.85rem;
}
.bnote-search-icon { color: var(--gray-400); font-size: 0.85rem; flex-shrink: 0; }
.bnote-search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--gray-700);
    outline: none;
    font-family: inherit;
}
.bnote-search-input::placeholder { color: var(--gray-400); }
.bnote-section-header {
    padding: 0.5rem 1rem 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--gray-400);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
    border-top: 1px solid var(--gray-100);
    margin-top: 0.25rem;
}
.bnote-list-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: var(--gray-800);
    transition: background var(--transition);
}
.bnote-list-item:hover, .bnote-list-item:active { background: var(--gray-50); }
.bnote-list-icon {
    font-size: 1.25rem;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-50);
    border-radius: 10px;
    flex-shrink: 0;
}
.bnote-list-name { flex: 1; font-size: 0.93rem; font-weight: 500; }
.bnote-list-desc { font-size: 0.78rem; color: var(--gray-400); margin-top: 0.1rem; }
.bnote-list-arrow { color: var(--gray-300); font-size: 1rem; flex-shrink: 0; }
.bnote-list-new {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
    text-decoration: none;
    color: var(--blue-600);
    font-size: 0.9rem;
    transition: background var(--transition);
}
.bnote-list-new:hover { background: var(--blue-50); }
.bnote-list-new-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-100);
    border-radius: 10px;
    font-size: 1.2rem;
    color: var(--blue-600);
    flex-shrink: 0;
}
.bnote-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-400);
    font-size: 0.9rem;
    line-height: 1.8;
}

/* ─────────────────────────────────────────────
   Board — Post Card: Author Department
───────────────────────────────────────────── */
.post-meta { flex-direction: column; align-items: flex-start; gap: 0; }
.post-author-dept {
    font-size: 0.74rem;
    color: var(--gray-400);
    font-weight: 400;
    line-height: 1.3;
}

/* ─────────────────────────────────────────────
   Board — Post Footer: Talknote Style
───────────────────────────────────────────── */
.post-footer-tk {
    display: flex;
    border-top: 1px solid var(--gray-100);
    margin-top: 0.6rem;
}
.post-footer-tk-btn {
    all: unset;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem 0.5rem;
    font-size: 0.82rem;
    color: var(--gray-500);
    cursor: pointer;
    transition: color var(--transition), background var(--transition);
    border-radius: 0;
    text-decoration: none;
}
.post-footer-tk-btn + .post-footer-tk-btn { border-left: 1px solid var(--gray-100); }
.post-footer-tk-btn:hover { color: var(--blue-600); background: var(--blue-50); }
.post-footer-tk-btn.liked { color: #ef4444; font-weight: 600; }
.post-footer-tk-edit {
    all: unset;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 0.6rem;
    font-size: 0.78rem;
    color: var(--gray-400);
    cursor: pointer;
    transition: color var(--transition);
}
.post-footer-tk-edit:hover { color: var(--blue-500); }

/* ─────────────────────────────────────────────
   Board — Mobile Post Create Overlay
───────────────────────────────────────────── */
.board-post-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: #fff;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.board-post-overlay.open { transform: translateY(0); }
.board-post-overlay-hdr {
    display: flex;
    align-items: center;
    height: 48px;
    padding: 0 0.75rem;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
    gap: 0.5rem;
}
.board-post-overlay-title {
    flex: 1;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-900);
}
.board-post-overlay-cancel {
    all: unset;
    color: var(--gray-500);
    font-size: 1.1rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition);
}
.board-post-overlay-cancel:hover { background: var(--gray-100); }
.board-post-overlay-submit {
    all: unset;
    color: var(--blue-600);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.35rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: background var(--transition), color var(--transition);
}
.board-post-overlay-submit:hover { background: var(--blue-50); }
.board-post-overlay-submit:disabled { color: var(--gray-300); cursor: default; }
.board-post-overlay-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1rem;
}
.board-post-overlay textarea {
    width: 100%;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    line-height: 1.7;
    resize: none;
    min-height: 200px;
    box-sizing: border-box;
    color: var(--gray-900);
    background: transparent;
}
.board-post-overlay textarea::placeholder { color: var(--gray-300); }
.board-post-overlay-toolbar {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 0.75rem;
    border-top: 1px solid var(--gray-100);
    flex-shrink: 0;
}
.board-post-overlay-attach {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: var(--blue-500);
    font-size: 1.1rem;
    cursor: pointer;
    position: relative;
    transition: background var(--transition);
}
.board-post-overlay-attach:hover { background: var(--blue-50); }
.board-post-overlay-attach input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.board-post-overlay-file-preview {
    padding: 0 0.75rem 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* ノート選択セレクト（デスクトップ投稿エリア・オーバーレイ共通） */
.post-note-select {
    width: 100%;
    padding: 0.45rem 0.65rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.375rem;
    background: var(--gray-50);
    color: var(--gray-800);
    margin-bottom: 0.5rem;
    box-sizing: border-box;
    cursor: pointer;
}
.post-note-select:focus { outline: 2px solid var(--blue-300); outline-offset: 2px; }
.board-post-overlay-note-select {
    padding: 0.5rem 1rem 0;
}
.board-post-overlay-note-select .post-note-select {
    margin-bottom: 0;
}

/* ─────────────────────────────────────────────
   Board — FAB (Floating Action Button)
───────────────────────────────────────────── */
.board-fab {
    display: none;
    position: fixed;
    right: 1.25rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--blue-600);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 300;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(37,99,235,.45);
    border: none;
    cursor: pointer;
    z-index: 150;
    line-height: 1;
    text-decoration: none;
    transition: background var(--transition), box-shadow var(--transition);
}
.board-fab:hover { background: var(--blue-700); box-shadow: 0 6px 18px rgba(37,99,235,.5); }

/* ─────────────────────────────────────────────
   Board — Responsive: Mobile (≤767px)
───────────────────────────────────────────── */
@media (max-width: 767px) {
    /* Hide site header on board pages (:has対応ブラウザ + body.board-page で両カバー) */
    body:has(.board-main-wrapper) .site-header,
    body.board-page .site-header { display: none !important; }
    body:has(.board-main-wrapper) .bottom-nav,
    body.board-page .bottom-nav  { display: none !important; }
    body:has(.board-main-wrapper) .site-footer,
    body.board-page .site-footer { display: none !important; }

    /* Show board-specific mobile chrome */
    .board-app-header { display: flex !important; }

    /* No sidebar */
    .board-sidebar { display: none !important; }

    /* Board main: fill viewport */
    .board-main-wrapper {
        height: 100dvh;
        height: 100vh; /* fallback */
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding-bottom: 0;
    }
    .board-layout {
        flex: 1;
        overflow: hidden;
    }
    .board-content { overflow-y: auto; }

    /* Note header: hide (app header replaces it) */
    .note-header { display: none !important; }

    /* Post input area: full-width on mobile */
    .post-input-area {
        display: none !important; /* hidden; use overlay instead */
    }

    /* Show board bottom nav on mobile browser too */
    .board-bottom-nav  { display: flex  !important; }

    /* FAB: position above bottom nav */
    .board-fab { display: flex; bottom: calc(56px + 1rem); }

    /* Board main: account for bottom nav */
    .board-main-wrapper {
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0));
    }

    /* Respect safe area insets */
    .board-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom, 0);
        height: calc(56px + env(safe-area-inset-bottom, 0));
    }
}

/* ─────────────────────────────────────────────
   Board — Standalone PWA: show board bottom nav
───────────────────────────────────────────── */
@media (display-mode: standalone) {
    /* :has対応ブラウザ + body.board-page で両カバー */
    body:has(.board-main-wrapper) .site-header,
    body.board-page .site-header { display: none !important; }
    body:has(.board-main-wrapper) .bottom-nav,
    body.board-page .bottom-nav  { display: none !important; }
    body:has(.board-main-wrapper) .site-footer,
    body.board-page .site-footer { display: none !important; }

    .board-app-header  { display: flex !important; }
    .board-sidebar     { display: none  !important; }
    .board-bottom-nav  { display: flex  !important; }
    .board-fab { bottom: calc(56px + 1rem); }

    /* Board main: site-headerが非表示なので100vh */
    .board-main-wrapper {
        height: 100dvh;
        height: 100vh; /* fallback */
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding-bottom: calc(56px + env(safe-area-inset-bottom, 0));
    }
    .board-layout { flex: 1; overflow: hidden; }

    /* Respect safe area insets (notch/home indicator) */
    .board-app-header {
        padding-top: env(safe-area-inset-top, 0);
        height: calc(48px + env(safe-area-inset-top, 0));
        flex-shrink: 0;
    }
    .board-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom, 0);
        height: calc(56px + env(safe-area-inset-bottom, 0));
    }
}

/* ============================================================
   Notifications
   ============================================================ */
.nav-notif { position: relative; padding-right: 1.1rem; }

.notif-badge {
    position: absolute;
    top: 0px;
    right: 0px;
    background: var(--red-500);
    color: #fff;
    font-size: .62rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    line-height: 1;
}

.notif-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}
.notif-page-header h1 { margin-bottom: 0; }

.notif-list { list-style: none; }
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .9rem 1.1rem;
    background: #fff;
    border-radius: var(--radius);
    border: 1.5px solid var(--gray-200);
    margin-bottom: .5rem;
    transition: border-color var(--transition);
}
.notif-item.notif-unread {
    border-color: var(--blue-300);
    background: var(--blue-50);
}
.notif-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .1rem; }
.notif-body { flex: 1; min-width: 0; }
.notif-message { font-size: .9rem; color: var(--gray-900); }
.notif-message-link {
    font-size: .9rem;
    color: var(--blue-600);
    text-decoration: none;
    font-weight: 600;
}
.notif-message-link:hover { text-decoration: underline; }
.notif-time {
    display: block;
    font-size: .77rem;
    color: var(--gray-400);
    margin-top: .2rem;
}

/* ============================================================
   Thanks feature
   ============================================================ */
.thanks-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}
.thanks-page-header h1 { margin-bottom: 0; }

/* ── 統計カード ── */
.thanks-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.thanks-stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.25rem;
    box-shadow: var(--shadow);
    text-align: center;
    border: 2px solid var(--blue-100);
    transition: box-shadow var(--transition), transform var(--transition);
}
.thanks-stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.thanks-stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--blue-600);
    line-height: 1;
    margin-bottom: .35rem;
}
.thanks-stat-label {
    font-size: .85rem;
    color: var(--gray-500);
    font-weight: 600;
    margin-bottom: .5rem;
}
.thanks-stat-link {
    font-size: .8rem;
    color: var(--blue-500);
    text-decoration: none;
}
.thanks-stat-link:hover { text-decoration: underline; }

/* ── セクション ── */
.thanks-section {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}
.thanks-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.thanks-section-header h2 { margin-bottom: 0; }
.thanks-more-link {
    font-size: .82rem;
    color: var(--blue-500);
    text-decoration: none;
}
.thanks-more-link:hover { text-decoration: underline; }

/* ── リスト ── */
.thanks-list { list-style: none; }
.thanks-item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.thanks-item:last-child { border-bottom: none; }

.thanks-item-body { flex: 1; min-width: 0; }
.thanks-item-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .25rem;
}
.thanks-item-name {
    font-weight: 700;
    font-size: .88rem;
    color: var(--gray-900);
}
.thanks-item-time {
    font-size: .77rem;
    color: var(--gray-400);
}
.thanks-item-message {
    font-size: .88rem;
    color: var(--gray-700);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
.thanks-item-no-message { color: var(--gray-400); font-style: italic; }

.thanks-badge {
    font-size: 1.2rem;
    flex-shrink: 0;
    align-self: center;
}
.thanks-badge-sent {
    font-size: .9rem;
    color: var(--blue-400);
    font-weight: 700;
}

.thanks-empty {
    text-align: center;
    padding: 2rem;
    color: var(--gray-400);
    font-size: .9rem;
}

.thanks-char-hint {
    font-size: .78rem;
    color: var(--gray-400);
    margin-top: .25rem;
    text-align: right;
}

/* ============================================================
   Responsive — モバイル（< 768px）
   ============================================================ */
@media (max-width: 767px) {
    /* PC専用要素を隠す */
    .nav-pc-only    { display: none !important; }

    /* ボード: board-specific ブロックで処理するため競合ルールを除去 */

    /* ボトムナビを表示・ヘッダーのハンバーガーは非表示（ボトムナビのメニューボタンで代替） */
    .bottom-nav     { display: flex !important; }
    .nav-hamburger  { display: none !important; }

    /* ヘッダーをコンパクトに */
    .nav-inner { height: 48px; padding: 0 .75rem; }

    /* ボトムナビ分のパディング */
    body { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
    text-align: center;
    padding: 1rem;
    margin-top: auto;
    background: var(--blue-800);
    color: rgba(255,255,255,.7);
    font-size: .85rem;
}

/* ============================================================
   Thanks Dashboard
   ============================================================ */
.thanks-dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
    text-align: center;
    border-top: 4px solid var(--blue-500);
}

.summary-label {
    font-size: .85rem;
    color: var(--gray-500);
    margin-bottom: .5rem;
}

.summary-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--blue-700);
}

.thanks-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-section {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.25rem 1.5rem;
}

.dashboard-section h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--gray-200);
}

@media (max-width: 768px) {
    .thanks-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Profile Card & Avatar
   ============================================================ */
.profile-card {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.profile-avatar-wrap {
    flex-shrink: 0;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--blue-200);
    box-shadow: var(--shadow-sm);
}

.profile-avatar-placeholder {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-400), var(--blue-600));
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.avatar-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--blue-200);
}

.form-hint {
    font-size: .8rem;
    color: var(--gray-500);
    margin-top: .25rem;
}

@media (max-width: 600px) {
    .profile-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Checkbox grid for multi-select fields */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.4rem 1rem;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    max-height: 200px;
    overflow-y: auto;
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.15rem 0;
}
.checkbox-label input[type="checkbox"] {
    flex-shrink: 0;
}

/* ============================================================
   Board My Page (bmp-*)
   ============================================================ */
.bmp-wrap {
    padding: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.bmp-profile-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}

.bmp-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--blue-100);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bmp-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bmp-avatar-initial {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--blue-600);
}

.bmp-display-name { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); }
.bmp-email, .bmp-dept { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.15rem; }

.bmp-section { margin-bottom: 1.25rem; }
.bmp-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
}

.bmp-push-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}
.bmp-push-desc { font-size: 0.85rem; color: var(--gray-700); margin-bottom: 0.75rem; }
.bmp-push-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.bmp-push-status { font-size: 0.85rem; color: var(--gray-500); }

.bmp-push-btn {
    padding: 0.45rem 1rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--blue-600);
    background: #fff;
    color: var(--blue-600);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}
.bmp-push-btn--on {
    background: var(--blue-600);
    color: #fff;
}
.bmp-push-msg { font-size: 0.82rem; margin-top: 0.6rem; }

/* ── 通知許可バナー（スタンドアロン PWA 用） ── */
.push-permission-banner {
    position: fixed;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 0.5rem);
    left: 0.75rem;
    right: 0.75rem;
    background: var(--blue-600);
    color: #fff;
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    z-index: 200;
}
.push-permission-banner__msg { font-size: 0.9rem; line-height: 1.4; }
.push-permission-banner__actions { display: flex; gap: 0.5rem; }
.push-permission-banner__ok {
    flex: 1;
    padding: 0.45rem 0;
    background: #fff;
    color: var(--blue-600);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.push-permission-banner__dismiss {
    padding: 0.45rem 0.9rem;
    background: transparent;
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
}

.bmp-note-list { list-style: none; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.bmp-note-item { border-bottom: 1px solid var(--gray-100); }
.bmp-note-item:last-child { border-bottom: none; }
.bmp-note-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    text-decoration: none;
    color: var(--gray-900);
    transition: background var(--transition);
}
.bmp-note-link:hover { background: var(--blue-50); }
.bmp-note-icon { font-size: 1.3rem; flex-shrink: 0; }
.bmp-note-name { font-size: 0.95rem; font-weight: 600; flex: 1; }
.bmp-note-desc { font-size: 0.78rem; color: var(--gray-500); margin-left: auto; }

.bmp-empty { font-size: 0.88rem; color: var(--gray-500); padding: 0.5rem 0.25rem; }

.bmp-logout-btn {
    display: block;
    text-align: center;
    background: #fff;
    border: 1.5px solid var(--red-500);
    color: var(--red-500);
    border-radius: var(--radius);
    padding: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.bmp-logout-btn:hover { background: var(--red-100); }
