:root {
  --brand: #1e3a4a;
  --brand-dark: #142a37;
  --accent: #c98534;
  --bg: #f9f8f5;
  --surface: #ffffff;
  --text: #1c1c1c;
  --muted: #717171;
  --line: #d8d5ce;
  --danger: #c0392b;
  --success: #2a7a4a;
  --shadow: 0 2px 12px rgba(20, 42, 55, 0.08);
  font-family: "BIZ UDPGothic", "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, var(--bg)) 0%, var(--bg) 280px); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

h1, h2 { font-family: "Noto Serif JP", "Noto Serif", Georgia, serif; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.45rem, 4vw, 2rem); }
h2 { margin-bottom: 8px; font-size: clamp(1.25rem, 4vw, 1.65rem); }

.app-shell { width: min(100%, 720px); margin: 0 auto; padding: 24px 18px 48px; }
.brand-header { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.brand-mark[hidden] { display: none !important; }
.brand-mark { display: grid; place-items: center; flex: 0 0 auto; width: 52px; height: 52px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800; font-size: 1.15rem; box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 30%, transparent); overflow: hidden; }
.brand-mark.has-image { padding: 5px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.eyebrow { margin: 0 0 2px; color: var(--brand); font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

.notice-card { background: color-mix(in srgb, var(--accent) 8%, #fff); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); border-radius: 8px; padding: 16px; margin-bottom: 20px; }
.notice-card p { margin: 6px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.65; }

.progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.progress-item { padding: 9px 8px; text-align: center; border-radius: 4px; background: #e8e5df; color: var(--muted); font-size: .76rem; font-weight: 700; }
.progress-item.is-active { background: var(--brand); color: #fff; }
.progress-item.is-complete { background: color-mix(in srgb, var(--brand) 14%, #fff); color: var(--brand); }

.step { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; box-shadow: var(--shadow); animation: fadeIn .25s ease-out; }
.step[hidden] { display: none !important; }
.section-heading { margin-bottom: 18px; }
.section-heading p { color: var(--muted); line-height: 1.65; margin-bottom: 0; }
.step-label { display: inline-block; margin-bottom: 8px; color: var(--accent); font-size: .75rem; font-weight: 900; letter-spacing: .08em; }

.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.category-button { min-height: 70px; padding: 14px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); font-weight: 700; cursor: pointer; transition: .18s ease; }
.category-button:hover, .category-button:focus-visible { border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 12%, transparent); }

.loading-card { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 130px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
.loading-card p { margin: 0; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }

.candidate-list { display: grid; gap: 14px; }
.candidate-card { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: #fff; }
.candidate-card p { margin: 10px 0 16px; line-height: 1.8; }
.candidate-badge { display: inline-flex; padding: 4px 8px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 12%, #fff); color: var(--accent); font-size: .75rem; font-weight: 900; }
.candidate-select { width: 100%; border: 0; border-radius: 6px; background: var(--brand); color: #fff; padding: 13px; font-weight: 800; cursor: pointer; }
.candidate-select:hover { background: var(--brand-dark); }

.none-match-button { width: 100%; margin-top: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); font-weight: 700; cursor: pointer; }
.none-match-button small { display: block; margin-top: 4px; color: var(--muted); font-weight: 500; }
.button-row { display: flex; justify-content: space-between; gap: 14px; margin-top: 18px; }

.field-label { display: block; margin: 18px 0 8px; font-weight: 700; }
textarea, input, select { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); padding: 13px 14px; outline: none; }
textarea:focus, input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
textarea { resize: vertical; line-height: 1.75; }
.field-meta { text-align: right; margin-top: 6px; color: var(--muted); font-size: .8rem; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.quick-actions button { border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 8px 11px; cursor: pointer; font-size: .82rem; }
.inline-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.small-primary { border: 0; border-radius: 6px; padding: 0 18px; background: var(--brand); color: #fff; font-weight: 800; cursor: pointer; }
.helper-text { margin: 7px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.confirm-box { display: flex; align-items: flex-start; gap: 10px; margin: 22px 0; padding: 15px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 6%, #fff); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); font-weight: 700; line-height: 1.55; }
.confirm-box input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); }

.primary-button, .secondary-button, .text-button { width: 100%; border-radius: 6px; padding: 14px 16px; font-weight: 800; cursor: pointer; }
.primary-button { border: 0; background: var(--brand); color: #fff; }
.primary-button:hover { background: var(--brand-dark); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; }
.primary-button.compact { width: auto; margin-top: 16px; }
.secondary-button { border: 1px solid var(--line); background: #fff; color: var(--text); }
.text-button { border: 0; background: transparent; color: var(--brand); padding-left: 0; padding-right: 0; }
.text-button.danger, .danger { color: var(--danger); }
.final-actions { display: grid; gap: 10px; }
.status-message { min-height: 28px; margin-top: 12px; text-align: center; font-size: .88rem; }
.status-message.success { color: var(--success); }
.status-message.error { color: var(--danger); }
.status-message.info { color: var(--brand); }

.completion-step { text-align: center; padding-block: 42px; }
.completion-icon { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 50%; background: color-mix(in srgb, var(--success) 12%, #fff); color: var(--success); font-size: 1.8rem; font-weight: 900; }
.completion-step p { color: var(--muted); line-height: 1.75; }

footer { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 24px; color: var(--muted); font-size: .78rem; }
footer a, .footer-button { color: var(--muted); background: transparent; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

dialog { border: 0; border-radius: 12px; padding: 0; width: min(92vw, 420px); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, .42); }
.dialog-card { padding: 22px; }
.store-choice-list { display: grid; gap: 10px; margin: 18px 0; }
.store-choice { text-align: left; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 14px; cursor: pointer; }
.store-choice strong, .store-choice small { display: block; }
.store-choice small { color: var(--muted); margin-top: 4px; }

.admin-body { background: var(--bg); }
.admin-shell { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 30px 0 60px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.secondary-link { border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 11px 14px; color: var(--text); text-decoration: none; font-weight: 700; }
.admin-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow); }
.admin-card h2 { font-size: 1.15rem; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.metric-card strong { display: block; font-size: 1.65rem; color: var(--brand); }
.metric-card span { display: block; margin-top: 4px; color: var(--muted); font-size: .82rem; }
.admin-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.admin-form-grid label { font-weight: 700; font-size: .9rem; }
.admin-form-grid input { margin-top: 7px; }
.full-width { grid-column: 1 / -1; }
.url-preview { word-break: break-all; padding: 13px; border-radius: 6px; background: color-mix(in srgb, var(--bg) 70%, #e0ddd8); }
.qr-placeholder { display: grid; place-items: center; min-height: 180px; margin-top: 14px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); }
.qr-pattern { font-size: 4rem; line-height: 1; color: var(--text); }
.qr-placeholder p { margin: 8px 0 0; }
.qr-code { display: grid; place-items: center; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #ffffff; }
.qr-code svg { width: 180px; height: 180px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 720px) {
  .app-shell { padding-inline: 14px; }
  .step { padding: 19px 16px; border-radius: 8px; }
  .category-grid { grid-template-columns: 1fr; }
  .button-row { flex-direction: column; gap: 2px; }
  .inline-form { grid-template-columns: 1fr; }
  .small-primary { padding: 12px; }
  .admin-header { align-items: flex-start; flex-direction: column; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
}

/* Gemini接続版の追加UI */
.brand-copy { min-width: 0; }
.eyebrow-row { display: flex; align-items: center; gap: 8px; }
.ai-mode-badge { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 4px; background: color-mix(in srgb, var(--muted) 10%, #fff); color: var(--muted); font-size: .68rem; font-weight: 700; }
.ai-mode-badge.is-live { background: color-mix(in srgb, var(--success) 12%, #fff); color: var(--success); }
.api-error-card { margin-bottom: 14px; padding: 16px; border: 1px solid color-mix(in srgb, var(--danger) 25%, #fff); border-radius: 8px; background: color-mix(in srgb, var(--danger) 5%, #fff); }
.api-error-card p { margin: 7px 0 14px; color: var(--muted); line-height: 1.6; }
.detail-panel { margin-top: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.detail-heading h3 { margin: 0; font-size: 1rem; }
.detail-heading p { margin: 5px 0 13px; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.detail-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-chips button { border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--text); padding: 9px 12px; cursor: pointer; font-size: .82rem; }
.detail-apply { margin-top: 13px; padding-block: 11px; }
button:disabled { cursor: not-allowed; opacity: .48; }


/* v0.4.0: 調整項目を先、口コミ文を後に配置 */
.choice-panel { margin-top: 16px; padding: 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.choice-heading { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 14px; }
.choice-heading h3 { margin: 0; font-size: 1rem; font-family: inherit; }
.choice-heading p { margin: 5px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.choice-number { display: inline-grid; place-items: center; flex: 0 0 auto; width: 25px; height: 25px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .76rem; font-weight: 900; }
.choice-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-chips button { border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--text); padding: 9px 12px; cursor: pointer; font-size: .82rem; }
.choice-chips button.is-selected { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, #fff); color: var(--brand); font-weight: 800; box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 10%, transparent); }
.compact-label { margin-top: 15px; }
.adjustment-submit { margin-top: 16px; min-height: 52px; }
.revision-counter { margin: 8px 0 0; color: var(--muted); text-align: center; font-size: .79rem; line-height: 1.55; }
.revision-counter.is-limit { color: var(--danger); font-weight: 700; }
.undo-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 9px 12px; border-radius: 6px; background: color-mix(in srgb, var(--brand) 5%, #fff); border: 1px solid color-mix(in srgb, var(--brand) 18%, var(--line)); }
.undo-row[hidden] { display: none !important; }
.undo-label { color: var(--brand); font-size: .82rem; }
.undo-row .text-button { width: auto; padding: 0; color: var(--brand); font-size: .82rem; text-decoration: underline; }
.posted-confirm-card { margin-top: 22px; padding: 18px; border: 2px solid color-mix(in srgb, var(--success) 28%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--success) 5%, #fff); }
.posted-confirm-card[hidden] { display: none !important; }
.posted-confirm-card p { margin: 0 0 14px; color: var(--text); line-height: 1.65; font-size: .92rem; }
.review-panel { margin-top: 22px; padding: 18px; border: 2px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 10px; background: #fff; }
.review-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.review-heading-row > div { display: flex; align-items: center; gap: 10px; }
.review-heading-row h3 { margin: 0; font-size: 1rem; font-family: inherit; }
.clear-text-button { flex: 0 0 auto; border: 0; background: transparent; color: var(--danger); font-size: .78rem; font-weight: 800; cursor: pointer; text-decoration: underline; }
.review-panel textarea { min-height: 190px; }

@media (max-width: 520px) {
  .review-heading-row { align-items: flex-start; }
  .review-heading-row > div { align-items: flex-start; }
  .choice-chips button { padding: 9px 10px; }
}


/* v0.4.2: 店舗ロゴ画像アップロード */
.logo-setting-label { display: block; font-weight: 700; font-size: .9rem; }
.logo-upload-row { display: flex; align-items: center; gap: 18px; margin-top: 9px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.logo-admin-preview { display: grid; place-items: center; flex: 0 0 auto; width: 112px; aspect-ratio: 1 / 1; overflow: hidden; border: 1px dashed var(--line); border-radius: 10px; background: #fff; color: var(--muted); box-shadow: var(--shadow); }
.logo-admin-preview.has-image { padding: 8px; border: 1px solid var(--line); background: #fff; }
.logo-admin-preview img { display: block; width: 100%; height: 100%; object-fit: contain; }
.logo-admin-preview img[hidden], .logo-admin-preview span[hidden] { display: none !important; }
.logo-placeholder { display: grid; place-items: center; gap: 6px; text-align: center; }
.logo-placeholder svg { width: 30px; height: 30px; fill: currentColor; opacity: .75; }
.logo-placeholder small { font-size: .72rem; font-weight: 700; }
.logo-upload-controls { flex: 1 1 auto; min-width: 0; }
.logo-upload-controls input[type="file"] { padding: 10px; background: #fff; }
.compact-button { width: auto; margin-top: 12px; padding: 10px 14px; }

@media (max-width: 560px) {
  .logo-upload-row { align-items: stretch; flex-direction: column; }
  .logo-admin-preview { width: 96px; }
  .compact-button { width: 100%; }
}

/* 口コミ返信デモ */
.admin-header-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.reply-admin-shell { width: min(980px, calc(100% - 32px)); }
.reply-demo-notice { margin-bottom: 18px; }
.reply-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.reply-card-heading h2 { margin-top: 2px; }
.reply-status-badge, .reply-history-status { display: inline-flex; align-items: center; justify-content: center; border-radius: 4px; padding: 5px 9px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.reply-status-badge.is-on, .reply-history-status.is-success { color: #12613d; background: #def7e9; }
.reply-status-badge.is-off, .reply-history-status.is-neutral { color: #5c6070; background: #eef0f5; }
.reply-status-badge.is-warning, .reply-history-status.is-warning { color: #855a00; background: #fff2c7; }
.reply-history-status.is-error { color: #9a2525; background: #ffe0e0; }
.reply-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.reply-settings-grid label, .reply-form-grid label, .reply-history-controls label { font-weight: 700; font-size: .9rem; }
.reply-settings-grid input, .reply-settings-grid select, .reply-settings-grid textarea,
.reply-form-grid input, .reply-form-grid select, .reply-form-grid textarea,
.reply-history-controls select { margin-top: 7px; }
.toggle-setting { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.toggle-setting input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px; }
.toggle-setting span { display: grid; gap: 5px; }
.toggle-setting small, .reply-consent-box small { display: block; color: var(--muted); font-weight: 500; line-height: 1.6; }
.reply-consent-box { margin-top: 18px; }
.reply-consent-box span { display: grid; gap: 4px; }
.sample-review-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.sample-review-buttons .secondary-button { width: auto; }
.reply-loading { display: flex; align-items: center; gap: 10px; margin-top: 14px; color: var(--brand); font-weight: 700; }
.reply-provider-meta { color: var(--muted); font-size: .78rem; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.reply-history-controls { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.reply-history-controls label { min-width: 220px; }
.reply-history-controls .primary-button, .reply-history-controls .secondary-button { width: auto; margin-top: 0; }
.reply-history-list { display: grid; gap: 12px; }
.reply-history-empty { margin: 0; padding: 22px; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); text-align: center; }
.reply-history-item { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: #fff; }
.reply-history-item-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.reply-history-item-header > div { display: grid; gap: 4px; }
.reply-history-item-header small, .reply-history-meta { color: var(--muted); }
.reply-history-review, .reply-history-reply { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; }
.reply-history-review { margin: 14px 0 8px; padding: 12px; border-radius: 6px; background: var(--bg); color: #4c5060; }
.reply-history-reply { margin: 0 0 10px; }
.reply-history-item-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.reply-history-item-actions .secondary-button { width: auto; }

@media (max-width: 720px) {
  .admin-header-actions { width: 100%; }
  .admin-header-actions .secondary-link { flex: 1 1 auto; text-align: center; }
  .reply-card-heading { flex-direction: column; }
  .reply-settings-grid { grid-template-columns: 1fr; }
  .sample-review-buttons { width: 100%; justify-content: flex-start; }
  .reply-provider-meta { text-align: left; }
  .reply-history-controls { align-items: stretch; flex-direction: column; }
  .reply-history-controls label, .reply-history-controls .primary-button, .reply-history-controls .secondary-button { width: 100%; }
  .reply-history-item-header { flex-direction: column; }
}

/* v0.5.2: 星評価はGoogle投稿者が付け、店舗側は受信データとして表示 */
.reply-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.reply-flow > div { display: grid; gap: 6px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.reply-flow span { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .78rem; font-weight: 900; }
.reply-flow strong { font-size: .92rem; }
.reply-flow small { color: var(--muted); line-height: 1.55; }
.received-review-grid input[readonly], .received-review-grid textarea[readonly] { background: var(--bg); color: #505467; cursor: default; }
.received-rating-field { display: grid; gap: 7px; align-content: start; font-weight: 700; font-size: .9rem; }
.received-rating-field strong { min-height: 49px; display: flex; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff8dc; color: #8a5a00; font-size: 1.15rem; letter-spacing: .06em; }

@media (max-width: 720px) {
  .reply-flow { grid-template-columns: 1fr; }
}

/* v0.6.0: Mock GBP API取得・返信投稿テスト */
.reply-notice-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reply-action-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.reply-action-row .primary-button, .reply-action-row .secondary-button { width: auto; margin-top: 0; }
.received-review-list { display: grid; gap: 10px; }
.received-review-item { width: 100%; display: grid; gap: 8px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.received-review-item:hover { border-color: var(--brand); }
.received-review-item.is-selected { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); background: color-mix(in srgb, var(--brand) 3%, #fff); }
.received-review-item-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.received-review-item-top strong { font-size: .92rem; }
.received-review-item-top small { flex: 0 0 auto; border-radius: 4px; padding: 4px 8px; font-weight: 700; }
.received-review-item-top small.is-replied { color: #12613d; background: #def7e9; }
.received-review-item-top small.is-unreplied { color: #855a00; background: #fff2c7; }
.received-review-comment, .received-review-reply { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }
.received-review-comment { color: #4c5060; }
.received-review-reply { padding: 9px 11px; border-radius: 6px; background: var(--bg); color: #555a6c; font-size: .86rem; }

@media (max-width: 720px) {
  .reply-notice-heading, .received-review-item-top { align-items: flex-start; flex-direction: column; }
  .reply-action-row { align-items: stretch; flex-direction: column; }
  .reply-action-row .primary-button, .reply-action-row .secondary-button { width: 100%; }
}

/* v0.6.1: 口コミ返信画面の操作導線を簡略化 */
.reply-page-header { margin-bottom: 14px; }
.reply-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.reply-toolbar label { min-width: 240px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.reply-toolbar select { margin-top: 6px; }
.reply-toolbar-status { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.reply-tabs { display: flex; gap: 6px; margin-bottom: 14px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: #e8e5df; }
.reply-tab { flex: 1 1 0; min-height: 44px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-weight: 700; cursor: pointer; }
.reply-tab.is-active { background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.reply-tab-panel[hidden] { display: none !important; }
.reply-workspace { display: grid; grid-template-columns: minmax(280px, .82fr) minmax(0, 1.58fr); gap: 14px; min-height: 680px; }
.reply-inbox-panel, .reply-detail-panel { border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.reply-inbox-panel { display: flex; flex-direction: column; min-height: 0; padding: 18px; }
.reply-detail-panel { padding: 22px; }
.reply-inbox-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.reply-inbox-header h2 { margin-bottom: 0; font-size: 1.1rem; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--brand); font-size: 1.2rem; font-weight: 900; cursor: pointer; }
.reply-filter-row { display: flex; gap: 6px; margin-bottom: 12px; }
.reply-filter { flex: 1 1 0; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--muted); padding: 8px 10px; font-size: .78rem; font-weight: 700; cursor: pointer; }
.reply-filter.is-active { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, #fff); color: var(--brand); }
.reply-inbox-panel .received-review-list { overflow: auto; padding-right: 2px; }
.reply-inbox-panel .received-review-item { padding: 13px; border-radius: 6px; }
.reply-inbox-panel .received-review-comment { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 3; -webkit-box-orient: vertical; font-size: .88rem; }
.compact-status { min-height: 20px; margin: 8px 0 0; text-align: left; font-size: .8rem; }
.reply-history-empty { display: grid; gap: 6px; }
.reply-history-empty span { font-size: .82rem; }
.reply-empty-state { display: grid; place-items: center; align-content: center; min-height: 600px; text-align: center; color: var(--muted); }
.reply-empty-state h2 { color: var(--text); }
.reply-empty-state p { max-width: 460px; line-height: 1.75; }
.reply-empty-icon { display: grid; place-items: center; width: 70px; height: 70px; margin-bottom: 14px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 8%, #fff); font-size: 2rem; }
.selected-review-summary { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.selected-review-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.selected-review-topline h2 { margin-bottom: 0; font-size: 1.15rem; }
.selected-review-rating { flex: 0 0 auto; border-radius: 4px; padding: 6px 10px; background: #fff3c4; color: #8a5a00; font-size: .92rem; letter-spacing: .04em; }
.selected-review-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin-top: 14px; color: var(--muted); font-size: .82rem; }
.selected-review-comment { margin: 14px 0 0; white-space: pre-wrap; line-height: 1.85; }
.reply-generate-section, .reply-editor-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.reply-step-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.reply-step-heading > div { display: flex; align-items: center; gap: 9px; }
.reply-step-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .8rem; font-weight: 900; }
.reply-main-action { min-height: 52px; }
.inline-meta { margin-top: 0; }
.reply-primary-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 12px; }
.reply-primary-actions .secondary-button { width: auto; }
.reply-delete-button { width: auto; margin-top: 6px; font-size: .8rem; }
.test-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.test-review-button { display: grid; gap: 7px; min-height: 120px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: left; cursor: pointer; }
.test-review-button strong { font-size: 1rem; }
.test-review-button small { color: var(--muted); line-height: 1.55; }
.test-review-button.is-positive:hover { border-color: var(--success); box-shadow: 0 0 0 2px color-mix(in srgb, var(--success) 11%, transparent); }
.test-review-button.is-negative:hover { border-color: var(--danger); box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 10%, transparent); }

@media (max-width: 860px) {
  .reply-workspace { grid-template-columns: 1fr; min-height: auto; }
  .reply-inbox-panel .received-review-list { max-height: 350px; }
  .reply-empty-state { min-height: 300px; }
}

@media (max-width: 620px) {
  .reply-toolbar { align-items: stretch; flex-direction: column; }
  .reply-toolbar label { min-width: 0; }
  .reply-toolbar-status { justify-content: flex-start; }
  .reply-tabs { overflow-x: auto; }
  .reply-tab { min-width: 120px; }
  .selected-review-topline, .reply-step-heading { align-items: flex-start; flex-direction: column; }
  .reply-primary-actions, .test-review-grid { grid-template-columns: 1fr; }
  .reply-primary-actions .secondary-button { width: 100%; }
}

/* v0.7.0: 実AI返信品質テスト */
.ai-test-shell { max-width: 1180px; }
.ai-test-header { margin-bottom: 16px; }
.ai-test-status-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.ai-test-status-card h2 { margin-bottom: 4px; }
.ai-test-status-badges { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ai-test-notice.is-warning { border-color: #e8c86e; background: #fff9e7; }
.ai-test-control-card { margin-bottom: 14px; }
.ai-test-control-grid { display: grid; grid-template-columns: minmax(220px, .5fr) minmax(0, 1.5fr); gap: 14px; }
.ai-test-control-grid .full-width { grid-column: 1 / -1; }
.ai-test-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.ai-test-actions .primary-button, .ai-test-actions .secondary-button { width: auto; margin-top: 0; }
.ai-test-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ai-test-summary > div { display: grid; gap: 4px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.ai-test-summary span { color: var(--muted); font-size: .76rem; font-weight: 700; }
.ai-test-summary strong { font-size: 1.35rem; }
.ai-test-results { display: grid; gap: 14px; }
.ai-test-empty { display: grid; place-items: center; align-content: center; min-height: 360px; padding: 28px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; text-align: center; color: var(--muted); }
.ai-test-empty h2 { color: var(--text); }
.ai-test-empty p { max-width: 560px; line-height: 1.75; }
.ai-quality-result { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.ai-quality-result.is-passed { border-color: color-mix(in srgb, var(--success) 45%, var(--line)); }
.ai-quality-result.is-failed { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.ai-quality-result.is-running { opacity: .82; }
.ai-quality-result-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 19px; border-bottom: 1px solid var(--line); background: var(--bg); }
.ai-quality-result-header > div { display: flex; align-items: center; gap: 12px; }
.ai-quality-result-header h2 { margin-bottom: 0; font-size: 1.08rem; }
.ai-quality-order { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 6px; background: var(--brand); color: #fff; font-size: .82rem; font-weight: 900; }
.ai-quality-pass-badge { flex: 0 0 auto; border-radius: 4px; padding: 5px 9px; background: #f1f2f7; color: var(--muted); font-size: .78rem; font-weight: 700; }
.ai-quality-result.is-passed .ai-quality-pass-badge { background: #def7e9; color: #12613d; }
.ai-quality-result.is-failed .ai-quality-pass-badge { background: #ffe1e1; color: #9f2d2d; }
.ai-quality-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.ai-quality-columns > section { padding: 20px; }
.ai-quality-columns > section + section { border-left: 1px solid var(--line); }
.ai-quality-columns h3, .ai-quality-evaluation h3 { margin-bottom: 10px; font-size: .9rem; font-family: inherit; }
.ai-quality-rating { margin: 0 0 4px; color: #b47a00; letter-spacing: .05em; }
.ai-quality-reviewer { margin: 0 0 10px; color: var(--muted); font-size: .8rem; }
.ai-quality-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; }
.ai-quality-meta { display: grid; gap: 7px; margin: 16px 0 0; padding-top: 13px; border-top: 1px solid var(--line); }
.ai-quality-meta > div { display: grid; grid-template-columns: 88px 1fr; gap: 10px; font-size: .78rem; }
.ai-quality-meta dt { color: var(--muted); font-weight: 700; }
.ai-quality-meta dd { margin: 0; overflow-wrap: anywhere; }
.ai-quality-evaluation { padding: 18px 20px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--success) 4%, #fff); }
.ai-quality-evaluation p { margin: 0; color: #12613d; }
.ai-quality-evaluation ul { margin: 8px 0 0; padding-left: 1.25rem; line-height: 1.7; }
.ai-quality-warnings { margin-top: 12px; padding: 12px 14px; border-radius: 6px; background: #fff6d8; color: #735000; }
.ai-quality-warnings ul { margin-top: 5px; }
.ai-quality-guardrails { margin-top: 12px; padding: 12px 14px; border-radius: 6px; background: #eef7ff; color: #174e78; }
.ai-quality-guardrails p { margin-top: 4px; color: inherit; }
.reply-status-badge.is-error { color: #9f2d2d; background: #ffe1e1; }

@media (max-width: 900px) {
  .ai-test-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ai-quality-columns { grid-template-columns: 1fr; }
  .ai-quality-columns > section + section { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 620px) {
  .ai-test-status-card { align-items: flex-start; flex-direction: column; }
  .ai-test-status-badges { justify-content: flex-start; }
  .ai-test-control-grid { grid-template-columns: 1fr; }
  .ai-test-actions { align-items: stretch; flex-direction: column; }
  .ai-test-actions .primary-button, .ai-test-actions .secondary-button { width: 100%; }
  .ai-test-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-quality-result-header { align-items: flex-start; flex-direction: column; }
}

/* 認証（ログイン画面・ヘッダー注入UI） */
.login-shell { max-width: 460px; }
.login-shell form { display: grid; gap: 14px; margin-top: 12px; }
.login-shell form label { display: grid; gap: 6px; font-weight: 600; }
.login-shell .status-message.is-error { color: #9f2d2d; }
.auth-controls { align-items: center; display: inline-flex; flex-wrap: wrap; gap: 8px; }
.auth-controls select { max-width: 230px; }
.auth-user-chip {
  background: color-mix(in srgb, var(--brand) 8%, #fff);
  border-radius: 4px;
  font-size: 0.82rem;
  max-width: 200px;
  overflow: hidden;
  padding: 4px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-user-chip.is-warning { background: #fff0d6; color: #8a5b00; }
