:root {
  --ink: #142033;
  --muted: #5b6b82;
  --line: #d7deea;
  --ok: #0f7a4a;
  --bad: #b42318;
  --warn: #fff4e5;
  --brand: #1f4b99;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f8fafc;
}
header, main { max-width: 1280px; margin: 0 auto; padding: 1.25rem; }
.app-header {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 0.35rem;
  border-bottom: 1px solid #e2e8f0;
}
.app-heading h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.app-heading p {
  margin: 0.35rem 0 0;
  color: #64748b;
  max-width: 46rem;
  line-height: 1.45;
}
.page-title {
  margin: 0.35rem 0 1.15rem;
  font-size: 1.45rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.22rem;
  background: #e8eef6;
  border-radius: 10px;
}
.tabs a {
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  text-decoration: none;
  color: #475569;
  background: transparent;
  font-weight: 600;
  font-size: 0.9rem;
}
.tabs a.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin: 0.25rem 0 1.25rem;
}
a.button {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-weight: 600;
}
a.button.secondary { background: var(--brand); }
.how-to {
  margin-bottom: 0;
  padding: 1.7rem 1.5rem 1.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.how-to ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem 1.1rem;
  color: #64748b;
  line-height: 1.4;
  font-size: 0.88rem;
}
.how-to li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}
.how-to li p { margin: 0; }
.how-to li strong { color: #0f172a; font-size: 0.92rem; }
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.how-to-norates ol {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .how-to ol { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .how-to ol { grid-template-columns: 1fr; }
}
section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}
label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; }
label.check { flex-direction: row; align-items: center; gap: 0.5rem; }
label.check input { width: auto; padding: 0; }
input, select, button {
  font: inherit;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
}
button {
  background: var(--brand);
  color: #fff;
  border: 0;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.08s ease, box-shadow 0.08s ease;
}
button:hover { filter: brightness(1.06); }
button:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.28);
  filter: brightness(0.88);
}
button:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
button.secondary { background: var(--brand); }
button.write { background: var(--brand); }
button.copy { background: var(--brand); }
button.copy:active, button.copy.busy { background: var(--brand); filter: brightness(0.88); }
button.busy, button:disabled {
  cursor: wait;
  opacity: 0.85;
  filter: none;
}
form[aria-busy="true"] { cursor: wait; }
.working {
  margin: 0.65rem 0 0;
  color: var(--ok);
  font-weight: 700;
}
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.success-btn {
  display: inline-block;
  background: #0f7a4a;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 0.7rem 1.7rem;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(15, 122, 74, 0.22);
}
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { border-bottom: 1px solid var(--line); padding: 0.45rem 0.4rem; text-align: left; vertical-align: middle; }
.num, th.price, th.formula, td.price-cell, td.formula-cell { text-align: right; font-variant-numeric: tabular-nums; }
th.formula, td.formula-cell { min-width: 11rem; }
th.price, td.price-cell { min-width: 9rem; }
th.check, td.check { width: 4.2rem; text-align: center; white-space: nowrap; }
th.check input, td.check input { width: auto; padding: 0; margin: 0; }
th.check .check { justify-content: center; font-size: 0.8rem; font-weight: 600; }
table.hide-copied tr.copied { display: none; }
tr.warn { background: var(--warn); }
tr.manual { background: #eef6ff; }
td.status-copied { color: var(--ok); font-weight: 600; }
td.status-missing { font-weight: 600; }
.results-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.95rem;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  color: #64748b;
  font-size: 0.9rem;
}
.results-summary strong { color: #0f172a; }
.prices-table {
  border-collapse: separate;
  border-spacing: 0;
}
.prices-table th {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  background: #f8fafc;
  padding: 0.8rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}
.prices-table td {
  padding: 1.15rem 0.85rem;
  vertical-align: top;
  border-bottom: 1px solid #f1f5f9;
}
.prices-table .product-cell { min-width: 16rem; max-width: 28rem; }
.product-name {
  display: block;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
}
.product-sku {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
.quote-cell { min-width: 13rem; text-align: right; }
.quote {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}
.price-line {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.3rem;
}
.quote-formula {
  margin: 0;
  max-width: 16rem;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 0.72rem;
  line-height: 1.35;
  text-align: right;
}
.prices-table .note-cell {
  color: #94a3b8;
  font-size: 0.78rem;
  min-width: 7rem;
}
.formula-text { font-size: 0.8rem; line-height: 1.3; max-width: 16rem; display: inline-block; }
.price-readout { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.05rem; color: #0f172a; }
.currency { font-weight: 600; font-size: 0.78rem; margin-left: 0.15rem; color: #64748b; }
.price-form { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; justify-content: flex-end; }
.price-edit {
  width: 5.2rem;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  color: #0f172a;
  appearance: textfield;
  -moz-appearance: textfield;
}
.price-edit::-webkit-outer-spin-button,
.price-edit::-webkit-inner-spin-button { appearance: none; margin: 0; }
.price-edit:focus { outline: 1px solid var(--brand); border-radius: 4px; }
button.slim {
  padding: 0.22rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 6px;
  width: auto;
  white-space: nowrap;
}
.price-form button { padding: 0.22rem 0.5rem; font-size: 0.75rem; white-space: nowrap; }
.tag { font-size: 0.72rem; color: var(--brand); font-weight: 600; white-space: nowrap; }
.tag.muted { color: #94a3b8; }
code { background: #eef2f8; padding: 0.1rem 0.35rem; border-radius: 4px; }
.setup-band {
  margin: 0;
  padding: 2.35rem 0;
  border-top: 1px solid #d7deea;
  border-bottom: 1px solid #d7deea;
  box-shadow: inset 0 1px 0 #eef2f7, inset 0 -1px 0 #eef2f7;
}
.setup-bubble-wrap {
  display: flex;
  justify-content: center;
  margin: 0;
}
.setup-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: min(36rem, 100%);
  padding: 1.35rem 2.1rem;
  text-align: center;
  background: linear-gradient(180deg, #f4f8ff 0%, #eaf1fc 100%);
  border: 1px solid #c5d4f0;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(31, 75, 153, 0.12);
}
.setup-bubble-title {
  margin: 0 0 0.28rem;
  font-weight: 700;
  color: #0f172a;
}
.setup-bubble .hint { margin: 0; }
.setup-bubble-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 0.55rem 0.75rem;
  margin: 0;
}
.setup-bubble-form label {
  text-align: left;
  min-width: 9.5rem;
}
.setup-bubble-form select,
.setup-bubble-form input { margin: 0; }
.setup-bubble-wide {
  width: min(58rem, 100%);
  border-radius: 28px;
}
@media (max-width: 640px) {
  .setup-bubble,
  .setup-bubble-wide { border-radius: 22px; }
}
.panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.45rem 1.3rem;
  margin: 2.1rem 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.panel > h2 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  color: #0f172a;
}
.welcome-lead {
  margin: -0.35rem 0 1.25rem;
  color: #64748b;
  font-size: 1.05rem;
  max-width: 46rem;
  line-height: 1.5;
}
.can-do ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.4rem;
}
.can-do li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  color: #64748b;
  line-height: 1.45;
  font-size: 0.92rem;
}
.can-do li p { margin: 0; }
.can-do .step-num { flex-shrink: 0; margin-top: 0.1rem; }
@media (max-width: 800px) {
  .can-do ol { grid-template-columns: 1fr; }
}
.empty-hint {
  margin: 1.75rem auto;
  max-width: 36rem;
  text-align: center;
  color: #64748b;
  line-height: 1.45;
}
.store-cards {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 0;
  padding: 2.1rem 0;
}
.feature-cards {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 0;
  padding: 2.1rem 0;
}
.feature-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.45rem 1.3rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.feature-card h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 700;
}
.feature-card p {
  margin: 0;
  color: #64748b;
  line-height: 1.45;
  font-size: 0.92rem;
  flex: 1;
}
.feature-card .button { margin-top: 0.35rem; }
.store-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 1.45rem 1.3rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.store-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}
.store-card-source {
  box-shadow: inset 3px 0 0 #16a34a, 0 1px 2px rgba(15, 23, 42, 0.04);
  border-color: #e2e8f0;
}
.page-footer,
.stores-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0;
  padding-top: 1.6rem;
  border-top: 1px solid #e2e8f0;
}
.page-stores .page-nav,
.page-copy .page-nav,
.page-prices .page-nav,
.page-intro .page-nav { margin: 0; }
.page-stores .page-nav .button,
.page-copy .page-nav .button,
.page-prices .page-nav .button,
.page-intro .page-nav .button,
.page-intro .feature-card .button,
.setup-bubble-form .button {
  padding: 0.65rem 1.15rem;
  border-radius: 10px;
}
.rates-stamp {
  margin: 0.7rem 0 0;
  text-align: center;
}
.footer-note {
  margin: 1.75rem auto 0;
  max-width: 40rem;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.45;
}
.store-card-summary {
  list-style: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.35rem;
  min-height: 9.5rem;
  cursor: pointer;
}
.store-card-summary::-webkit-details-marker,
.store-card-summary::marker { display: none; content: ""; }
.store-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.store-identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.store-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  flex-shrink: 0;
}
.store-card-source .store-icon {
  background: #dcfce7;
  color: #166534;
}
.store-card h2 {
  margin: 0;
  color: #0f172a;
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 700;
}
.store-currency {
  margin: 0.15rem 0 0;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 600;
}
.badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
}
.badge-source,
.badge-connected { background: #dcfce7; color: #166534; }
.badge-setup,
.badge-attention { background: #ffedd5; color: #c2410c; }
.configure {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-weight: 600;
  font-size: 0.85rem;
}
.store-card[open] .configure { background: #f8fafc; }
.store-card-body {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}
.store-card .field-hint,
.store-card .store-status { margin: 0; }
.store-card input,
.store-card select,
.store-card button { width: 100%; }
.store-card label.check input { width: auto; }
.store-card .store-settings,
.store-card .connect,
.store-card .store-disconnect {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.75rem;
}
.store-card .store-settings { margin-top: 0; }
.store-card .connect {
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}
