:root {
  --bg: #f7f7f4;
  --card: #ffffff;
  --ink: #1c1d1f;
  --muted: #5d6066;
  --line: #e3e3de;
  --accent: #0f6e5c;
  --accent-ink: #ffffff;
  --accent-soft: #e5f2ee;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --warn: #8a5a00;
  --warn-soft: #fff4dc;
  --ok: #167347;
  --radius: 10px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
code { font: 0.92em ui-monospace, SFMono-Regular, Consolas, monospace; background: #efefea; padding: 1px 5px; border-radius: 4px; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { border-bottom: 1px solid var(--line); background: var(--card); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; }
.brand small { font-weight: 500; color: var(--muted); }
.top nav { display: flex; gap: 18px; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; }
.top nav a:hover { color: var(--ink); }

.hero { padding: 48px 16px 24px; }
h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.01em; max-width: 22ch; }
.lead { font-size: 18px; color: #33363a; max-width: 62ch; margin: 0 0 10px; }
.hero-note { color: var(--muted); margin: 0; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 40px; }
.step { margin-bottom: 22px; }
.step.dim { opacity: 0.45; }
h3 { font-size: 18px; margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 700; flex: none; }
.lbl { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
input[type="password"], input[type="text"], input:not([type]), select { font: inherit; padding: 10px 12px; border: 1px solid #c9cac4; border-radius: 8px; background: #fff; color: var(--ink); width: 100%; max-width: 460px; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, .drop:focus-within { outline: 3px solid #7bc4b3; outline-offset: 2px; }
.hint { color: var(--muted); font-size: 14.5px; margin: 8px 0 0; max-width: 70ch; }
.drop { display: block; border: 2px dashed #c3c5bd; border-radius: var(--radius); padding: 22px 16px; text-align: center; cursor: pointer; background: #fbfbf9; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
#file-name { font-weight: 600; word-break: break-all; }
.opts { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 14px; font-size: 15px; }
.opts select { width: auto; margin-left: 6px; padding: 6px 8px; }
.check { display: flex; gap: 8px; align-items: flex-start; max-width: 520px; }
.check input { margin-top: 5px; }

.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn { font: inherit; font-weight: 600; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 11px 18px; border-radius: 8px; cursor: pointer; min-height: 44px; }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn.secondary { background: #fff; color: var(--accent); }
.btn.small { padding: 7px 12px; min-height: 36px; font-size: 14.5px; }
.btn:disabled { background: #e8e8e3; border-color: #d8d8d2; color: #6c6e72; cursor: not-allowed; }
.link { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; }
.msg { color: var(--bad); font-weight: 600; margin: 12px 0 0; min-height: 0; }
.msg:empty { display: none; }
.banner { background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 14px; margin-bottom: 18px; font-size: 15px; }

.progress { margin-top: 18px; }
.bar { height: 10px; background: #ecece7; border-radius: 99px; overflow: hidden; }
#bar-fill { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s ease; }
#progress-text { margin: 8px 0; color: var(--muted); font-size: 15px; }

#result { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 22px; }
#result-h { font-size: 22px; display: block; }
#result-h:focus { outline: none; }
.sub { color: var(--muted); margin: 0 0 14px; font-size: 15px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip { font: inherit; font-size: 14.5px; border: 1px solid var(--line); background: #fff; padding: 6px 12px; border-radius: 99px; cursor: pointer; color: var(--ink); min-height: 36px; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.row { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; background: #fff; }
.r-error { border-left: 4px solid var(--bad); }
.r-change { border-left: 4px solid var(--accent); }
.row-h { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.row-h a, .row-h > span:first-child { font-weight: 600; word-break: break-word; }
.meta { color: var(--muted); font-size: 13.5px; }
.row ul { margin: 8px 0 0; padding-left: 18px; font-size: 15px; }
.row li { margin: 3px 0; overflow-wrap: anywhere; }
.from { color: var(--muted); text-decoration: line-through; text-decoration-color: #b9bab5; }
.to { font-weight: 600; }
.from, .to { white-space: pre-wrap; }
.arrow { color: var(--muted); }
.errs li { color: var(--bad); }
.chg.muted { opacity: 0.6; }
.res { font-size: 13.5px; font-weight: 600; padding: 1px 8px; border-radius: 99px; white-space: nowrap; }
.res.ok { background: #e3f4ea; color: var(--ok); }
.res.bad { background: var(--bad-soft); color: var(--bad); white-space: normal; }
.res.wait { background: var(--warn-soft); color: var(--warn); }
.empty { color: var(--muted); }
.apply { margin-top: 18px; padding: 18px; background: #fafaf7; border: 1px solid var(--line); border-radius: var(--radius); }
.apply > p:first-child { margin-top: 0; }
.done-line { font-weight: 600; }
.free-left { color: var(--muted); margin: 0 0 10px; }
.undo-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.upsell { margin-top: 16px; padding: 14px; border-radius: 8px; background: var(--accent-soft); }
.upsell p { margin: 0 0 10px; }

.prose { margin-bottom: 40px; }
.prose h2 { font-size: 24px; margin: 0 0 12px; }
.prose p, .prose li { max-width: 70ch; }
.fields li { margin: 6px 0; }
.plans { display: grid; grid-template-columns: 1fr 1.3fr; gap: 16px; }
.plan { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.plan.main { border-color: var(--accent); }
.plan h3 { margin-bottom: 4px; }
.price { font-size: 30px; font-weight: 700; margin: 0 0 6px; }
.price small { font-size: 15px; font-weight: 500; color: var(--muted); }
.key-box { margin-top: 12px; }
.key-box code { font-size: 15px; }
.license { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.license label { font-weight: 600; font-size: 15px; width: 100%; }
.license input { flex: 1 1 200px; max-width: 320px; }
details { border-bottom: 1px solid var(--line); padding: 12px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; color: #33363a; }

.foot { border-top: 1px solid var(--line); background: var(--card); padding: 22px 0 30px; font-size: 14.5px; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 8px; }
.foot p { margin: 4px 0; }

@media (max-width: 640px) {
  .hero { padding-top: 30px; }
  .card { padding: 18px 14px; }
  .plans { grid-template-columns: 1fr; }
  .top nav { gap: 14px; font-size: 14px; }
  .top nav a, .banner .link, #last-undo .link { display: inline-flex; align-items: center; min-height: 32px; }
  .check { min-height: 32px; }
  .check input { width: 24px; height: 24px; margin-top: 0; flex: none; }
  summary { min-height: 32px; padding: 4px 0; box-sizing: border-box; }
  .brand, .foot nav a, .foot p a, .prose .hint a, #last-undo .link, .notify { display: inline-flex; align-items: center; min-height: 32px; }
  .actions .btn { flex: 1 1 100%; }
}

.notify { display: inline-block; margin-left: 12px; font-size: 14.5px; }
@media (max-width: 640px) { .notify { margin: 8px 0 0; } }

.notes { margin: 6px 0 0; padding-left: 18px; color: #7a5a00; font-size: 14.5px; }

/* Line Item Price Refresh additions */
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline input { flex: 1 1 240px; }
.ok-line { color: var(--ok); font-weight: 600; margin: 8px 0 0; }
.ok-line:empty { display: none; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.choices { display: grid; gap: 6px; margin: 10px 0; }
.choices:empty { display: none; }
.choice { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-height: 44px; cursor: pointer; background: #fff; }
.choice input { width: 20px; height: 20px; flex: none; }
.prices { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 12px; }
.prices label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; flex: 1 1 180px; max-width: 240px; }
.prices small { font-weight: 400; color: var(--muted); }
.stages { display: grid; gap: 12px; margin-bottom: 12px; }
.pipe { border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px 10px; margin: 0; min-width: 0; }
.pipe legend { font-weight: 600; padding: 0 6px; }
.pipe .check { margin: 4px 0; align-items: center; min-height: 32px; }
.pipe .check input, .pick { width: 20px; height: 20px; margin: 0; flex: none; }
.pick-l { display: inline-flex; gap: 8px; align-items: center; min-height: 32px; cursor: pointer; }
.note { margin: 8px 0 0; color: var(--warn); font-size: 14.5px; }
#deals-box h4 { margin: 18px 0 6px; font-size: 16px; }
.deal-list { margin: 0; padding-left: 18px; font-size: 15px; }
.deal-list li { margin: 4px 0; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .inline .btn { flex: 1 1 100%; }
  .prices label { max-width: none; }
}
