
:root{
  --bg:#f7f4f2; --surface:#ffffff; --surface2:#f1ece8; --text:#171717; --muted:#6e6864;
  --line:#ded7d2; --accent:#8e4155; --accent2:#c68796; --good:#356b52; --warn:#9a6922; --bad:#9b3939;
  --shadow:0 12px 34px rgba(34,26,27,.08); --radius:22px;
}
[data-theme="dark"]{
  --bg:#111113; --surface:#1a1a1d; --surface2:#232327; --text:#f6f3f1; --muted:#aaa2a0;
  --line:#383338; --accent:#d28297; --accent2:#8e4155; --good:#79b194; --warn:#d2a256; --bad:#e07f7f;
  --shadow:none;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer}
.app-shell{max-width:760px;margin:0 auto;min-height:100dvh;padding-bottom:92px}
.topbar{position:sticky;top:0;z-index:20;display:flex;justify-content:space-between;align-items:center;padding:18px 18px 12px;background:color-mix(in srgb,var(--bg) 92%, transparent);backdrop-filter:blur(14px);border-bottom:1px solid color-mix(in srgb,var(--line) 70%,transparent)}
.eyebrow{font-size:11px;letter-spacing:.16em;font-weight:800;color:var(--accent)}
h1{font-size:28px;line-height:1.08;margin:4px 0 0;letter-spacing:-.03em}
h2{font-size:21px;margin:0;letter-spacing:-.02em}
h3{font-size:16px;margin:0}
p{line-height:1.5}
.content{padding:14px 16px 28px}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow);margin-bottom:14px}
.hero{padding:22px;background:linear-gradient(145deg,var(--surface),color-mix(in srgb,var(--surface2) 70%,var(--surface)));overflow:hidden}
.hero .quote{font-size:20px;line-height:1.34;font-weight:750;letter-spacing:-.02em;margin:10px 0}
.muted{color:var(--muted)}
.small{font-size:13px}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.score-card{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:15px}
.score{font-size:34px;font-weight:800;letter-spacing:-.04em}
.score small{font-size:13px;color:var(--muted);font-weight:600}
.status-pill{display:inline-flex;border-radius:999px;padding:7px 10px;font-size:12px;font-weight:800;background:var(--surface2);margin-top:8px}
.status-green{color:var(--good)} .status-warn{color:var(--warn)} .status-bad{color:var(--bad)}
.progress{height:8px;border-radius:999px;background:var(--surface2);overflow:hidden;margin-top:8px}
.progress > i{display:block;height:100%;background:var(--accent);border-radius:999px}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.btn{min-height:46px;border-radius:14px;border:1px solid var(--line);padding:11px 15px;font-weight:750;background:var(--surface)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:white}
.btn.secondary{background:var(--surface2)}
.btn.ghost{background:transparent}
.btn.full{width:100%}
.icon-btn{width:44px;height:44px;border-radius:50%;border:1px solid var(--line);background:var(--surface);font-size:19px}
.profile-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 0;border-top:1px solid var(--line)}
.profile-row:first-of-type{border-top:0}
.avatar{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:var(--surface2);font-weight:800;color:var(--accent);flex:none}
.row-main{display:flex;align-items:center;gap:12px;min-width:0;flex:1}
.row-main strong,.row-main span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tag{font-size:11px;font-weight:800;padding:5px 8px;border:1px solid var(--line);border-radius:999px;color:var(--muted)}
.category{padding:15px 0;border-top:1px solid var(--line)}
.category:first-child{border-top:0}
.rating{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin-top:10px}
.rating button{min-height:46px;border:1px solid var(--line);background:var(--surface2);border-radius:12px;font-weight:800}
.rating button.selected{background:var(--accent);border-color:var(--accent);color:white}
.rating-labels{display:flex;justify-content:space-between;color:var(--muted);font-size:11px;margin-top:5px;gap:8px}
textarea,input,select{width:100%;min-height:46px;border:1px solid var(--line);border-radius:13px;background:var(--surface);padding:12px 13px;font-size:16px;outline:none}
textarea{resize:vertical}
textarea:focus,input:focus,select:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 18%,transparent)}
label{display:block;font-size:13px;font-weight:700;margin-top:12px}
label input,label select,label textarea{margin-top:6px;font-weight:500}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.callout{border-left:4px solid var(--accent);padding:11px 13px;background:var(--surface2);border-radius:0 14px 14px 0;font-size:13px;line-height:1.5}
.deal{display:flex;gap:10px;align-items:flex-start;padding:12px 0;border-top:1px solid var(--line)}
.deal input{width:22px;height:22px;min-height:auto;accent-color:var(--bad);flex:none;margin-top:1px}
.timeline-item{position:relative;padding:0 0 18px 28px}
.timeline-item:before{content:"";position:absolute;left:7px;top:7px;width:10px;height:10px;border-radius:50%;background:var(--accent)}
.timeline-item:after{content:"";position:absolute;left:11px;top:18px;bottom:0;width:2px;background:var(--line)}
.timeline-item:last-child:after{display:none}
.kpi{display:flex;justify-content:space-between;align-items:end;gap:10px;padding:9px 0;border-top:1px solid var(--line)}
.kpi:first-child{border-top:0}
.kpi b{font-size:22px}
.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);z-index:30;width:min(760px,100%);display:grid;grid-template-columns:repeat(5,1fr);background:color-mix(in srgb,var(--surface) 94%,transparent);backdrop-filter:blur(16px);border-top:1px solid var(--line);padding:8px 8px calc(8px + env(safe-area-inset-bottom))}
.nav-item{border:0;background:transparent;color:var(--muted);min-height:56px;border-radius:14px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.nav-item span{font-size:19px;line-height:1}.nav-item small{font-size:10px;font-weight:750}
.nav-item.active{color:var(--accent);background:var(--surface2)}
.dialog{width:min(650px,calc(100% - 24px));border:1px solid var(--line);border-radius:24px;background:var(--surface);color:var(--text);padding:18px;box-shadow:var(--shadow)}
.dialog::backdrop{background:rgba(0,0,0,.4);backdrop-filter:blur(3px)}
.dialog-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.dialog-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:16px}
.empty{text-align:center;padding:34px 15px}
.empty .big{font-size:38px}
.link-btn{border:0;background:transparent;color:var(--accent);font-weight:800;padding:6px 0}
.note-history{font-size:13px;white-space:pre-wrap;background:var(--surface2);border-radius:14px;padding:12px;margin-top:8px}
footer{font-size:11px;color:var(--muted);padding:8px 4px 25px;text-align:center}
@media(max-width:460px){.two-col,.grid-2{grid-template-columns:1fr}.score{font-size:30px}.content{padding-left:12px;padding-right:12px}}

.auth-dialog{max-width:520px}
.account-strip{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;border:1px solid var(--line);background:var(--surface2);border-radius:16px;margin-bottom:14px}
.cloud-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:var(--good);margin-right:6px}
.syncing .cloud-dot{background:var(--warn)}
.error-dot .cloud-dot{background:var(--bad)}
button:disabled{opacity:.45;cursor:not-allowed}
