:root {
  color-scheme: light;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-muted: #eef3f2;
  --text: #17201d;
  --muted: #5f6f6a;
  --line: #d9e0dd;
  --accent: #23685a;
  --accent-strong: #16473f;
  --warn: #a15c09;
  --danger: #a53232;
  --ok: #287348;
  --shadow: 0 14px 30px rgba(21, 36, 31, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.app-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 32px clamp(18px, 4vw, 56px) 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.app-header > * {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.lead {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.top-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  background: var(--surface-muted);
  border-radius: 8px;
  flex: 0 0 auto;
}

.tab,
button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.tab.active {
  background: var(--accent);
  color: white;
}

main {
  padding: 26px clamp(18px, 4vw, 56px) 48px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.finder {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin-bottom: 22px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.setting-page .finder {
  display: none;
}

.page-context {
  display: none;
  margin-bottom: 18px;
}

.page-context.active {
  display: block;
}

.page-context-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.page-context-panel h2 {
  margin-bottom: 6px;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
}

.page-context-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.back-link,
.setting-page-link {
  color: var(--accent-strong);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.search-row {
  display: grid;
  gap: 8px;
}

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

input,
select {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 12px;
}

.filter-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.filter-actions p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.filter-actions button {
  border-color: var(--line);
  background: var(--surface-muted);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.setting-card,
.metric,
.review-item,
.note-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.setting-card {
  min-width: 0;
  padding: 18px;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.card-head > div {
  min-width: 0;
}

.material {
  margin-bottom: 5px;
  color: var(--accent);
  font-weight: 700;
}

.summary {
  color: var(--muted);
  min-height: 44px;
}

.meta-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 6px;
  padding: 0 8px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.product-links {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}

.product-filter-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.product-filter-bar button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 10px;
  border-color: var(--line);
  background: var(--surface-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.product-filter-bar button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.color-filter-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  padding: 0 !important;
}

.color-swatch {
  display: block;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 999px;
  background: var(--swatch);
}

.color-swatch.transparent {
  background:
    linear-gradient(45deg, #d9e0dd 25%, transparent 25%),
    linear-gradient(-45deg, #d9e0dd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d9e0dd 75%),
    linear-gradient(-45deg, transparent 75%, #d9e0dd 75%);
  background-color: #ffffff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.product-filter-bar button.active .color-swatch {
  outline: 2px solid white;
  outline-offset: -3px;
}

.product-link-list {
  display: flex;
  gap: 10px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 4px 8px 0;
  scroll-snap-type: x proximity;
}

.card-actions {
  margin: 4px 0 14px;
}

.product-link {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  flex: 0 0 min(260px, 82vw);
  min-width: min(260px, 82vw);
  min-height: 86px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  color: var(--text);
  text-decoration: none;
  scroll-snap-align: start;
}

.product-link:hover {
  border-color: var(--accent);
}

.product-thumb {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 7px;
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.product-thumb.amazon {
  background: linear-gradient(135deg, #30465c, #ec9b24);
}

.product-thumb.rakuten {
  background: linear-gradient(135deg, #8d1d2c, #d94b63);
}

.product-thumb.has-image {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.product-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.product-copy strong {
  min-width: 0;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
}

.product-copy span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.status-pill,
.confidence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  font-weight: 700;
}

.status-pill.high,
.confidence.high {
  background: #dff3e7;
  color: var(--ok);
}

.status-pill.medium,
.confidence.medium {
  background: #fff1d8;
  color: var(--warn);
}

.status-pill.review,
.confidence.review {
  background: #fde4e1;
  color: var(--danger);
}

.fact-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.fact-row {
  display: grid;
  grid-template-columns: minmax(84px, 0.8fr) minmax(0, 1fr) minmax(84px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #f9fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.fact-note {
  padding: 9px 10px;
  border: 1px solid #f2d9a6;
  border-radius: 8px;
  background: #fff8e9;
  color: var(--warn);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.fact-label {
  color: var(--muted);
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.fact-value {
  font-weight: 800;
  min-width: 0;
  overflow-wrap: anywhere;
}

details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

.evidence-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.evidence-item {
  padding: 10px;
  border-left: 4px solid var(--accent);
  background: #f7faf9;
}

.evidence-item a,
.evidence-links a {
  color: var(--accent-strong);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.evidence-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.muted-link {
  color: var(--muted) !important;
}

.evidence-item p {
  margin-bottom: 4px;
  color: var(--muted);
}

.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.publish-readiness {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-bottom: 22px;
}

.evidence-audit-workbench {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-bottom: 22px;
}

.evidence-audit-workbench .panel-head button {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.readiness-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: 10px;
}

.readiness-metric,
.readiness-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.readiness-metric {
  padding: 12px;
}

.readiness-metric strong {
  display: block;
  font-size: 1.45rem;
}

.readiness-metric span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.readiness-metric.ready {
  border-color: #93c9a7;
}

.readiness-metric.needs-work {
  border-color: #d9b36d;
}

.readiness-metric.blocked {
  border-color: #d08b8b;
}

.readiness-list {
  display: grid;
  gap: 10px;
  max-height: 42vh;
  overflow: auto;
  padding-right: 4px;
}

.readiness-item {
  min-width: 0;
  padding: 14px;
}

.readiness-item.ready {
  border-left: 4px solid var(--ok);
}

.readiness-item.needs_work {
  border-left: 4px solid var(--warn);
}

.readiness-item.blocked {
  border-left: 4px solid var(--danger);
}

.readiness-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.readiness-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.readiness-title-row h3 {
  margin: 0;
  overflow-wrap: anywhere;
}

.readiness-item p {
  margin: 6px 0 8px;
  color: var(--muted);
  font-weight: 700;
}

.readiness-review-facts {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}

.readiness-review-facts > strong {
  font-size: 0.86rem;
}

.readiness-fact-list {
  display: grid;
  gap: 6px;
}

.readiness-fact-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.7fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.readiness-fact-row span,
.readiness-fact-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.readiness-fact-row span:first-child {
  font-weight: 800;
}

.readiness-fact-row small {
  color: var(--muted);
  font-weight: 700;
}

.readiness-status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.audit-list {
  display: grid;
  gap: 10px;
  max-height: 42vh;
  overflow: auto;
  padding-right: 4px;
}

.audit-guide {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #f2d9a6;
  border-radius: 8px;
  background: #fff8e9;
}

.audit-guide span {
  color: var(--muted);
  font-weight: 700;
}

.audit-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.audit-item.ok {
  border-left: 4px solid var(--ok);
}

.audit-item.warning,
.audit-item.unchecked {
  border-left: 4px solid var(--warn);
}

.audit-item.failed {
  border-left: 4px solid var(--danger);
}

.audit-item h3,
.audit-item p {
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.audit-item p {
  color: var(--muted);
  font-weight: 700;
}

.audit-comparison {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.comparison-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.comparison-values span,
.review-evidence-compare span {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 700;
}

.comparison-values strong,
.review-evidence-compare strong {
  color: var(--muted);
  font-size: 0.76rem;
}

.comparison-guide {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.comparison-guide li {
  margin: 3px 0;
}

.audit-status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric {
  padding: 16px;
}

.metric strong {
  display: block;
  font-size: 1.8rem;
}

.metric span {
  color: var(--muted);
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(min(100%, 280px), 0.8fr);
  gap: 18px;
  margin-bottom: 22px;
}

.affiliate-workbench {
  display: grid;
  grid-template-columns: minmax(min(100%, 360px), 0.9fr) minmax(0, 1.5fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
}

.manufacturer-workbench {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-bottom: 22px;
}

.click-insights {
  display: grid;
  gap: 12px;
  min-width: 0;
  margin-bottom: 22px;
}

.click-insights .ops-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.manufacturer-candidate-list {
  display: flex;
  gap: 12px;
  min-width: 0;
  overflow-x: auto;
  padding: 2px 4px 10px 0;
  scroll-snap-type: x proximity;
}

.manufacturer-card {
  flex: 0 0 min(360px, 86vw);
  display: grid;
  gap: 10px;
  min-width: min(360px, 86vw);
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
}

.manufacturer-card.adopted {
  border-color: #93c9a7;
}

.manufacturer-card.hold {
  border-color: #d9b36d;
}

.manufacturer-card.rejected {
  opacity: 0.68;
}

.manufacturer-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.manufacturer-card h3,
.manufacturer-card p {
  margin-bottom: 0;
}

.manufacturer-card-head p,
.manufacturer-note {
  color: var(--muted);
}

.manufacturer-card-head strong {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--accent-strong);
}

.material-chip-list,
.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-links a {
  color: var(--accent-strong);
  font-weight: 800;
}

.rakuten-panel,
.rakuten-results-panel {
  min-width: 0;
}

.rakuten-panel {
  position: sticky;
  top: 14px;
}

.rakuten-results-panel {
  display: grid;
  gap: 12px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.panel-head h2,
.subsection-title {
  margin-bottom: 0;
}

.panel-head span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.manual-offer-details {
  margin-top: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.manual-offer-details .source-form {
  margin-top: 12px;
  margin-bottom: 0;
  box-shadow: none;
}

.compact-form {
  gap: 8px;
  padding: 12px;
}

.compact-form input,
.compact-form select {
  min-height: 40px;
}

.compact-list {
  max-height: 48vh;
  overflow: auto;
  padding-right: 4px;
}

.subsection-title {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}

.review-list {
  display: grid;
  gap: 12px;
}

.review-item,
.note-panel {
  padding: 16px;
}

.review-highlight {
  outline: 3px solid #f2d9a6;
  outline-offset: 2px;
}

.review-item h3 {
  margin: 0 0 8px;
}

.review-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.review-context a {
  color: var(--accent-strong);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.human-review-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid #b8d8c2;
  border-radius: 8px;
  background: #f1faf5;
}

.human-review-summary > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.human-review-summary p {
  margin: 0;
}

.recommended-choice {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  background: #dff3e7;
  color: var(--ok);
  font-size: 0.78rem;
  font-weight: 800;
}

.decision-question {
  font-weight: 800;
}

.plain-conclusion {
  color: var(--text);
  font-weight: 700;
}

.why-unclear {
  color: var(--muted);
  font-weight: 700;
}

.review-summary-box {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #f2d9a6;
  border-radius: 8px;
  background: #fff8e9;
}

.review-summary-box p {
  margin: 0;
}

.review-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.review-summary {
  color: var(--muted);
}

.review-detail {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.review-fact {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
}

.review-fact strong {
  display: block;
  margin-bottom: 4px;
}

.review-fact small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
}

.review-guide {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
}

.review-guide-block {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.review-guide-block strong,
.review-evidence h4 {
  display: block;
  margin-bottom: 6px;
}

.review-guide-block ul,
.review-guide-block ol {
  margin: 0;
  padding-left: 20px;
}

.review-guide-block li {
  margin: 4px 0;
  color: var(--muted);
}

.review-evidence {
  display: grid;
  gap: 8px;
}

.review-evidence h4 {
  margin: 0;
}

.review-evidence-item {
  padding: 10px;
  border-left: 4px solid var(--accent);
  background: #fbfcfc;
}

.review-evidence-item a {
  color: var(--accent-strong);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.review-evidence-item p {
  margin: 6px 0;
}

.review-evidence-compare {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.9fr) minmax(0, 1.2fr);
  gap: 8px;
  margin: 8px 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
}

.copy-evidence-url {
  min-height: 30px;
  padding: 0 10px;
  border-color: var(--line);
  background: var(--surface-muted);
  font-size: 0.82rem;
}

.review-actions button {
  background: var(--surface-muted);
  border-color: var(--line);
}

.review-actions button.primary {
  background: var(--accent);
  color: white;
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 18px;
}

.ops-list {
  display: grid;
  gap: 12px;
}

.ops-toolbar {
  margin-bottom: 14px;
}

.ops-toolbar button {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.source-form {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.source-form button {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.target-context {
  min-width: 0;
}

.target-context-panel {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfa;
}

.target-context-panel strong,
.target-context-panel span,
.target-summary,
.candidate-judgement {
  overflow-wrap: anywhere;
}

.target-context-panel span,
.target-context-panel small,
.target-summary {
  color: var(--muted);
  font-size: 0.88rem;
}

.target-context-panel small {
  line-height: 1.45;
}

.form-warning {
  min-height: 20px;
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
  font-weight: 700;
}

.ops-item {
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.ops-item h3 {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.ops-item p {
  margin-bottom: 8px;
  color: var(--muted);
}

.affiliate-offer-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.affiliate-offer-row > div {
  min-width: 0;
}

.target-summary {
  margin: 0 0 8px;
  font-weight: 700;
}

.candidate-judgement {
  margin-bottom: 8px;
  font-weight: 700;
}

.candidate-judgement.ok {
  color: var(--ok);
}

.candidate-judgement.warn {
  color: var(--warn);
}

.candidate-judgement.danger {
  color: var(--danger);
}

.warn-item {
  border-color: #d9b36d;
}

.danger-item {
  border-color: #d08b8b;
  background: #fffafa;
}

.ops-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ops-meta span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.ops-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ops-actions button {
  border-color: var(--line);
  background: var(--surface-muted);
}

.button-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.ops-actions button.allow {
  border-color: var(--ok);
  color: var(--ok);
}

.ops-actions button.deny {
  border-color: var(--danger);
  color: var(--danger);
}

.ops-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.evidence-detail-panel {
  display: grid;
  gap: 14px;
  max-width: 920px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.evidence-detail-panel h2 {
  margin-bottom: 0;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.evidence-url-box,
.evidence-url-controls {
  min-width: 0;
}

.evidence-url-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #f9fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.evidence-url-controls code {
  min-width: 0;
  flex: 1 1 260px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.evidence-url-controls a,
.evidence-url-controls button {
  flex: 0 0 auto;
}

.evidence-url-controls button {
  border-color: var(--line);
  background: var(--surface-muted);
}

.evidence-excerpt {
  margin-bottom: 0;
  color: var(--muted);
}

.affiliate-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: start;
  padding: 24px clamp(18px, 4vw, 56px);
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.site-footer > div {
  min-width: 0;
  max-width: 680px;
}

.site-footer strong {
  display: block;
  margin-bottom: 6px;
}

.site-footer p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 14px;
}

.site-footer a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.static-main {
  display: grid;
  gap: 16px;
  max-width: 920px;
}

.static-panel {
  display: grid;
  gap: 8px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.static-panel h2,
.static-panel p {
  margin-bottom: 0;
}

.static-panel p {
  color: var(--muted);
  line-height: 1.75;
}

.contact-placeholder {
  padding: 10px 12px;
  border: 1px solid #f2d9a6;
  border-radius: 8px;
  background: #fff8e9;
  color: var(--warn) !important;
  font-weight: 800;
}

.contact-form-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  text-decoration: none;
}

.contact-form-link:hover {
  background: var(--accent-strong);
}

@media (max-width: 760px) {
  .app-header,
  .affiliate-workbench,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .app-header {
    display: grid;
    align-items: stretch;
  }

  .top-tabs {
    width: 100%;
  }

  .tab {
    flex: 1;
  }

  .rakuten-panel {
    position: static;
  }

  .compact-list {
    max-height: none;
  }

  .fact-row {
    grid-template-columns: 1fr;
  }

  .confidence {
    justify-self: start;
  }

  .filter-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .readiness-main {
    grid-template-columns: 1fr;
  }

  .readiness-fact-row {
    grid-template-columns: 1fr;
  }

  .audit-item {
    grid-template-columns: 1fr;
  }

  .comparison-values,
  .review-evidence-compare {
    grid-template-columns: 1fr;
  }

  .site-footer {
    display: grid;
  }

  .site-footer nav {
    justify-content: flex-start;
  }
}
