:root {
  --bg: #f7f4ee;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --ink: #17211f;
  --muted: #68736f;
  --line: #ded7c8;
  --line-2: #cfd8d2;
  --green: #1f766b;
  --green-2: #e8f5ef;
  --amber: #b7791f;
  --amber-2: #fff3d6;
  --red: #b94a48;
  --red-2: #fff0ee;
  --blue: #2f5d8c;
  --shadow: 0 18px 60px rgba(24, 33, 31, .11);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(23, 33, 31, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 31, .035) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.loading-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
}

.mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #123c37;
  color: white;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18), 0 10px 24px rgba(18, 60, 55, .24);
}

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 244, 238, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(24, 33, 31, .06);
}

.topbar-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.brand-title {
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.1;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.public-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr);
  gap: 18px;
  align-items: start;
}

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

.panel {
  padding: 22px;
}

.tool-panel {
  padding: 0;
  overflow: hidden;
}

.hero-panel {
  background: #132d2a;
  border-color: #132d2a;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto 22px 0 22px;
  height: 5px;
  background: linear-gradient(90deg, #e0a936, #54b99d, #7b9fc7);
  border-radius: 999px 999px 0 0;
}

.hero-panel .eyebrow {
  color: #8fe0ca;
}

.hero-panel p {
  color: #d8e5e1;
}

.premium-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.premium-row span {
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  border-radius: 999px;
  padding: 7px 10px;
  color: #f5fbf8;
  font-size: 12px;
  font-weight: 900;
}

.tool-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .65);
}

.tool-body {
  padding: 20px;
}

.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

h1, h2, h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(36px, 6vw, 68px);
  line-height: .96;
}

h2 {
  font-size: 24px;
  line-height: 1.15;
}

h3 {
  font-size: 17px;
  line-height: 1.25;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

.lead {
  max-width: 720px;
  font-size: 18px;
}

.button, button {
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  box-shadow: 0 6px 16px rgba(24, 33, 31, .05);
}

.button:hover, button:hover {
  border-color: var(--green);
}

.primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
  box-shadow: 0 12px 24px rgba(31, 118, 107, .22);
}

.auth-card {
  border-color: #cfd8d2;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(31, 118, 107, .35), rgba(183, 121, 31, .28), rgba(47, 93, 140, .28)) border-box;
}

.google-button {
  width: 100%;
  justify-content: center;
  background: #fff;
  border-color: #c8d0cc;
  text-decoration: none;
}

.google-button:hover {
  border-color: var(--blue);
  box-shadow: 0 10px 22px rgba(47, 93, 140, .12);
}

.google-mark {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  border: 1px solid #d7dde0;
  color: #2f5d8c;
  font-weight: 900;
  background: #f8fbff;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.divider::before,
.divider::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}

.danger {
  border-color: #e6b8b4;
  color: var(--red);
  background: var(--red-2);
}

.ghost {
  background: transparent;
  box-shadow: none;
}

.small {
  padding: 7px 10px;
  min-height: 32px;
  font-size: 13px;
}

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

.stack {
  display: grid;
  gap: 12px;
}

.stack-lg {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 6px;
  color: #33423f;
  font-size: 13px;
  font-weight: 800;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  min-height: 42px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 118, 107, .12);
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 8px;
}

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

.price-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfaf6);
  display: grid;
  gap: 10px;
  min-height: 260px;
}

.price-card strong {
  display: block;
  font-size: 28px;
  line-height: 1.05;
  color: #123c37;
}

.price-card p {
  margin: 0;
}

.price-card ul {
  margin: 0;
  padding-left: 18px;
  color: #465652;
  display: grid;
  gap: 6px;
}

.market-check {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.market-check input {
  width: auto;
  min-height: auto;
}

.preview-box {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.url-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

code {
  background: #eef3ef;
  color: #16443d;
  border-radius: 6px;
  padding: 4px 7px;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.app-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.side {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 12px;
}

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

.stat {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 22px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab-button[aria-selected="true"] {
  background: var(--green-2);
  border-color: var(--green);
  color: #124b44;
}

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

.book-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 14px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.book-card:hover {
  transform: translateY(-1px);
  border-color: #b9d7cf;
  box-shadow: 0 16px 42px rgba(24, 33, 31, .09);
}

.book-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: #42514d;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.pill.green {
  background: var(--green-2);
  border-color: #b9d7cf;
  color: #15574f;
}

.pill.amber {
  background: var(--amber-2);
  border-color: #ead39b;
  color: #72500f;
}

.qr {
  width: 132px;
  height: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 8px;
  justify-self: end;
}

.notice {
  border: 1px solid #b8d8ce;
  background: var(--green-2);
  color: #144b44;
  border-radius: 8px;
  padding: 12px;
}

.error {
  border: 1px solid #e4bbb7;
  background: var(--red-2);
  color: #8a2c2a;
  border-radius: 8px;
  padding: 12px;
}

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

.split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  font-size: 12px;
  color: #41534e;
  background: var(--surface-2);
}

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

.score {
  width: 110px;
  height: 110px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--green) calc(var(--score) * 1%), #e7e0d3 0);
  color: var(--ink);
  position: relative;
}

.score::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: inherit;
  background: #fff;
}

.score strong {
  position: relative;
  z-index: 1;
  font-size: 28px;
}

.empty {
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  padding: 22px;
  background: var(--surface-2);
}

details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-2);
}

summary {
  cursor: pointer;
  font-weight: 900;
}

@media (max-width: 900px) {
  .public-grid, .app-grid, .book-card, .pricing-grid {
    grid-template-columns: 1fr;
  }
  .side {
    position: static;
  }
  .qr {
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .topbar-inner, .container {
    width: min(100% - 20px, 1180px);
  }
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }
  .form-grid, .stat-grid {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 36px;
  }
}
