/*
 * 聖徳太子2.0 アプリ画面用 CSS
 * （new.php / topic.php / topics.php で使用）
 *
 * 既存セレクタとの衝突を避けるため、すべて .sh2- プレフィクス。
 * 共通トークンは shotoku-landing.css 側の :root で定義済み。
 */

/* ===== お題一覧カード ===== */
.sh2-topics-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.sh2-search {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}
.sh2-search input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--sh2-border);
    border-radius: 999px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
}
.sh2-search input:focus {
    outline: none;
    border-color: var(--sh2-primary);
    box-shadow: 0 0 0 4px var(--sh2-primary-100);
}
.sh2-topic-scope-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -8px 0 24px;
}
.sh2-topic-scope-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 16px;
    border: 1px solid var(--sh2-border);
    border-radius: 999px;
    background: #fff;
    color: var(--sh2-text-soft);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}
.sh2-topic-scope-tab:hover {
    border-color: var(--sh2-border-strong);
    color: var(--sh2-text);
}
.sh2-topic-scope-tab.is-active {
    border-color: transparent;
    background: var(--sh2-primary-100);
    color: var(--sh2-primary);
    box-shadow: 0 10px 24px rgba(124, 58, 237, .12);
}

.sh2-topic-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.sh2-topic-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius-lg);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: transform .12s, box-shadow .15s, border-color .15s;
    height: 100%;
}
.sh2-topic-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh2-shadow-lg);
    border-color: var(--sh2-border-strong);
}
.sh2-topic-card h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.5;
    color: var(--sh2-text);
}
.sh2-topic-card-scope {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: -2px;
}
.sh2-topic-scope-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 12px;
    font-weight: 800;
}
.sh2-topic-scope-target {
    color: var(--sh2-text-soft);
    font-size: 12.5px;
    font-weight: 700;
}
.sh2-topic-card p {
    margin: 0;
    font-size: 14px;
    color: var(--sh2-text-soft);
    line-height: 1.7;
    flex: 1;
}
.sh2-topic-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12.5px;
    color: var(--sh2-text-mute);
    border-top: 1px dashed var(--sh2-border);
    padding-top: 12px;
}
.sh2-topic-card-meta span::before {
    content: '・';
    margin-right: 4px;
}
.sh2-topic-card-meta span:first-child::before { content: ''; margin: 0; }

.sh2-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 32px;
    color: var(--sh2-text-mute);
}

/* ===== フォーム ===== */
.sh2-form { display: flex; flex-direction: column; gap: 20px; }
.sh2-field { display: flex; flex-direction: column; gap: 6px; }
.sh2-field label {
    font-weight: 600;
    color: var(--sh2-text);
    font-size: 14.5px;
}
.sh2-field input[type="text"],
.sh2-field input[type="email"],
.sh2-field textarea,
.sh2-field select {
    padding: 12px 16px;
    border: 2px solid var(--sh2-border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.6;
    background: #fff;
    color: var(--sh2-text);
    width: 100%;
    box-sizing: border-box;
}
.sh2-field input:focus,
.sh2-field textarea:focus,
.sh2-field select:focus {
    outline: none;
    border-color: var(--sh2-primary);
    box-shadow: 0 0 0 4px var(--sh2-primary-100);
}
.sh2-field small {
    font-size: 12.5px;
    color: var(--sh2-text-mute);
}
.sh2-required {
    display: inline-block;
    background: var(--sh2-accent);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 8px;
    font-weight: 500;
    vertical-align: middle;
}

.sh2-checkbox {
    display: flex;
    gap: 10px;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
}
.sh2-checkbox input { width: 18px; height: 18px; accent-color: var(--sh2-primary); }

.sh2-scope-radio {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sh2-scope-pick {
    display: flex;
    gap: 12px;
    padding: 16px;
    border: 2px solid var(--sh2-border);
    border-radius: var(--sh2-radius);
    cursor: pointer;
    transition: border-color .12s, background .12s;
}
.sh2-scope-pick:hover { border-color: var(--sh2-border-strong); background: var(--sh2-bg-soft); }
.sh2-scope-pick input { margin-top: 4px; accent-color: var(--sh2-primary); }
.sh2-scope-pick:has(input:checked) {
    border-color: var(--sh2-primary);
    background: var(--sh2-primary-100);
}
.sh2-scope-pick:has(input:disabled),
.sh2-scope-pick.is-disabled { opacity: 0.5; cursor: not-allowed; }
.sh2-scope-pick.is-locked {
    border-style: dashed;
    background: var(--sh2-bg-soft);
    color: var(--sh2-text-soft);
    cursor: default;
}
.sh2-scope-pick > div strong { display: block; margin-bottom: 4px; }
.sh2-scope-pick > div p { margin: 0; font-size: 13.5px; color: var(--sh2-text-soft); line-height: 1.6; }

/* お題作成ページ専用: お知らせカード */
.sh2-callout {
    padding: 14px 18px;
    border-radius: 12px;
    margin: 16px 0 24px;
    font-size: 14px;
    line-height: 1.7;
    border: 1px solid var(--sh2-border);
    background: var(--sh2-bg-soft);
}
.sh2-callout p { margin: 4px 0; }
.sh2-callout--info {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1e3a8a;
}
.sh2-callout a { color: inherit; text-decoration: underline; }

/* お題作成ページ専用: 組織/グループ選択ドロップダウン */
#sh2OrgField select,
#sh2GroupField select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--sh2-border);
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
    color: var(--sh2-text);
}
#sh2OrgField select:focus,
#sh2GroupField select:focus {
    outline: none;
    border-color: var(--sh2-primary);
}
.sh2-topic-role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.sh2-topic-role-grid > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sh2-topic-target-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius);
    background: var(--sh2-bg-soft);
}
.sh2-topic-target-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sh2-topic-target-head strong {
    font-size: 14px;
    color: var(--sh2-text);
}
.sh2-topic-target-head span {
    font-size: 12.5px;
    color: var(--sh2-text-mute);
}
.sh2-topic-target-list {
    display: grid;
    gap: 8px;
    max-height: 320px;
    overflow: auto;
    padding-right: 4px;
}
.sh2-topic-target-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(132px, 170px);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--sh2-border);
    border-radius: 10px;
    background: #fff;
}
.sh2-topic-target-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sh2-text);
}
.sh2-topic-target-row select {
    padding: 8px 10px;
    border-width: 1px;
    font-size: 13px;
}

.sh2-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
.sh2-form-msg {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
}
.sh2-form-msg.is-error   { background: #ffeaea; color: #b91c1c; border: 1px solid #fecaca; }
.sh2-form-msg.is-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.sh2-form-msg.is-info    { background: var(--sh2-primary-100); color: var(--sh2-primary-700); border: 1px solid var(--sh2-border-strong); }

/* ===== お題詳細 ===== */
.sh2-topic { padding: 48px 0 64px; }
.sh2-topic-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--sh2-text-mute);
}
.sh2-scope-badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12.5px;
}
.sh2-scope-badge--public { background: #e0eaff; color: #2547a8; }
.sh2-scope-badge--org    { background: var(--sh2-primary-100); color: var(--sh2-primary-700); }
.sh2-scope-badge--group  { background: #ffe7df; color: #b8431f; }
.sh2-topic-stat::before { content: '・'; margin-right: 4px; }
.sh2-topic-stat:first-of-type::before { content: ''; margin: 0; }

.sh2-topic-title {
    font-size: clamp(24px, 3.5vw, 32px);
    margin: 0 0 16px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}
.sh2-topic-desc {
    color: var(--sh2-text-soft);
    line-height: 1.85;
    margin-bottom: 16px;
    background: var(--sh2-bg-soft);
    padding: 20px 24px;
    border-radius: var(--sh2-radius);
    border-left: 4px solid var(--sh2-primary);
}
.sh2-topic-purpose {
    background: #fff8e6;
    border-left: 4px solid #ffb14c;
    padding: 12px 18px;
    border-radius: var(--sh2-radius);
    margin-bottom: 24px;
    font-size: 14.5px;
    color: #5d4209;
}
.sh2-topic-role-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: -8px 0 24px;
    padding: 14px 16px;
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius);
    background: #fff;
}
.sh2-topic-role-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}
.sh2-topic-role-pill--decision {
    background: #fef3c7;
    color: #92400e;
}
.sh2-topic-role-pill--manager {
    background: #dbeafe;
    color: #1d4ed8;
}
.sh2-topic-role-summary small {
    color: var(--sh2-text-mute);
    font-size: 12.5px;
}

.sh2-topic-nb-source {
    background: #f0f7ff;
    border-left: 4px solid #6b9bd1;
    padding: 12px 18px;
    border-radius: var(--sh2-radius);
    margin-bottom: 20px;
    font-size: 14.5px;
    color: #1e3a5f;
}

.sh2-topic-nb-source-lead {
    margin: 0 0 10px;
}

.sh2-topic-nb-source-link {
    display: inline-block;
}

/* 9ブログ自動お題のサクラ温め中バッジ（透明性表示） */
.sh2-sakura-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fdba74;
    font-size: 12.5px;
    font-weight: 600;
    vertical-align: middle;
}
.sh2-sakura-badge--off {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #d1d5db;
}

/* 管理画面: 9ブログ→お題 ブリッジパネル */
.sh2-mod-bridge {
    margin: 24px 0 32px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius);
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.sh2-mod-bridge-warn {
    margin: 12px 0;
    padding: 12px 14px;
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #7f1d1d;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
}
.sh2-mod-bridge-stats {
    list-style: none;
    margin: 12px 0 14px;
    padding: 0;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.sh2-mod-bridge-stats li {
    background: #f8fafc;
    border: 1px solid var(--sh2-border);
    border-radius: 10px;
    padding: 8px 14px;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sh2-mod-bridge-stats li span {
    font-size: 12px;
    color: #64748b;
}
.sh2-mod-bridge-stats li strong {
    font-size: 18px;
    color: #0f172a;
}
.sh2-mod-bridge-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin: 12px 0 4px;
}
.sh2-mod-bridge-hint {
    font-size: 12.5px;
    color: #6b7280;
}

.sh2-participant-bar {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius);
    padding: 14px 18px;
    margin: 24px 0 32px;
    font-size: 14.5px;
    color: var(--sh2-text);
}
.sh2-participant-bar > span { flex: 1; }

.sh2-link-btn {
    background: none;
    border: none;
    color: var(--sh2-primary-700);
    cursor: pointer;
    text-decoration: underline;
    font: inherit;
    padding: 0;
}

.sh2-topic-h2 {
    font-size: 22px;
    margin: 40px 0 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--sh2-primary-100);
}
.sh2-topic-help {
    color: var(--sh2-text-soft);
    font-size: 14.5px;
    margin: 0 0 16px;
}

/* ===== 意見カード ===== */
.sh2-stmt-list {
    list-style: none;
    margin: 0 0 32px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.sh2-stmt {
    background: #fff;
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius);
    padding: 20px 24px;
    transition: border-color .12s;
}
.sh2-stmt:hover { border-color: var(--sh2-border-strong); }
.sh2-stmt[data-my="agree"]    { border-left: 4px solid #10b981; }
.sh2-stmt[data-my="disagree"] { border-left: 4px solid #ef4444; }
.sh2-stmt[data-my="pass"]     { border-left: 4px solid #94a3b8; }

.sh2-stmt-body {
    font-size: 16px;
    line-height: 1.7;
    color: var(--sh2-text);
    margin-bottom: 8px;
    word-break: break-word;
}
.sh2-stmt-meta {
    display: flex;
    gap: 8px;
    font-size: 12.5px;
    color: var(--sh2-text-mute);
    margin-bottom: 14px;
}
.sh2-stmt-tag {
    background: var(--sh2-primary-100);
    color: var(--sh2-primary-700);
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
}
.sh2-stmt-tag--role {
    border: 1px solid transparent;
}
.sh2-stmt-tag--decision {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}
.sh2-stmt-tag--manager {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #1d4ed8;
}
.sh2-stmt-tag--general {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

.sh2-stmt-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.sh2-stmt-manage {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

.sh2-stmt-manage-btn {
    border: 1px solid var(--sh2-border);
    background: #fff;
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    color: var(--sh2-text-soft);
}

.sh2-stmt-manage-btn:hover {
    border-color: var(--sh2-border-strong);
    background: var(--sh2-bg-soft);
}

.sh2-stmt-manage-btn--danger {
    color: #b91c1c;
    border-color: #fecaca;
}

.sh2-topic-manage {
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fafc;
}

.sh2-topic-manage__label {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.sh2-topic-manage__edit {
    margin-bottom: 10px;
}

.sh2-topic-edit-form .sh2-field {
    margin-bottom: 10px;
}

.sh2-mod-control--full {
    flex-direction: column;
    align-items: stretch;
}

.sh2-mod-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--sh2-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
}

.sh2-mod-input:focus {
    outline: none;
    border-color: var(--sh2-accent);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.12);
}
.sh2-vote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 8px;
    border: 2px solid var(--sh2-border);
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--sh2-text-soft);
    transition: all .12s;
    line-height: 1.2;
}
.sh2-vote-btn:hover { border-color: var(--sh2-border-strong); background: var(--sh2-bg-soft); }
.sh2-vote-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sh2-vote-icon {
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}
.sh2-vote-count {
    font-size: 11px;
    color: var(--sh2-text-mute);
    background: var(--sh2-bg-alt);
    padding: 1px 8px;
    border-radius: 999px;
    margin-top: 2px;
}

.sh2-vote-agree.is-active    { background: #d1fae5; border-color: #10b981; color: #065f46; }
.sh2-vote-agree.is-active .sh2-vote-count { background: #a7f3d0; color: #047857; }
.sh2-vote-disagree.is-active { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.sh2-vote-disagree.is-active .sh2-vote-count { background: #fecaca; color: #b91c1c; }
.sh2-vote-pass.is-active     { background: #f1f5f9; border-color: #94a3b8; color: #334155; }
.sh2-vote-pass.is-active .sh2-vote-count { background: #e2e8f0; color: #475569; }

/* ===== 意見投稿フォーム ===== */
.sh2-stmt-form {
    background: var(--sh2-bg-soft);
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius);
    padding: 16px;
}
.sh2-stmt-form textarea {
    width: 100%;
    border: 2px solid var(--sh2-border);
    border-radius: 10px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
    background: #fff;
}
.sh2-stmt-form textarea:focus {
    outline: none;
    border-color: var(--sh2-primary);
    box-shadow: 0 0 0 4px var(--sh2-primary-100);
}
.sh2-stmt-form-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    flex-wrap: wrap;
    gap: 12px;
}
.sh2-stmt-counter {
    color: var(--sh2-text-mute);
    font-size: 13px;
}
.sh2-stmt-counter.is-warn  { color: var(--sh2-accent); font-weight: 600; }
.sh2-stmt-counter.is-error { color: #b91c1c; font-weight: 600; }

.sh2-btn-sm { padding: 8px 16px; font-size: 13.5px; }

/* ===== モーダル ===== */
.sh2-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.sh2-modal[hidden] { display: none; }
.sh2-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 16, 40, 0.55);
    backdrop-filter: blur(2px);
    cursor: pointer;
}
.sh2-modal-card {
    position: relative;
    background: #fff;
    border-radius: var(--sh2-radius-lg);
    box-shadow: 0 24px 64px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 480px;
    padding: 32px;
}
.sh2-modal-card h2 {
    margin: 0 0 12px;
    font-size: 22px;
}
.sh2-modal-card > p {
    color: var(--sh2-text-soft);
    margin: 0 0 20px;
    font-size: 14.5px;
    line-height: 1.7;
}

/* ===== 投票進捗バー ===== */
.sh2-progress {
    background: var(--sh2-bg-soft);
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius);
    padding: 12px 16px;
    margin: 12px 0 16px;
    position: sticky;
    top: 76px;
    z-index: 10;
    backdrop-filter: blur(6px);
}
.sh2-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13.5px;
    color: var(--sh2-text-soft);
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 10px;
}
.sh2-progress-head strong { color: var(--sh2-primary-700); font-size: 16px; }
.sh2-progress-done { color: #10b981; font-weight: 600; }
.sh2-progress-bar {
    background: #e5e7eb;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
}
.sh2-progress-bar-fill {
    background: linear-gradient(90deg, var(--sh2-primary), #10b981);
    height: 100%;
    transition: width .35s ease-out;
}
.sh2-link-btn {
    background: none;
    border: 1px solid var(--sh2-border);
    color: var(--sh2-primary-700);
    cursor: pointer;
    font-size: 12.5px;
    padding: 4px 10px;
    border-radius: 8px;
    transition: background .15s;
}
.sh2-link-btn:hover { background: #eef2ff; }
.sh2-flash { animation: sh2-flash 1.1s ease-out; }
@keyframes sh2-flash {
    0%   { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
    20%  { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.45); background: #fff8e6; }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* ===== 合意形成セクション ===== */
.sh2-consensus-section {
    background: linear-gradient(135deg, #f8f6ff 0%, #fff 100%);
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius-lg);
    padding: 24px 28px;
    margin: 32px 0 40px;
}
.sh2-consensus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 16px;
}
.sh2-consensus-block {
    background: #fff;
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius);
    padding: 20px;
}
.sh2-consensus-block--agree    { border-top: 4px solid #10b981; }
.sh2-consensus-block--divisive { border-top: 4px solid #f59e0b; }
.sh2-consensus-block h3 {
    font-size: 16px;
    margin: 0 0 12px;
    color: var(--sh2-text);
    font-weight: 700;
}
.sh2-consensus-block h3 small {
    font-weight: 400;
    color: var(--sh2-text-mute);
    font-size: 12.5px;
    margin-left: 6px;
}
.sh2-consensus-empty {
    color: var(--sh2-text-mute);
    font-size: 14px;
    margin: 0;
    padding: 16px 0;
    text-align: center;
}
.sh2-consensus-list {
    margin: 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.sh2-consensus-list li {
    line-height: 1.65;
}
.sh2-consensus-body {
    font-size: 14.5px;
    color: var(--sh2-text);
    margin-bottom: 6px;
}
.sh2-consensus-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--sh2-text-mute);
}
.sh2-consensus-bar {
    display: inline-block;
    width: 120px;
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}
.sh2-consensus-bar-fill {
    display: block;
    height: 100%;
    background: var(--sh2-primary);
    border-radius: 999px;
}
.sh2-consensus-bar--split {
    display: flex;
    background: #f1f5f9;
}
.sh2-consensus-bar-fill--right {
    margin-left: auto;
}
.sh2-consensus-foot {
    margin: 16px 0 0;
    color: var(--sh2-text-mute);
    text-align: right;
}

/* ===== 聖徳太子2.0AI 現在の合意案 ===== */
.sh2-ai-consensus-update {
    background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 58%, #ecfeff 100%);
    border: 1px solid var(--sh2-border);
    border-left: 5px solid var(--sh2-primary);
    border-radius: var(--sh2-radius-lg);
    box-shadow: var(--sh2-shadow-sm);
    padding: 22px 26px;
    margin: 24px 0 28px;
}
.sh2-ai-consensus-update-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}
.sh2-ai-consensus-update-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--sh2-primary);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    flex: 0 0 auto;
}
.sh2-ai-consensus-update h2 {
    margin: 0 0 4px;
    color: var(--sh2-text);
    font-size: 20px;
}
.sh2-ai-consensus-update-head p {
    margin: 0;
    color: var(--sh2-text-soft);
    font-size: 13px;
    font-weight: 700;
}
.sh2-ai-consensus-update-rate {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 13px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-weight: 800;
    margin-bottom: 12px;
}
.sh2-ai-consensus-update blockquote {
    margin: 0;
    padding: 16px 18px;
    border-radius: var(--sh2-radius);
    background: rgba(255, 255, 255, .82);
    border: 1px solid var(--sh2-border);
    color: var(--sh2-text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.8;
}
.sh2-ai-consensus-update-summary {
    margin-top: 14px;
}
.sh2-ai-consensus-update-summary p {
    margin: 0 0 10px;
    color: var(--sh2-text-soft);
    line-height: 1.8;
}
.sh2-ai-consensus-update-summary p:last-child { margin-bottom: 0; }
.sh2-ai-consensus-update-foot {
    margin: 14px 0 0;
    color: var(--sh2-text-mute);
    font-size: 12.5px;
}

/* ===== AI 提案ツール・モーダル ===== */
.sh2-stmt-form-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.sh2-stmt-form-tools small { color: var(--sh2-text-mute); font-size: 12.5px; }

.sh2-modal-card--wide { max-width: 640px; max-height: 86vh; overflow-y: auto; }

.sh2-ai-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0 20px;
    min-height: 120px;
}
.sh2-ai-loading {
    text-align: center;
    padding: 40px 0;
    color: var(--sh2-text-mute);
}
.sh2-ai-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--sh2-border);
    border-top-color: var(--sh2-primary);
    border-radius: 50%;
    animation: sh2-spin 0.8s linear infinite;
    margin-bottom: 10px;
}
@keyframes sh2-spin { to { transform: rotate(360deg); } }

.sh2-ai-note {
    background: #fff8e6;
    color: #5d4209;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin: 0;
}

.sh2-ai-card {
    background: var(--sh2-bg-soft);
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius);
    padding: 14px 16px;
    transition: border-color .12s, transform .12s;
}
.sh2-ai-card:hover { border-color: var(--sh2-border-strong); }
.sh2-ai-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}
.sh2-ai-num { color: var(--sh2-text-mute); font-size: 12px; }
.sh2-ai-stance {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--sh2-primary-100);
    color: var(--sh2-primary-700);
}
.sh2-ai-stance--agree    { background: #d1fae5; color: #047857; }
.sh2-ai-stance--disagree { background: #fee2e2; color: #b91c1c; }
.sh2-ai-stance--reframe  { background: #ede9fe; color: #6d28d9; }
.sh2-ai-stance--question { background: #ffedd5; color: #b8431f; }

.sh2-ai-body {
    font-size: 14.5px;
    color: var(--sh2-text);
    margin: 4px 0 6px;
    line-height: 1.65;
}
.sh2-ai-rationale {
    font-size: 12.5px;
    color: var(--sh2-text-mute);
    margin: 0 0 10px;
    line-height: 1.5;
}
.sh2-ai-rationale span { font-weight: 600; color: var(--sh2-text-soft); margin-right: 4px; }
.sh2-ai-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ===== AI 議論サマリー ===== */
.sh2-summary-section {
    background: linear-gradient(180deg, #ffffff 0%, #fff8f0 100%);
    border: 1px solid var(--sh2-border);
    border-left: 4px solid var(--sh2-primary);
    border-radius: var(--sh2-radius-lg);
    padding: 24px 28px;
    margin: 0 0 32px;
}
.sh2-summary-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.sh2-summary-head h2 { margin: 0; }
.sh2-summary-by {
    color: var(--sh2-text-mute);
    font-size: 12px;
    background: #fff;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid var(--sh2-border);
}
.sh2-summary-body p {
    font-size: 15px;
    line-height: 1.85;
    color: var(--sh2-text);
    margin: 0 0 12px;
}
.sh2-summary-body p:last-child { margin-bottom: 0; }

/* ===== 意見地図 ===== */
.sh2-map-section {
    background: #fff;
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius-lg);
    padding: 24px 28px;
    margin: 0 0 32px;
}
.sh2-map-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 24px;
    align-items: start;
    margin-top: 12px;
}
.sh2-map-svg {
    width: 100%;
    height: auto;
    background: #fff;
    border-radius: var(--sh2-radius);
    box-shadow: 0 2px 12px rgba(70, 50, 100, 0.06);
}
.sh2-map-legend {
    background: var(--sh2-bg-soft);
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius);
    padding: 14px 16px;
    font-size: 13px;
}
.sh2-map-legend h4 { margin: 0 0 8px; font-size: 13px; color: var(--sh2-text); }
.sh2-map-legend ul { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; }
.sh2-map-legend li { display: flex; align-items: center; gap: 8px; color: var(--sh2-text-soft); }
.sh2-map-legend li small { color: var(--sh2-text-mute); margin-left: auto; }
.sh2-map-legend-sep { border-top: 1px dashed var(--sh2-border); margin: 4px 0; padding: 0; height: 0; }
.sh2-map-swatch {
    display: inline-block;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #ccc;
}
.sh2-map-swatch--ring {
    background: #fff;
    border: 2px solid #999;
}
.sh2-map-swatch--consensus { border-color: #10b981; }
.sh2-map-swatch--divisive  { border-color: #ef4444; }
.sh2-map-swatch--undecided { border-color: #7c3aed; }
.sh2-map-tip { color: var(--sh2-text-mute); font-size: 11.5px; margin: 0; line-height: 1.5; }

/* ===== モデレーション管理画面 ===== */
.sh2-mod-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 32px;
    font-size: 14px;
    background: #fff;
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius);
    overflow: hidden;
}
.sh2-mod-table th, .sh2-mod-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--sh2-border);
    vertical-align: middle;
}
.sh2-mod-table th {
    background: var(--sh2-bg-soft);
    font-size: 13px;
    color: var(--sh2-text-soft);
    font-weight: 600;
}
.sh2-mod-table tr.is-selected {
    background: #fff8e6;
}
.sh2-mod-table tr:last-child td { border-bottom: none; }
.sh2-mod-table a { color: var(--sh2-primary-700); text-decoration: none; }
.sh2-mod-table a:hover { text-decoration: underline; }
.sh2-mod-meta { display: block; color: var(--sh2-text-mute); font-size: 11.5px; margin-top: 2px; }
.sh2-mod-pending { color: #b8431f; font-weight: 700; }
.sh2-mod-zero { color: var(--sh2-text-mute); }
.sh2-mod-status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: #e5e7eb;
    color: #374151;
}
.sh2-mod-status--open     { background: #d1fae5; color: #047857; }
.sh2-mod-status--draft    { background: #fef3c7; color: #92400e; }
.sh2-mod-status--closed   { background: #fee2e2; color: #b91c1c; }
.sh2-mod-status--archived { background: #e5e7eb; color: #4b5563; }
.sh2-mod-section-h2 { margin-top: 32px; }
.sh2-mod-controls {
    background: var(--sh2-bg-soft);
    border: 1px solid var(--sh2-border);
    border-radius: var(--sh2-radius);
    padding: 16px 18px;
    margin-bottom: 24px;
}
.sh2-mod-control {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.sh2-mod-control:last-child { margin-bottom: 0; }
.sh2-mod-control label { font-weight: 600; color: var(--sh2-text-soft); min-width: 120px; }
.sh2-mod-control select {
    padding: 8px 12px;
    border: 2px solid var(--sh2-border);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    color: var(--sh2-text);
}
.sh2-mod-pending-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sh2-mod-pending-item {
    background: #fff;
    border: 1px solid var(--sh2-border);
    border-left: 4px solid #f59e0b;
    border-radius: var(--sh2-radius);
    padding: 16px 18px;
    transition: border-color .2s;
    overflow: hidden;
}
.sh2-mod-pending-item.is-resolved { pointer-events: none; }
.sh2-mod-pending-item.is-approved { border-left-color: #10b981; background: #f0fdf4; }
.sh2-mod-pending-item.is-rejected { border-left-color: #ef4444; background: #fef2f2; opacity: 0.8; }
.sh2-mod-pending-body {
    font-size: 15px;
    line-height: 1.65;
    color: var(--sh2-text);
    margin-bottom: 8px;
}
.sh2-mod-pending-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--sh2-text-mute);
    margin-bottom: 12px;
    align-items: center;
}
.sh2-mod-pending-date { margin-left: auto; }
.sh2-mod-pending-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
.sh2-empty-soft {
    text-align: center;
    color: var(--sh2-text-mute);
    padding: 32px 16px;
    background: var(--sh2-bg-soft);
    border-radius: var(--sh2-radius);
}

/* ===== AI 参加者バッジ ===== */
.sh2-stmt-tag.sh2-stmt-tag--ai {
    background: #ede9fe;
    color: #6d28d9;
}
.sh2-stmt-tag.sh2-stmt-tag--ai::before { content: '🤖 '; }

@media (max-width: 920px) {
    .sh2-map-wrap { grid-template-columns: 1fr; }
    .sh2-map-legend ul { flex-direction: row; flex-wrap: wrap; }
    .sh2-map-legend li small { margin-left: 4px; }
    .sh2-map-legend-sep { width: 100%; }
}
@media (max-width: 720px) {
    .sh2-topics-head { flex-direction: column; align-items: stretch; }
    .sh2-topic-role-grid { grid-template-columns: 1fr; }
    .sh2-topic-target-row { grid-template-columns: auto minmax(0, 1fr); }
    .sh2-topic-target-row select { grid-column: 2; }
    .sh2-topic-card { padding: 20px; }
    .sh2-stmt { padding: 16px 18px; }
    .sh2-vote-btn { padding: 8px 4px; font-size: 12px; }
    .sh2-vote-icon { font-size: 18px; }
    .sh2-modal-card { padding: 24px; }
    .sh2-consensus-section, .sh2-summary-section, .sh2-map-section { padding: 18px; }
    .sh2-consensus-grid { grid-template-columns: 1fr; gap: 16px; }
    .sh2-ai-card-actions { flex-direction: column-reverse; align-items: stretch; }
    .sh2-ai-card-actions .sh2-btn { width: 100%; }
    .sh2-summary-body p { font-size: 14.5px; line-height: 1.75; }
    .sh2-topic { padding: 36px 0 52px; }
    .sh2-topic-title { word-break: break-word; }
    .sh2-stmt-form textarea { font-size: 16px; /* iOS ズーム抑制 */ }
}

@media (max-width: 480px) {
    .sh2-topic { padding: 24px 0 40px; }
    .sh2-topic-title { font-size: clamp(20px, 6vw, 26px); }
    .sh2-topic-meta { flex-wrap: wrap; gap: 8px; }
    .sh2-search {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .sh2-search input {
        border-radius: 12px;
        min-height: 48px;
        font-size: 16px;
    }
    .sh2-search .sh2-btn { width: 100%; justify-content: center; min-height: 48px; }
    .sh2-topic-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .sh2-participant-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .sh2-participant-bar > span { flex: none; width: 100%; }
    .sh2-stmt-actions { gap: 6px; }
    .sh2-stmt-form-bar { flex-wrap: wrap; gap: 8px; }
    .sh2-stmt-form-tools { width: 100%; }
    .sh2-modal-card--wide { max-height: 92vh; }
}
