/* See /docs/building/master-prompt.md */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #14201b;
  --muted: #5f6f69;
  --muted-soft: #8a978f;
  --line: #e7e2d9;
  --field-bg: #fbfaf7;
  --field-line: #e0dace;
  --emerald: #047857;
  --emerald-deep: #065f46;
  --emerald-tint: #edf7f1;
  --emerald-line: #bfe0d0;
  --sand-tint: #fbf3e6;
  --sand-line: #f0dcb8;
  --sand-ink: #b45309;
  --radius-card: 16px;
  --radius-calc: 22px;
  --radius-field: 11px;
  --shadow-calc: 0 18px 50px rgba(20, 32, 27, 0.08);
  --shadow-soft: 0 4px 24px rgba(20, 32, 27, 0.05);
  --font: 'DM Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235f6f69' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

.noscript {
  padding: 1rem;
  background: #fef2f2;
  color: #991b1b;
  text-align: center;
}

/* Hero */
.hero {
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(4, 120, 87, 0.1), transparent 55%),
    radial-gradient(ellipse 70% 55% at 100% 0%, rgba(180, 83, 9, 0.08), transparent 50%),
    var(--bg);
  padding: 1.25rem 1.5rem 3.5rem;
  border-bottom: 1px solid var(--line);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1080px;
  margin: 0 auto 2rem;
}

.brand {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand span { color: var(--emerald); }

.nav-link {
  color: var(--emerald-deep);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.45rem 1rem;
  border: 1.5px solid var(--emerald-line);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.nav-link:hover {
  border-color: var(--emerald);
  box-shadow: var(--shadow-soft);
}

.hero-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--emerald);
  margin: 0 0 0.5rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  line-height: 1.1;
  margin: 0 0 0.75rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-wrap: balance;
  max-width: 18ch;
}

.lead {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 40rem;
  margin: 0 0 1.15rem;
  text-wrap: pretty;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.38rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
}

.trust-row span::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--emerald);
  flex-shrink: 0;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* Calculator */
.calc-section {
  margin-top: -2rem;
  position: relative;
  z-index: 2;
}

.calc-card {
  background: var(--surface);
  border-radius: var(--radius-calc);
  box-shadow: var(--shadow-calc);
  border: 1px solid var(--line);
  overflow: hidden;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.calc-inputs {
  padding: 1.85rem;
}

.calc-overline {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-soft);
  margin: 0 0 1.1rem;
}

.calc-result {
  padding: 1.85rem;
  background: linear-gradient(155deg, var(--emerald-deep) 0%, var(--emerald) 100%);
  border-left: 1px solid var(--emerald-line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
}

.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.field input,
.field select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-field);
  font: inherit;
  font-size: 1rem;
  background: var(--field-bg);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field select {
  appearance: none;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.18);
  background: var(--surface);
}

.salary-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

.salary-row input { min-width: 0; }

.salary-row select {
  min-width: 8.5rem;
  padding: 0.7rem 2rem 0.7rem 0.75rem;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-field);
  font: inherit;
  background-color: var(--field-bg);
  appearance: none;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  cursor: pointer;
}

.salary-row select:focus {
  outline: none;
  border-color: var(--emerald);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.18);
  background-color: var(--surface);
}

.schedule-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.25rem;
}

.preset-chip {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--field-bg);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.preset-chip:hover {
  border-color: var(--emerald-line);
  color: var(--emerald-deep);
}

.preset-chip.is-active {
  background: var(--emerald-tint);
  border-color: var(--emerald-line);
  color: var(--emerald-deep);
}

.result-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.75);
  margin: 0 0 0.35rem;
}

.hourly-rate {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: clamp(2.6rem, 6vw, 3.6rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.65rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.rate-unit {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 600;
  letter-spacing: 0;
  opacity: 0.85;
}

.copy-btn {
  align-self: flex-start;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.copy-btn.is-copied {
  background: rgba(255, 255, 255, 0.25);
}

.copy-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gross-note {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 1rem;
}

.breakdown {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.chip {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-field);
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
}

.chip small {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 700;
}

.chip strong {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 700;
}

/* Formula strip */
.formula-strip {
  margin: 3rem 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

.formula-strip h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 0.5rem;
}

.formula-strip .section-intro {
  color: var(--muted);
  margin: 0 0 1.15rem;
  text-wrap: pretty;
}

.flow {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.flow-step {
  flex: 1;
  text-align: left;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-field);
  min-width: 0;
}

.flow-step.salary { background: var(--sand-tint); border: 1px solid var(--sand-line); }
.flow-step.hours { background: var(--field-bg); border: 1px solid var(--field-line); }
.flow-step.result { background: var(--emerald-tint); border: 1px solid var(--emerald-line); }

.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.flow-step.salary .icon-chip { color: var(--sand-ink); border-color: var(--sand-line); }
.flow-step.result .icon-chip { color: var(--emerald-deep); border-color: var(--emerald-line); }

.flow-step small {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.flow-step strong {
  display: block;
  font-size: 0.98rem;
  margin-top: 0.2rem;
  color: var(--ink);
}

.flow-arrow {
  display: flex;
  align-items: center;
  color: var(--muted-soft);
  font-size: 1.35rem;
  font-weight: 700;
  flex-shrink: 0;
}

.formula-mono {
  font-family: var(--mono);
  font-size: 0.88rem;
  text-align: center;
  padding: 0.85rem 1rem;
  background: var(--field-bg);
  border: 1px solid var(--field-line);
  border-radius: 999px;
  color: var(--ink);
  margin: 0;
}

/* Sections */
.section {
  margin: 3rem 0;
}

.section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0 0 0.5rem;
}

.section > p {
  color: var(--muted);
  margin: 0 0 1.25rem;
  text-wrap: pretty;
}

/* Table */
.ref-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.ref-table th {
  background: var(--field-bg);
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.ref-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--line);
}

.ref-table tr:last-child td { border-bottom: none; }
.ref-table tr:nth-child(even) td { background: #faf9f6; }
.ref-table td:last-child { font-weight: 700; color: var(--emerald-deep); }

/* Formula cards */
.formula-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.formula-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1.25rem;
}

.formula-card .card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  border: 1px solid var(--line);
  background: var(--field-bg);
  color: var(--muted);
}

.formula-card:nth-child(1) .card-icon {
  background: var(--sand-tint);
  border-color: var(--sand-line);
  color: var(--sand-ink);
}

.formula-card:nth-child(2) .card-icon {
  background: var(--emerald-tint);
  border-color: var(--emerald-line);
  color: var(--emerald-deep);
}

.formula-card h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.formula-card p {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.formula-card code {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--field-bg);
  border: 1px solid var(--field-line);
  padding: 0.65rem;
  border-radius: var(--radius-field);
  line-height: 1.5;
  color: var(--ink);
}

.formula-card .example {
  font-family: var(--mono);
  font-size: 0.82rem;
  margin-top: 0.65rem;
  color: var(--emerald-deep);
  font-weight: 500;
}

/* Work year */
.workyear-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 1.5rem;
}

.hours-badge {
  text-align: center;
  background: var(--emerald-tint);
  border: 2px solid var(--emerald-line);
  border-radius: 14px;
  padding: 1rem 1.5rem;
  min-width: 9rem;
}

.hours-badge strong {
  display: block;
  font-size: 1.05rem;
  color: var(--emerald-deep);
  line-height: 1.3;
  font-weight: 800;
}

.hours-badge span {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

/* FAQ */
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-field);
  margin-bottom: 0.5rem;
}

.faq summary {
  padding: 1rem 2.5rem 1rem 1.15rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: '+';
  position: absolute;
  right: 1.15rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--muted-soft);
  line-height: 1;
}

.faq details[open] summary::after { content: '−'; }

.faq details[open] summary {
  border-bottom: 1px solid var(--line);
  color: var(--emerald-deep);
}

.faq details p {
  padding: 1rem 1.15rem 1rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.legal-note {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--field-bg);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-field);
  font-size: 0.85rem;
  color: var(--muted);
}

/* Tools */
.tools-block .eyebrow { margin-bottom: 0.25rem; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.tool-card {
  display: block;
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.tool-card:hover {
  border-color: var(--emerald);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.tool-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.tool-card strong { display: block; margin-bottom: 0.35rem; }
.tool-card p { margin: 0; font-size: 0.88rem; color: var(--muted); }

.app-footer {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.app-footer a { color: var(--emerald-deep); }

@media (max-width: 768px) {
  .calc-grid { grid-template-columns: 1fr; }
  .calc-result { border-left: none; border-top: 1px solid var(--emerald-line); }
  .formula-cards { grid-template-columns: 1fr; }
  .workyear-box { grid-template-columns: 1fr; }
  .flow { flex-direction: column; align-items: stretch; }
  .flow-arrow { justify-content: center; transform: rotate(90deg); }
}
