:root {
  color: #1d1b1b;
  background: #fff8f3;
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 0, 54, 0.16), transparent 32rem),
    linear-gradient(135deg, #fff8f3 0%, #fff 42%, #fff1ec 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0;
}

.hero-card,
.panel {
  border: 1px solid rgba(255, 0, 54, 0.12);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 24px 80px rgba(71, 19, 24, 0.1);
  backdrop-filter: blur(12px);
}

.hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding: 36px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #ff0036;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.04;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
}

.subtitle {
  max-width: 720px;
  margin-bottom: 0;
  color: #6f5a5a;
  font-size: 1.02rem;
  line-height: 1.8;
}

.hero-metrics {
  display: grid;
  flex: 0 0 160px;
  gap: 12px;
}

.hero-metrics span {
  border-radius: 999px;
  padding: 12px 16px;
  color: #ff0036;
  background: #fff0f3;
  font-weight: 800;
  text-align: center;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.92fr);
  gap: 24px;
  align-items: start;
}

.panel {
  padding: 28px;
}

.panel-heading {
  margin-bottom: 22px;
}

.row-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: #4a3d3d;
  font-weight: 700;
}

label.wide {
  grid-column: 1 / -1;
}

input,
textarea {
  width: 100%;
  border: 1px solid #ead8d8;
  border-radius: 16px;
  padding: 13px 14px;
  color: #241b1b;
  background: #fffdfb;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: #ff0036;
  box-shadow: 0 0 0 4px rgba(255, 0, 54, 0.1);
}

.mode-grid,
.type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mode-grid {
  margin-bottom: 14px;
}

.mode-card,
.type-card,
.generate-button,
.result-toolbar button,
.ghost-button,
.history-actions button {
  border: 0;
  border-radius: 16px;
  font-weight: 800;
}

.mode-card,
.type-card {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 14px;
  color: #3b3030;
  background: #f8f1ef;
  text-align: left;
}

.mode-card {
  flex-direction: column;
  align-items: flex-start;
}

.mode-card span {
  color: #7a6868;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
}

.mode-card.active span {
  color: rgba(255, 255, 255, 0.86);
}

.mode-card.active,
.type-card.active {
  color: #fff;
  background: linear-gradient(135deg, #ff0036, #ff6a00);
  box-shadow: 0 14px 26px rgba(255, 0, 54, 0.22);
}

.generate-button {
  width: 100%;
  margin: 18px 0;
  padding: 16px 20px;
  color: #fff;
  background: linear-gradient(135deg, #ff0036, #ff6a00);
  box-shadow: 0 16px 34px rgba(255, 0, 54, 0.22);
}

.result-card,
.compliance-card {
  border-radius: 20px;
  padding: 18px;
  background: #fff8f7;
}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.result-toolbar h3,
.compliance-card h3 {
  margin-bottom: 0;
}

.result-toolbar button,
.ghost-button,
.history-actions button {
  padding: 9px 13px;
  color: #ff0036;
  background: #ffe9ee;
}

pre {
  min-height: 220px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #3e3333;
  line-height: 1.75;
}

.compliance-card {
  margin-top: 16px;
  background: #f5fff7;
}

.compliance-card.warning {
  background: #fff5e8;
}

.compliance-card p {
  margin: 10px 0 0;
  color: #6d5b5b;
  line-height: 1.7;
}

.risk-item {
  border-top: 1px solid rgba(147, 81, 23, 0.15);
  margin-top: 14px;
  padding-top: 14px;
}

.risk-item strong,
.risk-item span {
  display: block;
  margin-bottom: 6px;
}

.history-panel {
  margin-top: 24px;
}

.empty-text {
  margin-bottom: 0;
  color: #796868;
}

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

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #f0dddd;
  border-radius: 18px;
  padding: 16px;
  background: #fffdfb;
}

.history-item p {
  margin: 6px 0 0;
  color: #7a6868;
}

.history-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 920px) {
  .hero-card,
  .workspace,
  .history-item {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .history-item {
    align-items: stretch;
  }

  .hero-card {
    flex-direction: column;
  }

  .hero-metrics {
    grid-template-columns: repeat(3, 1fr);
    flex-basis: auto;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  .hero-card,
  .panel {
    border-radius: 22px;
    padding: 20px;
  }

  .field-grid,
  .mode-grid,
  .type-grid,
  .hero-metrics {
    grid-template-columns: 1fr;
  }
}

select {
  width: 100%;
  border: 1px solid #ead8d8;
  border-radius: 16px;
  padding: 13px 14px;
  color: #241b1b;
  background: #fffdfb;
  outline: none;
  transition: border 0.2s, box-shadow 0.2s;
}

select:focus {
  border-color: #ff0036;
  box-shadow: 0 0 0 4px rgba(255, 0, 54, 0.1);
}

#result-editor {
  min-height: 260px;
  line-height: 1.75;
}

.edit-hint {
  margin: 10px 0 0;
  color: #8a7474;
  font-size: 0.9rem;
}

.segment-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.segment-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid #f0dddd;
  border-radius: 16px;
  padding: 12px;
  background: #fffdfb;
}

.segment-item span {
  color: #4d3e3e;
  line-height: 1.65;
  word-break: break-word;
}

.segment-item button,
.history-tools button {
  border: 0;
  border-radius: 14px;
  padding: 8px 12px;
  color: #ff0036;
  background: #ffe9ee;
  font-weight: 800;
  white-space: nowrap;
}

.history-tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.empty-text.compact {
  margin: 0;
  font-size: 0.92rem;
}

.risk-item ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #6d4f22;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .segment-item {
    grid-template-columns: 1fr;
  }

  .history-tools {
    width: 100%;
    justify-content: stretch;
  }

  .history-tools button {
    flex: 1;
  }
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  width: min(1440px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0;
}

.sidebar {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: calc(100vh - 48px);
  border: 1px solid rgba(255, 0, 54, 0.12);
  border-radius: 30px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 80px rgba(71, 19, 24, 0.1);
  backdrop-filter: blur(12px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #ff0036, #ff6a00);
  box-shadow: 0 14px 30px rgba(255, 0, 54, 0.24);
  font-weight: 900;
}

.brand-block strong,
.brand-block span,
.sidebar-note strong,
.sidebar-note span {
  display: block;
}

.brand-block strong {
  color: #241b1b;
  font-size: 1.05rem;
}

.brand-block span,
.sidebar-note span {
  color: #8a7474;
  font-size: 0.88rem;
  line-height: 1.55;
}

.side-nav {
  display: grid;
  gap: 10px;
}

.side-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 18px;
  padding: 14px 16px;
  color: #4a3d3d;
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.side-nav-item.active,
.side-nav-item:hover {
  color: #fff;
  background: linear-gradient(135deg, #ff0036, #ff6a00);
  box-shadow: 0 14px 26px rgba(255, 0, 54, 0.2);
}

.sidebar-note {
  margin-top: auto;
  border-radius: 22px;
  padding: 16px;
  background: #fff5f0;
}

.sidebar-note strong {
  margin-bottom: 6px;
  color: #ff0036;
}

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

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.dashboard-topbar h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.25rem);
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 0, 54, 0.14);
  border-radius: 999px;
  padding: 12px 16px;
  color: #ff0036;
  background: rgba(255, 255, 255, 0.88);
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(71, 19, 24, 0.08);
}

.home-grid {
  display: grid;
  gap: 24px;
}

.home-hero h2,
.generator-intro h2,
.placeholder-panel h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.generate-button.compact {
  width: auto;
  margin: 0;
}

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

.entry-card {
  display: grid;
  gap: 10px;
  min-height: 180px;
  border: 1px solid rgba(255, 0, 54, 0.12);
  border-radius: 26px;
  padding: 24px;
  color: #342929;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 48px rgba(71, 19, 24, 0.08);
  text-align: left;
}

.entry-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 60px rgba(71, 19, 24, 0.12);
}

.entry-icon,
.placeholder-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: #fff0f3;
  font-size: 1.45rem;
}

.entry-card strong {
  font-size: 1.18rem;
}

.entry-card small {
  color: #7a6868;
  font-size: 0.95rem;
  line-height: 1.6;
}

.placeholder-panel {
  display: grid;
  justify-items: start;
  gap: 14px;
  min-height: 420px;
  align-content: center;
}

.generator-intro {
  margin-bottom: 24px;
}

@media (max-width: 1080px) {
  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .side-nav-item {
    justify-content: center;
  }

  .sidebar-note {
    display: none;
  }
}

@media (max-width: 760px) {
  .dashboard-shell {
    width: min(100% - 20px, 1180px);
    padding: 18px 0;
  }

  .dashboard-topbar,
  .home-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .account-chip,
  .home-actions .generate-button,
  .home-actions .ghost-button {
    justify-content: center;
    width: 100%;
  }

  .side-nav,
  .entry-grid {
    grid-template-columns: 1fr;
  }
}

/* V4.1 SaaS dashboard refresh */
:root {
  color: #111827;
  background: #f7f8fb;
}

body {
  background:
    radial-gradient(circle at 82% 8%, rgba(99, 102, 241, 0.08), transparent 24rem),
    radial-gradient(circle at 18% 0%, rgba(14, 165, 233, 0.08), transparent 22rem),
    #f7f8fb;
}

.dashboard-shell {
  display: block;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

.sidebar {
  position: fixed;
  inset: 16px auto 16px 16px;
  z-index: 20;
  width: 248px;
  height: auto;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
}

.dashboard-main {
  width: min(1180px, calc(100% - 328px));
  margin-left: 296px;
  padding: 24px 24px 48px 0;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border: 1px solid #111827;
  border-radius: 13px;
  color: #ffffff;
  background: #111827;
  box-shadow: none;
  font-size: 0.78rem;
  letter-spacing: -0.03em;
}

.brand-block strong {
  color: #111827;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.brand-block span,
.sidebar-note span,
.entry-card small,
.subtitle,
.edit-hint,
.empty-text,
.history-item p,
.compliance-card p {
  color: #6b7280;
}

.side-nav {
  gap: 6px;
}

.side-nav-item {
  border-radius: 12px;
  padding: 11px 12px;
  color: #4b5563;
  font-size: 0.94rem;
  font-weight: 650;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.side-nav-item.active,
.side-nav-item:hover {
  color: #111827;
  background: #f3f4f6;
  box-shadow: none;
}

.side-nav-item.active {
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.sidebar-note {
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #f9fafb;
}

.sidebar-note strong,
.eyebrow {
  color: #111827;
}

.dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 -24px 24px 0;
  border-bottom: 1px solid rgba(229, 231, 235, 0.86);
  padding: 18px 24px 18px 0;
  background: rgba(247, 248, 251, 0.82);
  backdrop-filter: blur(14px);
}

.topbar-title {
  min-width: 0;
}

.product-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dashboard-topbar h1 {
  color: #111827;
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  font-weight: 760;
  letter-spacing: -0.04em;
}

.version-badge {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 4px 9px;
  color: #374151;
  background: #ffffff;
  font-size: 0.72rem;
  font-weight: 750;
}

.account-chip {
  border: 1px solid #e5e7eb;
  padding: 8px 12px 8px 8px;
  color: #374151;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  font-weight: 650;
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #111827, #4b5563);
}

.avatar-placeholder span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.hero-card,
.panel,
.entry-card {
  border: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.06);
  backdrop-filter: none;
}

.hero-card {
  border-radius: 28px;
  padding: 40px;
}

.home-hero {
  min-height: 250px;
  align-items: flex-end;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(249, 250, 251, 0.9)),
    radial-gradient(circle at 82% 18%, rgba(17, 24, 39, 0.08), transparent 18rem);
}

.home-hero h2,
.generator-intro h2,
.placeholder-panel h2 {
  color: #111827;
  font-size: clamp(2.15rem, 5vw, 4.5rem);
  letter-spacing: -0.07em;
}

.subtitle {
  max-width: 680px;
  font-size: 1rem;
  line-height: 1.8;
}

.eyebrow {
  margin-bottom: 10px;
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.14em;
}

.entry-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.entry-card {
  position: relative;
  min-height: 214px;
  border-radius: 22px;
  padding: 22px;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.entry-card::before {
  content: '';
  position: absolute;
  inset: auto 18px 18px auto;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background: #f3f4f6;
}

.entry-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.1);
}

.entry-card strong {
  position: relative;
  margin-top: 18px;
  color: #111827;
  font-size: 1.16rem;
  letter-spacing: -0.03em;
}

.entry-card small {
  position: relative;
  max-width: 12rem;
}

.entry-meta {
  position: relative;
  width: fit-content;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 5px 9px;
  color: #4b5563;
  background: #ffffff;
  font-size: 0.72rem;
  font-weight: 720;
}

.entry-arrow {
  position: absolute;
  right: 24px;
  bottom: 22px;
  color: #111827;
  font-size: 1.1rem;
}

.panel {
  border-radius: 24px;
  padding: 24px;
}

input,
textarea,
select {
  border-color: #e5e7eb;
  border-radius: 12px;
  color: #111827;
  background: #ffffff;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #111827;
  box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.08);
}

.mode-card,
.type-card {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  color: #374151;
  background: #ffffff;
}

.mode-card.active,
.type-card.active,
.generate-button {
  color: #ffffff;
  background: #111827;
  box-shadow: 0 14px 28px rgba(17, 24, 39, 0.16);
}

.mode-card.active span {
  color: rgba(255, 255, 255, 0.78);
}

.ghost-button,
.result-toolbar button,
.history-actions button,
.segment-item button,
.history-tools button {
  color: #111827;
  background: #f3f4f6;
}

.result-card,
.compliance-card,
.history-item,
.segment-item {
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.compliance-card.warning {
  background: #fffbeb;
}

@media (max-width: 1180px) {
  .entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .sidebar {
    position: static;
    width: auto;
    margin: 16px 16px 0;
  }

  .dashboard-main {
    width: auto;
    margin-left: 0;
    padding: 16px;
  }

  .dashboard-topbar {
    margin: 0 -16px 20px;
    padding: 16px;
  }

  .side-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .product-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .entry-grid,
  .side-nav {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .panel {
    border-radius: 20px;
    padding: 22px;
  }
}

/* V4.1 Dashboard hard reset: make the app unmistakably SaaS-like */
:root {
  --dashboard-bg: #f3f5f9;
  --dashboard-card: #ffffff;
  --dashboard-ink: #0f172a;
  --dashboard-muted: #64748b;
  --dashboard-line: #e2e8f0;
  --dashboard-shadow: 0 22px 60px rgba(15, 23, 42, 0.10);
  --dashboard-soft-shadow: 0 14px 34px rgba(15, 23, 42, 0.075);
  --dashboard-radius: 24px;
  color: var(--dashboard-ink);
  background: var(--dashboard-bg);
}

body {
  background:
    radial-gradient(circle at 72% 10%, rgba(79, 70, 229, 0.12), transparent 28rem),
    radial-gradient(circle at 22% 0%, rgba(14, 165, 233, 0.14), transparent 24rem),
    linear-gradient(180deg, #f8fafc 0%, var(--dashboard-bg) 42%, #eef2f7 100%);
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 28px;
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 24px 28px 48px 24px;
}

.sidebar {
  position: fixed;
  top: 24px;
  left: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  width: 240px;
  height: auto;
  margin: 0;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 28px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--dashboard-shadow);
  backdrop-filter: blur(18px);
}

.dashboard-main {
  grid-column: 2;
  width: 100%;
  max-width: 1260px;
  margin: 0 auto 0 0;
  padding: 0;
}

.brand-block {
  border-bottom: 1px solid var(--dashboard-line);
  padding-bottom: 18px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #111827 0%, #4338ca 100%);
  box-shadow: 0 16px 32px rgba(67, 56, 202, 0.22);
}

.brand-block strong {
  font-size: 1.08rem;
}

.side-nav {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.side-nav-item {
  position: relative;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 13px 14px;
  color: #475569;
  background: transparent;
  font-size: 0.96rem;
}

.side-nav-item span:first-child {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 11px;
  background: #f1f5f9;
  color: #334155;
}

.side-nav-item.active,
.side-nav-item:hover {
  border-color: #dbe4f0;
  color: #0f172a;
  background: #f8fafc;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.side-nav-item.active::before {
  content: '';
  position: absolute;
  left: -20px;
  width: 4px;
  height: 28px;
  border-radius: 999px;
  background: #4f46e5;
}

.side-nav-item.active span:first-child,
.side-nav-item:hover span:first-child {
  color: #ffffff;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
}

.sidebar-note {
  border: 1px solid #dbeafe;
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(135deg, #eff6ff, #f8fafc);
}

.sidebar-note strong {
  color: #1d4ed8;
}

.dashboard-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 0 26px;
  border: 1px solid rgba(226, 232, 240, 0.82);
  border-radius: 24px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px);
}

.dashboard-topbar h1 {
  font-size: clamp(1.35rem, 2.1vw, 2rem);
  letter-spacing: -0.045em;
}

.version-badge {
  border: 0;
  padding: 5px 10px;
  color: #4338ca;
  background: #eef2ff;
}

.account-chip {
  min-width: 126px;
  border-color: var(--dashboard-line);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.avatar-placeholder {
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
}

.home-grid {
  gap: 22px;
}

.hero-card,
.panel,
.entry-card {
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: var(--dashboard-card);
  box-shadow: var(--dashboard-soft-shadow);
}

.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  gap: 32px;
  min-height: 330px;
  border-radius: 32px;
  padding: 44px;
  overflow: hidden;
  background:
    radial-gradient(circle at 83% 20%, rgba(79, 70, 229, 0.18), transparent 18rem),
    linear-gradient(135deg, #ffffff 0%, #f8fafc 56%, #eef2ff 100%);
}

.home-hero::before {
  content: '';
  position: absolute;
  inset: 22px 22px auto auto;
  width: 160px;
  height: 160px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.14);
  filter: blur(8px);
}

.home-hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
}

.home-hero h2,
.generator-intro h2,
.placeholder-panel h2 {
  color: var(--dashboard-ink);
}

.home-hero h2 {
  max-width: 780px;
  margin-bottom: 18px;
  font-size: clamp(2.6rem, 5.5vw, 5.4rem);
  line-height: 0.96;
}

.subtitle {
  color: var(--dashboard-muted);
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.home-hero-actions span {
  border: 1px solid #dbe4f0;
  border-radius: 999px;
  padding: 9px 12px;
  color: #334155;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
  font-weight: 750;
}

.home-hero-panel {
  position: relative;
  z-index: 1;
  align-self: stretch;
  display: grid;
  gap: 14px;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 26px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 24px 52px rgba(79, 70, 229, 0.10);
}

.home-hero-panel span {
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.16), rgba(14, 165, 233, 0.10));
}

.home-hero-panel span:nth-child(2) {
  margin-left: 34px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(255, 255, 255, 0.55));
}

.home-hero-panel span:nth-child(3) {
  margin-right: 48px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.17), rgba(255, 255, 255, 0.55));
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.entry-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 12px;
  min-height: 240px;
  border-radius: 28px;
  padding: 24px;
  overflow: hidden;
  isolation: isolate;
}

.entry-card::before {
  inset: auto -24px -28px auto;
  width: 132px;
  height: 132px;
  opacity: 0.82;
}

.entry-card.accent-violet::before { background: #ede9fe; }
.entry-card.accent-blue::before { background: #dbeafe; }
.entry-card.accent-amber::before { background: #fef3c7; }
.entry-card.accent-emerald::before { background: #d1fae5; }

.entry-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(135deg, #0f172a, #475569);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
}

.accent-violet .entry-icon { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.accent-blue .entry-icon { background: linear-gradient(135deg, #0284c7, #06b6d4); }
.accent-amber .entry-icon { background: linear-gradient(135deg, #d97706, #f59e0b); }
.accent-emerald .entry-icon { background: linear-gradient(135deg, #059669, #10b981); }

.entry-meta {
  border-color: #dbe4f0;
  color: #475569;
  background: #f8fafc;
}

.entry-card strong {
  margin-top: 4px;
  font-size: 1.22rem;
}

.entry-card small {
  max-width: none;
  color: var(--dashboard-muted);
}

.entry-arrow {
  display: grid;
  place-items: center;
  right: 22px;
  bottom: 22px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.78);
}

.entry-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 26px 64px rgba(15, 23, 42, 0.14);
}

.panel,
.result-card,
.compliance-card,
.history-item,
.segment-item,
input,
textarea,
select,
.mode-card,
.type-card {
  border-color: var(--dashboard-line);
}

@media (max-width: 1180px) {
  .dashboard-shell {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 22px;
    padding-left: 20px;
  }

  .sidebar {
    left: 20px;
    width: 220px;
  }

  .entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-hero-panel {
    min-height: 180px;
  }
}

@media (max-width: 900px) {
  .dashboard-shell {
    display: block;
    padding: 14px;
  }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    margin: 0 0 16px;
    border-radius: 24px;
  }

  .dashboard-main {
    width: auto;
    max-width: none;
    margin: 0;
  }

  .side-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-nav-item.active::before {
    display: none;
  }

  .dashboard-topbar {
    position: static;
  }
}

@media (max-width: 640px) {
  .dashboard-shell {
    padding: 10px;
  }

  .dashboard-topbar {
    align-items: stretch;
    flex-direction: column;
    border-radius: 20px;
    padding: 16px;
  }

  .product-title-row {
    gap: 8px;
  }

  .account-chip {
    width: 100%;
    justify-content: center;
  }

  .side-nav,
  .entry-grid,
  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: auto;
    border-radius: 24px;
    padding: 26px;
  }

  .home-hero h2 {
    font-size: clamp(2.15rem, 13vw, 3.5rem);
  }

  .home-hero-panel {
    display: none;
  }

  .entry-card {
    min-height: 200px;
  }
}

/* V4.2 strict SaaS dashboard layout override */
.dashboard-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 32px;
  min-height: 100vh;
  width: 100%;
  margin: 0;
  padding: 24px 32px 56px 24px;
}

.sidebar {
  position: fixed;
  top: 24px;
  left: 24px;
  bottom: 24px;
  width: 240px;
  height: auto;
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  padding: 20px;
  background: #f8fafc;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.dashboard-main {
  grid-column: 2;
  width: 100%;
  max-width: 1280px;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.brand-block {
  padding-bottom: 20px;
  margin-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}

.side-nav-item {
  width: 100%;
}

.home-grid {
  display: grid;
  gap: 24px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  gap: 32px;
  align-items: stretch;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.entry-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 268px;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  padding: 26px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.09);
  text-align: left;
}

.entry-card h3 {
  position: relative;
  z-index: 1;
  margin: 2px 0 0;
  color: #0f172a;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.entry-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #64748b;
  font-size: 0.96rem;
  line-height: 1.7;
}

.entry-button {
  position: relative;
  z-index: 1;
  align-self: flex-start;
  margin-top: auto;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: #ffffff;
  background: #0f172a;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.18);
  font-weight: 800;
}

.entry-button:hover {
  transform: translateY(-1px);
  background: #1e293b;
}

@media (max-width: 1180px) {
  .dashboard-shell {
    grid-template-columns: 240px minmax(0, 1fr);
    padding-left: 24px;
  }

  .sidebar {
    left: 24px;
    width: 240px;
  }

  .entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dashboard-shell {
    display: block;
    padding: 14px;
  }

  .sidebar {
    position: static;
    width: auto;
    margin-bottom: 16px;
  }

  .dashboard-main {
    width: auto;
    max-width: none;
  }

  .home-hero {
    grid-template-columns: 1fr;
  }
}

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

/* V5 history page enhancement */
.history-page {
  display: grid;
  gap: 24px;
}

.history-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 0;
}

.history-hero h2 {
  margin-bottom: 12px;
  color: var(--dashboard-ink);
  font-size: clamp(2.2rem, 4.8vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.history-stats {
  display: grid;
  flex: 0 0 220px;
  gap: 12px;
}

.history-stats span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #dbe4f0;
  border-radius: 18px;
  padding: 14px 16px;
  color: #475569;
  background: #f8fafc;
  font-weight: 750;
}

.history-stats strong {
  color: #4f46e5;
  font-size: 1.5rem;
}

.history-page-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 24px;
  align-items: start;
}

.history-list-panel,
.history-detail-panel {
  min-width: 0;
}

.history-page-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 300px);
  overflow: auto;
  padding-right: 4px;
}

.history-page-item {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px;
  color: #64748b;
  background: #ffffff;
  text-align: left;
}

.history-page-item:hover,
.history-page-item.active {
  border-color: #c7d2fe;
  background: #eef2ff;
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.08);
}

.history-page-item-title {
  color: #0f172a;
  font-weight: 850;
}

.history-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.history-detail-heading h2 {
  margin-bottom: 8px;
  color: #0f172a;
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  letter-spacing: -0.05em;
}

.history-detail-heading p {
  margin: 0;
  color: #64748b;
  line-height: 1.65;
}

.history-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.ghost-button.danger,
.history-detail-actions .danger {
  color: #b91c1c;
  background: #fee2e2;
}

.history-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}

.history-meta-grid div {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 13px 14px;
  background: #f8fafc;
}

.history-meta-grid dt {
  margin-bottom: 6px;
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 800;
}

.history-meta-grid dd {
  margin: 0;
  color: #0f172a;
  font-weight: 760;
  word-break: break-word;
}

.history-detail-section {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.history-detail-section h3 {
  margin: 0;
  color: #0f172a;
}

.history-detail-section pre {
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 18px;
  color: #1e293b;
  background: #f8fafc;
  font: inherit;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.history-detail-empty {
  display: grid;
  justify-items: start;
  gap: 14px;
  min-height: 420px;
  align-content: center;
}

.history-more-button {
  width: 100%;
  margin-top: 14px;
  padding: 12px 14px;
}

@media (max-width: 980px) {
  .history-hero,
  .history-detail-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .history-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    flex-basis: auto;
  }

  .history-page-grid {
    grid-template-columns: 1fr;
  }

  .history-page-list {
    max-height: none;
  }

  .history-detail-actions {
    justify-content: stretch;
  }

  .history-detail-actions button {
    flex: 1;
  }
}

@media (max-width: 640px) {
  .history-stats,
  .history-meta-grid {
    grid-template-columns: 1fr;
  }

  .history-hero h2 {
    font-size: clamp(2rem, 13vw, 3.5rem);
  }

  .history-page-item,
  .history-detail-section pre {
    border-radius: 16px;
  }

  .history-detail-actions {
    display: grid;
  }
}

/* V5.1 favorites enhancement */
.home-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.home-stat-card {
  position: relative;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  padding: 22px;
  background: #ffffff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.home-stat-card::after {
  content: '';
  position: absolute;
  right: -28px;
  bottom: -32px;
  width: 118px;
  height: 118px;
  border-radius: 999px;
  opacity: 0.72;
}

.home-stat-card.accent-violet::after { background: #ede9fe; }
.home-stat-card.accent-amber::after { background: #fef3c7; }
.home-stat-card.accent-blue::after { background: #dbeafe; }

.home-stat-card span,
.home-stat-card strong,
.home-stat-card p {
  position: relative;
  z-index: 1;
}

.home-stat-card span {
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 820;
}

.home-stat-card strong {
  display: block;
  margin: 10px 0 6px;
  color: #0f172a;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.home-stat-card p {
  margin: 0;
  color: #64748b;
}

.recent-favorites-panel {
  display: grid;
  gap: 16px;
}

.recent-favorite-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.recent-favorite-item {
  display: grid;
  gap: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px;
  background: #f8fafc;
}

.recent-favorite-item strong {
  display: block;
  margin-bottom: 6px;
  color: #0f172a;
}

.recent-favorite-item p {
  margin: 0;
  color: #64748b;
  line-height: 1.65;
}

.recent-favorite-item button {
  justify-self: start;
}

.history-tabs {
  display: flex;
  gap: 10px;
  margin: -4px 0 16px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 6px;
  background: #f8fafc;
}

.history-tab {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  color: #64748b;
  background: transparent;
  font-weight: 850;
}

.history-tab span {
  margin-left: 6px;
  color: #94a3b8;
}

.history-tab.active {
  color: #0f172a;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.history-tab.active span {
  color: #4f46e5;
}

.favorite-button.active,
.history-actions button[data-favorite] {
  color: #92400e;
  background: #fef3c7;
}

.history-page-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 980px) {
  .home-stat-grid,
  .recent-favorite-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .history-tabs {
    flex-direction: column;
  }

  .recent-favorite-item button {
    justify-self: stretch;
  }
}

.history-page-item-main {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.history-page-favorite {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 850;
}

@media (max-width: 640px) {
  .history-page-favorite {
    justify-self: stretch;
  }
}

/* V5.2 regenerate from history */
.generator-restore-notice,
.history-feedback,
.history-missing-form {
  border: 1px solid #bfdbfe;
  border-radius: 18px;
  padding: 14px 16px;
  color: #1e40af;
  background: #eff6ff;
  font-weight: 800;
  line-height: 1.65;
}

.generator-restore-notice {
  margin: -10px 0 24px;
}

.history-feedback {
  margin-bottom: 18px;
}

.history-missing-form {
  margin: -2px 0 18px;
  color: #92400e;
  background: #fffbeb;
  border-color: #fde68a;
}

@media (max-width: 640px) {
  .generator-restore-notice,
  .history-feedback,
  .history-missing-form {
    border-radius: 16px;
    padding: 12px 14px;
  }
}

/* V5.3 dashboard usage stats and recent activity */
.home-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-stat-card h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.home-stat-card.accent-emerald::after { background: #d1fae5; }

.home-activity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.recent-activity-panel,
.recent-favorites-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

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

.recent-record-item {
  display: grid;
  gap: 7px;
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 15px 16px;
  color: #64748b;
  background: #f8fafc;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.recent-record-item:hover {
  border-color: #c7d2fe;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.09);
  transform: translateY(-1px);
}

.recent-record-item strong {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 850;
}

.recent-record-item span {
  line-height: 1.5;
}

.home-empty-state {
  display: grid;
  justify-items: start;
  gap: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 18px;
  padding: 22px;
  background: #f8fafc;
}

.home-empty-state.compact {
  min-height: 116px;
  align-content: center;
}

.home-empty-state p {
  margin: 0;
  color: #64748b;
  line-height: 1.7;
}

@media (max-width: 1180px) {
  .home-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .home-activity-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .home-stat-grid {
    grid-template-columns: 1fr;
  }

  .home-empty-state,
  .home-empty-state .generate-button {
    width: 100%;
  }
}

/* V6.1 AI core capability upgrade */
.model-selector-card,
.analysis-card,
.score-card {
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.055);
}

.model-selector-card {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

.model-selector-card p {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.6;
}

.analysis-card {
  margin: 16px 0 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.analysis-card .result-toolbar {
  align-items: flex-start;
}

.analysis-card .result-toolbar button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  color: #ffffff;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.18);
  font-weight: 850;
  white-space: nowrap;
}

#analysis-editor {
  min-height: 240px;
  background: #ffffff;
}

.score-card {
  margin-top: 16px;
  background: #f8fafc;
}

.score-card p,
.score-card li {
  color: #64748b;
  line-height: 1.7;
}

.score-card ul {
  margin: 14px 0 0;
  padding-left: 20px;
}

.score-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.score-heading h3 {
  margin: 0;
  color: #0f172a;
  font-size: 1.25rem;
}

.risk-pill {
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 0.84rem;
  font-weight: 850;
  white-space: nowrap;
}

.risk-低 { color: #047857; background: #d1fae5; }
.risk-中 { color: #92400e; background: #fef3c7; }
.risk-高 { color: #b91c1c; background: #fee2e2; }

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.score-metric {
  display: grid;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 13px;
  background: #ffffff;
}

.score-metric span {
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 800;
}

.score-metric strong {
  color: #0f172a;
  font-size: 1.65rem;
  letter-spacing: -0.05em;
}

.score-metric i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f46e5 var(--score), #e2e8f0 var(--score));
}

@media (max-width: 640px) {
  .score-heading,
  .analysis-card .result-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }
}

/* V6.3 content marketing type groups */
.type-grid {
  grid-template-columns: 1fr;
}

.type-group {
  display: grid;
  gap: 10px;
}

.type-group h3 {
  margin: 4px 0 0;
  color: #0f172a;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

.type-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 640px) {
  .type-group-grid {
    grid-template-columns: 1fr;
  }
}

/* V6.4 hot content factory strategy controls */
.strategy-card {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.055);
}

.strategy-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.strategy-heading h3 {
  margin: 0;
}

.strategy-heading span {
  border-radius: 999px;
  padding: 7px 10px;
  color: #4338ca;
  background: #eef2ff;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

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

.strategy-hint {
  margin: 0;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.65;
}

.recommended-version {
  margin-top: 14px;
  border: 1px solid #c7d2fe;
  border-radius: 16px;
  padding: 13px;
  background: #eef2ff;
}

.recommended-version strong {
  color: #3730a3;
}

.recommended-version p {
  margin: 7px 0 0;
  color: #475569;
}

@media (max-width: 760px) {
  .strategy-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .strategy-grid {
    grid-template-columns: 1fr;
  }
}

/* V6.5 AI product recognition */
.image-recognition-panel {
  margin-bottom: 24px;
}

.image-recognition-badge {
  border-radius: 999px;
  padding: 8px 12px;
  color: #0369a1;
  background: #e0f2fe;
  font-size: 0.84rem;
  font-weight: 850;
}

.image-recognition-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr);
  gap: 16px;
}

.image-upload-zone {
  display: grid;
  place-items: center;
  min-height: 230px;
  border: 2px dashed #c7d2fe;
  border-radius: 22px;
  padding: 24px;
  color: #334155;
  background: #f8fafc;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.image-upload-zone:hover,
.image-upload-zone.dragging {
  border-color: #4f46e5;
  background: #eef2ff;
  transform: translateY(-1px);
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 20px;
  background: #ffffff;
  font-size: 1.6rem;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.image-upload-zone strong,
.image-preview-card strong {
  display: block;
  margin-top: 12px;
  color: #0f172a;
}

.image-upload-zone p,
.image-preview-card p {
  margin: 8px 0 0;
  color: #64748b;
  line-height: 1.65;
}

.image-preview-card {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 230px;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  padding: 16px;
  background: #ffffff;
}

.image-preview-card img {
  width: 160px;
  height: 160px;
  border-radius: 18px;
  object-fit: cover;
  background: #f1f5f9;
}

.image-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.image-analysis-result {
  margin-top: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 16px;
  background: #f8fafc;
}

.image-analysis-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.image-analysis-columns section {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 13px;
  background: #ffffff;
}

.image-analysis-columns h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.image-analysis-columns p,
.image-analysis-columns li {
  color: #475569;
  line-height: 1.6;
}

.image-analysis-columns ul {
  margin: 0;
  padding-left: 18px;
}

.image-analysis-result pre {
  margin-top: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 14px;
  background: #ffffff;
  font: inherit;
}

@media (max-width: 980px) {
  .image-recognition-grid,
  .image-analysis-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .image-preview-card {
    grid-template-columns: 1fr;
  }

  .image-preview-card img {
    width: 100%;
    height: auto;
    max-height: 260px;
  }

  .image-action-row .generate-button,
  .image-action-row .ghost-button {
    width: 100%;
  }
}

/* V6.6 product insight center / content factory architecture */
.insight-workspace {
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
}

.insight-summary-grid,
.vision-provider-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.insight-summary-card,
.vision-provider-option,
.saved-insights-card {
  border: 1px solid rgba(255, 0, 54, 0.1);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 18px 50px rgba(71, 19, 24, 0.08);
}

.insight-summary-card {
  padding: 20px;
}

.insight-summary-card h3 {
  margin: 0 0 10px;
  color: #2c2020;
}

.insight-summary-card p {
  margin: 0;
  color: #6f5a5a;
  line-height: 1.7;
}

.vision-provider-panel {
  margin-bottom: 24px;
}

.vision-provider-grid {
  margin-bottom: 0;
}

.vision-provider-option {
  display: grid;
  gap: 8px;
  padding: 18px;
  color: #3b3030;
}

.vision-provider-option input {
  width: auto;
}

.vision-provider-option.active {
  border-color: rgba(255, 0, 54, 0.28);
  box-shadow: 0 18px 50px rgba(255, 0, 54, 0.12);
}

.vision-provider-option.disabled {
  opacity: 0.68;
  background: #f7f1ef;
}

.vision-provider-option span {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  color: #ff0036;
  background: #fff0f3;
  font-size: 0.78rem;
  font-weight: 900;
}

.vision-provider-option p {
  margin: 0;
  color: #756565;
  line-height: 1.6;
}

.insight-toolbar {
  margin-bottom: 16px;
}

.insight-action-row,
.saved-insight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.saved-insights-card {
  margin-top: 22px;
  padding: 20px;
}

.saved-insights-card .panel-heading {
  margin-bottom: 14px;
}

.saved-insights-card .panel-heading span {
  color: #ff0036;
  font-size: 0.82rem;
  font-weight: 800;
}

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

.saved-insight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #f0dfdf;
  border-radius: 18px;
  padding: 14px;
  background: #fffdfb;
}

.saved-insight-item.active {
  border-color: rgba(255, 0, 54, 0.3);
  background: #fff7f7;
}

.saved-insight-item strong,
.saved-insight-item span {
  display: block;
}

.saved-insight-item span {
  margin-top: 4px;
  color: #8a7777;
  font-size: 0.86rem;
}

@media (max-width: 980px) {
  .insight-summary-grid,
  .vision-provider-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .insight-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .insight-summary-grid,
  .vision-provider-grid {
    grid-template-columns: 1fr;
  }

  .saved-insight-item,
  .saved-insight-actions {
    align-items: stretch;
    flex-direction: column;
  }
}
