/* LoadPR web — matched to the LoadPR iOS app: systemBlue, pure white, iOS
   "liquid glass". System font (SF on Apple devices) = the look + instant LCP. */
:root {
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f2f2f7;   /* iOS systemGray6 */
  --border: #d2d2d7;
  --hair: #e5e5ea;        /* systemGray5 */
  --ink: #1c1c1e;         /* label */
  --muted: #6e6e73;       /* secondaryLabel */
  --faint: #8e8e93;       /* systemGray */
  --blue: #007aff;        /* iOS systemBlue */
  --blue-press: #0a84ff;
  --ok: #34c759;          /* systemGreen */
  --seg-track: #ececf0;
  --seg-thumb: #ffffff;
  --radius: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --pill: 980px;
  --maxw: 980px;
  --nav-h: 48px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 30px rgba(0,0,0,.06);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.05), 0 24px 60px rgba(0,0,0,.09);
  --shadow-thumb: 0 3px 8px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:#000; --bg-alt:#0a0a0a; --surface:#1c1c1e; --surface-2:#1c1c1e;
    --border:#38383a; --hair:#2c2c2e; --ink:#f5f5f7; --muted:#98989f; --faint:#8e8e93;
    --blue:#0a84ff; --blue-press:#409cff; --ok:#30d158;
    --seg-track:#2c2c2e; --seg-thumb:#636366;
    --shadow:0 1px 2px rgba(0,0,0,.4), 0 8px 30px rgba(0,0,0,.5);
    --shadow-lg:0 24px 60px rgba(0,0,0,.6); --shadow-thumb:0 2px 6px rgba(0,0,0,.4);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: -.01em; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  padding-bottom: env(safe-area-inset-bottom);
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* frosted nav */
header.site {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hair);
}
header.site .wrap { display: flex; align-items: center; gap: 20px; height: var(--nav-h); }
.brand { font-weight: 600; letter-spacing: -.02em; font-size: 19px; color: var(--ink); }
.brand b { color: var(--blue); font-weight: 600; }
header.site nav { margin-left: auto; display: flex; gap: 26px; overflow-x: auto; scrollbar-width: none; }
header.site nav::-webkit-scrollbar { display: none; }
header.site nav a { color: var(--muted); font-size: 13px; font-weight: 400; white-space: nowrap; }
header.site nav a:hover { color: var(--ink); text-decoration: none; }
.langswitch { display: flex; gap: 10px; padding-left: 4px; }
.langswitch a { font-size: 12px; color: var(--faint); }
.langswitch a.on { color: var(--blue); font-weight: 600; }

main { padding: 0 0 90px; }
h1 { font-size: clamp(38px, 7vw, 68px); line-height: 1.05; letter-spacing: -.02em; font-weight: 700; margin: 56px 0 14px; }
h2 { font-size: clamp(24px, 3.4vw, 32px); line-height: 1.12; letter-spacing: -.015em; font-weight: 600; margin: 44px 0 12px; }
h3 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.intro { color: var(--muted); font-size: clamp(19px, 2.4vw, 24px); line-height: 1.42; font-weight: 400; letter-spacing: -.012em; margin: 0 auto 40px; max-width: 42ch; }

body.page-home h1 { text-align: center; margin-top: 72px; }
body.page-home .intro { text-align: center; }
body.page-prog h1 { margin-top: 52px; }

.tool-layout { display: grid; gap: 22px; }

/* App Store CTA */
.cta {
  display: flex; align-items: center; justify-content: center; gap: 12px 28px; flex-wrap: wrap; text-align: center;
  background: var(--surface-2); border-radius: var(--radius); padding: 34px 26px; margin: 44px 0;
}
.cta .cta-txt { max-width: 46ch; }
.cta h3 { font-size: clamp(22px, 3vw, 27px); letter-spacing: -.015em; margin-bottom: 4px; }
.cta p { margin: 0; color: var(--muted); font-size: 17px; }
.cta a.btn {
  background: var(--blue); color: #fff; padding: 13px 24px; border-radius: var(--pill);
  font-weight: 500; font-size: 17px; white-space: nowrap; letter-spacing: -.01em; transition: transform .12s, background .2s;
}
.cta a.btn:hover { background: var(--blue-press); text-decoration: none; }
.cta a.btn:active { transform: scale(.97); }

/* the tool card */
#lp-app {
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); max-width: 600px; margin: 0 auto; width: 100%;
}
body.page-home #lp-app, body.page-tool #lp-app { box-shadow: var(--shadow-lg); border-color: transparent; }
.lp-form { display: grid; gap: 18px; }
.lp-field { display: grid; gap: 7px; }
.lp-label { font-size: 13px; color: var(--muted); font-weight: 500; }
.lp-form input, .lp-form select {
  width: 100%; padding: 13px 14px; font-size: 17px; background: var(--surface-2); color: var(--ink);
  border: 1px solid transparent; border-radius: var(--radius-sm); letter-spacing: -.01em;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.lp-form select { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }
.lp-form input:focus, .lp-form select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 20%, transparent); }
.lp-bar-group { display: flex; gap: 10px; }
.lp-bar-group select { flex: 1; }
.lp-bar-group input { flex: 0 0 104px; }

/* iOS liquid-glass segmented control */
.lp-seg { display: inline-flex; background: var(--seg-track); border-radius: var(--pill); padding: 3px; gap: 2px; }
.lp-seg-btn { border: 0; background: transparent; color: var(--ink); padding: 9px 24px; border-radius: var(--pill); font-size: 15px; font-weight: 600; cursor: pointer; letter-spacing: -.01em; transition: background .2s, box-shadow .2s, color .2s; }
.lp-seg-btn.on { background: var(--seg-thumb); box-shadow: var(--shadow-thumb); }

.lp-inv { border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 2px 14px; background: var(--bg-alt); }
.lp-inv summary { cursor: pointer; padding: 11px 0; font-size: 14px; color: var(--muted); font-weight: 500; list-style: none; }
.lp-inv summary::-webkit-details-marker { display: none; }
.lp-inv summary::before { content: "＋ "; color: var(--faint); }
.lp-inv[open] summary::before { content: "－ "; }
.lp-inv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; padding: 6px 0 14px; }
.lp-inv-row { display: flex; align-items: center; gap: 9px; font-size: 15px; }
.lp-inv-row input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--blue); }
.lp-inv-w { flex: 1; }
.lp-count { flex: 0 0 82px; padding: 7px 9px !important; font-size: 13px !important; }

/* results */
.lp-out { margin-top: 20px; display: grid; gap: 14px; }
.lp-card { background: var(--surface-2); border-radius: var(--radius-md); padding: 20px; }
.lp-card.lp-exact { background: color-mix(in srgb, var(--ok) 9%, var(--surface-2)); }
.lp-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.lp-weight-big { font-size: clamp(34px, 8vw, 48px); font-weight: 300; letter-spacing: -.03em; line-height: 1; }
.lp-weight-big .lp-unit { font-size: .42em; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.lp-badge { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; align-self: center; }
.lp-exact .lp-badge { color: var(--ok); }
.lp-warn { color: #b25e00; font-weight: 500; margin: 0; font-size: 15px; }
@media (prefers-color-scheme: dark) { .lp-warn { color: #ffd60a; } }
.lp-diagram-wrap { margin: 12px 0 14px; }
.lp-diagram { max-height: 176px; display: block; }
.lp-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.lp-per-side { font-weight: 500; margin-right: 2px; }
.lp-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border-radius: var(--pill); padding: 6px 13px; font-size: 14px; font-weight: 600; color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair); }
.lp-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.lp-chip-empty { color: var(--muted); font-weight: 400; }

.lp-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.lp-table th, .lp-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--hair); }
.lp-table th { color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.lp-table tr:last-child td { border-bottom: 0; }

.lp-langbar { display: flex; align-items: center; gap: 12px; justify-content: center; flex-wrap: wrap; background: var(--surface-2); color: var(--ink); padding: 10px 16px; font-size: 14px; border-bottom: 1px solid var(--hair); }
.lp-btn-sm { background: var(--blue); color: #fff; border: 0; padding: 7px 16px; border-radius: var(--pill); font-weight: 500; font-size: 13px; cursor: pointer; }
.lp-btn-sm.ghost { background: transparent; color: var(--blue); }

.prose { max-width: 42rem; margin: 0 auto; }
.prose p, .prose li { color: var(--ink); font-size: 17px; line-height: 1.55; }
.prose ul { padding-left: 1.2em; }
.prose h2 { margin-top: 40px; }
.support { margin-top: 48px; }
.faq details { border-bottom: 1px solid var(--hair); padding: 4px 2px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 500; font-size: 18px; list-style: none; position: relative; padding-right: 30px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 22px; font-weight: 300; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 0 0 16px; color: var(--muted); }

.related { display: flex; flex-wrap: wrap; gap: 10px; margin: 40px 0; justify-content: center; }
.related a { background: var(--surface-2); padding: 9px 18px; border-radius: var(--pill); font-size: 15px; color: var(--ink); font-weight: 500; letter-spacing: -.01em; transition: background .18s; }
.related a:hover { background: var(--hair); text-decoration: none; }

footer.site { border-top: 1px solid var(--hair); background: var(--bg-alt); padding: 34px 0 28px; color: var(--muted); font-size: 13px; margin-top: 56px; }
footer.site .cols { display: flex; gap: 44px; flex-wrap: wrap; margin-bottom: 18px; }
footer.site .cols strong { display: block; color: var(--ink); font-size: 13px; margin-bottom: 8px; }
footer.site a { color: var(--muted); display: block; padding: 3px 0; }
footer.site a:hover { color: var(--ink); }
footer.site .priv { font-size: 12px; color: var(--faint); border-top: 1px solid var(--hair); padding-top: 16px; }

#lp-app:not(.lp-ready) .lp-form { opacity: .55; }

/* legal pages */
body.page-legal h1 { font-size: clamp(30px, 5vw, 42px); margin-top: 48px; text-align: left; }
.prose.legal h2 { font-size: 21px; margin-top: 34px; }
.prose.legal .legal-updated { color: var(--faint); font-size: 14px; }
.prose.legal a { text-decoration: underline; }

@media (prefers-reduced-motion: no-preference) {
  main h1, main .intro, #lp-app, .prose > * { animation: lp-rise .6s cubic-bezier(.16,.84,.44,1) both; }
  main .intro { animation-delay: .05s; }
  #lp-app { animation-delay: .1s; }
}
@keyframes lp-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
