:root {
  --neo-bg: #f5f7fb;
  --neo-surface: #ffffff;
  --neo-surface-soft: #f8fafc;
  --neo-border: #dbe2ea;
  --neo-text: #1f2937;
  --neo-muted: #5f6b7a;
  --neo-primary: #2563eb;
  --neo-success: #138a63;
  --neo-warning: #b7791f;
  --neo-danger: #c2410c;
  --neo-info: #0f766e;
  --neo-shadow: 0 8px 22px rgba(31, 41, 55, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  color: var(--neo-text);
  background: var(--neo-bg);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

.pc-container {
  background:
    linear-gradient(180deg, rgba(245, 247, 251, 0.1), var(--neo-bg) 360px),
    radial-gradient(circle at 18% 8%, rgba(37, 99, 235, 0.11), transparent 28%),
    radial-gradient(circle at 82% 0%, rgba(19, 138, 99, 0.1), transparent 24%);
}

.pc-container .pc-content {
  padding-top: 22px;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

a {
  color: var(--neo-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
  letter-spacing: 0;
}

p,
li,
label {
  color: var(--neo-muted);
  line-height: 1.55;
}

.pc-sidebar .b-brand,
.pc-header .b-brand {
  align-items: center;
  display: inline-flex;
  gap: 10px;
  min-height: 38px;
}

.neo-brand-mark {
  align-items: center;
  background: var(--neo-primary);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.neo-brand-text {
  color: var(--neo-text);
  font-weight: 800;
}

.neo-header .header-wrapper {
  gap: 16px;
  min-width: 0;
}

.neo-sidebar {
  border-right: 1px solid var(--neo-border);
  box-shadow: 8px 0 24px rgba(31, 41, 55, 0.04);
}

.neo-sidebar .pc-navbar > .pc-item:not(.pc-caption) > .pc-link {
  border-radius: 8px;
  margin: 2px 12px;
}

.neo-sidebar .pc-caption {
  margin-top: 10px;
}

.neo-top-title {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.neo-top-title span {
  color: var(--neo-text);
  font-weight: 700;
}

.neo-top-title strong {
  color: var(--neo-muted);
  font-size: 0.84rem;
}

.neo-header-actions,
.app-links,
.nav,
.actions,
.action-row,
.pill-row,
.tab-row,
.badge-row,
.hero-summary,
.feature-meta,
.compact-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.neo-header-actions form,
.app-links form,
.nav form,
.actions form,
.inline-form {
  margin: 0;
}

.neo-content {
  display: grid;
  gap: 18px;
  padding-bottom: 44px;
}

.shell,
.section-stack,
.form-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.hero,
.panel {
  background: var(--neo-surface);
  border: 1px solid var(--neo-border);
  border-radius: 8px;
  box-shadow: var(--neo-shadow);
  padding: 24px;
}

.feature-card,
.status-card,
.quick-card,
.result-card,
.empty-card,
.card {
  background: var(--neo-surface);
  border: 1px solid var(--neo-border);
  border-radius: 8px;
  box-shadow: 0 2px 9px rgba(31, 41, 55, 0.05);
  padding: 16px;
}

.card .card-body {
  padding: 0;
}

.hero {
  display: grid;
  gap: 22px;
}

.topbar,
.section-head,
.hero-main {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
}

.hero-copy {
  align-items: start;
  display: grid;
  gap: 14px;
  max-width: 760px;
  min-width: 0;
}

.hero h1,
.panel h1 {
  color: var(--neo-text);
  font-size: 2.65rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.panel h1 {
  font-size: 2.1rem;
}

.panel h2,
.card h2,
.feature-card h2,
.status-card h2,
.quick-card h2,
.result-card h2,
.empty-card h2 {
  color: var(--neo-text);
  font-size: 1.15rem;
  font-weight: 800;
}

.panel h3,
.card h3,
.feature-card h3,
.status-card h3,
.quick-card h3,
.result-card h3,
.empty-card h3 {
  color: var(--neo-text);
  font-size: 1rem;
  font-weight: 800;
}

.lead {
  color: var(--neo-muted);
  font-size: 1rem;
  max-width: 68ch;
}

.muted {
  color: var(--neo-muted);
  font-size: 0.92rem;
}

.mono {
  color: var(--neo-text);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.eyebrow,
.pill,
.status-badge,
.feature-badge,
.badge {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 700;
  gap: 6px;
  line-height: 1.2;
  padding: 6px 10px;
}

.eyebrow {
  width: auto;
}

.eyebrow,
.pill,
.feature-badge,
.badge.blue {
  background: #eef4ff;
  border: 1px solid #c8dafc;
  color: var(--neo-primary);
}

.badge.green,
.status-badge.pro,
.pill.pro {
  background: #edf8f4;
  border: 1px solid #c3eadc;
  color: var(--neo-success);
}

.badge.yellow,
.status-badge.balanced,
.pill.balanced {
  background: #fff8e6;
  border: 1px solid #f7dfa7;
  color: var(--neo-warning);
}

.badge.red,
.status-badge.con,
.pill.con {
  background: #fff1eb;
  border: 1px solid #ffd1c2;
  color: var(--neo-danger);
}

.nav-chip,
.mode-button,
.chip,
button,
.button-link,
.action-button {
  align-items: center;
  background: var(--neo-surface);
  border: 1px solid var(--neo-border);
  border-radius: 8px;
  color: var(--neo-text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  text-decoration: none;
}

.nav-chip:hover,
.mode-button:hover,
.chip:hover,
button:hover,
.button-link:hover,
.action-button:hover {
  border-color: #aac1ef;
  text-decoration: none;
}

.nav-chip.active,
.mode-button.active,
.chip.active,
button.primary,
.button-link.primary,
.action-button.primary {
  background: var(--neo-primary);
  border-color: var(--neo-primary);
  color: #fff;
}

.button-link.secondary,
.action-button.secondary {
  background: #eef4ff;
  border-color: #c8dafc;
  color: var(--neo-primary);
}

.mode-switch {
  background: var(--neo-surface-soft);
  border: 1px solid var(--neo-border);
  border-radius: 8px;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
}

.hero-grid,
.feature-grid,
.card-grid,
.results-grid,
.dual-grid,
.triple-grid,
.quad-grid,
.form-grid,
.feature-nav,
.grid {
  display: grid;
  gap: 14px;
}

.hero-grid {
  align-items: stretch;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  min-width: 0;
}

.feature-grid,
.results-grid {
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
}

.card-grid {
  grid-template-columns: 1fr;
}

.dual-grid,
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.triple-grid,
.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quad-grid,
.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.feature-nav {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.metric {
  color: var(--neo-text);
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
}

.quick-card,
.status-card {
  display: grid;
  gap: 8px;
}

.status-card {
  align-content: start;
  min-height: 124px;
}

.status-card.primary {
  border-left: 4px solid var(--neo-primary);
}

.status-card.success {
  border-left: 4px solid var(--neo-success);
}

.status-card.alert {
  border-left: 4px solid var(--neo-info);
}

.status-card.warning {
  border-left: 4px solid var(--neo-warning);
}

.billing-workspace {
  display: grid;
  gap: 18px;
}

.billing-header,
.billing-plan-top {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.billing-header h2 {
  margin-bottom: 0;
}

.billing-summary,
.billing-plan-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.billing-plan-card {
  background: #fff;
  border: 1px solid var(--neo-border);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 16px;
}

.billing-plan-card.active {
  border-color: var(--neo-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.billing-plan-top strong {
  color: var(--neo-text);
  font-size: 1.02rem;
}

.billing-plan-top span {
  color: var(--neo-primary);
  font-weight: 800;
}

.billing-plan-card form {
  margin: 0;
}

.feature-card {
  min-height: 144px;
}

.feature-top {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.feature-top h3 {
  margin-bottom: 0;
}

.details-card {
  background: var(--neo-surface-soft);
  border: 1px solid var(--neo-border);
  border-radius: 8px;
  padding: 14px;
}

.details-card summary {
  color: var(--neo-text);
  cursor: pointer;
  font-weight: 800;
}

.free-text {
  min-height: 150px;
}

.aside-stack {
  align-content: start;
  display: grid;
  gap: 14px;
}

.feature-link {
  background: var(--neo-surface-soft);
  border: 1px solid var(--neo-border);
  border-radius: 8px;
  color: var(--neo-text);
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 14px;
}

.feature-link span {
  color: var(--neo-primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.feature-link strong {
  font-size: 0.95rem;
}

.form-stack form,
form.stack,
.panel form:not(.inline-form):not(.actions) {
  display: grid;
  gap: 12px;
}

label {
  color: var(--neo-muted);
  display: grid;
  font-size: 0.88rem;
  font-weight: 700;
  gap: 6px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid var(--neo-border);
  border-radius: 8px;
  color: var(--neo-text);
  font: inherit;
  min-height: 40px;
  padding: 9px 11px;
  width: 100%;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--neo-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.table-wrap {
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  font-size: 0.92rem;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--neo-border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--neo-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.error {
  background: #fff1eb;
  border: 1px solid #ffd1c2;
  border-radius: 8px;
  color: var(--neo-danger);
  padding: 12px;
}

.success {
  background: #ecfdf5;
  border: 1px solid #b7f0d8;
  border-radius: 8px;
  color: var(--neo-success);
  padding: 12px;
}

.empty {
  background: #fff;
  border: 1px dashed var(--neo-border);
  border-radius: 8px;
  color: var(--neo-muted);
  padding: 16px;
}

.tabs,
.tab-panel {
  display: grid;
  gap: 14px;
}

[data-mode="classic"] .advanced-only,
[data-mode="advanced"] .classic-only {
  display: none !important;
}

.graph-wrap,
.matrix-wrap {
  overflow-x: auto;
}

.graph-node,
.matrix-cell {
  border-radius: 8px;
}

.matrix-cell.high {
  background: #edf8f4;
}

.matrix-cell.medium {
  background: #fff8e6;
}

.matrix-cell.low {
  background: #eef4ff;
}

.matrix-cell.none {
  background: #f1f5f9;
}

.score-progress {
  accent-color: var(--neo-primary);
  height: 10px;
  width: 100%;
}

.score-progress::-webkit-progress-bar {
  background: #eef2f7;
  border-radius: 999px;
}

.score-progress::-webkit-progress-value {
  background: var(--neo-primary);
  border-radius: 999px;
}

.score-progress::-moz-progress-bar {
  background: var(--neo-primary);
  border-radius: 999px;
}

.neo-footer {
  align-items: center;
  color: var(--neo-muted);
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 0 0 24px 280px;
  padding: 10px;
}

@media (max-width: 1024px) {
  .hero-grid,
  .dual-grid,
  .triple-grid,
  .quad-grid,
  .form-grid,
  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }

  .neo-footer {
    margin-left: 0;
  }

  .hero h1 {
    font-size: 2.35rem;
  }
}

@media (max-width: 760px) {
  .pc-header,
  .pc-container {
    max-width: 100vw;
    overflow-x: hidden;
  }

  .pc-content.neo-content {
    padding: 16px;
  }

  .shell,
  .hero,
  .panel,
  .hero-grid,
  .feature-grid,
  .card-grid,
  .dual-grid,
  .form-grid {
    max-width: calc(100vw - 32px);
    min-width: 0;
    overflow-x: hidden;
    width: 100%;
  }

  .hero *,
  .panel * {
    min-width: 0;
  }

  .hero,
  .panel,
  .feature-card,
  .status-card,
  .quick-card,
  .result-card,
  .empty-card,
  .card {
    padding: 14px;
  }

  .hero h1 {
    font-size: 1.42rem;
    line-height: 1.16;
    max-width: 280px;
    width: 280px;
  }

  .hero-copy > *,
  .status-card > *,
  .quick-card > *,
  .lead,
  .status-card p,
  .quick-card p {
    max-width: 280px;
    overflow-wrap: anywhere;
  }

  .hero-summary,
  .compact-meta {
    max-width: 280px;
  }

  .neo-header-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: hidden;
  }

  .neo-header-actions .btn {
    white-space: normal;
  }

  .neo-header-actions .btn:not(:last-child) {
    display: none;
  }

  .topbar,
  .section-head {
    display: grid;
    width: 100%;
  }

  .app-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    width: 100%;
  }

  .mode-switch {
    width: 100%;
  }

  .mode-switch .mode-button {
    flex: 1;
  }

  .nav-chip,
  .mode-button,
  .chip,
  button,
  .button-link,
  .action-button {
    justify-content: center;
    min-width: 0;
  }
}
