/* ============================================================
   よこ糸 — 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;

    --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: 100;
}

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

.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);
}
.nav-logo:hover { opacity: .85; }

.nav-links {
    display: flex;
    align-items: center;
    gap: .15rem;
}

.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;
}
.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);
}

/* ============================================================
   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;
    display: flex;
    flex-direction: row;
    height: calc(100vh - 56px);
}

/* ── サイドバー ── */
.board-sidebar {
    width: 210px;
    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); }

/* ── メインコンテンツ ── */
.board-content {
    flex: 1;
    overflow-y: auto;
    background: var(--gray-50);
    display: flex;
    flex-direction: column;
    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 {
    background: #fff;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}
.post-input-area textarea {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    min-height: 68px;
    resize: vertical;
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.55;
    transition: border var(--transition);
}
.post-input-area textarea:focus { outline: none; border-color: var(--blue-400); }
.post-input-actions { display: flex; justify-content: flex-end; margin-top: 0.5rem; }

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

/* ── 投稿カード ── */
.post-card {
    background: #fff;
    border-bottom: 1px solid var(--gray-100);
    padding: 1.1rem 1.5rem 0.85rem;
}
.post-card-header {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-bottom: 0.6rem;
}

/* ── アバター ── */
.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-author {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--gray-900);
    line-height: 38px; /* align with avatar */
}
.post-note-badge { font-size: 0.72rem; color: var(--gray-400); margin-left: 0.3rem; }
.post-body-text {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
    font-size: 0.88rem;
    color: var(--gray-900);
    margin-bottom: 0.6rem;
    padding-left: calc(38px + 0.7rem);
}
.post-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: calc(38px + 0.7rem);
    font-size: 0.77rem;
    color: var(--gray-400);
    flex-wrap: wrap;
}
.post-time { font-size: 0.77rem; color: var(--gray-400); }

/* いいねボタン */
.btn-like {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 0.77rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    transition: color var(--transition), background var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.btn-like:hover { color: var(--red-500); background: var(--red-100); }
.btn-like.liked { color: var(--red-500); font-weight: 600; }

/* 削除ボタン（テキストリンク風） */
.btn-delete-link {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 0.77rem;
    padding: 0.15rem 0.4rem;
    transition: color var(--transition);
}
.btn-delete-link:hover { color: var(--red-500); }

/* いいねした人 */
.like-who {
    font-size: 0.77rem;
    color: var(--gray-400);
    padding-left: calc(38px + 0.7rem);
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ── コメント ── */
.comments-section {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--gray-100);
    padding-left: calc(38px + 0.7rem);
}
.comment-item {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0.4rem;
    align-items: flex-start;
}
.comment-bubble {
    flex: 1;
    background: var(--gray-50);
    border-radius: 12px;
    padding: 0.35rem 0.7rem;
    font-size: 0.83rem;
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.comment-author-name { font-weight: 700; color: var(--gray-700); font-size: 0.78rem; }
.comment-body { color: var(--gray-900); }
.comment-delete-form { display: inline; margin-left: auto; }
.comment-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-300);
    font-size: 0.65rem;
    padding: 0;
    line-height: 1;
    transition: color var(--transition);
}
.comment-delete-btn:hover { color: var(--red-500); }
.comment-input-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.4rem;
}
.comment-input {
    flex: 1;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    padding: 0.35rem 0.85rem;
    font-size: 0.83rem;
    font-family: inherit;
    background: var(--gray-50);
    transition: border var(--transition), background var(--transition);
}
.comment-input:focus { outline: none; border-color: var(--blue-400); background: #fff; }
.comment-submit-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--blue-500);
    font-size: 1rem;
    padding: 0 0.2rem;
    transition: color var(--transition);
}
.comment-submit-btn:hover { color: var(--blue-700); }

/* ── ページネーション ── */
.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); }

/* ============================================================
   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 — Mobile header
   ============================================================ */
@media (max-width: 640px) {
    .nav-inner {
        height: auto;
        min-height: 48px;
        flex-wrap: wrap;
        padding: .5rem .75rem;
        gap: .25rem;
    }

    .nav-links {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: .4rem;
        gap: .05rem;
        flex-wrap: nowrap;
    }

    .nav-link {
        font-size: .78rem;
        padding: .28rem .5rem;
        white-space: nowrap;
    }

    .nav-user {
        font-size: .78rem;
        padding: 0 .35rem;
    }

    .nav-divider {
        height: 16px;
        margin: 0 .3rem;
    }
}

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