/* Portal styles. Colors and fonts come from ../assets/style.css */

body.app { --r: 8px; --shadow: 0 1px 0 rgba(13, 24, 48, 0.06), 0 14px 28px -22px rgba(13, 24, 48, 0.4); --ok: #138a5c; --bad: #cf3f37; }
@media (prefers-color-scheme: dark) { body.app { --ok: #3fc58e; --bad: #ff6b61; --shadow: 0 14px 28px -20px rgba(0, 0, 0, 0.8); } }

.top .who { font-size: 14px; font-weight: 600; color: var(--muted); text-align: right; }
.appnav { display: flex; gap: 4px 20px; flex-wrap: wrap; padding-block: 0 12px; font-weight: 600; font-size: 15px; }
.appnav a { color: var(--ink); text-decoration: none; padding-block: 4px; border-bottom: 3px solid transparent; }
.appnav a[aria-current="page"] { border-bottom-color: var(--signal); }
.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--muted); cursor: pointer; }
.linkbtn:hover { color: var(--ink); }

.appmain { padding-block: 28px 56px; display: grid; gap: 20px; }
.appmain h1 { font-size: clamp(30px, 6vw, 44px); font-stretch: 120%; }
.appmain h2 { font-size: 22px; font-stretch: 112%; }
.narrowbox { max-width: 520px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hp { position: absolute; left: -9999px; }

.flash { margin: 0; padding: 12px 16px; border-radius: 6px; border: 1px solid var(--ink); background: var(--surface); font-size: 15px; }
.flash.ok { border-color: var(--ok); color: var(--ok); }
.flash.error { border-color: var(--bad); color: var(--bad); }
.flash ul { margin: 6px 0 0; padding-left: 18px; }

/* forms */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px 18px; display: grid; gap: 16px; }
.panel.danger { border-color: var(--bad); }
.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field label, .lab { font-weight: 600; font-size: 14px; padding: 0; }
.help { font-size: 13px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], input[type="date"], input:not([type]), select, textarea {
  width: 100%; font: 400 16px/1.4 var(--sans); color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 6px; padding: 12px 13px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
textarea { min-height: 96px; resize: vertical; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts input { position: absolute; opacity: 0; pointer-events: none; }
.opts label { font: 500 14px/1 var(--sans); padding: 11px 13px; border-radius: 4px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.opts input:checked + label { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.opts input:focus-visible + label { outline: 2px solid var(--signal); outline-offset: 2px; }
.confirm { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); cursor: pointer; font-weight: 500; font-size: 15px; line-height: 1.45; }
.confirm input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--blue); }
.note { border-radius: 6px; padding: 13px 15px; background: color-mix(in srgb, var(--signal) 16%, var(--surface)); display: grid; gap: 4px; font-size: 14px; }
.note b { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.btn { cursor: pointer; font-family: var(--sans); background: transparent; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 13px; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.secondary { color: var(--on-deep); border-color: rgba(233, 237, 251, 0.5); }
.inlineform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inlineform input, .inlineform select { width: auto; min-width: 120px; }

/* deck */
.deckhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.deck { position: relative; height: clamp(450px, calc(100svh - 300px), 560px); max-width: 460px; width: 100%; margin: 4px auto 0; perspective: 1400px; touch-action: pan-y; }
.card { position: absolute; inset: 0; cursor: grab; transform-style: preserve-3d; transition: transform 0.55s cubic-bezier(0.2, 1.3, 0.35, 1), opacity 0.4s; user-select: none; }
.card.dragging { transition: none; cursor: grabbing; }
.card.flying { transition: transform 0.5s cubic-bezier(0.3, 0.1, 0.6, 1), opacity 0.45s; pointer-events: none; }
.card[data-depth="1"] { transform: translateY(14px) scale(0.95); pointer-events: none; }
.card[data-depth="2"] { transform: translateY(28px) scale(0.9); opacity: 0.55; pointer-events: none; }
.card[data-depth="hidden"] { opacity: 0; pointer-events: none; }
.flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.7s cubic-bezier(0.2, 1.3, 0.35, 1); }
.card.flipped .flip { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--surface); border: 1px solid var(--ink); border-radius: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.face.back { transform: rotateY(180deg); padding: 22px 20px; gap: 14px; }
.visual { position: relative; height: 200px; flex: 0 0 auto; background: var(--deep); color: var(--on-deep); padding: 16px 18px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.visual .ini { position: absolute; right: -8px; bottom: -40px; font: 800 180px/1 var(--sans); font-stretch: 125%; letter-spacing: -0.06em; color: var(--deep-2); pointer-events: none; }
.visual .row1 { position: relative; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; }
.status-pill i { width: 7px; height: 7px; background: var(--signal); }
.visual .score { font: 500 13px/1 var(--mono); color: var(--signal); }
.visual h3 { position: relative; font-size: 28px; font-stretch: 120%; font-weight: 800; }
.visual .sub { position: relative; font-size: 14px; opacity: 0.75; margin-top: 3px; }
.card .body { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font: 500 10px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-size: 14px; line-height: 1.35; font-weight: 500; overflow-wrap: anywhere; }
.why { margin-top: auto; border-left: 3px solid var(--signal); padding: 2px 0 2px 12px; display: grid; gap: 2px; font-size: 14px; }
.tapnote { font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); text-align: center; }
.locked { margin-top: auto; border: 1px dashed var(--muted); border-radius: 6px; padding: 12px; display: grid; gap: 4px; }
.stamp { position: absolute; top: 22px; z-index: 3; font: 800 15px/1 var(--sans); font-stretch: 125%; padding: 9px 13px; border-radius: 4px; border: 3px solid currentColor; opacity: 0; pointer-events: none; background: var(--surface); }
.stamp.yes { right: 16px; color: var(--blue); transform: rotate(10deg); }
.stamp.no { left: 16px; color: var(--bad); transform: rotate(-10deg); }
.stamp.top { left: 50%; top: auto; bottom: 36%; color: #b57800; transform: translateX(-50%); }
.empty { position: absolute; inset: 0; border: 1px dashed var(--muted); border-radius: 10px; display: grid; place-content: center; justify-items: center; text-align: center; gap: 12px; padding: 24px; }
.callbar { display: flex; justify-content: center; align-items: flex-start; gap: 18px; margin-top: 18px; }
.callbar[hidden] { display: none; }
.cbw { display: grid; justify-items: center; gap: 6px; }
.cbw span { font-size: 12px; font-weight: 600; color: var(--muted); }
.cb { width: 62px; height: 62px; border-radius: 50%; border: 1px solid var(--ink); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: transform 0.25s; }
.cb svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cb:active { transform: scale(0.9); }
.cb.small { width: 48px; height: 48px; }
.cb.small svg { width: 20px; height: 20px; }
.cb.no { color: var(--bad); }
.cb.top { color: #b57800; }
.cb.yes { width: 74px; height: 74px; background: var(--blue); color: var(--on-blue); border-color: var(--blue); }
.cb[disabled] { opacity: 0.35; cursor: default; }
.hint { text-align: center; font-size: 13px; color: var(--muted); max-width: 520px; margin: 4px auto 0; }

.overlay { position: fixed; inset: 0; z-index: 50; overflow-y: auto; background: var(--deep); color: var(--on-deep); display: flex; align-items: center; }
.overlay[hidden] { display: none; }
.overlay .wrap { width: 100%; padding-block: 40px; display: flex; flex-direction: column; gap: 22px; align-items: center; text-align: center; }
.overlay h2 { font-size: clamp(48px, 14vw, 80px); font-stretch: 125%; }
.timer { font: 500 15px/1 var(--mono); color: var(--signal); display: flex; align-items: center; gap: 8px; }
.timer i { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }
.names { display: flex; justify-content: space-between; width: 100%; max-width: 420px; gap: 12px; font-size: 15px; }
.names div { display: grid; gap: 2px; min-width: 0; }
.names div:last-child { text-align: right; }
.names small { font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.6; }
.overlay .btns { display: grid; gap: 10px; width: 100%; max-width: 420px; }
.overlay .btn.primary { background: var(--signal); border-color: var(--signal); color: #0d1830; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; padding: 13px 18px; border-radius: 4px; max-width: calc(100% - 32px); }
.toast[hidden] { display: none; }

/* matches */
.bill { background: var(--deep); color: var(--on-deep); border-radius: 10px; padding: 20px; display: grid; gap: 12px; }
.bill .big { font: 800 38px/1 var(--sans); font-stretch: 120%; font-variant-numeric: tabular-nums; }
.bill .row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; border-top: 1px solid rgba(233, 237, 251, 0.15); padding-top: 10px; }
.bill .row span:first-child { opacity: 0.7; }
.bill .row span:last-child { text-align: right; }
.mrow { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 14px; }
.mhead { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; }
.mhead .av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--deep); color: var(--on-deep); font: 800 16px/1 var(--sans); font-stretch: 125%; }
.mhead h3 { font-size: 18px; }
.mhead p { font-size: 13px; color: var(--muted); }
.st { font: 500 11px/1 var(--mono); padding: 6px 8px; border-radius: 4px; white-space: nowrap; display: inline-block; }
.st.wait { background: color-mix(in srgb, var(--signal) 24%, transparent); color: var(--ink); }
.st.ok { background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.st.new { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.contact-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 16px; margin: 0; }
.contact-list div { min-width: 0; }
.contact-list dt { font: 500 10px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.contact-list dd { margin: 2px 0 0; font-size: 15px; overflow-wrap: anywhere; }
.succ { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; font-size: 15px; }
details.report { border-top: 1px solid var(--line); padding-top: 12px; }
details.report summary { cursor: pointer; font-weight: 700; }
details.report form { margin-top: 14px; }

/* admin */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: grid; gap: 4px; }
.kpi b { font: 800 28px/1 var(--sans); font-stretch: 115%; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 13px; color: var(--muted); }
.todo { display: grid; gap: 10px; }
.todo > div { display: grid; grid-template-columns: 10px 1fr; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; font-size: 15px; }
.todo > div::before { content: ""; width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; background: var(--signal); }
.todo > div.auto::before { background: var(--ok); }
.todo small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.acts input { width: 140px; padding: 8px 10px; }
.tablewrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--ink); border-radius: 8px; }
.stats { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.stats th, .stats td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.stats thead th { font-weight: 600; color: var(--muted); font-size: 12px; }
.stats tfoot td { font-weight: 700; border-bottom: 0; }
.stats.log td { font-size: 12px; }
.filters { display: flex; gap: 16px; font-weight: 600; }
.filters a { color: var(--ink); text-decoration: none; border-bottom: 3px solid transparent; }
.filters a[aria-current="page"] { border-bottom-color: var(--signal); }
.legal h2 { margin-top: 10px; }
.legal ul { padding-left: 20px; display: grid; gap: 6px; }

@media (prefers-reduced-motion: reduce) { .card, .flip { transition: none; } }

/* ratings */
.visual .stars { position: relative; margin-top: 6px; font: 500 13px/1 var(--mono); color: var(--signal); }
.rate { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; justify-items: start; }
.rate fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 6px; }
.starpick { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.starpick input { position: absolute; opacity: 0; pointer-events: none; }
.starpick label { font-size: 32px; line-height: 1; color: var(--line); cursor: pointer; padding: 2px; transition: color 0.15s; }
.starpick input:checked ~ label, .starpick label:hover, .starpick label:hover ~ label { color: var(--signal); }
.starpick input:focus-visible + label { outline: 2px solid var(--signal); outline-offset: 2px; }
.panel.offer { border-color: var(--signal); background: color-mix(in srgb, var(--signal) 10%, var(--surface)); }

/* fee calculator */
.calc .calc-product summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.calc .calc-product[open] summary { margin-bottom: 12px; }
.calc-out { margin: 0; display: grid; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.calc-out div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); }
.calc-out div:first-child { border-top: 0; }
.calc-out dt { color: var(--muted); }
.calc-out dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.calc-out .sum { background: var(--deep); color: var(--on-deep); }
.calc-out .sum dt { color: inherit; opacity: 0.75; }
.calc-apply { display: flex; flex-wrap: wrap; gap: 8px; }
.calcwrap > summary { cursor: pointer; }
.calcwrap .calc { border: 0; padding: 0; background: none; }

/* profile progress */
.progress { gap: 10px; border-color: var(--ink); }
.progress-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.progress-pct { font: 800 30px/1 var(--sans); font-stretch: 120%; font-variant-numeric: tabular-nums; }
.progress-note { font-size: 14px; color: var(--muted); }
.progress .bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress .bar span { display: block; height: 100%; background: var(--signal); border-radius: inherit; transition: width .25s ease; }
.progress.is-done .bar span { background: var(--ok, #138a5c); }
.progress-missing { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
.progress-missing:empty { display: none; }
[id^="sec-"] { scroll-margin-top: 160px; }
h1 { overflow-wrap: anywhere; }
.panel > .bar, .progress .bar { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.panel > .bar span { display: block; height: 100%; background: var(--signal); border-radius: inherit; }
.opt { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); vertical-align: 2px; }
.confirm .price { display: block; margin-top: 6px; font-size: 14px; font-weight: 700; }
