:root {
  --bg: #0f1420;
  --panel: #171f2f;
  --panel-2: #1f2a3d;
  --text: #f3f7ff;
  --muted: #b9c4d8;
  --line: rgba(255,255,255,0.14);
  --accent: #f2b84b;
  --accent-2: #79d0ff;
  --danger: #ffcf8c;
  --shadow: 0 18px 50px rgba(0,0,0,0.35);
}
* { 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;
  background: radial-gradient(circle at top left, #233453 0, #101725 42%, #090d15 100%);
  color: var(--text);
  line-height: 1.55;
}
a { color: var(--accent-2); }
.wrap { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }
.hero { padding: 72px 0 44px; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.5fr 0.9fr; gap: 32px; align-items: center; }
.eyebrow { color: var(--accent); text-transform: uppercase; font-weight: 800; letter-spacing: 0.14em; font-size: 0.78rem; margin: 0 0 10px; }
h1 { font-size: clamp(2.5rem, 7vw, 5.4rem); line-height: 0.95; margin: 0 0 22px; letter-spacing: -0.05em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); line-height: 1.1; margin: 0 0 16px; letter-spacing: -0.03em; }
h3 { margin: 0 0 10px; }
.lead { font-size: 1.25rem; color: var(--muted); max-width: 760px; }
.section { padding: 40px 0; }
.two-col { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; }
.status-card, .notice, .preview-box, .company-card, .draft-card, details {
  background: rgba(23,31,47,0.82);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.status-card { padding: 24px; }
.status-card h2 { font-size: 1.2rem; }
dt { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
dd { margin: 0 0 14px; font-weight: 700; }
.small { color: var(--muted); font-size: 0.92rem; }
.hero-actions, .picker-actions, .template-row, .draft-actions, .share-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text); text-decoration: none;
  background: var(--panel-2); cursor: pointer; font-weight: 800;
}
.button.primary { background: var(--accent); color: #15110a; border-color: transparent; }
.button.secondary { background: rgba(255,255,255,0.07); }
.button.ghost { background: transparent; }
.button:hover { filter: brightness(1.08); }

.button.gmail {
  background: #fff;
  color: #3c4043;
  border-color: #dadce0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.button.gmail::before {
  content: "✉";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 4px;
  color: #d93025;
  font-weight: 900;
}
.button.gmail:hover, .button.gmail:focus {
  filter: none;
  background: #fff5f5;
  border-color: #d93025;
}
.share-text {
  margin-top: 12px;
  min-height: 180px;
  background: rgba(0,0,0,0.28);
}
#nativeShare.hidden { display: none !important; }

.notice { padding: 20px; }
.notice.warning { border-color: rgba(242,184,75,0.5); background: rgba(242,184,75,0.1); }
.bill-summary { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 20px; }
.section-head.tight { margin-bottom: 6px; }
.form-grid, .filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
label { display: grid; gap: 6px; color: var(--muted); font-weight: 700; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 13px; background: rgba(0,0,0,0.22); color: var(--text);
  font: inherit;
}
textarea { resize: vertical; }
.full-label { margin-top: 14px; }
.checkbox-line { display: flex; flex-direction: row; gap: 10px; align-items: center; }
.checkbox-line input { width: auto; }
.template-row { margin: 16px 0; justify-content: space-between; align-items: end; }
.preview-box { padding: 20px; }
pre { white-space: pre-wrap; word-wrap: break-word; color: #e8eefc; margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.company-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.company-card { padding: 16px; box-shadow: none; }
.company-top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.company-title { display: flex; gap: 10px; align-items: start; }
.company-title input { width: auto; margin-top: 6px; }
.company-name { font-size: 1.1rem; font-weight: 900; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pill { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; color: var(--muted); font-size: 0.8rem; }
a.pill { text-decoration: none; }
a.pill:hover, a.pill:focus { filter: brightness(1.18); background: rgba(255,255,255,0.07); outline: none; }
.pill.good { color: #b5ffc9; border-color: rgba(181,255,201,0.4); }
.pill.warn { color: var(--danger); border-color: rgba(255,207,140,0.4); }
details:target { border-color: rgba(121,208,255,0.75); box-shadow: 0 0 0 3px rgba(121,208,255,0.12); }
.drafts { display: grid; gap: 14px; margin-top: 16px; }
.draft-card { padding: 18px; }
.draft-card h3 { margin-bottom: 4px; }
.draft-to { color: var(--muted); word-break: break-word; }
.draft-stats { color: var(--muted); margin: 14px 0; }
.details { display: grid; gap: 12px; }
details { padding: 14px 18px; box-shadow: none; }
summary { cursor: pointer; font-weight: 900; }
table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 0.92rem; }
th, td { border-top: 1px solid var(--line); padding: 9px; text-align: left; vertical-align: top; }
th { color: var(--accent); }
.footer { padding: 36px 0; color: var(--muted); border-top: 1px solid var(--line); }
.hidden { display: none !important; }
@media (max-width: 900px) {
  .hero-grid, .two-col, .form-grid, .filters, .company-list { grid-template-columns: 1fr; }
  .section-head { align-items: start; flex-direction: column; }
}

/* Email-method chooser for quick company-card links */
button.pill {
  font: inherit;
  background: transparent;
  cursor: default;
}
.pill-button {
  cursor: pointer;
}
.pill-button:hover, .pill-button:focus {
  filter: brightness(1.18);
  background: rgba(255,255,255,0.07);
  outline: none;
}
.inline-email {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.inline-email:hover, .inline-email:focus {
  color: #bdeaff;
  outline: none;
}
.email-modal.hidden { display: none; }
.email-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}
.email-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.68);
  backdrop-filter: blur(5px);
}
.email-modal-card {
  position: relative;
  width: min(680px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 22px;
}
.email-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}
.email-modal-head h2 { margin-bottom: 6px; }
.modal-close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.07);
  color: var(--text);
  font: inherit;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover, .modal-close:focus { filter: brightness(1.12); }
.email-choice-recipients {
  margin: 14px 0;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.22);
  color: var(--muted);
  word-break: break-word;
}
.email-choice-actions { margin: 16px 0 12px; }
body.modal-open { overflow: hidden; }
