/* コピーライティング道場 — shadcn/ui inspired
 * No icons / No shadows / Thin 1px borders / Generous spacing
 */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "palt";
}

button { font-family: inherit; }

/* ===== Layout ===== */

.app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 32px var(--space-3xl);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: hsl(var(--background));
  margin: 0 -32px;
  padding: 18px 32px 16px;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.app-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.app-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
}
.app-title-accent { color: hsl(var(--foreground)); }
.app-subtitle {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  font-weight: 400;
}

.mode-tabs {
  display: flex;
  gap: 0;
  margin-left: var(--space-xl);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 3px;
  background: hsl(var(--muted));
}
.mode-tab {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
  font-weight: 500;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mode-tab:hover { color: hsl(var(--foreground)); }
.mode-tab.active {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

.settings {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sticky-subline {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  padding: 8px 0 16px;
}

/* ===== Hero ===== */

.hero-section {
  padding: 32px 0 24px;
}
.hero-question {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  margin-bottom: 6px;
}
.hero-sub {
  font-size: 13px;
  color: hsl(var(--muted-foreground));
}

/* ===== 2-column layout ===== */

.layout-2col {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
  padding-top: 24px;
}
.sidebar {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 18px 16px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--background));
}
.sidebar-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-bottom: 12px;
}
.sidebar .tile-category {
  margin-bottom: 4px;
}
.sidebar .tile-category:last-child {
  margin-bottom: 0;
}
.sidebar .tile-category-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.sidebar .tile-category-label::-webkit-details-marker { display: none; }
.sidebar .tile-category-label::before {
  content: "›";
  display: inline-block;
  width: 12px;
  font-size: 14px;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  transition: transform 0.18s ease;
  transform: rotate(0deg);
  margin-right: 2px;
}
.sidebar .tile-category[open] > .tile-category-label::before {
  transform: rotate(90deg);
}
.sidebar .tile-category-label:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}
.sidebar .tile-category-label > span:first-of-type {
  flex: 1;
  text-align: left;
}
.sidebar .tile-category-count {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted));
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  letter-spacing: 0;
}
.sidebar .tile-category[open] .tile-grid {
  margin-top: 2px;
  padding-bottom: 4px;
  animation: accordion-down 0.18s ease;
}
@keyframes accordion-down {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.sidebar .tile-grid,
.sidebar #lp-templates {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar .use-case-tile,
.sidebar .lp-template-card {
  position: relative;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 8px 14px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  width: 100%;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar .use-case-tile::before,
.sidebar .lp-template-card::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  width: 3px;
  height: 0;
  background: hsl(var(--foreground));
  border-radius: var(--radius-pill);
  transform: translateY(-50%);
  transition: height 0.18s ease;
}
.sidebar .use-case-tile:hover,
.sidebar .lp-template-card:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  border-color: transparent;
}
.sidebar .use-case-tile.active,
.sidebar .lp-template-card.active {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}
.sidebar .use-case-tile.active::before,
.sidebar .lp-template-card.active::before {
  height: 14px;
}
.sidebar .use-case-tile.active .tile-label,
.sidebar .lp-template-card.active .lp-template-name {
  font-weight: 600;
}
.sidebar .tile-label,
.sidebar .lp-template-name {
  font-size: 13px;
  font-weight: 400;
}
.sidebar .tile-spec,
.sidebar .lp-template-blocks {
  font-size: 10px;
  font-family: var(--font-mono);
  color: hsl(var(--muted-foreground));
  margin-top: 0;
}
.sidebar .lp-template-industry,
.sidebar .lp-template-desc {
  display: none;
}

.main-content {
  min-width: 0;
}

/* fade-in form when tile selected */
.card[id$="-form-card"] {
  animation: fade-in 0.2s ease;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Mobile responsive ===== */

@media (max-width: 900px) {
  .app { padding: 0 16px var(--space-2xl); }
  .app-header {
    margin: 0 -16px;
    padding: 14px 16px 12px;
    flex-wrap: wrap;
    gap: var(--space-md);
  }
  .app-brand { width: 100%; }
  .app-title { font-size: 15px; }
  .mode-tabs { margin-left: 0; flex: 1; }
  .settings { margin-left: 0; }
  .settings #backend-model { font-size: 11px; padding: 5px 8px; max-width: 160px; }

  .layout-2col {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 12px;
  }
  .sidebar {
    position: static;
    max-height: none;
    padding: 8px;
    overflow: visible;
  }
  .sidebar-title { display: none; }
  .sidebar .tile-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 6px 8px;
  }
  .sidebar .use-case-tile,
  .sidebar .lp-template-card {
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-pill);
    white-space: nowrap;
  }
  .sidebar .use-case-tile::before,
  .sidebar .lp-template-card::before {
    display: none;
  }
  .sidebar .use-case-tile.active,
  .sidebar .lp-template-card.active {
    background: hsl(var(--foreground));
    color: hsl(var(--background));
    border-color: hsl(var(--foreground));
  }
  .sidebar .tile-spec,
  .sidebar .lp-template-blocks {
    display: none;
  }

  .hero-section { padding: 16px 0 12px; }
  .hero-question { font-size: 20px; }
  .hero-sub { font-size: 12px; }

  .card { padding: var(--space-lg); }
  .case-copy { font-size: 16px; }

  .diag-meta { flex-direction: column; }
}

@media (max-width: 480px) {
  .mode-tab { padding: 6px 10px; font-size: 12px; }
  .settings { width: 100%; flex-wrap: wrap; }
  .settings #backend-model { flex: 1; max-width: none; }
}

/* ===== Tiles (use cases) ===== */

.tile-category {
  margin-bottom: var(--space-2xl);
}
.tile-category-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-bottom: var(--space-md);
}
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-sm);
}
.use-case-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: left;
  font-family: inherit;
}
.use-case-tile:hover {
  border-color: hsl(var(--foreground));
  background: hsl(var(--muted));
}
.use-case-tile.active {
  border-color: hsl(var(--foreground));
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}
.use-case-tile.active .tile-spec { color: hsl(0 0% 80%); }
.tile-label {
  font-size: 13px;
  font-weight: 500;
  color: inherit;
}
.tile-spec {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}

/* ===== Selected tile banner ===== */

.selected-tile-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: hsl(var(--muted));
  border-radius: var(--radius);
  margin-bottom: var(--space-lg);
}
.selected-tile-label {
  font-size: 14px;
  font-weight: 600;
}
.selected-tile-hint {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}

/* ===== Card ===== */

.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--space-lg);
}

/* ===== Form ===== */

.form-grid {
  display: grid;
  gap: var(--space-lg);
}
.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row.full { width: 100%; }

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.1);
}
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.6; }
.form-help {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}

.cta-row {
  margin-top: var(--space-xl);
  display: flex;
  justify-content: flex-end;
}

/* ===== Buttons ===== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}
.btn-primary:hover:not(:disabled) { background: hsl(var(--primary) / 0.9); }

.btn-large {
  padding: 10px 20px;
  font-size: 14px;
}

.btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: hsl(var(--accent)); }

.btn-outline {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}
.btn-outline:hover:not(:disabled) { background: hsl(var(--accent)); }

#backend-model {
  font-family: inherit;
  font-size: 12px;
  padding: 6px 10px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

/* ===== Notices ===== */

.notice {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  border: 1px solid hsl(var(--border));
  margin-bottom: var(--space-md);
}
.notice.info { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.notice.warning {
  background: hsl(var(--warning) / 0.1);
  border-color: hsl(var(--warning) / 0.3);
  color: hsl(var(--foreground));
}
.notice.danger {
  background: hsl(var(--destructive) / 0.08);
  border-color: hsl(var(--destructive) / 0.3);
  color: hsl(var(--destructive));
}
.notice code {
  font-family: var(--font-mono);
  background: hsl(var(--background));
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 12px;
}

/* ===== Results ===== */

.results-header {
  font-size: 13px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-lg) 0 var(--space-md);
  border-bottom: 1px solid hsl(var(--border));
  margin-bottom: var(--space-md);
}

.case-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.case-no {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.case-copy {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.6;
  color: hsl(var(--foreground));
  padding: var(--space-md) 0;
  letter-spacing: -0.005em;
}

.auto-checks { display: flex; gap: 6px; align-items: center; }
.check {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid hsl(var(--border));
  font-family: var(--font-mono);
  color: hsl(var(--muted-foreground));
}
.check.ok { color: hsl(var(--success)); border-color: hsl(var(--success) / 0.4); }
.check.warn { color: hsl(var(--warning)); border-color: hsl(var(--warning) / 0.5); }

.why-block {
  background: hsl(var(--muted));
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.why-row { display: flex; gap: 10px; align-items: flex-start; font-size: 12px; }
.why-label {
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  min-width: 80px;
  flex-shrink: 0;
}
.why-text { color: hsl(var(--foreground)); flex: 1; }
.technique-tag-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.technique-tag {
  display: inline-block;
  padding: 2px 8px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  font-family: inherit;
  color: hsl(var(--foreground));
}

/* 単独型詳細ビュー */
.dict-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: hsl(var(--muted-foreground));
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 16px;
  transition: color 0.12s ease;
}
.dict-back-link:hover { color: hsl(var(--foreground)); }
.dict-single {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 28px 32px;
  background: hsl(var(--background));
}
.dict-single-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 18px;
  margin-bottom: 6px;
  border-bottom: 1px solid hsl(var(--border));
}
.dict-single-no {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0.05em;
}
.dict-single-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: hsl(var(--foreground));
}
.dict-single-body {
  padding: 0;
  border-top: none;
}
.technique-tag-btn {
  cursor: pointer;
  transition: all 0.12s ease;
}
.technique-tag-btn::after {
  content: " →";
  color: hsl(var(--muted-foreground));
  font-size: 10px;
  margin-left: 2px;
  transition: transform 0.12s ease;
  display: inline-block;
}
.technique-tag-btn:hover {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border-color: hsl(var(--foreground));
}
.technique-tag-btn:hover::after {
  color: hsl(var(--background));
  transform: translateX(2px);
}

/* 型詳細を開いたときのフラッシュ */
.dict-item-flash {
  animation: dict-flash 1.2s ease;
}
@keyframes dict-flash {
  0% { box-shadow: 0 0 0 0 hsl(var(--foreground) / 0.4); }
  30% { box-shadow: 0 0 0 6px hsl(var(--foreground) / 0.12); }
  100% { box-shadow: 0 0 0 0 hsl(var(--foreground) / 0); }
}

.learn-deeper {
  margin-top: var(--space-md);
  border-top: 1px solid hsl(var(--border));
  padding-top: var(--space-md);
}
.learn-deeper-summary {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  user-select: none;
  list-style: none;
}
.learn-deeper-summary::-webkit-details-marker { display: none; }
.learn-deeper-summary::after { content: " ▾"; font-size: 9px; }
.learn-deeper[open] .learn-deeper-summary::after { content: " ▴"; }
.learn-deeper-body {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.7;
  color: hsl(var(--foreground));
  white-space: pre-wrap;
}

.quick-improvements {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid hsl(var(--border));
}
.qi-label {
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}
.qi-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-family: inherit;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
}
.qi-btn:hover:not(:disabled) { background: hsl(var(--accent)); }
.qi-btn:disabled { opacity: 0.5; }

.case-actions-row {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.improvements-result:not(:empty) {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid hsl(var(--border));
}
.improvements-label {
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-sm);
}
.improvement-item {
  padding: 10px 12px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.improvement-copy { font-size: 14px; color: hsl(var(--foreground)); }
.improvement-chars {
  font-size: 10px;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
  margin-left: 6px;
}
.improvement-diff {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  margin-top: 4px;
}

/* ===== Fix mode ===== */

.fix-diagnosis { padding-bottom: var(--space-md); }
.diag-original {
  font-size: 16px;
  padding: 14px 16px;
  background: hsl(var(--muted));
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  line-height: 1.6;
}
.diag-meta {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}
.diag-score-box {
  padding: 14px 18px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  text-align: center;
  min-width: 100px;
}
.diag-score {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}
.diag-score-max { font-size: 12px; opacity: 0.5; }
.diag-score-label {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}
.diag-checks {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.diag-check-item {
  display: flex;
  gap: 12px;
  font-size: 12px;
  align-items: center;
}
.diag-check-label {
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  min-width: 70px;
}
.diag-check-value { font-family: var(--font-mono); }
.diag-check-value.ok { color: hsl(var(--success)); }
.diag-check-value.warn { color: hsl(var(--warning)); }
.diag-weakness {
  font-size: 12px;
  color: hsl(var(--destructive));
  padding: 6px 0;
}
.diag-goodpoint {
  font-size: 12px;
  color: hsl(var(--success));
  padding: 6px 0;
}
.diag-anti-hits {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: var(--space-md);
  border-top: 1px solid hsl(var(--border));
  margin-top: var(--space-sm);
}
.diag-anti-tag {
  font-size: 11px;
  padding: 3px 8px;
  background: hsl(var(--destructive) / 0.08);
  color: hsl(var(--destructive));
  border-radius: var(--radius-sm);
}

/* ===== LP一括 ===== */

.lp-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.lp-template-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.12s ease;
}
.lp-template-card:hover {
  border-color: hsl(var(--foreground));
  background: hsl(var(--muted));
}
.lp-template-card.active {
  border-color: hsl(var(--foreground));
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}
.lp-template-card.active .lp-template-industry,
.lp-template-card.active .lp-template-desc,
.lp-template-card.active .lp-template-blocks {
  color: hsl(0 0% 80%);
}
.lp-template-name {
  font-size: 14px;
  font-weight: 600;
}
.lp-template-industry {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}
.lp-template-desc {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
}
.lp-template-blocks {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
  margin-top: auto;
}

.lp-block-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.lp-block-preview-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
}
.lp-block-role-tag { font-weight: 500; }
.lp-block-len-tag {
  font-family: var(--font-mono);
  color: hsl(var(--muted-foreground));
}

.lp-block-card { padding: var(--space-lg); }
.lp-block-type-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
  color: hsl(var(--muted-foreground));
}
.lp-block-copy-item {
  padding: var(--space-md) 0;
  border-top: 1px solid hsl(var(--border));
}
.lp-block-copy-item:first-of-type { border-top: none; padding-top: 0; }
.lp-copy-idx {
  font-size: 10px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.lp-block-copy {
  font-size: 15px;
  line-height: 1.6;
  margin: 4px 0 6px;
}
.lp-block-copy-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* ===== Footer ===== */

.app-footer {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-lg) 0;
  border-top: 1px solid hsl(var(--border));
  margin-top: var(--space-2xl);
}
.footer-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  background: transparent;
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.12s ease;
}
.footer-btn:hover {
  background: hsl(var(--accent));
  color: hsl(var(--foreground));
}

/* ===== History ===== */

.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.history-item {
  padding: 10px 12px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.history-item-copy {
  color: hsl(var(--foreground));
  margin-bottom: 2px;
}
.history-item-time {
  font-size: 10px;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
}

/* ===== Dictionary modal ===== */

.dict-intro {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-bottom: 14px;
  line-height: 1.7;
}
.dict-search-input { margin-bottom: 14px; }

.dict-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dict-item {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  background: hsl(var(--background));
  transition: border-color 0.12s ease;
}
.dict-item:hover { border-color: hsl(var(--foreground) / 0.4); }
.dict-item-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
}
.dict-item-summary::-webkit-details-marker { display: none; }
.dict-item-summary::after {
  content: "›";
  margin-left: auto;
  color: hsl(var(--muted-foreground));
  font-size: 16px;
  transition: transform 0.18s ease;
}
.dict-item[open] {
  background: hsl(var(--background));
  border-color: hsl(var(--foreground) / 0.5);
}
.dict-item[open] .dict-item-summary::after { transform: rotate(90deg); }
.dict-no {
  font-size: 11px;
  font-family: var(--font-mono);
  color: hsl(var(--muted-foreground));
  min-width: 32px;
  font-weight: 500;
}
.dict-name {
  font-weight: 500;
  letter-spacing: -0.005em;
}
.dict-item-body {
  padding: 4px 24px 20px 24px;
  border-top: 1px solid hsl(var(--border));
  font-size: 13px;
  color: hsl(var(--foreground));
  line-height: 1.8;
}

/* ===== Markdown sections (rich technique detail) ===== */

.dict-item-body .md-section {
  padding: 20px 0;
  border-bottom: 1px dashed hsl(var(--border));
}
.dict-item-body .md-section:last-child { border-bottom: none; padding-bottom: 4px; }
.dict-item-body .md-section:first-child { padding-top: 4px; }
.dict-item-body .md-section-lead {
  border-bottom: 1px solid hsl(var(--border));
  padding-bottom: 24px;
  margin-bottom: 4px;
  font-size: 14px;
  line-height: 1.85;
  color: hsl(var(--foreground));
}

.dict-item-body .md-section-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--background));
  background: hsl(var(--foreground));
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}
.dict-item-body .md-section-content {
  font-size: 13px;
  line-height: 1.8;
}

.dict-item-body .md-p {
  margin: 0 0 12px;
  color: hsl(var(--foreground));
}
.dict-item-body .md-p:last-child { margin-bottom: 0; }
.dict-item-body strong {
  font-weight: 600;
  color: hsl(var(--foreground));
}
.dict-item-body .md-quote {
  font-weight: 500;
  color: hsl(var(--foreground));
}

/* Lists in prose */
.dict-item-body .md-list {
  margin: 8px 0 0;
  padding-left: 0;
  list-style: none;
}
.dict-item-body .md-list li {
  position: relative;
  padding: 6px 0 6px 22px;
  font-size: 13px;
  line-height: 1.75;
}
.dict-item-body .md-list li::before {
  position: absolute;
  left: 4px;
  top: 6px;
  font-family: var(--font-mono);
  color: hsl(var(--muted-foreground));
  font-size: 12px;
}
.dict-item-body .md-ul li::before { content: "·"; font-size: 18px; line-height: 1; top: 8px; }
.dict-item-body .md-ol { counter-reset: ol-counter; }
.dict-item-body .md-ol li { counter-increment: ol-counter; }
.dict-item-body .md-ol li::before {
  content: counter(ol-counter, decimal-leading-zero);
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}

/* === 代表例（お手本コピー）=== */
.dict-item-body .md-examples {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}
.dict-item-body .md-example-card {
  position: relative;
  padding: 22px 24px 18px;
  background: hsl(var(--muted));
  border-radius: var(--radius);
  border-left: 3px solid hsl(var(--foreground));
}
.dict-item-body .md-example-no {
  position: absolute;
  top: 10px;
  right: 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0.05em;
}
.dict-item-body .md-example-quote {
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: -0.005em;
  color: hsl(var(--foreground));
  margin-bottom: 10px;
  padding-right: 30px;
  font-style: normal;
}
.dict-item-body .md-example-caption {
  font-size: 12px;
  line-height: 1.75;
  color: hsl(var(--muted-foreground));
}

/* === 典型構造（型テンプレート）=== */
.dict-item-body .md-structure {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.dict-item-body .md-structure-item {
  padding: 10px 14px;
  background: hsl(var(--background));
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: hsl(var(--foreground));
  line-height: 1.6;
}

/* === AIへの指示例（引用） === */
.dict-item-body .md-quote-block {
  margin: 4px 0 0;
  padding: 14px 18px;
  border-left: 3px solid hsl(var(--muted-foreground));
  background: hsl(var(--muted));
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 13px;
  color: hsl(var(--foreground));
  font-style: normal;
  line-height: 1.75;
}

/* === 落とし穴（警告風）=== */
.dict-item-body .md-pitfall-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dict-item-body .md-pitfall-list li {
  position: relative;
  padding: 10px 14px 10px 36px;
  background: hsl(var(--destructive) / 0.06);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.7;
  color: hsl(var(--foreground));
}
.dict-item-body .md-pitfall-list li::before {
  content: "!";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
}

.anti-dict-list {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
}
.dict-anti-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  background: hsl(var(--background));
  font-size: 12px;
}
.dict-anti-text { color: hsl(var(--muted-foreground)); }

.dict-anti-item-new {
  border-color: hsl(var(--foreground)) !important;
  background: hsl(var(--foreground) / 0.04) !important;
}
.dict-anti-item-new .dict-anti-text { color: hsl(var(--foreground)); font-weight: 500; }
.dict-anti-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
}

/* ===== Loading / empty states ===== */

.output-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: hsl(var(--muted-foreground));
  font-size: 12px;
}
.output-loading::after {
  content: "Loading...";
  font-family: var(--font-mono);
}
.output-empty {
  padding: var(--space-2xl);
  text-align: center;
  color: hsl(var(--muted-foreground));
  font-size: 13px;
}

/* ===== Sample menu (fix mode) ===== */

.fix-sample-menu {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  background: hsl(var(--background));
  overflow: hidden;
  margin-bottom: 8px;
}
.fix-sample-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-bottom: 1px solid hsl(var(--border));
  font-family: inherit;
  transition: background 0.12s;
}
.fix-sample-item:last-child { border-bottom: none; }
.fix-sample-item:hover { background: hsl(var(--muted)); }
.fix-sample-label {
  font-size: 10px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.fix-sample-copy {
  font-size: 13px;
  color: hsl(var(--foreground));
}

/* ===== Modal (shared) ===== */

#apikey-modal,
#security-modal,
#dict-modal,
#doc-modal,
#longform-modal,
#brand-voice-modal,
#seo-research-modal,
#workflow-modal {
  background: hsl(var(--foreground) / 0.5) !important;
  backdrop-filter: blur(4px);
}
#apikey-modal > div,
#security-modal > div,
#dict-modal > div,
#doc-modal > div,
#longform-modal > div,
#brand-voice-modal > div,
#seo-research-modal > div,
#workflow-modal > div {
  background: hsl(var(--background)) !important;
  border: 1px solid hsl(var(--border));
  box-shadow: 0 20px 60px hsl(var(--foreground) / 0.15);
}

/* ===== Rich loading（裏で動く差別化資産を見せる） ===== */

.output-loading-rich {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 24px 24px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--muted));
  margin: var(--space-md) 0;
}
.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid hsl(var(--border));
  border-top-color: hsl(var(--foreground));
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
  margin-top: 2px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.loading-line {
  display: flex;
  gap: 12px;
  font-size: 12px;
  font-family: var(--font-mono);
}
.loading-key {
  color: hsl(var(--muted-foreground));
  min-width: 80px;
  font-weight: 500;
}
.loading-val {
  color: hsl(var(--foreground));
}

/* NEW バッジ（凡庸事典の自動成長） */
.dict-anti-item-new {
  border-color: hsl(var(--foreground)) !important;
  background: hsl(var(--background)) !important;
}
.dict-anti-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border-radius: var(--radius-sm);
}

/* ===== 薬事法アラート ===== */

.check.yakuji-warn {
  color: hsl(var(--destructive));
  border-color: hsl(var(--destructive) / 0.5);
  background: hsl(var(--destructive) / 0.06);
  font-weight: 600;
}
.yakuji-alert {
  margin: var(--space-md) 0;
  padding: 12px 14px;
  background: hsl(var(--destructive) / 0.06);
  border: 1px solid hsl(var(--destructive) / 0.3);
  border-radius: var(--radius-md);
  font-size: 12px;
}
.yakuji-alert strong {
  display: block;
  color: hsl(var(--destructive));
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
}
.yakuji-hit {
  padding: 6px 0;
  border-top: 1px solid hsl(var(--destructive) / 0.15);
}
.yakuji-hit:first-of-type { border-top: none; padding-top: 0; }
.yakuji-phrase {
  font-weight: 600;
  color: hsl(var(--destructive));
  font-family: var(--font-mono);
}
.yakuji-cats {
  color: hsl(var(--muted-foreground));
  font-size: 11px;
  margin-left: 8px;
}
.yakuji-paraphrase {
  margin-top: 4px;
  padding: 4px 8px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
  color: hsl(var(--foreground));
  font-size: 11.5px;
}
.yakuji-llm-slot {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: hsl(var(--muted-foreground));
}
.yakuji-llm-pending { opacity: 0.7; font-style: italic; }
.yakuji-llm-ok { color: hsl(var(--muted-foreground)); }
.yakuji-llm-skip { color: hsl(var(--muted-foreground)); opacity: 0.6; font-size: 11px; }

/* ===== 4軸スコアバー ===== */

.score-bars {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 16px;
  margin: var(--space-md) 0 4px;
  padding: 10px 14px;
  background: hsl(var(--muted));
  border-radius: var(--radius-md);
}
.score-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.score-label {
  color: hsl(var(--muted-foreground));
  min-width: 50px;
  font-weight: 500;
}
.score-meter {
  flex: 1;
  height: 4px;
  background: hsl(var(--border));
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.score-fill {
  display: block;
  height: 100%;
  background: hsl(var(--foreground));
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}
.score-bar.score-low .score-fill { background: hsl(var(--destructive)); }
.score-bar.score-mid .score-fill { background: hsl(var(--warning)); }
.score-bar.score-high .score-fill { background: hsl(var(--success)); }
.score-num {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  min-width: 22px;
  text-align: right;
}

/* 精度向上ボタン強調 */
.qi-btn-deep {
  background: hsl(var(--foreground)) !important;
  color: hsl(var(--background)) !important;
  border-color: hsl(var(--foreground)) !important;
  font-weight: 600 !important;
}
.qi-btn-deep:hover:not(:disabled) {
  background: hsl(var(--foreground) / 0.85) !important;
}

/* 改善案のスコアピル */
.improvement-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0 4px;
}
.iscore-pill {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid hsl(var(--border));
}
.iscore-high { color: hsl(var(--success)); border-color: hsl(var(--success) / 0.4); }
.iscore-mid  { color: hsl(var(--warning)); border-color: hsl(var(--warning) / 0.5); }
.iscore-low  { color: hsl(var(--destructive)); border-color: hsl(var(--destructive) / 0.5); }

/* ===== ブリーフ尋問パネル ===== */

.brief-panel-card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--background));
  padding: 22px 24px;
  margin: var(--space-md) 0;
  animation: fade-in 0.2s ease;
}
.brief-panel-header { margin-bottom: var(--space-md); }
.brief-questions {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin: var(--space-md) 0;
}
.brief-q {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: hsl(var(--muted));
  border-radius: var(--radius-md);
}
.brief-q-num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: hsl(var(--background));
  background: hsl(var(--foreground));
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  height: fit-content;
  flex-shrink: 0;
}
.brief-q-body { flex: 1; }
.brief-q-text {
  font-size: 14px;
  font-weight: 500;
  color: hsl(var(--foreground));
  margin-bottom: 4px;
}
.brief-q-why {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
}
.brief-q-input { background: hsl(var(--background)); }

/* ===== 対立軸 A/B モード ===== */

.ab-axis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.ab-axis-btn {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  background: hsl(var(--background));
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}
.ab-axis-btn:hover {
  border-color: hsl(var(--foreground));
  background: hsl(var(--muted));
}
.ab-axis-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.ab-axis-detail {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  line-height: 1.7;
}
.ab-side {
  font-family: var(--font-mono);
  font-size: 10px;
}
.ab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.ab-card {
  position: relative;
}
.ab-card-a { border-left: 3px solid hsl(var(--foreground)); }
.ab-card-b { border-left: 3px solid hsl(var(--muted-foreground)); }

@media (max-width: 768px) {
  .ab-grid { grid-template-columns: 1fr; }
}

/* ===== 採用/却下ボタン ===== */

.case-decision {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid hsl(var(--border));
}
.dec-btn {
  padding: 4px 12px;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  background: hsl(var(--background));
  cursor: pointer;
  transition: all 0.12s ease;
}
.dec-adopt:hover {
  background: hsl(var(--success) / 0.1);
  border-color: hsl(var(--success));
  color: hsl(var(--success));
}
.dec-reject:hover {
  background: hsl(var(--destructive) / 0.1);
  border-color: hsl(var(--destructive));
  color: hsl(var(--destructive));
}
.dec-recorded {
  font-size: 11px;
  font-weight: 600;
}
.decided-adopt { color: hsl(var(--success)); }
.decided-reject { color: hsl(var(--destructive)); }

/* ===== 赤入れログ（履歴パネル内） ===== */

.redpen-summary {
  padding: 14px;
  background: hsl(var(--muted));
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}
.redpen-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.redpen-stat {
  text-align: center;
  padding: 10px;
  background: hsl(var(--background));
  border-radius: var(--radius-sm);
}
.redpen-stat-num {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
}
.redpen-stat-label {
  font-size: 10px;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.redpen-recent-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
}
.redpen-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: hsl(var(--background));
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.redpen-decision-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  height: fit-content;
}
.redpen-adopt .redpen-decision-tag {
  background: hsl(var(--success) / 0.15);
  color: hsl(var(--success));
}
.redpen-reject .redpen-decision-tag {
  background: hsl(var(--destructive) / 0.15);
  color: hsl(var(--destructive));
}
.redpen-body { flex: 1; min-width: 0; }
.redpen-copy {
  font-size: 12px;
  color: hsl(var(--foreground));
  margin-bottom: 2px;
}
.redpen-reason {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  font-style: italic;
}
.redpen-meta {
  font-size: 10px;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
  margin-top: 2px;
}
.redpen-pattern-hint {
  margin-top: 10px;
  padding: 8px 12px;
  background: hsl(var(--background));
  border-left: 2px solid hsl(var(--foreground));
  font-size: 11px;
  color: hsl(var(--foreground));
}

/* ===== CDレビュー ===== */

.cd-review-panel { background: hsl(var(--muted)); }
.cd-review-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.cd-review-item {
  display: flex;
  gap: 14px;
  padding: 12px 14px;
  background: hsl(var(--background));
  border-radius: var(--radius-md);
  border: 1px solid hsl(var(--border));
}
.cd-review-best {
  border-color: hsl(var(--foreground));
  background: hsl(var(--background));
}
.cd-rank-badge {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: hsl(var(--muted));
  border-radius: 50%;
  flex-shrink: 0;
}
.cd-review-best .cd-rank-badge {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}
.cd-rank-th { font-size: 9px; font-weight: 400; }
.cd-review-body { flex: 1; min-width: 0; }
.cd-review-copy {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  line-height: 1.5;
}
.cd-review-verdict {
  font-size: 12px;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 4px;
}
.cd-review-reason, .cd-review-when {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  margin-top: 2px;
}

/* ===== 三層辞書 ===== */

.three-layer-section {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px dashed hsl(var(--border));
}
.three-layer-section:last-child { border-bottom: none; }
.three-layer-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
}
.three-layer-adopt { background: hsl(var(--success) / 0.15); color: hsl(var(--success)); }
.three-layer-ban { background: hsl(var(--destructive) / 0.15); color: hsl(var(--destructive)); }
.three-layer-question { background: hsl(var(--warning) / 0.15); color: hsl(var(--warning)); }
.three-layer-desc { font-size: 11px; color: hsl(var(--muted-foreground)); margin-bottom: 10px; }
.three-layer-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.three-layer-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  background: hsl(var(--background));
}
.tag-adopt { border-color: hsl(var(--success) / 0.4); }
.tag-ban { border-color: hsl(var(--destructive) / 0.4); text-decoration: line-through; opacity: 0.7; }
.tag-question { border-color: hsl(var(--warning) / 0.5); }
.tag-reason { background: hsl(var(--muted)); }
.tag-count {
  font-size: 9px;
  font-family: var(--font-mono);
  background: hsl(var(--muted));
  padding: 0 4px;
  border-radius: var(--radius-sm);
  color: hsl(var(--muted-foreground));
}
.three-layer-empty { font-size: 12px; color: hsl(var(--muted-foreground)); font-style: italic; }
.three-layer-export { margin-top: 16px; text-align: right; }

/* ===== キャンペーン一括 ===== */

.campaign-summary { margin-bottom: 16px; }
.campaign-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
  background: hsl(var(--muted));
  border-radius: var(--radius-md);
}
.campaign-meta-item { text-align: center; }
.campaign-meta-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
  margin-bottom: 2px;
}
.campaign-meta-val {
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-mono);
}
.campaign-meta-val.ok { color: hsl(var(--success)); }
.campaign-meta-val.warn { color: hsl(var(--warning)); }
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.campaign-item {
  padding: 12px 14px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
}
.campaign-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.campaign-item-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
}
.campaign-item-copy {
  font-size: 13px;
  line-height: 1.6;
  color: hsl(var(--foreground));
  margin-bottom: 6px;
}
.campaign-item-actions { text-align: right; }

/* ===== プリセットバー ===== */

.preset-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 var(--space-md);
  padding: 8px 12px;
  background: hsl(var(--muted));
  border-radius: var(--radius-md);
}
.preset-label {
  font-size: 11px;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.preset-select { flex: 1; max-width: 280px; font-size: 12px; padding: 4px 8px; }
.preset-btn { font-size: 11px; padding: 3px 10px; }

/* ===== Flash vs Opus 比較 ===== */

.versus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.versus-col {
  padding: 14px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
}
.versus-head {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
}
.versus-meta {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
  margin-bottom: 10px;
}
.versus-case {
  padding: 10px;
  margin-bottom: 8px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
}
.versus-case-no {
  font-size: 10px;
  font-weight: 700;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.versus-case-copy {
  font-size: 13px;
  line-height: 1.55;
  color: hsl(var(--foreground));
  margin-bottom: 6px;
}
.versus-case-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.versus-technique {
  font-size: 10px;
  padding: 2px 8px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
}

@media (max-width: 768px) {
  .versus-grid { grid-template-columns: 1fr; }
}

/* ===== 現在ドキュメント表示バー ===== */

.current-doc-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border-radius: var(--radius-md);
  margin: var(--space-md) 0;
  font-size: 12px;
}
.doc-bar-label { font-weight: 600; }
.doc-bar-title {
  flex: 1;
  background: hsl(var(--background) / 0.1);
  border: 1px solid hsl(var(--background) / 0.2);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  color: hsl(var(--background));
  font-family: inherit;
}
.doc-bar-title:focus { outline: none; border-color: hsl(var(--background) / 0.5); }

/* ===== ドキュメント一覧 ===== */

.doc-item {
  padding: 14px;
  margin-bottom: 8px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  transition: border-color 0.12s;
}
.doc-item:hover { border-color: hsl(var(--foreground) / 0.5); }
.doc-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.doc-type-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  background: hsl(var(--muted));
  border-radius: var(--radius-pill);
  color: hsl(var(--muted-foreground));
}
.doc-title-row {
  font-size: 13px;
  font-weight: 600;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-time {
  font-size: 10px;
  color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
}
.doc-preview {
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
  line-height: 1.5;
}
.doc-actions {
  display: flex;
  gap: 6px;
}
.doc-actions .btn { font-size: 11px; padding: 3px 10px; }

/* ===== 長文記事生成 ===== */

.lf-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.lf-template-card {
  text-align: left;
  padding: 14px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  background: hsl(var(--background));
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.lf-template-card:hover {
  border-color: hsl(var(--foreground));
  background: hsl(var(--muted));
}
.lf-tmpl-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.lf-tmpl-meta {
  font-size: 11px; font-family: var(--font-mono);
  color: hsl(var(--muted-foreground)); margin-bottom: 6px;
}
.lf-tmpl-hint { font-size: 11px; color: hsl(var(--muted-foreground)); line-height: 1.5; }

.lf-structure {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px; background: hsl(var(--muted)); border-radius: var(--radius-sm);
  margin-top: 8px;
}
.lf-sec-tag {
  font-size: 11px; padding: 3px 10px;
  background: hsl(var(--background));
  border-radius: var(--radius-sm);
}
.lf-sec-chars {
  font-family: var(--font-mono); color: hsl(var(--muted-foreground));
  margin-left: 4px;
}

.lf-result-card { padding: var(--space-xl); }
.lf-result-head { margin-bottom: 14px; }
.lf-result-meta {
  font-size: 12px; color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
}
.lf-result-meta strong { color: hsl(var(--foreground)); font-size: 14px; }

.lf-sections { display: flex; flex-direction: column; gap: 14px; margin: 14px 0; }
.lf-section {
  padding: 14px 16px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  background: hsl(var(--background));
}
.lf-section-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px; flex-wrap: wrap;
}
.lf-section-no {
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  color: hsl(var(--background)); background: hsl(var(--foreground));
  padding: 2px 7px; border-radius: var(--radius-sm);
}
.lf-section-name { font-size: 13px; font-weight: 600; flex: 1; }
.lf-section-chars {
  font-family: var(--font-mono); font-size: 10px;
  color: hsl(var(--muted-foreground));
}
.lf-section-content {
  font-size: 13px; line-height: 1.85;
  color: hsl(var(--foreground));
  padding: 4px;
}
.lf-section-content.lf-editing {
  background: hsl(var(--muted));
  outline: 2px solid hsl(var(--foreground));
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.lf-seo-card {
  padding: 12px 14px;
  background: hsl(var(--muted));
  border-radius: var(--radius-md);
  margin: 10px 0;
}
.lf-seo-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
}
.lf-seo-row {
  display: flex; align-items: center; gap: 12px;
  padding: 4px 0; font-size: 12px;
}
.lf-seo-kw { font-weight: 600; flex: 1; }
.lf-seo-count { font-family: var(--font-mono); color: hsl(var(--muted-foreground)); }
.lf-seo-density {
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.lf-seo-density.ok { background: hsl(var(--success) / 0.15); color: hsl(var(--success)); }
.lf-seo-density.warn { background: hsl(var(--warning) / 0.15); color: hsl(var(--warning)); }
.lf-seo-hint {
  font-size: 10px; color: hsl(var(--muted-foreground));
  margin-top: 6px;
}

/* ===== SEO ダッシュボード ===== */

.seo-dashboard {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 16px;
  background: hsl(var(--background));
}
.seo-dash-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid hsl(var(--border));
}
.seo-dash-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.seo-score-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 14px;
}
.seo-score-high { background: hsl(var(--success) / 0.15); color: hsl(var(--success)); }
.seo-score-mid  { background: hsl(var(--warning) / 0.15); color: hsl(var(--warning)); }
.seo-score-low  { background: hsl(var(--destructive) / 0.15); color: hsl(var(--destructive)); }

.seo-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.seo-meta-item {
  text-align: center;
  padding: 8px 4px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
}
.seo-meta-label {
  font-size: 9px;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.seo-meta-val {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 600;
}
.seo-verdict {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
  text-align: center;
  margin-top: 8px;
  font-style: italic;
}
.seo-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid hsl(var(--border)); }
.seo-section.seo-warn .seo-section-label { color: hsl(var(--destructive)); }
.seo-section-label {
  font-size: 11px; font-weight: 700; margin-bottom: 6px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.seo-kw-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 12px;
}
.seo-kw-name { font-weight: 600; flex: 1; }
.seo-kw-count { font-family: var(--font-mono); font-size: 11px; color: hsl(var(--muted-foreground)); }
.seo-kw-density {
  font-family: var(--font-mono); padding: 2px 8px;
  border-radius: var(--radius-sm); font-size: 10px;
}
.seo-kw-ok { background: hsl(var(--success) / 0.15); color: hsl(var(--success)); }
.seo-kw-warn { background: hsl(var(--warning) / 0.15); color: hsl(var(--warning)); }
.seo-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.seo-warn-tag {
  font-size: 10px; padding: 2px 8px;
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
  border-radius: var(--radius-sm);
}
.seo-yakuji-hit {
  margin-top: 6px; padding: 6px 8px;
  background: hsl(var(--destructive) / 0.06);
  border-radius: var(--radius-sm);
}
.seo-yakuji-phrase { font-weight: 600; color: hsl(var(--destructive)); font-size: 11px; }
.seo-yakuji-fix { font-size: 10px; color: hsl(var(--muted-foreground)); margin-top: 2px; }

/* ===== ブランドボイス ===== */

.bv-section {
  padding: 16px 0;
  border-bottom: 1px dashed hsl(var(--border));
}
.bv-section:last-child { border-bottom: none; }
.bv-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
}
.bv-card {
  padding: 12px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  background: hsl(var(--background));
  margin-bottom: 8px;
}
.bv-card-active { border-color: hsl(var(--foreground)); background: hsl(var(--muted)); }
.bv-card-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.bv-card-name { font-size: 13px; font-weight: 600; flex: 1; }
.bv-active-tag {
  font-size: 9px; font-weight: 700;
  padding: 2px 8px;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border-radius: var(--radius-pill);
}
.bv-card-body {
  font-size: 11px; line-height: 1.7;
  color: hsl(var(--muted-foreground));
}
.bv-attr { margin-bottom: 2px; }
.bv-key { font-weight: 600; color: hsl(var(--foreground)); margin-right: 4px; }

/* ===== オンボーディング ===== */

#onboarding-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: hsl(var(--foreground) / 0.55);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  animation: fade-in 0.3s ease;
}
.onboard-card {
  background: hsl(var(--background));
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  max-width: 560px;
  width: 92%;
  max-height: 88vh;
  overflow-y: auto;
}
.onboard-title {
  font-size: 22px; font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.onboard-desc {
  font-size: 13px;
  line-height: 1.8;
  color: hsl(var(--muted-foreground));
  margin-bottom: 24px;
}
.onboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.onboard-chip {
  padding: 10px 14px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  background: hsl(var(--background));
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s;
}
.onboard-chip:hover {
  background: hsl(var(--muted));
  border-color: hsl(var(--foreground) / 0.4);
}
.onboard-chip.selected {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border-color: hsl(var(--foreground));
}
.onboard-actions {
  display: flex; justify-content: space-between; gap: 8px;
}

/* ===== SEO リサーチ ===== */

.sr-tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid hsl(var(--border)); }
.sr-tab {
  padding: 8px 14px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 12px;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.12s;
}
.sr-tab.active {
  color: hsl(var(--foreground));
  border-bottom-color: hsl(var(--foreground));
  font-weight: 600;
}
.sr-tab:hover:not(.active) { color: hsl(var(--foreground)); }

.sr-result-card { margin-top: 12px; }
.sr-section {
  padding: 14px 0;
  border-top: 1px solid hsl(var(--border));
}
.sr-section:first-child { border-top: none; padding-top: 0; }
.sr-section.sr-warn .sr-section-title { color: hsl(var(--destructive)); }
.sr-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
}

.sr-kw-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 12px;
  flex-wrap: wrap;
}
.sr-kw-name { font-weight: 600; min-width: 140px; }
.sr-pill {
  font-size: 10px; padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
}
.sr-pill-high { background: hsl(var(--success) / 0.15); color: hsl(var(--success)); }
.sr-pill-mid { background: hsl(var(--warning) / 0.15); color: hsl(var(--warning)); }
.sr-pill-low { background: hsl(var(--muted)); color: hsl(var(--muted-foreground)); }
.sr-kw-reason { font-size: 11px; color: hsl(var(--muted-foreground)); }

.sr-tag-cloud { display: flex; flex-wrap: wrap; gap: 4px; }
.sr-cloud-tag {
  font-size: 11px; padding: 3px 10px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
}
.sr-question {
  padding: 8px 12px; margin-bottom: 4px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.sr-intent-bars { display: flex; flex-direction: column; gap: 6px; }
.sr-intent-bar {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
}
.sr-intent-label { min-width: 110px; font-family: var(--font-mono); color: hsl(var(--muted-foreground)); }
.sr-intent-meter {
  flex: 1; height: 6px;
  background: hsl(var(--border)); border-radius: var(--radius-pill);
  overflow: hidden;
}
.sr-intent-fill { display: block; height: 100%; background: hsl(var(--foreground)); border-radius: var(--radius-pill); transition: width 0.3s; }
.sr-intent-num { font-family: var(--font-mono); font-weight: 600; min-width: 32px; text-align: right; }

.sr-text-block {
  padding: 10px 12px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.7;
}
.sr-text-block.sr-strong { font-weight: 600; }
.sr-meta-info { font-size: 10px; color: hsl(var(--muted-foreground)); font-family: var(--font-mono); margin-left: 8px; }

.sr-content-rec {
  display: flex; gap: 10px; padding: 6px 0;
  font-size: 12px;
}
.sr-content-type {
  font-weight: 600; min-width: 100px;
}
.sr-content-reason { color: hsl(var(--muted-foreground)); }

.sr-pattern { font-size: 12px; padding: 4px 0; font-family: var(--font-mono); }

.sr-list-item { padding: 4px 0; font-size: 12px; }
.sr-list-warn { color: hsl(var(--destructive)); font-weight: 500; }

.sr-outline-item {
  display: flex; gap: 10px;
  padding: 8px 12px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.sr-outline-h2 { border-left: 3px solid hsl(var(--foreground)); }
.sr-outline-h3 { border-left: 3px solid hsl(var(--muted-foreground)); margin-left: 14px; }
.sr-outline-tag {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  padding: 2px 6px; background: hsl(var(--muted));
  border-radius: var(--radius-sm); height: fit-content;
}
.sr-outline-body { flex: 1; }
.sr-outline-text { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.sr-outline-reason { font-size: 11px; color: hsl(var(--muted-foreground)); }
.sr-outline-chars { font-family: var(--font-mono); }

.sr-improved-title {
  padding: 10px 12px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
.sr-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sr-title-text { flex: 1; font-weight: 600; font-size: 13px; }
.sr-title-reason { font-size: 11px; color: hsl(var(--muted-foreground)); margin-bottom: 4px; }
.sr-tactics { display: flex; flex-wrap: wrap; gap: 4px; }
.sr-tactic-tag {
  font-size: 9px; padding: 1px 6px;
  background: hsl(var(--background));
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  color: hsl(var(--muted-foreground));
}

.sr-ab-pair {
  padding: 10px; margin-bottom: 8px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
}
.sr-ab-row { display: flex; gap: 10px; align-items: center; padding: 4px 0; font-size: 12px; }
.sr-ab-side {
  font-family: var(--font-mono); font-weight: 700;
  padding: 2px 8px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
  font-size: 10px;
}
.sr-ab-hyp { font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 4px; padding-left: 28px; }

/* ===== ワークフロー ===== */

.wf-template-grid {
  display: grid; gap: 10px;
  margin-top: 8px;
}
.wf-tmpl-card {
  padding: 14px;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
  background: hsl(var(--background));
}
.wf-tmpl-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.wf-tmpl-desc { font-size: 12px; color: hsl(var(--muted-foreground)); margin-bottom: 6px; }
.wf-tmpl-steps {
  font-size: 10px; font-family: var(--font-mono);
  color: hsl(var(--muted-foreground));
  margin-bottom: 8px;
}
.wf-step-chain {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  margin-bottom: 4px;
}
.wf-step-chip {
  font-size: 11px; padding: 2px 8px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
}
.wf-arrow {
  font-size: 11px; color: hsl(var(--muted-foreground));
}

.wf-step-row {
  display: flex; gap: 8px; align-items: center;
  padding: 6px 0;
}
.wf-step-num {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  width: 28px; text-align: center;
  color: hsl(var(--muted-foreground));
}

.wf-saved {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; margin-bottom: 6px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
}
.wf-saved-name { font-weight: 600; flex: 1; font-size: 13px; }
.wf-saved-meta { font-size: 10px; color: hsl(var(--muted-foreground)); font-family: var(--font-mono); }

.wf-progress-step {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
}
.wf-progress-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
}
.wf-progress-no {
  font-family: var(--font-mono); font-size: 10px;
  padding: 2px 8px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
}
.wf-progress-label { flex: 1; font-weight: 600; }
.wf-progress-status { font-size: 11px; font-family: var(--font-mono); }
.wf-progress-body { margin-top: 8px; padding-top: 8px; border-top: 1px solid hsl(var(--border)); }

.wf-output-case {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0;
  font-size: 12px;
}
.wf-output-best { font-weight: 600; }
.wf-case-num {
  font-family: var(--font-mono); font-size: 9px;
  padding: 1px 6px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
}
.wf-case-copy { flex: 1; }
.wf-case-meta {
  font-family: var(--font-mono); font-size: 10px;
  color: hsl(var(--muted-foreground));
}

.wf-summary {
  margin-top: 14px;
  padding: 12px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
  text-align: center;
}
.wf-summary-title { font-weight: 600; margin-bottom: 8px; }

/* ===== Brand Voice v2（12次元・実DB） ===== */

.bv-version-tag {
  font-size: 9px; font-weight: 700;
  padding: 1px 6px;
  background: hsl(var(--success));
  color: hsl(var(--background));
  border-radius: var(--radius-sm);
}
.bv-version-tag.bv-version-old {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
.bv-12dim-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 12px;
}
.bv-12dim-item {
  display: flex; gap: 8px; padding: 3px 0;
  font-size: 11px; line-height: 1.5;
}
.bv-12dim-key {
  font-weight: 600; min-width: 70px;
  color: hsl(var(--muted-foreground));
}
.bv-12dim-val { color: hsl(var(--foreground)); flex: 1; }
.bv-fb-summary {
  margin-top: 6px;
  padding: 4px 8px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
  font-size: 10px; color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
}

/* Voice 詳細・比較 オーバーレイ */
.bv-detail-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: hsl(var(--foreground) / 0.5);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  padding: 20px;
}
.bv-detail-card {
  background: hsl(var(--background));
  border-radius: var(--radius-lg);
  max-width: 720px; width: 100%; max-height: 80vh;
  display: flex; flex-direction: column;
  border: 1px solid hsl(var(--border));
  box-shadow: 0 20px 60px hsl(var(--foreground) / 0.15);
}
.bv-detail-head {
  padding: 18px 24px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid hsl(var(--border));
}
.bv-detail-head h3 { font-size: 15px; font-weight: 600; }
.bv-detail-body {
  padding: 18px 24px;
  overflow-y: auto;
}
.bv-detail-row {
  display: flex; gap: 14px; padding: 8px 0;
  border-bottom: 1px dashed hsl(var(--border));
}
.bv-detail-key {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: hsl(var(--muted-foreground));
  min-width: 130px;
}
.bv-detail-val { font-size: 12px; line-height: 1.7; flex: 1; }

.bv-cmp-row {
  display: grid;
  grid-template-columns: 130px 1fr 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed hsl(var(--border));
  font-size: 11px;
}
.bv-cmp-key { font-family: var(--font-mono); font-weight: 600; color: hsl(var(--muted-foreground)); }
.bv-cmp-side { line-height: 1.6; }
.bv-cmp-a { padding-right: 8px; border-right: 1px solid hsl(var(--border)); }

.bv-fb-item {
  padding: 8px 12px;
  margin-bottom: 6px;
  background: hsl(var(--muted));
  border-radius: var(--radius-sm);
  font-size: 11px;
}
.bv-fb-item.bv-fb-adopt { border-left: 3px solid hsl(var(--success)); }
.bv-fb-item.bv-fb-reject { border-left: 3px solid hsl(var(--destructive)); }
.bv-fb-tag {
  font-weight: 700; font-size: 10px;
  padding: 1px 6px; border-radius: var(--radius-sm);
  margin-right: 8px;
}
.bv-fb-adopt .bv-fb-tag { background: hsl(var(--success) / 0.15); color: hsl(var(--success)); }
.bv-fb-reject .bv-fb-tag { background: hsl(var(--destructive) / 0.15); color: hsl(var(--destructive)); }
.bv-fb-copy { color: hsl(var(--foreground)); }
.bv-fb-reason { font-size: 10px; color: hsl(var(--muted-foreground)); margin-top: 3px; padding-left: 24px; }

/* SEO 実データ表示 */
.sr-data-source {
  font-size: 10px; font-family: var(--font-mono);
  color: hsl(var(--success));
  padding: 6px 10px;
  background: hsl(var(--success) / 0.08);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}
.sr-cloud-tag.sr-cloud-real {
  background: hsl(var(--success) / 0.15);
  color: hsl(var(--success));
  font-weight: 500;
}
.sr-real-page {
  padding: 8px 10px;
  margin-bottom: 4px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
}
.sr-real-page.sr-real-failed {
  border-color: hsl(var(--destructive) / 0.5);
  color: hsl(var(--destructive));
}
.sr-real-url { font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.sr-real-meta { font-size: 10px; color: hsl(var(--muted-foreground)); font-family: var(--font-mono); }

/* ===== 自己批判ループ ===== */

.self-critique-panel { background: hsl(var(--muted)); }
.self-critique-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.critique-item {
  padding: 14px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md);
}
.critique-label {
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 2px 8px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border-radius: var(--radius-sm);
}
.critique-label-new {
  background: hsl(var(--foreground));
  color: hsl(var(--background));
}
.critique-original {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 12px;
  margin-bottom: 6px;
  opacity: 0.7;
}
.critique-original-text { text-decoration: line-through; }
.critique-arrow {
  font-size: 11px;
  color: hsl(var(--destructive));
  font-style: italic;
  margin: 4px 0;
  padding-left: 14px;
}
.critique-improved {
  display: flex; gap: 8px; align-items: center;
  font-size: 14px; font-weight: 500;
  margin-bottom: 4px;
}
.critique-improved-text { color: hsl(var(--foreground)); }
.critique-meta {
  font-family: var(--font-mono); font-size: 10px;
  color: hsl(var(--muted-foreground));
  margin-left: auto;
}
.critique-changed {
  font-size: 11px;
  color: hsl(var(--muted-foreground));
}
