:root {
  --ink: #172026;
  --muted: #60717d;
  --line: #d9e1e5;
  --soft: #f4f7f3;
  --panel: #ffffff;
  --green: #1f7a5a;
  --green-weak: #dff1e8;
  --blue: #275a9f;
  --amber: #a35f00;
  --red: #b43b37;
  --shadow: 0 14px 32px rgba(23, 32, 38, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
  background: #172026;
  color: #eef5f1;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: #f0b35a;
  color: #172026;
  border-radius: 8px;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #b7c7cf;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 42px;
  border-radius: 8px;
  background: transparent;
  color: #d7e2e6;
  text-align: left;
  padding: 0 12px;
}

.nav-item.active,
.nav-item:hover {
  background: #24333c;
  color: #ffffff;
}

.connection {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b7c7cf;
  font-size: 13px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #c96d2c;
}

.dot.live {
  background: #58c18b;
}

.main {
  padding: 24px;
  min-width: 0;
}

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

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 4px;
}

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

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.1;
}

h2 {
  font-size: 17px;
  margin-bottom: 0;
}

h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.top-actions,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.primary,
.secondary,
.text-button,
.danger {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  white-space: nowrap;
}

.primary {
  background: var(--green);
  color: #ffffff;
}

.secondary {
  background: #e4ecef;
  color: var(--ink);
}

.danger {
  background: #f2dedc;
  color: var(--red);
}

.text-button {
  background: transparent;
  color: var(--blue);
  padding-inline: 4px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric,
.panel,
.price-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span,
.usage-grid span,
.mini {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  font-size: 34px;
  margin-top: 8px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 16px;
}

.panel {
  padding: 18px;
}

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

.product-stack,
.lead-list,
.history-list {
  display: grid;
  gap: 10px;
}

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

.product-row.compact {
  grid-template-columns: minmax(0, 1fr) auto;
}

.product-row img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: #e8eef1;
}

.product-title {
  font-weight: 700;
  margin: 0;
  overflow-wrap: anywhere;
}

.product-meta {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 0;
}

.score-pill {
  min-width: 64px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--green-weak);
  color: var(--green);
}

.score-pill.low {
  background: #f7dfdf;
  color: var(--red);
}

.score-pill.medium {
  background: #f6ead8;
  color: var(--amber);
}

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

.usage-grid div {
  padding: 12px;
  background: #f7fafb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.usage-grid strong {
  display: block;
  margin-top: 6px;
}

.notice {
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #eef4f8;
  color: #35556a;
  font-size: 14px;
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

.table-wrap {
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

.issue-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.issue {
  border-radius: 999px;
  padding: 5px 8px;
  background: #eef4f8;
  color: #38586c;
  font-size: 12px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.product-picker {
  align-self: start;
}

.optimizer-body {
  display: grid;
  gap: 14px;
}

.compare-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.copy-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  padding: 12px;
  min-height: 110px;
  overflow-wrap: anywhere;
}

.suggestion-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px;
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.check-list input {
  width: auto;
}

.bulk-grid,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.audit-tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
}

.file-field {
  margin-bottom: 12px;
}

.workflow-list {
  display: grid;
  gap: 10px;
}

.workflow-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  padding: 13px;
}

.workflow-list strong,
.workflow-list span {
  display: block;
}

.workflow-list span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.bulk-item,
.lead-item,
.history-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.lead-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.price-card {
  padding: 18px;
}

.price {
  font-size: 30px;
  font-weight: 800;
  margin: 10px 0;
}

.price small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #172026;
  color: #ffffff;
  border-radius: 8px;
  padding: 12px 14px;
  max-width: min(420px, calc(100vw - 36px));
  transform: translateY(80px);
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  box-shadow: var(--shadow);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.legal-page {
  background: #ffffff;
}

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 22px;
  line-height: 1.6;
}

.legal h1 {
  margin-bottom: 18px;
}

.legal h2 {
  margin-top: 28px;
  margin-bottom: 8px;
}

.legal a {
  color: var(--green);
  font-weight: 700;
}

.audit-page {
  background: #fbfcf8;
}

.audit-hero {
  background: #142025;
  color: #f7fbf8;
  min-height: 86vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.audit-nav {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.audit-nav a {
  color: #dbe8e1;
  text-decoration: none;
  margin-left: 16px;
}

.audit-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 0 !important;
}

.audit-logo span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f0b35a;
  color: #172026;
  font-weight: 800;
}

.audit-hero-inner {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 42px 22px 76px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: 48px;
  align-items: center;
}

.audit-kicker {
  color: #f0b35a;
  font-weight: 800;
  margin-bottom: 12px;
}

.audit-hero h1 {
  font-size: 54px;
  line-height: 1.02;
  max-width: 780px;
  margin-bottom: 22px;
}

.audit-lede {
  color: #c7d8cf;
  font-size: 19px;
  line-height: 1.55;
  max-width: 720px;
}

.audit-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.audit-primary,
.audit-secondary,
.audit-form button,
.audit-package-button {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  font-weight: 800;
}

.audit-primary,
.audit-form button {
  background: #f0b35a;
  color: #172026;
}

.audit-package-button {
  margin-top: auto;
  width: 100%;
  justify-content: center;
  background: #1f7a5a;
  color: #ffffff;
}

.audit-package-button.selected {
  outline: 3px solid rgba(240, 179, 90, 0.48);
  outline-offset: 3px;
}

.audit-secondary {
  background: #24333c;
  color: #ffffff;
}

.audit-preview {
  background: #ffffff;
  color: #172026;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.audit-preview-head,
.audit-score-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.audit-preview-head {
  color: #60717d;
  margin-bottom: 14px;
}

.audit-score-row {
  border: 1px solid #d9e1e5;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}

.audit-score-row strong {
  border-radius: 8px;
  min-width: 52px;
  min-height: 34px;
  display: grid;
  place-items: center;
}

.audit-score-row .bad {
  background: #f7dfdf;
  color: #b43b37;
}

.audit-score-row .warn {
  background: #f6ead8;
  color: #a35f00;
}

.audit-score-row .good {
  background: #dff1e8;
  color: #1f7a5a;
}

.audit-preview ul {
  margin: 16px 0 0;
  padding-left: 20px;
  color: #42515a;
}

.audit-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 64px 22px;
}

.audit-band {
  background: #eef4f0;
}

.audit-section h2 {
  font-size: 34px;
  margin-bottom: 22px;
}

.audit-grid,
.audit-pricing {
  display: grid;
  gap: 14px;
}

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

.audit-pricing {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.audit-grid article,
.audit-pricing article,
.audit-form {
  background: #ffffff;
  border: 1px solid #d9e1e5;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 14px 32px rgba(23, 32, 38, 0.06);
}

.audit-pricing article {
  display: flex;
  flex-direction: column;
}

.audit-grid p,
.audit-pricing p,
.audit-muted,
.audit-request p {
  color: #60717d;
  line-height: 1.55;
}

.audit-muted {
  margin-top: -8px;
  margin-bottom: 22px;
}

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

.audit-payment-option {
  background: #ffffff;
  border: 1px solid #d9e1e5;
  border-radius: 8px;
  padding: 14px;
  color: #172026;
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.audit-payment-option:hover,
.audit-payment-option.active {
  border-color: #1f7a5a;
  box-shadow: 0 12px 26px rgba(31, 122, 90, 0.12);
  transform: translateY(-1px);
}

.audit-payment-option span,
.audit-payment-option strong {
  display: block;
}

.audit-payment-option span {
  color: #60717d;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.audit-payment-option strong {
  font-size: 16px;
  margin-bottom: 8px;
}

.audit-payment-options p {
  margin-bottom: 0;
  overflow-wrap: anywhere;
}

.audit-shopier-link {
  grid-column: 1 / -1;
  min-height: 44px;
  border-radius: 8px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1f7a5a;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.audit-shopier-link.hidden {
  display: none;
}

.audit-pricing strong {
  display: block;
  font-size: 34px;
  margin: 10px 0;
}

.audit-pricing .featured {
  border-color: #f0b35a;
  box-shadow: 0 16px 38px rgba(240, 179, 90, 0.16);
}

.audit-request {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 0.7fr);
  gap: 24px;
  align-items: start;
}

.audit-form {
  display: grid;
  gap: 12px;
}

.audit-form button {
  border: 0;
  justify-content: center;
}

@media (max-width: 980px) {
  .audit-hero-inner,
  .audit-request {
    grid-template-columns: 1fr;
  }

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

  .audit-hero h1 {
    font-size: 40px;
  }
}

@media (max-width: 620px) {
  .audit-grid,
  .audit-pricing {
    grid-template-columns: 1fr;
  }

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

  .audit-hero h1 {
    font-size: 32px;
  }

  .audit-nav {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 5;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 12px;
  }

  .nav {
    display: flex;
    min-width: max-content;
  }

  .connection {
    display: none;
  }

  .metrics,
  .split,
  .optimizer-grid,
  .compare-grid,
  .audit-tool-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .main {
    padding: 16px;
  }

  .topbar,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions,
  .inline-actions {
    width: 100%;
  }

  .top-actions button,
  .inline-actions button {
    flex: 1;
  }

  h1 {
    font-size: 24px;
  }
}
