/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #000000;
  --bg-sidebar: #0a0a0a;
  --border: #1a1a1a;
  --border-light: #2a2a2a;
  --text: #e8e8e8;
  --text-secondary: #b8b8b8;
  --text-dim: #b8b8b8;
  --accent: #ffffff;
  --sheet-bg: #ffffff;
  --sheet-header: #f3f3f3;
  --sheet-border: #d0d0d0;
  --sheet-text: #1a1a1a;
  --sheet-num: #666666;
  --btn-bg: #ffffff;
  --btn-text: #000000;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Outfit', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* ── Banner ── */
.banner {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
}

.banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Fade to black at the bottom — merges into description */
.banner-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to bottom, transparent, #000000);
  pointer-events: none;
}

/* Logo + heading centred vertically, left-aligned */
.banner-identity {
  position: absolute;
  top: 50%;
  left: 40px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
}

.banner-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.banner-text {
  font-size: 2.7rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

a { color: var(--text-secondary); text-decoration: none; }
a:hover { color: var(--text); }

/* ── Description (below banner) ── */
.description {
  padding: 10px 40px 0 40px;
  font-size: 1.02rem;
  font-weight: 300;
  color: #b8b8b8;
  line-height: 1.6;
  max-width: 720px;
}

/* ── Page Layout ── */
.page {
  display: flex;
  flex: 1;
  padding: 6px 40px 0 40px;
  gap: 32px;
  overflow: hidden;
}

.col-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.col-sidebar {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  margin-top: -20px;
}

/* (header and old description removed — now using banner + top-level description) */

/* ── Spreadsheet Preview ── */
.sheet-container {
  background: var(--sheet-bg);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  margin-top: 20px;
}

.sheet-scroll {
  flex: 1;
  overflow: auto;
}

/* Scrollbar styling for the sheet */
.sheet-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.sheet-scroll::-webkit-scrollbar-track {
  background: #f0f0f0;
}

.sheet-scroll::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 4px;
}

.sheet-scroll::-webkit-scrollbar-thumb:hover {
  background: #a0a0a0;
}

.sheet-scroll::-webkit-scrollbar-corner {
  background: #f0f0f0;
}

/* Table — styled like Google Sheets */
table.sheet {
  border-collapse: collapse;
  font-family: 'DM Mono', 'Consolas', monospace;
  font-size: 11px;
  color: var(--sheet-text);
  white-space: nowrap;
}

table.sheet thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--sheet-header);
  border-bottom: 2px solid var(--sheet-border);
  border-right: 1px solid var(--sheet-border);
  padding: 6px 12px;
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  color: var(--sheet-text);
  user-select: none;
}

table.sheet tbody td {
  border-bottom: 1px solid #e8e8e8;
  border-right: 1px solid #e8e8e8;
  padding: 4px 10px;
  vertical-align: top;
  line-height: 1.4;
}

table.sheet tbody tr:hover td {
  background: #e8f0fe;
}

/* Row numbers */
.row-num {
  background: var(--sheet-header) !important;
  color: var(--sheet-num) !important;
  text-align: center !important;
  font-size: 10px !important;
  width: 32px;
  min-width: 32px;
  border-right: 2px solid var(--sheet-border) !important;
  user-select: none;
  position: sticky;
  left: 0;
  z-index: 1;
}

thead .row-num {
  z-index: 3 !important;
}

/* Numeric cells */
td.num {
  text-align: right;
}

/* Role titles — wrap over 2 lines */
.role-titles {
  white-space: normal;
  width: 510px;
  min-width: 510px;
}

/* ── Checkout Sidebar ── */
.checkout-card {
  width: 100%;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 18px;
}

.checkout-heading {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 28px;
}

.checkout-qty {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 18px;
}

.product-box {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 32px;
}

.product-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.product-detail {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.checkout-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 24px;
}

.checkout-price .currency {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-dim);
  vertical-align: middle;
}

.checkout-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.checkout-meta:last-of-type {
  margin-bottom: 0;
}

.checkout-btn {
  display: block;
  width: 100%;
  margin-top: 48px;
  padding: 14px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s ease;
  text-decoration: none;
}

.checkout-btn:hover {
  opacity: 0.88;
  color: var(--btn-text);
}

.checkout-powered {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 14px;
  margin-bottom: 10px;
}

.checkout-tos {
  text-align: center;
  font-size: 0.68rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.checkout-tos a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.checkout-tos a:hover {
  color: var(--text);
}

/* ── Footer ── */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 40px;
  font-size: 0.68rem;
  color: var(--text-dim);
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.footer-links {
  display: flex;
  gap: 16px;
}

.footer-links a {
  color: var(--text-dim);
  font-size: 0.68rem;
}

.footer-links a:hover { color: var(--text-secondary); }

/* ── ToS Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #111111;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 36px;
  max-width: 560px;
  width: 90%;
  position: relative;
}

.modal-content h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.modal-body {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.modal-body a {
  color: var(--text);
  text-decoration: underline;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-scroll .modal-body {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 8px;
}

.modal-scroll .modal-body::-webkit-scrollbar {
  width: 6px;
}

.modal-scroll .modal-body::-webkit-scrollbar-track {
  background: transparent;
}

.modal-scroll .modal-body::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}

.modal-body h3 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 20px;
  margin-bottom: 8px;
}

.modal-body p {
  margin-bottom: 10px;
}

.legal-updated {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 16px !important;
}

/* ── Download Page (preserved) ── */
.download-page {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.download-card {
  background: #0f0f0f;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 56px 48px;
  max-width: 520px;
  width: 100%;
}

.download-card .check-icon {
  width: 64px;
  height: 64px;
  background: rgba(52, 211, 153, 0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 1.8rem;
}

.download-card h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.download-card .subtitle {
  color: var(--text-secondary);
  margin-bottom: 36px;
}

.btn-download {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.15s ease;
  margin-bottom: 12px;
  text-decoration: none;
}

.btn-download:hover {
  opacity: 0.88;
  color: var(--btn-text);
}

.btn-secondary {
  display: block;
  width: 100%;
  padding: 14px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  border-color: var(--text-dim);
  color: var(--text);
}

.download-note {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ── Error/Loading States ── */
.loading {
  color: var(--text-dim);
  font-size: 1rem;
}

.error-card {
  background: #0f0f0f;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 16px;
  padding: 56px 48px;
  max-width: 520px;
  width: 100%;
  text-align: center;
}

.error-card h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #f87171;
  margin-bottom: 12px;
}

.error-card p {
  color: var(--text-secondary);
  margin-bottom: 8px;
}
