﻿/* ==================================================================
   HowJamSessionManager - スタイルシート
   モバイルファーストのレスポンシブデザイン
   ================================================================== */

/* ---- カスタムプロパティ ------------------------------------------ */
:root {
    --bg: #fffbeb;
    --bg2: #fef3c7;
    --card: #ffffff;
    --card2: #fffbeb;
    --border: #fde68a;
    --accent: #e94560;
    --accent2: #d97706;
    --accent3: #6d4ef0;
    --text: #1e293b;
    --text-muted: #64748b;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0284c7;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(120, 90, 0, .12);
    --transition: .18s ease;
}

/* ---- リセット / ベース -------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
}

h1,
h2,
h3,
h4 {
    line-height: 1.3;
    font-weight: 700;
}

strong {
    font-weight: 700;
}

code {
    font-family: monospace;
    background: var(--card2);
    padding: .1em .4em;
    border-radius: 4px;
    font-size: .9em;
}

/* ---- ヘッダー ---------------------------------------------------- */
.app-header {
    background: #92400e;
    border-bottom: 1px solid #78350f;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.app-logo {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent2);
    text-decoration: none;
    letter-spacing: .02em;
}

.app-logo span {
    font-size: .95rem;
}

/* -- ハンバーガーボタン -- */
.nav-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: .4rem;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fef3c7;
    transition: var(--transition);
}

/* -- ナビメニュー -- */
.main-nav {
    display: none;
    background: #92400e;
    padding: .75rem 1rem 1rem;
    border-top: 1px solid #78350f;
}

.main-nav.open {
    display: block;
}

.nav-profile {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 0 .75rem;
    border-bottom: 1px solid #78350f;
    margin-bottom: .5rem;
    color: #fef3c7;
}

.nav-menu {
    list-style: none;
}

.nav-menu li a {
    display: block;
    padding: .6rem .5rem;
    color: #fde68a;
    font-size: .95rem;
    border-radius: 6px;
    transition: var(--transition);
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: #78350f;
    color: #fef9c3;
    text-decoration: none;
}

.nav-logout {
    color: var(--danger) !important;
}

/* -- サブメニュー -- */
.nav-has-sub {
    position: relative;
}

.nav-sub-toggle {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    padding: .6rem .5rem;
    color: #fde68a;
    font-size: .95rem;
    border-radius: 6px;
    font-family: inherit;
    transition: var(--transition);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.nav-sub-toggle:hover {
    background: #78350f;
    color: #fef9c3;
}

.nav-sub-caret {
    font-size: .75rem;
    margin-left: .25rem;
    transition: transform .18s ease;
}

.nav-sub-toggle[aria-expanded="true"] .nav-sub-caret {
    transform: rotate(180deg);
}

.nav-submenu {
    display: none;
    list-style: none;
    padding-left: 0;
    margin-left: 1rem;
    border-left: 2px solid #78350f;
}

.nav-submenu.open {
    display: block;
}

.nav-submenu li a {
    padding: .45rem .5rem .45rem .75rem !important;
    font-size: .88rem !important;
    color: #fcd34d !important;
}

@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }

    /* ヘッダー全体を横一行に: ロゴ | プロフィール + ナビ */
    .app-header {
        display: flex;
        align-items: stretch;
    }

    .header-bar {
        flex: 0 0 auto;
        max-width: none;
        width: auto;
        margin: 0;
        padding: .5rem 1.25rem .5rem 1rem;
        border-right: 1px solid #78350f;
    }

    .main-nav {
        display: flex !important;
        align-items: center;
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
        margin: 0;
        padding: .3rem .75rem .3rem 1rem;
        border-top: none;
        background: #92400e;
        gap: .5rem;
        overflow: visible;
    }

    .nav-profile {
        border-bottom: none;
        padding: 0;
        margin: 0;
        flex-shrink: 0;
        white-space: nowrap;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-profile strong {
        display: inline-block;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
        font-size: .85rem;
    }

    .nav-menu {
        display: flex;
        gap: .1rem;
        margin-left: auto;
        flex-wrap: nowrap;
        min-width: 0;
    }

    .nav-menu li a {
        padding: .35rem .5rem;
        font-size: .85rem;
        white-space: nowrap;
    }

    /* デスクトップ用サブメニュードロップダウン */
    .nav-has-sub {
        position: relative;
    }

    .nav-sub-toggle {
        padding: .35rem .5rem;
        font-size: .85rem;
        white-space: nowrap;
    }

    .nav-submenu {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        min-width: 160px;
        background: #78350f;
        border: 1px solid #92400e;
        border-radius: var(--radius);
        padding: .35rem 0;
        box-shadow: var(--shadow);
        z-index: 200;
        padding-left: 0;
    }

    .nav-submenu.open {
        display: block;
    }

    .nav-submenu li a {
        padding: .5rem .9rem;
        display: block;
        font-size: .9rem;
        white-space: nowrap;
    }
}

/* ---- メインコンテンツ -------------------------------------------- */
.main-content {
    flex: 1;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
}

/* ---- フッター ---------------------------------------------------- */
.app-footer {
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: .78rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}

/* ---- タブバー ---------------------------------------------------- */
.tab-bar {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border);
    margin: -1.25rem -1.25rem 1rem;
    padding: 0 1.25rem;
    overflow-x: auto;
}

.tab-btn {
    padding: .65rem 1.1rem;
    font-size: .9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    background: none;
    cursor: pointer;
    font-family: inherit;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text);
    text-decoration: none;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ---- ページネーション -------------------------------------------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: .35rem;
    padding: .75rem 0 .25rem;
    flex-wrap: wrap;
}

/* ---- カード ------------------------------------------------------ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
    scroll-margin-top: 4rem;
    overflow-wrap: break-word;
    word-break: break-word;
    /* モバイル: header-barのみ */
}

.song-block {
    scroll-margin-top: 4rem;
    /* モバイル */
}

@media (min-width: 768px) {

    /* デスクトップ: ヘッダー1行化により約3rem */
    .card,
    .song-block {
        scroll-margin-top: 4rem;
    }
}

.card-compact {
    padding: .75rem 1rem;
}

.card h3 {
    font-size: 1rem;
    margin-bottom: .75rem;
}

/* ---- ページヘッダー --------------------------------------------- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
}

.page-header h2 {
    font-size: 1.3rem;
}

.page-header small {
    color: var(--text-muted);
    font-size: .85rem;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .75rem;
}

/* ---- 参加者オンボーディング -------------------------------------- */
.participant-onboarding {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(135deg, #ffffff, var(--card2));
    box-shadow: var(--shadow);
}

.participant-onboarding-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .85rem;
}

.participant-onboarding-kicker {
    display: inline-block;
    margin-bottom: .2rem;
    color: var(--accent2);
    font-size: .75rem;
    font-weight: 700;
}

.participant-onboarding h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.05rem;
}

.participant-onboarding-close {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.participant-onboarding-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem;
}

.participant-onboarding-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .15rem .55rem;
    align-items: start;
    min-width: 0;
    padding: .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .82);
    color: var(--text);
    text-decoration: none;
}

.participant-onboarding-step:hover {
    text-decoration: none;
    border-color: var(--accent2);
    transform: translateY(-1px);
}

.participant-onboarding-num {
    display: inline-flex;
    grid-row: span 2;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    background: var(--accent2);
    color: #fff;
    font-size: .85rem;
    font-weight: 700;
}

.participant-onboarding-step strong,
.participant-onboarding-step small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.participant-onboarding-step strong {
    color: var(--text);
    line-height: 1.35;
}

.participant-onboarding-step small {
    color: var(--text-muted);
    line-height: 1.45;
}

@media (max-width: 900px) {
    .participant-onboarding-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 540px) {
    .participant-onboarding {
        padding: .85rem;
    }

    .participant-onboarding-steps {
        grid-template-columns: 1fr;
    }
}

/* ---- 公開イベント詳細ヒーロー ------------------------------------ */
.event-public-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background:
        linear-gradient(135deg, var(--card), var(--card2)),
        var(--card);
    color: var(--text);
    box-shadow: var(--shadow);
}

.event-public-hero .btn-secondary {
    background: var(--card2);
    color: var(--text);
    border: 1px solid var(--border);
}

.event-public-hero .btn-warning {
    background: var(--warning);
    color: #111827;
}

.event-public-hero button:disabled {
    background: #f1f5f9;
    color: #334155;
}

.event-hero-main {
    min-width: 0;
}

.event-hero-kicker {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .65rem;
}

.event-hero-number {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: .15rem .65rem;
    border-radius: 999px;
    background: var(--bg2);
    color: var(--text);
    font-size: .82rem;
    font-weight: 700;
}

.event-public-hero h1 {
    margin: 0 0 .85rem;
    font-size: clamp(1.45rem, 3.4vw, 2.25rem);
    line-height: 1.22;
    letter-spacing: 0;
    overflow-wrap: anywhere;
    color: var(--text);
}

.event-hero-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.event-hero-summary-item {
    min-width: 0;
    padding: .7rem .75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .78);
}

.event-hero-summary-wide {
    grid-column: 1 / -1;
}

.event-hero-summary-label {
    display: block;
    margin-bottom: .2rem;
    color: var(--accent2);
    font-size: .72rem;
    font-weight: 700;
}

.event-hero-summary-item strong,
.event-hero-summary-item span:not(.event-hero-summary-label) {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.event-hero-summary-item strong {
    color: var(--text);
    font-size: .98rem;
}

.event-hero-summary-item span:not(.event-hero-summary-label) {
    margin-top: .15rem;
    color: var(--text-muted);
    font-size: .84rem;
}

.event-hero-description {
    margin-top: .8rem;
    color: var(--text);
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.event-hero-side {
    display: flex;
    flex-direction: column;
    gap: .65rem;
    min-width: 0;
    padding: .85rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid var(--border);
}

.event-hero-side-row {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    align-items: flex-start;
    padding-bottom: .55rem;
    border-bottom: 1px solid var(--border);
}

.event-hero-side-row span {
    flex: 0 0 auto;
    color: var(--accent2);
    font-size: .8rem;
    font-weight: 700;
}

.event-hero-side-row strong {
    min-width: 0;
    color: var(--text);
    text-align: right;
    overflow-wrap: anywhere;
}

.event-hero-link,
.event-hero-history {
    color: var(--accent);
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.event-hero-history {
    display: block;
    font-size: .85rem;
    overflow-wrap: anywhere;
}

.event-hero-actions {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin-top: .15rem;
}

.event-hero-join {
    width: 100%;
    min-height: 2.6rem;
}

.event-hero-note {
    margin: 0;
    color: var(--text-muted);
    font-size: .82rem;
    line-height: 1.55;
}

.event-hero-joined {
    display: grid;
    gap: .2rem;
    padding: .65rem .75rem;
    border-radius: 8px;
    background: #dcfce7;
    color: #14532d;
}

.event-hero-joined span {
    font-size: .85rem;
}

.event-hero-share {
    display: flex;
    gap: .35rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: .55rem;
    border-top: 1px solid var(--border);
}

.event-hero-share span {
    color: var(--accent2);
    font-size: .8rem;
    font-weight: 700;
}

.event-public-guide {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    gap: 1rem;
    align-items: center;
    margin: 0 0 1rem;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.event-public-guide-main {
    min-width: 0;
}

.event-public-guide-kicker {
    display: inline-block;
    margin-bottom: .25rem;
    color: var(--accent2);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .04em;
}

.event-public-guide h2 {
    margin: 0 0 .75rem;
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1.35;
}

.event-public-guide-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .55rem;
}

.event-public-guide-item {
    min-width: 0;
    padding: .65rem .7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .72);
}

.event-public-guide-item span {
    display: block;
    margin-bottom: .18rem;
    color: var(--text-muted);
    font-size: .76rem;
    font-weight: 700;
}

.event-public-guide-item strong {
    display: block;
    color: var(--text);
    font-size: .94rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-public-guide-item small {
    display: block;
    margin-top: .2rem;
    color: var(--text-muted);
    font-size: .72rem;
    line-height: 1.35;
}

.event-public-guide-actions {
    display: grid;
    gap: .45rem;
}

.event-public-guide-actions .btn {
    width: 100%;
}

.public-app-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0;
    padding: .95rem 1rem;
    border: 1px solid rgba(109, 78, 240, .24);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(109, 78, 240, .10), rgba(233, 69, 96, .08)),
        var(--card);
    color: var(--text);
    box-shadow: var(--shadow);
}

.public-app-banner-copy {
    display: grid;
    gap: .18rem;
    min-width: 0;
}

.public-app-banner-kicker {
    color: var(--accent2);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .02em;
}

.public-app-banner-copy strong {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.35;
}

.public-app-banner-copy span:last-child {
    color: var(--text-muted);
    font-size: .86rem;
    line-height: 1.45;
}

.public-app-banner-action {
    flex-shrink: 0;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .event-public-hero {
        grid-template-columns: 1fr;
        padding: .85rem;
        gap: .8rem;
    }

    .event-hero-summary {
        grid-template-columns: 1fr;
    }

    .event-hero-side {
        padding: .75rem;
    }

    .event-hero-side-row strong {
        text-align: left;
    }

    .event-public-guide {
        grid-template-columns: 1fr;
        padding: .85rem;
    }

    .event-public-guide-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .public-app-banner {
        align-items: stretch;
        flex-direction: column;
        padding: .85rem;
    }

    .public-app-banner-action {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .event-public-guide-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- ボタン ------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    padding: .5rem 1.1rem;
    border: none;
    border-radius: 7px;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:hover {
    opacity: .85;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-secondary {
    background: var(--card2);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: .75rem 1.5rem;
    font-size: 1rem;
}

.btn-sm {
    padding: .3rem .7rem;
    font-size: .82rem;
}

.btn-xs {
    padding: .15rem .4rem;
    font-size: .75rem;
    border-radius: 4px;
}

/* ---- フォーム ---------------------------------------------------- */
.form-group {
    margin-bottom: .9rem;
    flex: 1;
}

.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: .3rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    padding: .55rem .75rem;
    font-size: .95rem;
    transition: var(--transition);
    -webkit-appearance: none;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, .18);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 5rem;
}

.form-control-sm {
    padding: .35rem .55rem;
    font-size: .85rem;
}

.w-auto {
    width: auto;
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    min-width: 120px;
}

.form-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .5rem;
}

.required {
    color: var(--danger);
    font-size: .8em;
}

.search-bar {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-bar .form-control {
    flex: 1;
    min-width: 140px;
}

.input-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin-bottom: .5rem;
}

.input-row .form-control {
    flex: 1;
}

.host-sort-btns {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.host-sort-btns .btn {
    padding: .15rem .4rem;
    font-size: .72rem;
    line-height: 1;
}

/* ---- ミュージシャンオートコンプリート ----------------------------- */
.musician-ac-wrap {
    position: relative;
    flex: 1;
    min-width: 160px;
}

.musician-ac-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2a2d4a;
    border: 1px solid #6c7ae0;
    border-radius: 6px;
    z-index: 200;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .55);
    color: #e8e8f8;
}

.musician-ac-item {
    padding: .5rem .75rem;
    cursor: pointer;
    font-size: .9rem;
    display: flex;
    align-items: center;
    gap: .5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    color: #e8e8f8;
}

.musician-ac-item:last-child {
    border-bottom: none;
}

.musician-ac-item:hover,
.musician-ac-item.active {
    background: rgba(108, 122, 224, .35);
    color: #ffffff;
}

.musician-ac-item small {
    color: #a0a8d8;
    font-size: .8rem;
}

.musician-ac-badge {
    font-size: .72rem;
    background: #4a5abf;
    color: #d8dcff;
    border-radius: 4px;
    padding: .1rem .38rem;
    white-space: nowrap;
    font-weight: 600;
}

/* ---- ホストパートピッカー（ドロップダウン式）-------------------------------- */
.host-part-picker {
    position: relative;
    flex: none;
}

.host-part-trigger {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    background: var(--card2, #2a2d4a);
    border: 1px solid var(--border, #3a3d5c);
    border-radius: 6px;
    padding: .3rem .55rem;
    font-size: .85rem;
    color: #1a1a1a;
    cursor: pointer;
    white-space: nowrap;
    min-width: 4.5rem;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color .15s, color .15s;
    line-height: 1.4;
}

.host-part-trigger.has-value {
    border-color: #6c7ae0;
    color: #1a1a1a;
}

.host-part-trigger .part-caret {
    flex-shrink: 0;
    font-size: .65rem;
    opacity: .6;
}

.host-part-dropdown {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    min-width: 120px;
    background: #2a2d4a;
    border: 1px solid #6c7ae0;
    border-radius: 6px;
    z-index: 300;
    padding: .3rem .35rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .55);
    display: flex;
    flex-direction: column;
    gap: .05rem;
}

.host-part-item {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .88rem;
    padding: .3rem .4rem;
    border-radius: 4px;
    cursor: pointer;
    color: #e8e8f8;
    white-space: nowrap;
    transition: background .1s;
    user-select: none;
}

.host-part-item:hover {
    background: rgba(108, 122, 224, .25);
}

.host-part-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    accent-color: #6c7ae0;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ---- チェックボックスグループ ------------------------------------ */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .25rem;
}

.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .35rem .65rem;
    font-size: .88rem;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.checkbox-label:has(input:checked) {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.checkbox-label input {
    display: none;
}

.form-check-label {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
}

.song-check-group .checkbox-label {
    flex-direction: column;
    align-items: flex-start;
    min-width: 160px;
}

/* ---- テーブル ---------------------------------------------------- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: .65rem .75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table th {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-muted);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: rgba(0, 0, 0, .04);
}

.data-table .actions {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.data-table .col-actions {
    width: 1px;
    white-space: nowrap;
}

.song-type-mobile {
    display: none;
}

.song-rating-cell {
    white-space: nowrap;
}

.song-rating-cell span {
    white-space: nowrap;
}
.participant-table-wrap {
    overflow-x: auto;
}

.participant-table {
    width: calc(100% + 76px);
    min-width: 0;
    table-layout: fixed;
}

.participant-table th:first-child,
.participant-table td:first-child {
    width: 30%;
    overflow-wrap: anywhere;
}

.participant-table th:nth-child(2),
.participant-table td:nth-child(2) {
    width: 30%;
    overflow-wrap: anywhere;
}

.participant-table th:nth-child(3),
.participant-table td:nth-child(3) {
    width: 20%;
    white-space: nowrap;
}

.participant-table .col-actions {
    width: 76px;
    text-align: right;
}

.user-table-wrap {
    overflow-x: auto;
}

.user-table {
    width: calc(100% + 320px);
    min-width: 0;
    table-layout: fixed;
}

.user-table th:nth-child(1),
.user-table td:nth-child(1) {
    width: calc((100% - 320px) * .36);
    overflow-wrap: anywhere;
}

.user-table th:nth-child(2),
.user-table td:nth-child(2) {
    width: calc((100% - 320px) * .34);
    overflow-wrap: anywhere;
}

.user-table th:nth-child(3),
.user-table td:nth-child(3) {
    width: calc((100% - 320px) * .30);
}

.user-table th:nth-child(4),
.user-table td:nth-child(4) {
    width: 140px;
}

.user-table th:nth-child(5),
.user-table td:nth-child(5) {
    width: 70px;
    white-space: nowrap;
}

.user-table .col-actions,
.user-table td.actions {
    width: 110px;
    white-space: nowrap;
}

.musician-table-wrap {
    overflow-x: auto;
}

.musician-table {
    width: calc(100% + 92px);
    min-width: 0;
    table-layout: fixed;
}

.musician-table th:nth-child(1),
.musician-table td:nth-child(1) {
    width: calc((100% - 92px) * .31);
    overflow-wrap: anywhere;
}

.musician-table th:nth-child(2),
.musician-table td:nth-child(2) {
    width: calc((100% - 92px) * .24);
    overflow-wrap: anywhere;
}

.musician-table th:nth-child(3),
.musician-table td:nth-child(3) {
    width: calc((100% - 92px) * .27);
    overflow-wrap: anywhere;
}

.musician-table th:nth-child(4),
.musician-table td:nth-child(4) {
    width: calc((100% - 92px) * .18);
    white-space: nowrap;
}

.musician-table .col-actions,
.musician-table td.actions {
    width: 92px;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .user-table,
    .musician-table {
        width: 100%;
        table-layout: auto;
    }

    .user-table th:nth-child(n),
    .user-table td:nth-child(n),
    .musician-table th:nth-child(n),
    .musician-table td:nth-child(n) {
        width: auto;
    }
}

/* ---- 参加者テーブル 2行レイアウト -------------------------------- */
.pt-row-main td {
    border-bottom: none;
    padding-bottom: .1rem;
    vertical-align: top;
}

.pt-row-sub td {
    padding-top: .1rem;
    border-top: none;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.pt-notes-row {
    font-size: .82rem;
    color: var(--text-muted);
    padding-bottom: .5rem !important;
    font-style: italic;
    min-height: .6rem;
}

/* 下段セル：備考 + ボタン横並び */
.pt-sub-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
}

.pt-notes {
    flex: 1;
    min-width: 0;
}

.pt-sub-actions {
    display: flex;
    gap: .35rem;
    flex-shrink: 0;
}

/* 編集モーダル 危険ゾーン（削除ボタンエリア） */
.modal-danger-zone {
    margin-top: 1rem;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
    text-align: right;
}

/* 上下2行まとめてホバー */
.pt-row-main:hover td,
.pt-row-main:hover+.pt-row-sub td,
.pt-row-sub:hover td,
.pt-row-main:has(+ .pt-row-sub:hover) td {
    background: rgba(0, 0, 0, .04);
}

.row-disabled {
    opacity: .5;
}

/* ---- バッジ ------------------------------------------------------ */
.badge {
    display: inline-block;
    padding: .2em .65em;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.badge-lg {
    font-size: .85rem;
    padding: .3em .8em;
}

.badge-admin {
    background: #7c3aed;
    color: #fff;
}

.badge-host {
    background: var(--accent);
    color: #fff;
}

.badge-participant {
    background: var(--info);
    color: #000;
}

.badge-success {
    background: var(--success);
    color: #fff;
}

.badge-warning {
    background: var(--warning);
    color: #000;
}

.badge-danger {
    background: var(--danger);
    color: #fff;
}

.badge-info {
    background: var(--info);
    color: #000;
}

.badge-muted {
    background: #fde68a;
    color: #78350f;
}

.badge-secondary {
    background: var(--card2);
    color: var(--text);
    border: 1px solid var(--border);
}

/* ---- タグ -------------------------------------------------------- */
.tag {
    display: inline-block;
    padding: .15em .55em;
    background: var(--accent3);
    color: #fff;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 600;
}

/* ---- アラート ---------------------------------------------------- */
.alert {
    padding: .8rem 1rem;
    border-radius: var(--radius);
    margin-bottom: .9rem;
    font-size: .9rem;
    font-weight: 500;
}

.alert-success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

.alert-danger {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.alert-info {
    background: #e0f2fe;
    border: 1px solid #7dd3fc;
    color: #075985;
}

/* ---- テキストユーティリティ -------------------------------------- */
.text-muted {
    color: var(--text-muted);
}

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: .5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: .5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.ml-1 {
    margin-left: .4rem;
}

/* ---- ログインページ ---------------------------------------------- */
.login-page {
    justify-content: center;
    align-items: flex-start;
    padding-top: 5vh;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 1rem;
}

.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem 1.75rem;
    box-shadow: var(--shadow);
}

.login-logo {
    text-align: center;
    font-size: 3rem;
    margin-bottom: .5rem;
}

.login-title {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: .25rem;
    color: var(--accent2);
}

.login-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: .9rem;
    margin-bottom: 1.5rem;
}

.login-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .85rem;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--accent);
    display: inline-block;
    margin: .15rem .4rem 0;
}

/* ---- セッションカード（一覧） ------------------------------------ */
.session-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

/* ── 直近イベントバナー（横スクロール） ── */
.eh-banner-scroll {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    padding-bottom: .5rem;
    scrollbar-width: thin;
    scrollbar-color: #3a3d5a transparent;
}

.eh-banner-scroll::-webkit-scrollbar {
    height: 4px;
}

.eh-banner-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.eh-banner-scroll::-webkit-scrollbar-thumb {
    background: #3a3d5a;
    border-radius: 2px;
}

.eh-banner-card {
    flex: 0 0 170px;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .75rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s;
}

.eh-banner-card:hover {
    border-color: #7c3aed;
}

.eh-banner-days {
    display: inline-block;
    font-size: .7rem;
    font-weight: 700;
    color: #fff;
    padding: .15rem .45rem;
    border-radius: 99px;
    margin-bottom: .2rem;
    align-self: flex-start;
}

.eh-banner-title {
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text);
}

.eh-banner-sub {
    font-size: .75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.session-card {
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: var(--transition);
}

.session-card:hover {
    border-color: var(--accent3);
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: .5rem;
}

.session-hosts {
    font-size: .85rem;
    color: var(--text-muted);
    margin-bottom: .35rem;
}

.session-card-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin-top: .75rem;
}

/* ---- 演奏曲ブロック ---------------------------------------------- */
.song-block {
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .9rem 1rem;
    margin-bottom: .65rem;
}

.song-block-done {
    background: #f0fdf4;
    border-color: #86efac;
}

.song-block-done .song-order-ctrl button:disabled {
    opacity: .45;
}

/* -- パートサマリー（確定・演奏済み一覧表示） -- */
.parts-summary {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    margin-top: .55rem;
    padding-top: .55rem;
    border-top: 1px dashed var(--border);
}

.parts-summary-item {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .85rem;
}

.parts-summary-label {
    color: var(--text-muted);
    font-weight: 600;
}

.parts-summary-name {
    color: var(--text);
}

.song-block-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: .5rem;
}

.song-order-ctrl {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.song-num {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 1.2em;
    text-align: center;
}

.btn-xs {
    padding: .1rem .35rem;
    font-size: .75rem;
    line-height: 1.2;
    border-radius: 4px;
    border: 1px solid var(--border);
    cursor: pointer;
}

.count-ctrl {
    display: flex;
    align-items: center;
    gap: .25rem;
    white-space: nowrap;
}

.count-val {
    display: inline-block;
    min-width: 1.8em;
    text-align: center;
    font-weight: 700;
}

.pt-part-row {
    display: flex;
    align-items: center;
    gap: .4rem;
    min-height: 1.6rem;
    margin-bottom: .1rem;
    padding: .1rem 0;
}

.pt-part-row:last-child {
    margin-bottom: 0;
}

.pt-part-count {
    font-size: .78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.song-info {
    flex: 1;
}

.song-block-actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    align-items: center;
}

/* -- パートパネル -- */
.parts-panel {
    margin-top: .75rem;
    padding: .75rem;
    background: var(--bg2);
    border-radius: 8px;
}

.parts-grid {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.part-row {
    display: grid;
    grid-template-columns: 110px 1fr 1fr;
    align-items: center;
    gap: .5rem;
}

.part-label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* -- パート表示（参加者） -- */
.parts-view {
    margin-top: .65rem;
}

.parts-view-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .88rem;
    flex-wrap: wrap;
}

.parts-view-row:last-child {
    border-bottom: none;
}

.parts-view-row .part-label {
    min-width: 90px;
    color: var(--text-muted);
}

.part-assignments {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    align-items: center;
}

.part-empty {
    color: var(--text-muted);
    font-style: italic;
    font-size: .82rem;
}

.participant-chip {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: .1em .65em;
    font-size: .82rem;
}

/* ---- 情報グリッド ------------------------------------------------ */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.info-row {
    display: flex;
    gap: .75rem;
    font-size: .92rem;
}

.info-label {
    color: var(--text-muted);
    min-width: 80px;
}

/* ---- 参加URL ----------------------------------------------------- */
.join-url-box {
    display: flex;
    gap: .5rem;
    align-items: center;
}

.qrcode-wrap {
    display: flex;
    padding: .75rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: fit-content;
}

/* ---- スター評価 -------------------------------------------------- */
.star-rate {
    display: flex;
    gap: .25rem;
    align-items: center;
}

.star-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--border);
    transition: var(--transition);
    line-height: 1;
    padding: 0;
}

.star-btn.on {
    color: var(--accent2);
}

.star-btn.star-none {
    font-size: 1.1rem;
    color: var(--border);
}

.star-btn.star-none.on {
    color: var(--danger);
}

.star-btn:hover {
    color: var(--accent2);
    transform: scale(1.15);
}

.stars {
    color: var(--accent2);
    letter-spacing: .05em;
}

/* ---- レビュー ---------------------------------------------------- */
.review-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.review-item {
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .85rem 1rem;
}

.review-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .4rem;
    flex-wrap: wrap;
}

.review-header small {
    color: var(--text-muted);
    margin-left: auto;
}

/* ---- マイパーツ -------------------------------------------------- */
.my-parts {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}

/* ---- モーダル ---------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .65);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 1rem;
}

/* ---- スクロールバー スタイル ------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg2);
}

::-webkit-scrollbar-thumb {
    background: #d97706;
    border-radius: 3px;
}

/* ---- 定番曲ピッカー ----------------------------------------------- */
.song-picker {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    position: relative;
}

.song-picker-filters {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .4rem;
    align-items: center;
}

.spf-btn {
    padding: .2rem .6rem;
    font-size: .78rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card2);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    line-height: 1.4;
}

.spf-btn:hover {
    border-color: var(--accent3);
    color: var(--text);
}

.spf-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.spf-sep {
    width: 1px;
    height: 1.4em;
    background: var(--border);
    margin: 0 .1rem;
    align-self: center;
}

.song-picker-search {
    display: flex;
    align-items: center;
    gap: .35rem;
}

.song-picker-search .form-control {
    flex: 1;
}

.sp-clear {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: .95rem;
    padding: .2rem .4rem;
}

.sp-clear:hover {
    color: var(--danger);
}

.sp-selected {
    padding: .4rem .6rem;
    background: rgba(99, 102, 241, .08);
    border: 1px solid var(--accent3);
    border-radius: var(--radius);
    font-size: .88rem;
}

/* ---- 累計実績サマリーカード --------------------------------------- */
.stats-summary-card {
    background: linear-gradient(135deg, rgba(109, 78, 240, .15), rgba(233, 69, 96, .1));
    border: 1px solid rgba(109, 78, 240, .35);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    padding: .85rem 1.15rem;
}

.stats-summary-inner {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.stats-label {
    font-size: .82rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.stats-items {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.stats-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 68px;
}

.stats-num {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1.1;
}

.stats-item:nth-child(3) .stats-num {
    color: #34d399;
}

.stats-item:nth-child(5) .stats-num {
    color: #fbbf24;
}

.stats-name {
    font-size: .75rem;
    color: var(--text-muted);
    margin-top: .1rem;
}

.stats-divider {
    width: 1px;
    height: 2rem;
    background: rgba(255, 255, 255, .15);
}

/* ---- 印刷スタイル ------------------------------------------------- */
@media print {

    /* ナビ・ヘッダー・ボタン類を非表示 */
    .app-header,
    .app-nav,
    .page-header .btn,
    button,
    .btn,
    .stats-summary-card,
    .modal-overlay,
    #addParticipantForm,
    #songPickerWrap,
    #editSongModal,
    #editParticipantModal,
    #bulletin-board form,
    .comment-form,
    #url-qr,
    #public-url,
    .section-nav {
        display: none !important;
    }

    body,
    .app-body {
        background: #ffffff !important;
        color: #000000 !important;
    }

    .card {
        background: #ffffff !important;
        border: 1px solid #cccccc !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    .song-block {
        border: 1px solid #dddddd !important;
        background: #f9f9f9 !important;
        page-break-inside: avoid;
    }

    .badge,
    .tag {
        border: 1px solid #aaaaaa !important;
        color: #333333 !important;
        background: #eeeeee !important;
    }

    a {
        color: #000000 !important;
        text-decoration: none !important;
    }
}

.sp-chosen {
    color: var(--accent);
    font-weight: 600;
}

.sp-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
    max-height: 240px;
    overflow-y: auto;
    margin-top: .15rem;
}

.sp-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem .5rem;
    padding: .5rem .75rem;
    cursor: pointer;
    font-size: .88rem;
    border-bottom: 1px solid var(--border);
    transition: background .12s;
}

.sp-item:last-child {
    border-bottom: none;
}

.sp-item:hover {
    background: var(--card2);
}

.sp-item-title {
    font-weight: 600;
    flex-basis: 100%;
}

.sp-artist {
    color: var(--text-muted);
    font-size: .8rem;
}

.sp-tag {
    font-size: .72rem;
    padding: .05rem .4rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, .15);
    color: var(--accent3);
}

/* ---- レスポンシブ調整 -------------------------------------------- */
@media (max-width: 600px) {
    .form-row:not(.form-row-inline) {
        flex-direction: column;
        gap: 0;
    }

    .form-row-inline {
        flex-wrap: wrap;
        gap: 6px;
    }

    .form-row-inline .form-group {
        flex: 1 1 calc(50% - 6px);
        min-width: 0;
    }

    /* 検索フォームをコンパクト化 */
    .search-form .form-group {
        margin-bottom: .55rem;
    }

    .search-form .form-group label {
        font-size: .78rem;
        margin-bottom: .15rem;
    }

    .search-form .form-control {
        padding: .4rem .6rem;
        font-size: .88rem;
    }

    .search-form .form-actions {
        margin-top: .25rem;
    }

    .search-form .form-actions .btn {
        flex: 1;
    }

    .part-row {
        grid-template-columns: 90px 1fr;
    }

    .part-row input[type="text"] {
        grid-column: 1/-1;
    }

    .data-table {
        font-size: .82rem;
    }

    .data-table th,
    .data-table td {
        padding: .5rem .5rem;
    }

    /* イベントマスタ: スマホで補助列を非表示 → 2段目に情報を集約 */
    .event-master-table .col-sub {
        display: none;
    }

    /* 操作ボタン列は折り返し許可 */
    .data-table .actions {
        flex-wrap: wrap;
    }

    .song-master-table .song-type-col,
    .song-master-table .song-type-cell {
        display: none;
    }

    .song-master-table .song-genre-col,
    .song-master-table .song-genre-cell {
        width: 4.8rem;
        min-width: 4.8rem;
        max-width: 4.8rem;
    }

    .song-master-table .song-genre-cell {
        white-space: normal;
    }

    .song-master-table .song-type-mobile {
        display: block;
        margin-bottom: .25rem;
        font-size: .76rem;
        line-height: 1.25;
        color: var(--text-muted);
        white-space: nowrap;
    }

    .song-master-table .song-genre-tags {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: .2rem;
    }

    .song-master-table .song-genre-tags .tag {
        margin-top: 0 !important;
        white-space: nowrap;
    }

    .song-master-table .song-rating-col,
    .song-master-table .song-rating-cell {
        width: 5.8rem;
        min-width: 5.8rem;
        white-space: nowrap;
    }

    /* スマホのみ表示（PC では非表示） */
    .d-sm-none {
        display: flex !important;
    }
}

/* PC では d-sm-none を通常非表示 */
@media (min-width: 601px) {
    .d-sm-none {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .main-content {
        padding: 1.5rem 2rem;
    }

    .song-block-header {
        flex-wrap: nowrap;
    }
}

/* ---- イベントマスタ ホスト2段表示 -------------------------------- */
.event-host-row td {
    padding-top: .2rem;
    padding-bottom: .6rem;
    border-top: none;
    border-bottom: 3px solid var(--border);
}

/* イベント1段目行：上に太い区切り線・下線なし */
.event-master-row td {
    border-top: 2px solid var(--border);
    border-bottom: none;
    padding-top: .75rem;
    padding-bottom: .2rem;
}

/* 先頭行は区切り線不要 */
.event-master-row:first-of-type td {
    border-top: none;
}

.event-host-detail {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem 1.2rem;
}

.event-host-group {
    display: flex;
    align-items: center;
    gap: .35rem;
    font-size: .82rem;
    color: var(--text-muted);
}

.event-host-label {
    font-weight: 600;
    font-size: .75rem;
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: .1rem .4rem;
    white-space: nowrap;
}

/* ---- 掲示板コメント -------------------------------------------- */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-bottom: 1.25rem;
}

.comment-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .7rem 1rem;
    background: var(--card2);
}

.comment-item.comment-role-host {
    border-left: 4px solid var(--accent);
    background: #fff8f8;
}

.comment-item.comment-role-participant {
    border-left: 4px solid var(--info);
    background: #f0f8ff;
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .35rem;
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    font-size: .9rem;
}

.comment-role-host .comment-author {
    color: var(--accent);
}

.comment-role-participant .comment-author {
    color: var(--info);
}

.comment-date {
    font-size: .78rem;
}

.comment-body {
    font-size: .92rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-form {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: .5rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.comment-form-name {
    font-size: .88rem;
    padding: .3rem 0;
}

.btn-xs {
    font-size: .72rem;
    padding: .15rem .5rem;
    line-height: 1.4;
    border-radius: 4px;
    margin-left: auto;
}

.yen-input-wrap {
    position: relative;
}

.yen-input-wrap .form-control {
    padding-right: 2.5rem;
}

.yen-input-unit {
    position: absolute;
    top: 50%;
    right: .85rem;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: .9rem;
    pointer-events: none;
}

@media (max-width: 640px) {
    .history-date-filter {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: .75rem;
        row-gap: .85rem;
    }

    .history-date-filter .form-group {
        width: 100%;
        min-width: 0;
        margin-bottom: 0;
    }

    .history-date-filter input[type="date"] {
        min-width: 0;
        font-size: .88rem;
        padding-left: .5rem;
        padding-right: .35rem;
    }

    .history-date-filter .form-group:last-child {
        grid-column: 1 / -1;
        justify-content: center;
    }
}
