/* =====================================================================
   日本酒アプリ ベーススタイル
   和モダン（白＋和紙色ベース、藍/朱アクセント）
   ===================================================================== */

/* ----- リセット ----- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img, svg, video { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/*
 * HTML の hidden 属性を必ず効かせる。
 * （後段で .modal や .app-nav に display: flex 等を当てているため、
 *   このルールがないと hidden 属性が無視される）
 */
[hidden] { display: none !important; }

/* ----- カラー変数 ----- */
:root {
    --c-base: #FFFFFF;
    --c-paper: #F8F4EC;
    --c-ink: #1A1A1A;
    --c-ink-soft: #4A4A4A;
    --c-accent-blue: #1F4E79;
    --c-accent-red: #B7282E;
    --c-sub: #E0D9C6;
    --c-gray: #6B7280;
    --c-border: #E5E7EB;
    --c-success: #28A745;
    --c-warning: #F59E0B;
    --c-danger: #DC3545;

    --radius: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
    --nav-height: 60px;
    --header-height: 52px;
}

/* ----- 基本タイポ ----- */
body {
    font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
    color: var(--c-ink);
    background: var(--c-paper);
    line-height: 1.6;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

/* ----- アプリレイアウト ----- */
#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
    background: var(--c-base);
    display: flex;
    flex-direction: column;
}

.app-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: var(--c-accent-blue);  /* 和風紺色 #1F4E79 */
    color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 10;
}
.app-title { font-size: 18px; font-weight: 700; margin: 0; color: #fff; letter-spacing: 0.02em; }

.app-main {
    flex: 1;
    padding: 16px;
    padding-bottom: calc(var(--nav-height) + 16px);
}

/* ----- ボトムナビ ----- */
.app-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--c-base);
    border-top: 1px solid var(--c-border);
    display: flex;
    z-index: 20;
}
@media (min-width: 481px) {
    .app-nav {
        left: 50%;
        right: auto;        /* ベースの right:0 を解除しないと中央寄せにならない */
        width: 100%;
        max-width: 480px;
        transform: translateX(-50%);
    }
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--c-gray);
    transition: color 0.2s;
}
.nav-item.is-active { color: var(--c-accent-blue); }
.nav-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    line-height: 1;
}
.nav-icon-emoji { font-size: 22px; display: inline-flex; align-items: center; justify-content: center; }
.nav-label { font-size: 11px; margin-top: 2px; }

/* 画面タイトルのアイコン（emoji / img 両対応） */
/* h2 にアイコンがある場合は flex で下揃え */
h2:has(.page-icon) {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    line-height: 1.2;
}
.page-icon {
    display: inline-block;
    font-size: 0.9em;
}
img.page-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
    font-size: 0;  /* alt が表示されない時の保険 */
}

/* ----- 共通UI ----- */
.loading {
    color: var(--c-gray);
    padding: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    font-size: 13px;
}
.loading::before {
    content: "";
    display: block;
    width: 36px;
    height: 36px;
    border: 3px solid var(--c-sub);
    border-top-color: var(--c-accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .loading::before { animation: none; opacity: 0.6; }
}

/* button / a / label すべてに同じボタンスタイルを適用 */
.btn-primary, .btn-danger, .btn-secondary {
    display: inline-block;
    padding: 12px 20px;
    border-radius: var(--radius);
    border: none;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.1s, transform 0.05s;
    user-select: none;
}
.btn-primary:active, .btn-danger:active, .btn-secondary:active { transform: scale(0.98); }
.btn-primary {
    background: var(--c-accent-blue);
    color: white;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled {
    background: var(--c-gray);
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-danger {
    background: var(--c-accent-red);
    color: white;
}
.btn-danger:hover { opacity: 0.9; }
.btn-secondary {
    background: var(--c-base);
    color: var(--c-ink);
    border: 1px solid var(--c-border);
}
.btn-secondary:hover { background: var(--c-paper); }

/* ----- フォーカス可視化 ----- */
:focus-visible {
    outline: 2px solid var(--c-accent-blue);
    outline-offset: 2px;
}

/* ----- フッタ ----- */
.app-footer {
    padding: 16px;
    color: var(--c-gray);
    font-size: 12px;
    text-align: center;
    background: var(--c-paper);
}
.app-footer a { color: var(--c-accent-blue); }

/* =====================================================================
   認証画面（ログイン / 招待URL登録）
   ===================================================================== */

body.is-auth-screen { background: var(--c-paper); }

.auth-screen {
    max-width: 380px;
    margin: 0 auto;
    padding: 40px 20px;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}
.auth-header h1 {
    font-size: 22px;
    margin: 0 0 4px;
    color: var(--c-accent-blue);
    letter-spacing: 0.05em;
}
.auth-subtitle {
    font-size: 14px;
    color: var(--c-ink-soft);
    margin: 0;
}

.auth-form {
    background: var(--c-base);
    padding: 24px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
    font-size: 13px;
    font-weight: 500;
    color: var(--c-ink-soft);
}
.field input[type="email"],
.field input[type="password"],
.field input[type="text"] {
    padding: 10px 12px;
    font-size: 16px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-base);
    color: var(--c-ink);
    font-family: inherit;
}
.field input:focus {
    outline: 2px solid var(--c-accent-blue);
    outline-offset: 0;
    border-color: var(--c-accent-blue);
}
.field .hint {
    font-size: 12px;
    color: var(--c-gray);
}
.field .hint code {
    background: var(--c-paper);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.field-check label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--c-ink-soft);
    cursor: pointer;
    line-height: 1.5;
}
.field-check input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.auth-links {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
}
.auth-links a {
    color: var(--c-accent-blue);
    text-decoration: underline;
}

.error-box {
    color: var(--c-danger);
    background: #FFF0F0;
    border: 1px solid #F5C2C7;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 13px;
}

/* =====================================================================
   ホーム / 共通
   ===================================================================== */

.home-screen { padding: 8px; }
.home-screen h2 { margin: 0 0 12px; }
.home-screen .muted { color: var(--c-gray); font-size: 13px; }
.check-list { padding-left: 20px; font-size: 14px; color: var(--c-ink-soft); }

/* ホーム ヒーロー＆ショートカット */
.home-hero { text-align: center; padding: 20px 0 24px; }
.home-greet { margin: 0 0 4px; font-size: 24px; color: var(--c-accent-blue); }
.home-email { margin: 0; font-size: 13px; color: var(--c-gray); }
.home-lead { margin: 14px 0 0; font-size: 14px; color: var(--c-ink-soft); }

.home-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
}
.home-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 20px 12px;
    background: var(--c-base);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--c-ink);
    box-shadow: var(--shadow);
    transition: transform 0.05s, box-shadow 0.1s;
    text-align: center;
}
.home-card:active { transform: scale(0.98); box-shadow: none; }
.home-card-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    line-height: 1;
}
/* img でない（マイページ等の絵文字）用フォールバック */
span.home-card-icon { width: auto; height: auto; font-size: 32px; display: inline-block; }
.home-card-label { font-size: 14px; font-weight: 600; margin-top: 4px; }
.home-card-sub { font-size: 11px; color: var(--c-gray); }
.home-card-wide { grid-column: span 2; flex-direction: row; gap: 12px; padding: 16px; }
.home-card-wide .home-card-icon { font-size: 24px; }
.home-card-wide .home-card-label { margin-top: 0; }
.home-card-wide .home-card-sub { margin-left: auto; }

.placeholder { padding: 20px; color: var(--c-gray); }
.placeholder h2 { color: var(--c-ink); }
.placeholder code { background: var(--c-paper); padding: 2px 6px; border-radius: 3px; }

.not-found { padding: 40px 20px; text-align: center; color: var(--c-gray); }

/* =====================================================================
   マイページ
   ===================================================================== */

.mp-screen { padding: 0 4px 16px; }
.mp-head h2 { margin: 4px 0 4px; }
.mp-head p { margin: 0 0 16px; }

/* ナビカード（模試/履歴/設定/ログアウト） */
.mp-nav-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.mp-nav-card {
    position: relative;
    background: var(--c-base);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 14px 10px 10px;
    text-align: center;
    cursor: pointer;
    transition: background 0.1s;
}
.mp-nav-card:hover { background: var(--c-paper); }
.mpn-icon { font-size: 26px; line-height: 1; }
.mpn-label { font-size: 13px; margin-top: 4px; color: var(--c-ink); }
.mpn-badge {
    position: absolute;
    top: 4px; right: 4px;
    font-size: 10px;
    background: #FFF7E8;
    border: 1px solid #F5B400;
    border-radius: 999px;
    padding: 1px 6px;
}
.mp-nav-card-danger .mpn-label { color: var(--c-accent-red); }

/* サマリ統計 */
.mp-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}
.mp-stat {
    background: var(--c-paper);
    border-radius: var(--radius);
    padding: 10px 4px;
    text-align: center;
}
.mp-stat .stat-label { font-size: 11px; color: var(--c-ink-soft); }
.mp-stat .stat-val { font-size: 18px; font-weight: 700; color: var(--c-accent-blue); margin-top: 4px; }

/* チャートブロック */
.mp-chart-block {
    background: var(--c-base);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.mp-chart-block h3 {
    margin: 0 0 10px;
    font-size: 13px;
    color: var(--c-ink-soft);
    align-self: stretch;   /* h3 は全幅で左寄せのまま */
}
.mp-chart-wrap {
    height: 200px;
    position: relative;
    width: 100%;
    /* max-width はチャートごとに inline style で指定 */
}
.mp-chart-wrap canvas {
    display: block !important;
    margin: 0 auto !important;
}

/* 先月の模試ランキング */
.mp-rank-block {
    background: linear-gradient(135deg, #FFF7D6, #FFEEB0);
    border: 1px solid #E5B800;
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 14px;
}
.mp-rank-block h3 {
    margin: 0 0 4px;
    font-size: 13px;
    color: #7C5A00;
}
.mp-rank-line {
    margin: 0;
    font-size: 16px;
    color: #5A3F00;
}
.mp-rank-line strong { font-size: 20px; color: #B7282E; }

/* 設定リスト */
.setting-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}
.setting-list li {
    border-bottom: 1px solid var(--c-border);
}
.setting-list li:first-child { border-top: 1px solid var(--c-border); }
.setting-list a {
    display: block;
    padding: 14px 12px;
    color: var(--c-ink);
    position: relative;
}
.setting-list a::after {
    content: '›';
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    color: var(--c-gray);
    font-size: 20px;
}
.setting-list a:hover { background: var(--c-paper); }
.setting-list a.is-danger { color: var(--c-accent-red); }

/* 設定フォーム */
.settings-form { display: flex; flex-direction: column; gap: 14px; }
.settings-form .field input { width: 100%; padding: 10px 12px;
    border: 1px solid var(--c-border); border-radius: var(--radius);
    background: var(--c-base); font-size: 15px; font-family: inherit; }
.settings-form .field input:read-only { background: var(--c-paper); color: var(--c-ink-soft); }
.settings-form .field input:focus {
    outline: 2px solid var(--c-accent-blue);
    border-color: var(--c-accent-blue);
}
.settings-form button { padding: 12px 24px; margin-top: 8px; }

.info-box {
    color: #166534;
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 13px;
}

.warning-box {
    background: #FEF3C7;
    border: 1px solid #FCD34D;
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.7;
}
.warning-box p { margin: 4px 0; }

/* =====================================================================
   模試試験
   ===================================================================== */

.exam-screen { padding: 8px 4px; }
.exam-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.exam-head h2 { margin: 0; }
.exam-rules { margin: 16px 0; padding-left: 20px; line-height: 1.8; font-size: 14px; }

.exam-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #FFF7E8;
    border: 1px solid #F5B400;
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 16px;
}
.badge-medal { font-size: 32px; }
.badge-title { font-weight: 700; }
.badge-sub { font-size: 12px; color: var(--c-ink-soft); }

.exam-last {
    background: var(--c-paper);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 16px;
}
.exam-last h3 { margin: 0 0 6px; font-size: 13px; color: var(--c-ink-soft); }
.exam-last p { margin: 0; }

.exam-actions {
    margin-top: 24px;
    display: flex;
    gap: 10px;
    flex-direction: column;
}
.exam-actions .btn-primary,
.exam-actions .btn-secondary {
    text-align: center;
    padding: 14px 24px;
    display: inline-block;
}

/* 受験中 */
.exam-take-screen { padding: 8px 4px; }
.exam-progress { margin-bottom: 16px; }
.exam-progress .progress-bar { margin-top: 6px; }
.exam-q { margin: 16px 0; font-size: 16px; line-height: 1.7; }
.exam-choices { display: flex; flex-direction: column; gap: 8px; }
.exam-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-base);
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
}
.exam-choice:hover { background: var(--c-paper); }
.exam-choice:has(input:checked) {
    border-color: var(--c-accent-blue);
    background: #EFF6FF;
}
.exam-choice input { accent-color: var(--c-accent-blue); }
.exam-nav {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}
.exam-nav button { flex: 1; padding: 12px 0; }

/* 履歴 */
.exam-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

/* 汎用データテーブル（受験履歴等） */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: var(--c-base);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.data-table thead th {
    background: var(--c-paper);
    color: var(--c-ink-soft, #6B7280);
    font-weight: 600;
    text-align: center;
    padding: 8px 6px;
    border-bottom: 1px solid var(--c-border);
    border-right: 1px solid var(--c-border);
}
.data-table thead th:last-child { border-right: none; }
.data-table tbody td {
    padding: 10px 6px;
    border-bottom: 1px solid var(--c-border);
    border-right: 1px solid var(--c-border);
    text-align: center;
    vertical-align: middle;
}
.data-table tbody td:last-child { border-right: none; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.02); }
.data-table .btn-link {
    color: var(--c-accent-blue);
    text-decoration: underline;
    font-size: 13px;
}
.exam-stat {
    background: var(--c-paper);
    border-radius: var(--radius);
    padding: 10px;
    text-align: center;
}
.exam-stat .stat-label { font-size: 11px; color: var(--c-ink-soft); }
.exam-stat .stat-val { font-size: 20px; font-weight: 700; color: var(--c-accent-blue); }

/* =====================================================================
   みんなの飲み歩き
   ===================================================================== */

.cm-screen { padding: 0 4px; }
.cm-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.cm-title-row h2 { margin: 0; }
.cm-title-row .cm-filter-toggle {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 13px;
    margin: 0;
    display: inline-flex;
    align-items: center;
}
.cm-filter-toggle.is-open {
    background: #FDECEC;
    border-color: #E5A0A0;
    color: #B7282E;
}

.cm-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}
.cm-tab {
    flex: 1;
    padding: 8px 0;
    background: var(--c-base);
    border: 1px solid var(--c-border);
    color: var(--c-ink-soft);
    border-radius: var(--radius);
    font-size: 13px;
}
.cm-tab.is-on {
    background: var(--c-accent-blue);
    color: white;
    border-color: var(--c-accent-blue);
}

/* フィルタ・呑みたいリスト の横並び行 */
.cm-action-row {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}
.cm-filter-toggle {
    flex: 1;
    text-align: center;
    background: var(--c-paper);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 8px 10px;
    font-size: 13px;
    color: var(--c-ink-soft);
    cursor: pointer;
}
.cm-filter-toggle:hover { border-color: var(--c-accent-blue); }
.cm-filter-panel {
    background: var(--c-paper);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 12px;
    font-size: 13px;
}
.cm-filter-panel .field { margin-bottom: 10px; }
.cm-filter-panel .field label { font-size: 12px; color: var(--c-ink-soft); margin-bottom: 4px; display: block; }
.cm-filter-panel select, .cm-filter-panel input {
    padding: 6px 8px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-base);
    font-size: 13px;
}
.cm-filter-panel input[type="text"] { width: 100%; }
.range-row { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--c-ink-soft); }
.range-row select { flex: 1; }
.cm-filter-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}
.cm-filter-actions button { padding: 6px 18px; font-size: 13px; }

.cm-cards { display: flex; flex-direction: column; gap: 10px; }
.cm-card {
    display: flex;
    background: var(--c-base);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
}
/* いい酒 + 呑みたい を縦並びにまとめる右端カラム */
.cm-card-actions {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-left: 1px solid var(--c-border);
    min-width: 78px;
}
.cm-card-main {
    display: flex;
    flex: 1;
    min-width: 0;
}
.cm-card-main:hover { background: var(--c-paper); }
.cm-thumb {
    width: 90px;
    flex-shrink: 0;
    align-self: stretch;       /* カードの高さに合わせて縦に伸びる */
    min-height: 90px;
}
.cm-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cm-body { flex: 1; padding: 8px 12px; min-width: 0; }
.cm-brand { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-meta { font-size: 11px; color: var(--c-ink-soft); display: flex; gap: 6px; align-items: center; margin: 4px 0; }
.cm-meta .cm-type { background: var(--c-paper); padding: 1px 6px; border-radius: 999px; }
.cm-date, .rl-date { font-size: 11px; color: var(--c-ink-soft); margin-bottom: 4px; }
.cm-stars { color: #F5B400; font-size: 13px; letter-spacing: 1px; }

/* いい酒ボタン（カード）— .cm-card-actions の上半分 */
.like-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: var(--c-base);
    border: none;
    padding: 6px 10px;
    color: var(--c-gray);
    cursor: pointer;
    transition: background 0.1s;
}
.like-btn .like-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--c-gray);
    line-height: 1;
    letter-spacing: 0.5px;
}
.like-btn.is-liked .like-label { color: #B7700F; }
.like-btn .like-icon {
    display: block;
    width: 28px;
    height: 28px;
    font-size: 0;  /* 絵文字テキストを隠す */
    background-image: url('../img/icons/like.png?v=2');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: opacity 0.15s;
}
.like-btn.is-liked .like-icon {
    background-image: url('../img/icons/like-active.png?v=2');
}
.like-btn .like-count { font-size: 11px; font-weight: 700; }
.like-btn:hover { background: var(--c-paper); }

/* 「+ 呑みたい」ボタン（.cm-card-actions の下半分。like-btn と上下分割） */
.wish-btn {
    border: none;
    border-top: 1px solid var(--c-border);
    background: var(--c-base);
    color: var(--c-accent-blue);
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    text-align: center;
    transition: background 0.1s, color 0.1s;
}
.wish-btn:hover { background: var(--c-paper); }
.wish-btn.is-wished {
    background: #FFF7E8;
    color: #B7700F;
}

/* いい酒・いつか呑みたい ボタン（詳細画面、大） */
.cm-detail-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
}
.like-btn-large {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--c-base);
    border: 2px solid var(--c-border);
    border-radius: 999px;
    color: var(--c-ink-soft);
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.like-btn-large .like-icon {
    display: inline-block;
    width: 36px;
    height: 36px;
    font-size: 0;
    background-image: url('../img/icons/like.png?v=2');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: opacity 0.15s;
}
.like-btn-large.is-liked {
    background: #FFF7E8;
    border-color: #F5B400;
    color: var(--c-ink);
}
.like-btn-large.is-liked .like-icon {
    background-image: url('../img/icons/like-active.png?v=2');
}
.like-btn-large:hover { border-color: var(--c-accent-blue); }

/* 詳細画面の「いつか呑みたい」ボタン（大） */
.wish-btn-large {
    flex-basis: auto;
    width: auto;
    padding: 12px 24px;
    border: 2px solid var(--c-border);
    border-top: 2px solid var(--c-border);  /* カード版の border-top を上書き */
    border-radius: 999px;
    background: var(--c-base);
    color: var(--c-accent-blue);
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s, border-color 0.15s;
}
.wish-btn-large.is-wished {
    background: #FFF7E8;
    border-color: #F5B400;
    color: #B7700F;
}
.wish-btn-large:hover { border-color: var(--c-accent-blue); }

/* ヘッダー「呑みたいリスト」トグル（フィルタ・検索と横並び） */
.cm-wishlist-toggle {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: var(--c-paper);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 8px 10px;
    font-size: 13px;
    color: var(--c-ink-soft);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.cm-wishlist-toggle .wl-icon { font-size: 14px; }
.cm-wishlist-toggle.is-on {
    background: #FFF7E8;
    border-color: #F5B400;
    color: #B7700F;
    font-weight: 700;
}
.cm-wishlist-toggle:hover { border-color: var(--c-accent-blue); }

/* =====================================================================
   飲み歩き記録 一覧
   ===================================================================== */

.rl-screen { position: relative; }
.rl-head h2 { margin: 0 0 16px; }

.rl-empty {
    text-align: center;
    color: var(--c-ink-soft);
    padding: 40px 0;
}
.rl-empty p { margin: 8px 0; }

.rl-cards { display: flex; flex-direction: column; gap: 10px; }

.rl-card {
    display: flex;
    background: var(--c-base);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: box-shadow 0.15s;
}
.rl-card:hover { box-shadow: var(--shadow); }

.rl-thumb {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    background: var(--c-paper);
}
.rl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rl-body {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}
.rl-brand {
    font-weight: 700;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rl-meta {
    font-size: 12px;
    color: var(--c-ink-soft);
    display: flex;
    gap: 8px;
    align-items: center;
}
.rl-meta .rl-type {
    background: var(--c-paper);
    padding: 1px 8px;
    border-radius: 999px;
}
.rl-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.rl-stars { color: #F5B400; font-size: 14px; letter-spacing: 1px; }
.rl-likes { font-size: 12px; color: var(--c-accent-blue); }

/* FAB（右下フロート新規記録ボタン） */
.rl-fab {
    position: fixed;
    bottom: calc(var(--nav-height) + 16px);
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--c-accent-red);
    color: white;
    font-size: 28px;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(183,40,46,0.3);
    z-index: 30;
    text-decoration: none;
}
@media (min-width: 481px) {
    .rl-fab {
        position: fixed;
        right: calc(50vw - 240px + 16px);
    }
}

/* =====================================================================
   飲み歩き記録 詳細
   ===================================================================== */

.rd-screen { padding: 0 4px 24px; }
.rd-head { padding: 8px 0; font-size: 13px; }
.rd-head a { color: var(--c-accent-blue); }

.rd-photo {
    margin: 8px -16px;
    background: var(--c-ink);
}
.rd-photo img {
    width: 100%;
    max-height: 60dvh;
    object-fit: contain;
    display: block;
}

.rd-main { margin: 16px 0; }
.rd-row-1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.rd-brand { margin: 0; font-size: 20px; }
.rd-type {
    background: var(--c-paper);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--c-ink-soft);
    white-space: nowrap;
}
.rd-row-2 {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.rd-stars { color: #F5B400; font-size: 18px; letter-spacing: 2px; }
.rd-likes { color: var(--c-accent-blue); font-size: 14px; }
.rd-brewery {
    margin-top: 8px;
    font-size: 13px;
}
.rd-brewery a { color: var(--c-accent-blue); }

.rd-chart {
    margin: 24px 0;
    padding: 16px;
    background: var(--c-paper);
    border-radius: var(--radius);
}
.rd-chart h3 { margin: 0 0 12px; font-size: 14px; color: var(--c-ink-soft); }
.rd-chart-wrap {
    max-width: 320px;
    margin: 0 auto;
}

.rd-memo {
    margin: 20px 0;
    padding: 12px 16px;
    background: var(--c-paper);
    border-left: 4px solid var(--c-accent-blue);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.rd-memo h3 { margin: 0 0 6px; font-size: 13px; color: var(--c-ink-soft); }
.rd-memo p { margin: 0; white-space: pre-wrap; }

.rd-actions { margin-top: 24px; text-align: center; }
.rd-actions .btn-primary { display: inline-block; padding: 12px 32px; }

/* =====================================================================
   飲み歩き記録 フォーム
   ===================================================================== */

.record-form-screen { padding: 0 4px 32px; }
.rf-head h2 { margin: 8px 0 16px; }
.rf-head a { color: var(--c-accent-blue); font-size: 13px; }

.rf-section { margin-bottom: 18px; }
.rf-label {
    display: block;
    font-size: 13px;
    color: var(--c-ink-soft);
    font-weight: 500;
    margin-bottom: 6px;
}
.rf-label .req {
    font-size: 10px;
    background: var(--c-accent-red);
    color: white;
    padding: 1px 6px;
    border-radius: 999px;
    margin-left: 6px;
    font-weight: 500;
}

.rf-section input[type="text"],
.rf-section select,
.rf-section textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-base);
    font-family: inherit;
    font-size: 15px;
}
.rf-section input:focus,
.rf-section select:focus,
.rf-section textarea:focus {
    outline: 2px solid var(--c-accent-blue);
    border-color: var(--c-accent-blue);
}

/* 写真 */
.rf-photo-area {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.rf-photo-preview {
    width: 120px;
    height: 120px;
    background: var(--c-paper);
    border: 2px dashed var(--c-border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    overflow: hidden;
}
.rf-photo-preview.has { border-style: solid; border-color: var(--c-border); background: var(--c-ink); }
.rf-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.rf-photo-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
}
.rf-file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    background: var(--c-base);
    color: var(--c-ink);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s, transform 0.05s;
    user-select: none;
    min-height: 44px;  /* タップしやすい最小サイズ */
}
.rf-file-btn:hover { background: var(--c-paper); border-color: var(--c-ink-soft); }
.rf-file-btn:active { transform: scale(0.98); }
.rf-file-btn:focus-within { outline: 2px solid var(--c-accent-blue); outline-offset: 2px; }

/* 5軸 */
.rf-axes { display: flex; flex-direction: column; gap: 10px; }
.rf-axis-label { font-size: 13px; margin-bottom: 4px; }
.rf-axis-row { display: flex; align-items: center; gap: 8px; }
.rf-axis-row .hint { font-size: 11px; color: var(--c-gray); width: 22px; text-align: center; }
.rf-scale { display: flex; gap: 4px; flex: 1; }
.rf-scale-btn {
    flex: 1;
    padding: 8px 0;
    border: 1px solid var(--c-border);
    background: var(--c-base);
    border-radius: var(--radius);
    font-weight: 500;
    color: var(--c-ink-soft);
    transition: background 0.1s, color 0.1s;
}
.rf-scale-btn.is-on {
    background: var(--c-accent-blue);
    color: white;
    border-color: var(--c-accent-blue);
}

/* ★評価 */
.rf-rating { display: flex; gap: 4px; }
.rf-star {
    font-size: 32px;
    line-height: 1;
    background: none;
    border: none;
    color: #DDD;
    padding: 4px;
    transition: color 0.1s, transform 0.1s;
}
.rf-star.is-on { color: #F5B400; }
.rf-star:hover { transform: scale(1.1); }

/* 公開トグル */
.rf-toggle { display: flex; gap: 0; }
.rf-toggle-btn {
    padding: 10px 24px;
    border: 1px solid var(--c-border);
    background: var(--c-base);
    color: var(--c-ink-soft);
    font-weight: 500;
    transition: background 0.1s, color 0.1s;
}
.rf-toggle-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.rf-toggle-btn:last-child  { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }
.rf-toggle-btn.is-on {
    background: var(--c-accent-blue);
    color: white;
    border-color: var(--c-accent-blue);
}

/* アクション */
.rf-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    flex-direction: column;
}
.rf-actions .btn-primary,
.rf-actions .btn-danger {
    width: 100%;
    padding: 14px 0;
    font-size: 16px;
}

.hint { font-size: 12px; color: var(--c-gray); margin-top: 4px; }

/* =====================================================================
   学習機能
   ===================================================================== */

.learn-list-screen .progress-text {
    font-size: 14px;
    color: var(--c-ink-soft);
    margin-bottom: 8px;
}
.progress-bar {
    height: 8px;
    background: var(--c-sub);
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: var(--c-accent-blue);
    transition: width 0.3s;
}
.learn-progress { margin-bottom: 20px; }
.learn-progress .progress-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

/* 学習・マップ等で共通利用する免責リンク（赤字下線） */
.disclaimer-link {
    color: #B7282E;
    font-size: 12px;
    font-weight: 600;
    text-decoration: underline;
    white-space: nowrap;
}
.disclaimer-link:hover { text-decoration: none; }

.learn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

/* 学習一覧の末尾に置く模試試験への導線 */
.learn-exam-cta {
    margin: 24px 0 8px;
    padding: 16px 14px 18px;
    background: var(--c-base);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    text-align: center;
}
.learn-exam-cta h3 {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--c-ink);
}
.learn-exam-cta p { margin: 0 0 10px; }
.learn-exam-cta .btn-primary {
    display: inline-block;
    padding: 9px 22px;
    text-decoration: none;
}
.learn-exam-cta.is-cleared {
    background: linear-gradient(135deg, #FFF7D6, #FFEEB0);
    border-color: #E5B800;
}
.learn-exam-cta.is-cleared h3 { color: #7C5A00; }
.learn-card {
    background: var(--c-base);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 14px 12px 12px;
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 110px;
}
.learn-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.learn-card.locked { background: var(--c-paper); color: var(--c-gray); cursor: not-allowed; opacity: 0.6; }
.learn-card.locked:hover { transform: none; box-shadow: none; }
.learn-card.completed { border-color: var(--c-success); background: #F0FDF4; }
.learn-card.available { border-color: var(--c-accent-blue); background: #EFF6FF; }

.learn-card-no { font-weight: 700; color: var(--c-accent-blue); font-size: 16px; }
.learn-card.locked .learn-card-no { color: var(--c-gray); }
.learn-card-title { font-size: 13px; line-height: 1.4; flex: 1; margin: 6px 0; }
.learn-card-status { font-size: 11px; color: var(--c-ink-soft); }
.learn-card-status .check { color: var(--c-success); font-weight: 700; }
.learn-card-status .badge-current {
    display: inline-block; background: var(--c-accent-blue); color: white;
    padding: 1px 8px; border-radius: 999px; font-size: 10px;
}

/* レベル詳細 */
.learn-back { font-size: 13px; margin-bottom: 12px; }
.learn-back a { color: var(--c-accent-blue); }
.learn-lvl-no { font-size: 12px; font-weight: 700; color: var(--c-accent-blue); }
.learn-lvl-title { margin: 4px 0 16px; font-size: 20px; }
.learn-body {
    font-size: 15px;
    line-height: 1.8;
}
.learn-body p { margin: 0 0 14px; }
.learn-body strong { color: var(--c-accent-red); font-weight: 500; }
.learn-body img { margin: 12px auto; border-radius: var(--radius); }
.learn-actions { margin-top: 24px; text-align: center; }
.learn-actions .btn-primary { display: inline-block; text-align: center; padding: 12px 24px; }

/* クイズ */
.quiz-screen, .quiz-result-screen { padding: 8px 0; }
.quiz-progress { margin-bottom: 16px; }
.quiz-progress-text { font-size: 12px; color: var(--c-ink-soft); margin-bottom: 6px; }
.quiz-q { font-size: 17px; line-height: 1.6; margin: 16px 0 18px; }
.quiz-choices { display: flex; flex-direction: column; gap: 10px; }
.quiz-choice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    background: var(--c-base);
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
}
.quiz-choice:hover { background: var(--c-paper); }
.quiz-choice:has(input:checked) {
    border-color: var(--c-accent-blue);
    background: #EFF6FF;
}
.quiz-choice input { accent-color: var(--c-accent-blue); }
.quiz-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.quiz-actions a, .quiz-actions button { padding: 12px 24px; text-align: center; }

.result-headline {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}
.result-headline.is-pass   { background: #F0FDF4; color: #166534; }
.result-headline.is-fail   { background: #FEF3C7; color: #92400E; }
.result-headline.is-review { background: #EFF6FF; color: #1E3A8A; }
.quiz-result-item {
    border-left: 4px solid var(--c-border);
    padding: 10px 14px;
    margin-bottom: 12px;
    background: var(--c-paper);
    border-radius: 0 var(--radius) var(--radius) 0;
}
.quiz-result-item.is-correct { border-left-color: var(--c-success); }
.quiz-result-item.is-wrong   { border-left-color: var(--c-danger); }
.result-no { font-weight: 700; color: var(--c-accent-blue); font-size: 12px; }
.result-question { font-weight: 500; margin: 4px 0 6px; }
.result-answer { font-size: 13px; color: var(--c-ink-soft); }
.result-answer .ok { color: var(--c-success); margin-left: 8px; font-weight: 700; }
.result-answer .ng { color: var(--c-danger); margin-left: 8px; font-weight: 700; }
.result-correct { font-size: 13px; color: var(--c-ink); margin-top: 4px; }
.result-explanation { font-size: 12px; color: var(--c-ink-soft); margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--c-border); }

/* =====================================================================
   酒蔵マップ画面
   ===================================================================== */

/* 地図画面では .app-main の padding を打ち消し、全幅で表示 */
body:has(#map) .app-main { padding: 0; }

.map-screen {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--header-height) - var(--nav-height));
}
.map-canvas {
    flex: 1;
    width: 100%;
    background: var(--c-paper);
    min-height: 0;
}
/* タイル画像だけセピア化（ピン・現在地マーカー・ポップアップはカラーのまま維持） */
/* まずグレースケール化してから sepia を当てて、OSM 元の黄色味に左右されない均一なセピアに */
.map-canvas .leaflet-tile-pane {
    filter: grayscale(1) sepia(0.5) contrast(1.05);
}

/* 地図 / リスト 切替タブ */
.view-toggle {
    display: flex;
    background: var(--c-base);
    border-bottom: 1px solid var(--c-border);
    flex-shrink: 0;
}
.view-toggle button {
    flex: 1;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: var(--c-ink-soft);
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.1s;
}
.view-toggle button:hover { color: var(--c-ink); }
.view-toggle button.active {
    color: var(--c-accent-blue);
    border-bottom-color: var(--c-accent-blue);
    font-weight: 600;
}

/* 都道府県フィルタ（チップ式、横スクロール可） */
.map-filter {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
    background: var(--c-base);
    border-bottom: 1px solid var(--c-border);
    scrollbar-width: thin;
}
.map-filter::-webkit-scrollbar { height: 4px; }
.map-filter::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 2px; }
.pref-chip {
    flex-shrink: 0;
    padding: 5px 12px;
    background: var(--c-paper);
    border: 1px solid var(--c-border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--c-ink-soft);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.pref-chip.is-on {
    background: var(--c-accent-blue);
    color: white;
    border-color: var(--c-accent-blue);
    font-weight: 700;
}
.pref-chip:not(.is-on):hover { border-color: var(--c-accent-blue); color: var(--c-ink); }

/* リストビュー */
.brewery-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
    background: var(--c-paper);
    min-height: 0;
}
.brewery-list-card {
    background: var(--c-base);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
}
.bl-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.bl-header h3 {
    font-size: 15px;
    margin: 0;
    line-height: 1.5;
    margin-right: auto;  /* バッジを右寄せに押し出す */
}
.bl-visited {
    display: inline-block;
    font-size: 11px;
    line-height: 1.5;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--c-accent-blue);
    color: white;
    white-space: nowrap;
    vertical-align: middle;
}
.bl-address { font-size: 12px; color: var(--c-ink-soft); margin: 4px 0; }
.bl-brands  { font-size: 12px; color: var(--c-ink-soft); margin: 4px 0; }
.bl-brands a { color: var(--c-accent-blue); text-decoration: underline; }
.bl-actions {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    font-size: 12px;
}
.bl-actions a { color: var(--c-accent-blue); text-decoration: none; }
.bl-actions a:hover { text-decoration: underline; }
.bl-map-link::before { content: "📍 "; }

/* リストカード「訪問済みにする」ボタン（btn-primary/btn-secondary の色は継承） */
.bl-record { margin-top: 10px; }
.bl-record-btn {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
}

/* マップポップアップ内の同ボタン */
.brewery-popup .popup-actions { margin-top: 8px; }
.brewery-popup .popup-record-btn {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
}
.map-status {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--c-paper);
    border-top: 1px solid var(--c-border);
    font-size: 12px;
    color: var(--c-muted, #6B7280);
}
.map-status-updated {
    white-space: nowrap;
    color: var(--c-muted, #6B7280);
}

.map-legend {
    flex-shrink: 0;
    padding: 10px 16px 14px;
    background: var(--c-paper);
    border-top: 1px solid var(--c-border);
}
.map-legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 12px;
    color: var(--c-text);
}
.map-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.legend-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--c-border);
}
.map-legend-note {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.5;
}
.map-legend-link {
    color: #B7282E;
    font-weight: 600;
    text-decoration: underline;
}
.map-legend-link:hover {
    text-decoration: none;
}

/* 銘柄名の Web 検索窓（入力不可・押すと Google 検索） */
.brand-search-box {
    display: flex;
    align-items: stretch;
    width: 100%;
    border: 1px solid #cfcfcf;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    vertical-align: middle;
    user-select: none;
}
.brand-search-text {
    flex: 1 1 auto;
    min-width: 0;
    padding: 4px 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--c-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
}
.brand-search-btn {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    background: #888;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}
.brand-search-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    /* 白アイコンでない場合に白く見せたいときは下記を有効化:
       filter: brightness(0) invert(1); */
}
.brand-search-btn:hover { background: #6b6b6b; }

.cm-filter-icon {
    width: 15px;
    height: 15px;
    object-fit: contain;
    margin-right: 5px;
    vertical-align: -2px;
}

/* ----- 汎用ダイアログ (<dialog>) ----- */
.app-dialog {
    width: min(92vw, 480px);
    max-height: 80vh;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    background: var(--c-base);
    color: var(--c-text);
    overflow: hidden;
}
.app-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}
.app-dialog .dialog-title {
    margin: 0;
    padding: 14px 18px;
    background: var(--c-accent-blue, #1F4E79);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}
.app-dialog .dialog-body {
    padding: 16px 18px;
    max-height: calc(80vh - 130px);
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.7;
}
.app-dialog .dialog-body p { margin: 0 0 10px; }
.app-dialog .dialog-body ul { margin: 0; padding-left: 1.2em; }
.app-dialog .dialog-body li { margin-bottom: 8px; }
.app-dialog .dialog-actions {
    padding: 12px 18px 14px;
    border-top: 1px solid var(--c-border);
    text-align: right;
}

/* Leaflet ピン（divIcon）の余分な背景を消す */
.brewery-marker {
    background: transparent !important;
    border: none !important;
}

/* ピンタップ時のポップアップ */
.brewery-popup h3 {
    margin: 0 0 6px;
    font-size: 14px;
    color: var(--c-ink);
}
.brewery-popup .popup-address {
    font-size: 12px;
    color: var(--c-ink-soft);
    margin: 4px 0;
}
.brewery-popup .popup-brands {
    font-size: 12px;
    color: var(--c-ink-soft);
    margin: 4px 0;
}
.brewery-popup .popup-brands a {
    color: var(--c-accent-blue);
    text-decoration: underline;
}
/* 見学可否バッジ（popup / list 両方で使う共通スタイル） */
.popup-visit {
    display: inline-block;
    font-size: 11px;
    line-height: 1.5;
    padding: 1px 8px;
    border-radius: 999px;
    color: white;
    white-space: nowrap;
    vertical-align: middle;
}
.popup-visit.visit-available   { background: #28A745; }
.popup-visit.visit-unknown     { background: #9CA3AF; }
.popup-visit.visit-unavailable { background: #DC3545; }
.brewery-popup .popup-visit { margin: 4px 0; }
.brewery-popup .popup-visited {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--c-accent-blue);
    color: white;
    margin-bottom: 6px;
}
