:root {
  color-scheme: light;
  --ink: #101418;
  --muted: #5b6470;
  --line: #d7dee7;
  --panel: #ffffff;
  --paper: #f6f8fb;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --orange: #f59e0b;
  --blue: #2563eb;
  --red: #dc2626;
  --shadow: 0 14px 45px rgba(16, 20, 24, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  letter-spacing: 0;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand { font-weight: 800; font-size: 20px; }
.topbar nav { display: flex; gap: 18px; align-items: center; color: var(--muted); }

.hero {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 48px;
  align-items: center;
  padding: 54px 6vw 68px;
  background: #eef4f1;
}
.hero h1 {
  margin: 0;
  font-size: clamp(56px, 9vw, 112px);
  line-height: 0.9;
  letter-spacing: 0;
}
.eyebrow { margin: 0 0 18px; color: var(--brand-dark); font-weight: 700; }
.lead { max-width: 680px; font-size: 21px; line-height: 1.5; color: #27323a; }
.hero-actions, .form-actions, .toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.primary-link, .secondary-link, button {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--brand);
  padding: 9px 14px;
  cursor: pointer;
  background: var(--brand);
  color: white;
  font-weight: 700;
}
.secondary-link, button.secondary, button.ghost {
  background: white;
  color: var(--brand-dark);
}

.product-shot {
  background: #121820;
  color: white;
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  min-height: 420px;
}
.shot-toolbar { display: flex; gap: 8px; padding-bottom: 14px; color: #b8c4cf; }
.shot-toolbar span { border: 1px solid #344252; border-radius: 8px; padding: 7px 10px; }
.shot-grid { display: grid; gap: 10px; }
.mail-row {
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 8px 12px;
  align-items: center;
  background: #1b2530;
  border: 1px solid #304052;
  border-radius: 8px;
  padding: 14px;
}
.mail-row span { width: 10px; height: 10px; background: var(--blue); }
.mail-row.important span { background: var(--orange); }
.mail-row.muted span { background: #7c8794; }
.mail-row em { grid-column: 2; color: #b8c4cf; font-style: normal; }
.digest-preview {
  margin-top: 18px;
  background: #f8fafc;
  color: var(--ink);
  border-radius: 8px;
  padding: 16px;
}

.band, .pricing, .auth-panel {
  padding: 56px 6vw;
  border-top: 1px solid var(--line);
}
.band {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 0.7fr);
  gap: 32px;
  align-items: start;
  background: white;
}
h2 { margin: 0 0 14px; font-size: 30px; }
p { color: var(--muted); line-height: 1.55; }
.command-box, .auth-panel form, .message-form, .message-detail, .secret-once {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.command-box { display: grid; gap: 10px; background: #101418; color: #e5edf6; }
code { white-space: normal; overflow-wrap: anywhere; }

.pricing { background: #fbfaf7; }
.price-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.price-grid article {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}
.price-grid h3 { margin: 0 0 10px; }
.price-grid p { margin: 0; font-size: 28px; color: var(--ink); font-weight: 800; }

.auth-panel form {
  max-width: 440px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}
label { display: grid; gap: 6px; color: var(--muted); font-size: 14px; font-weight: 700; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
}
textarea { resize: vertical; }

.app-shell {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 220px 1fr;
  border-top: 1px solid var(--line);
  background: white;
}
.sidebar {
  border-right: 1px solid var(--line);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #f7f9fb;
}
.sidebar button {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  text-align: left;
}
.sidebar button.active {
  background: #e7f2ef;
  color: var(--brand-dark);
  border-color: #b8d5cc;
}
.workspace { padding: 24px; min-width: 0; }
.view { display: none; }
.view.active { display: block; }
.view-head {
  position: relative;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.filter-popover {
  position: absolute;
  right: 0;
  top: 46px;
  z-index: 5;
  width: min(280px, calc(100vw - 48px));
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
  box-shadow: var(--shadow);
}
.split {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(320px, 1fr);
  gap: 18px;
}
.inline-form, .message-form { display: grid; gap: 10px; margin-bottom: 14px; }
.check { display: flex; flex-direction: row; align-items: center; gap: 8px; }
.check input { width: auto; }
.message-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.message-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
  cursor: pointer;
}
.message-item .flag { width: 10px; height: 10px; background: var(--blue); }
.message-item.important .flag { background: var(--orange); }
.message-item.spam .flag { background: var(--red); }
.message-item small { color: var(--muted); }
.message-detail { min-height: 180px; overflow-wrap: anywhere; }
.rendered-mail {
  display: grid;
  gap: 10px;
  line-height: 1.55;
}
.rendered-mail h4, .rendered-mail h5, .rendered-mail p, .rendered-mail ul { margin: 0; }
.rendered-mail ul { padding-left: 22px; }
.rendered-mail a { color: var(--blue); text-decoration: underline; }
.link-copy {
  min-height: 26px;
  margin-left: 6px;
  padding: 2px 7px;
  font-size: 12px;
  background: white;
  color: var(--brand-dark);
}
.message-detail pre, .digest-list pre {
  white-space: pre-wrap;
  font-family: inherit;
  line-height: 1.5;
}
.table {
  display: grid;
  gap: 8px;
}
.table-row, .digest-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
  overflow-wrap: anywhere;
}
.secret-once {
  margin-bottom: 14px;
  background: #fff7ed;
  border-color: #fed7aa;
}
.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  border-radius: 8px;
  background: #101418;
  color: white;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.hidden { display: none !important; }

@media (max-width: 900px) {
  .hero, .band, .app-shell, .split {
    grid-template-columns: 1fr;
  }
  .hero { padding-top: 30px; }
  .app-shell { min-height: auto; }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    flex-direction: row;
    overflow-x: auto;
  }
  .view-head { flex-direction: column; }
  .topbar { padding: 0 16px; }
  .topbar nav { gap: 10px; font-size: 14px; }
}
