:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --panel: #fffdf8;
  --panel-strong: #f0f7f4;
  --border: #ddd8cc;
  --text: #20211f;
  --muted: #686b63;
  --accent: #2f6f63;
  --accent-dark: #1f544b;
  --warning: #9b5d19;
  --danger: #9b2f2f;
  --ok: #26744d;
  --shadow: 0 18px 50px rgba(52, 48, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  min-width: 0;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

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

select,
input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  color: var(--text);
  padding: 0 12px;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 24px;
}

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

.language-select {
  width: auto;
  min-width: 140px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.topbar h1,
.section-heading h2,
.checkout-panel h2 {
  margin: 0;
  line-height: 1.1;
}

.topbar h1 {
  font-size: clamp(28px, 4.4vw, 48px);
  max-width: 780px;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

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

.side-panel,
.main-panel,
.checkout-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.side-panel {
  align-self: start;
  position: sticky;
  top: 18px;
  padding: 18px;
}

.main-panel {
  padding: 22px;
}

.field-label,
.label {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-panel {
  display: grid;
  gap: 10px;
}

.auth-panel .field-label {
  margin-bottom: -2px;
}

.auth-header {
  display: grid;
  gap: 10px;
}

.auth-signed-out,
.auth-signed-in {
  display: grid;
  gap: 10px;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
}

.segment {
  min-height: 38px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
}

.segment.active {
  background: var(--accent);
  color: white;
}

.auth-note,
.auth-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-hint {
  margin-top: -2px;
}

.account-email {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.status-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.status-block strong {
  display: block;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

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

.section-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.section-heading.compact {
  align-items: center;
  margin-top: 26px;
}

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

.notice {
  display: grid;
  gap: 4px;
  margin: 0 0 18px;
  border: 1px solid #b8d8c8;
  border-radius: 8px;
  background: #edf8f2;
  color: var(--accent-dark);
  padding: 14px 16px;
}

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

.notice-list {
  display: grid;
  gap: 5px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 13px;
}

.notice.quiet {
  border-color: var(--border);
  background: #fffaf0;
}

.product-card {
  display: grid;
  min-height: 280px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  padding: 18px;
  gap: 14px;
}

.product-card h3 {
  margin: 0;
  font-size: 22px;
}

.price {
  font-size: 28px;
  font-weight: 850;
}

.feature-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 14px;
}

.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--panel-strong);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.checkout-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
  background: #fbf7ed;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

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

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

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

.row strong {
  display: block;
}

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

.status-pill {
  border-radius: 999px;
  padding: 5px 9px;
  background: #eee8dc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.active,
.status-pill.processed,
.status-pill.paid {
  background: #ddf1e6;
  color: var(--ok);
}

.status-pill.refunded,
.status-pill.expired {
  background: #f7e0dc;
  color: var(--danger);
}

.status-pill.review_required {
  background: #f7ead5;
  color: var(--warning);
}

.hidden {
  display: none !important;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(32, 33, 31, 0.34);
}

.modal {
  width: min(460px, 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 20px;
}

.modal h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.modal-copy {
  margin: 12px 0 18px;
  color: var(--muted);
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100% - 36px));
  border-radius: 8px;
  background: #1f2724;
  color: white;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .workspace,
  .two-column,
  .product-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1220px);
    padding-top: 10px;
  }

  .topbar,
  .section-heading {
    display: grid;
  }

  .topbar h1 {
    font-size: clamp(30px, 13vw, 54px);
  }

  .main-panel,
  .side-panel,
  .checkout-panel,
  .product-card {
    padding: 14px;
  }
}
