:root {
  --bg: #f7f7f4;
  --surface: #ffffff;
  --text: #1b1d1c;
  --muted: #545a57;
  --line: #d9dbd6;
  --accent: #0f766e;
  --accent-text: #ffffff;
  --neg: #b42318;
  --warn-bg: #fff4d6;
  --warn-line: #d9a400;
  --focus: #2563eb;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121413;
    --surface: #1b1e1d;
    --text: #ecefed;
    --muted: #a7aeaa;
    --line: #333836;
    --accent: #2dd4bf;
    --accent-text: #06201d;
    --neg: #ff8a80;
    --warn-bg: #3a2f0b;
    --warn-line: #b38900;
    --focus: #93c5fd;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
main, .top, footer { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-top: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.top nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
h1 { font-size: clamp(26px, 5vw, 36px); line-height: 1.15; margin: 28px 0 8px; }
h2 { font-size: 21px; margin: 32px 0 8px; }
h3 { font-size: 17px; }
.lede { color: var(--muted); margin: 0 0 20px; max-width: 70ch; }
.small, .hint { font-size: 13px; color: var(--muted); }

.tool form { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.mode { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.mode legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.seg { display: inline-flex; flex-direction: row; align-items: center; font-weight: 500; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.seg:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
input[type=number], input[type=text], input[type=email], select {
  font: inherit; font-weight: 400; width: 100%; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text);
}
.extra { display: grid; gap: 10px; margin-top: 12px; }
.extra:empty { display: none; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
[data-view=profit] .when-price, [data-view=price] .when-profit { display: none; }

.results { margin-top: 16px; display: grid; gap: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.card summary { cursor: pointer; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; list-style: none; }
.card summary::-webkit-details-marker { display: none; }
.card summary .sub { grid-column: 1 / -1; }
.name { font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.big { font-size: 22px; font-weight: 700; }
.big.neg { color: var(--neg); }
.sub { font-size: 14px; color: var(--muted); }
.badge { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--muted); }
.badge.warn { border-color: var(--warn-line); background: var(--warn-bg); color: var(--text); }
.solo .name { margin-bottom: 4px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
td, th { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; }
td:last-child, th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.lines { margin-top: 10px; }
.lines .total td { font-weight: 700; border-bottom: 0; }
.notes { font-size: 13px; color: var(--muted); padding-left: 18px; }
.src { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.dispute { font-size: 13px; background: var(--warn-bg); border-left: 4px solid var(--warn-line); padding: 8px 10px; border-radius: 6px; overflow-wrap: anywhere; }
.others-h { margin: 18px 0 6px; }
.others .me td { font-weight: 700; }

.pro { margin-top: 28px; background: var(--surface); border: 2px solid var(--accent); border-radius: 12px; padding: 16px; }
.pro h2 { margin-top: 0; }
.pro form { display: grid; gap: 10px; max-width: 480px; }
.pro .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
button { font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-text); border: 0; border-radius: 8px; padding: 10px 16px; cursor: pointer; justify-self: start; }
.status { font-weight: 600; margin: 8px 0 0; }
.status:empty { display: none; }

.guide ul.cols { columns: 2 220px; padding-left: 18px; }
.log { padding-left: 18px; }
.log time { font-variant-numeric: tabular-nums; font-weight: 600; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
footer { margin-top: 48px; padding-top: 16px; padding-bottom: 32px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.grid label { justify-content: space-between; }
