/* Molefy phone app. Look: Diagnify Liquid Glass (the locked mock-up). No inline styles anywhere: the page's CSP refuses them. */
:root { --ink: #0f1a2b; --ink2: #46536a; --ink3: #5f6b80; --accent: #0b3d91; --glass: rgba(226,236,249,0.80); --content: rgba(252,253,255,0.94);
  --edge: 1px solid rgba(255,255,255,0.9); --bad: #b42318; --bad-bg: #fde8e6; --warn: #9a5b00; --warn-bg: #fff3dc; --ok: #1d6b46; --ok-bg: #e3f5ec;
  --mono: 'IBM Plex Mono', ui-monospace, monospace; --soft: 0 1px 2px rgba(15,30,60,0.06), 0 4px 12px rgba(15,30,60,0.06);
  --lift: 0 2px 6px rgba(15,30,60,0.08), 0 12px 28px rgba(15,30,60,0.10); }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font: 400 16px/22px 'IBM Plex Sans', system-ui, sans-serif; color: var(--ink); background: #dfe6f0; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
h1, h2, p, figure, fieldset { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.screen { width: 100%; max-width: 480px; min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; padding: max(14px, env(safe-area-inset-top)) 8px 0;
  background: radial-gradient(circle at 0% 0%, rgba(150,186,240,0.78), rgba(150,186,240,0) 46%), radial-gradient(circle at 100% 4%, rgba(140,214,196,0.70), rgba(140,214,196,0) 42%),
    radial-gradient(circle at 100% 100%, rgba(244,200,168,0.62), rgba(244,200,168,0) 46%), radial-gradient(circle at 0% 100%, rgba(170,204,236,0.62), rgba(170,204,236,0) 44%),
    linear-gradient(160deg, #eaf0f8, #f4f5f9); }
.main { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.foot { position: sticky; bottom: 0; margin: 0 -8px; padding: 10px 16px max(20px, env(safe-area-inset-bottom)); display: flex; gap: 10px; background: var(--glass); border-top: var(--edge);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }

/* top bar */
.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 48px; padding: 0 6px; border-radius: 24px; background: var(--glass); border: var(--edge);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), inset 0 -1px 0 rgba(15,30,60,0.06), var(--lift); }
.bar h1 { font-size: 15px; line-height: 20px; font-weight: 600; text-align: center; }
.bar .end { justify-self: end; margin-right: 10px; font: 400 12.5px var(--mono); color: var(--ink2); }
.brand { grid-column: 1 / 3; display: inline-flex; align-items: center; gap: 8px; padding-left: 8px; font-size: 15px; font-weight: 600; }
.link { justify-self: start; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 10px 0 4px; font-size: 15px; font-weight: 500; text-decoration: none; }
.link.end { justify-self: end; margin: 0; padding: 0 12px; font: 600 15px 'IBM Plex Sans', system-ui, sans-serif; color: var(--accent); }
.who { justify-self: end; display: grid; place-items: center; width: 44px; height: 44px; text-decoration: none; }
.who span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; background: var(--content); border: 1px solid rgba(15,30,60,0.12); font-size: 13px; font-weight: 600; }

/* text and cards */
.hero { margin: 12px 8px 0; font-size: 32px; line-height: 38px; font-weight: 600; letter-spacing: -0.01em; }
.lead { margin: 0 8px; color: var(--ink2); line-height: 23px; }
.h2 { margin: 6px 8px 0; font-size: 22px; line-height: 28px; font-weight: 600; }
.card { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 20px; background: var(--content); border: var(--edge); box-shadow: var(--soft); }
.card.lift { box-shadow: var(--lift); }
.card.tight { gap: 8px; padding: 12px; }
.card h2 { font-size: 15px; line-height: 20px; font-weight: 600; }
.small, .note, .help { font-size: 13px; line-height: 18px; color: var(--ink2); }
.small.bad { color: var(--bad); }
.note { padding: 0 14px; }
.mono { font-family: var(--mono); }
.points { margin: 0; padding: 0 8px; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 14.5px; line-height: 20px; }
.points li { display: flex; gap: 10px; }
.points svg { flex: none; color: var(--accent); }
.pill { flex: none; padding: 2px 10px; border-radius: 999px; font: 600 12.5px/18px 'IBM Plex Sans', system-ui, sans-serif; background: rgba(11,61,145,0.10); color: var(--accent); }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.strip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 20px; font-weight: 500; text-decoration: none; }
.strip svg { flex: none; }
.strip.ok { background: var(--ok-bg); color: var(--ok); }
.strip.warn { background: var(--warn-bg); color: var(--warn); }
.strip.bad { background: var(--bad-bg); color: var(--bad); }

/* forms */
.field, .lab { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 14px; line-height: 20px; font-weight: 600; }
.lab, .set legend, .zoom label { font-size: 13px; line-height: 16px; font-weight: 500; color: var(--ink2); }
.set { padding: 0; border: 0; min-width: 0; }
.set legend { padding: 0 0 6px; }
.f { width: 100%; min-width: 0; height: 50px; padding: 0 14px; border-radius: 14px; border: 1px solid rgba(15,30,60,0.32); background: #fff; font-size: 16px; color: var(--ink); }
.f.code { height: 60px; text-align: center; font: 500 28px var(--mono); letter-spacing: 0.3em; }
.tick { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14.5px; line-height: 20px; }
.tick input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.btn { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 16px; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; }
.btn.quiet { background: var(--content); color: var(--ink); border: 1px solid rgba(15,30,60,0.14); }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip { flex: none; align-self: flex-start; min-height: 44px; padding: 0 14px; border-radius: 999px; background: rgba(236,243,252,0.72); border: 1px solid rgba(15,30,60,0.12); font-size: 13px; font-weight: 600; cursor: pointer; }
.file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: 999px; background: rgba(15,30,60,0.07); }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: grid; place-items: center; min-height: 44px; padding: 0 4px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink2); text-align: center; }
.seg input:checked + span { background: #fff; color: var(--accent); box-shadow: 0 1px 2px rgba(15,30,60,0.10), 0 2px 6px rgba(15,30,60,0.08); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* lists */
.search { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 23px; background: var(--content); border: var(--edge); box-shadow: var(--soft); color: var(--ink2); }
.search input { flex: 1; min-width: 0; height: 44px; border: 0; background: none; font-size: 16px; color: var(--ink); outline: none; }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.list { display: flex; flex-direction: column; padding: 4px 0; border-radius: 20px; background: var(--content); border: var(--edge); box-shadow: var(--soft); }
.row { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; color: inherit; text-decoration: none; border-top: 1px solid rgba(15,30,60,0.08); }
.row:first-child { border-top: 0; }
.row .t { flex: 1; min-width: 0; }
.row b { display: block; font-size: 16px; line-height: 22px; font-weight: 600; overflow-wrap: anywhere; }
.row small { display: block; font-size: 13px; line-height: 18px; color: var(--ink2); }
.row small.flag { color: var(--bad); font-weight: 500; }
.row img { flex: none; width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: #e6ebf3; }
.row svg { flex: none; color: var(--ink3); }
.empty { padding: 28px 18px; text-align: center; color: var(--ink2); font-size: 14.5px; }
.banner { display: flex; flex-direction: column; padding: 8px 14px; border-radius: 20px; background: var(--content); border: var(--edge); box-shadow: var(--soft); }
.banner b { font-size: 16px; line-height: 20px; font-weight: 600; overflow-wrap: anywhere; }
.banner small { font: 400 12.5px/16px var(--mono); color: var(--ink2); }

/* the photo */
.spot { background-image: radial-gradient(ellipse 30% 24% at 46% 46%, #3a2018 0 46%, rgba(58,32,24,0) 74%), radial-gradient(ellipse 36% 30% at 54% 52%, #6b3f2c 0 52%, rgba(107,63,44,0) 76%),
  radial-gradient(ellipse 18% 14% at 62% 60%, #8a5a40 0 50%, rgba(138,90,64,0) 82%), radial-gradient(circle at 28% 22%, #f1cdb4, #e0b093 62%, #cc9577); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 18px; border-radius: 16px; border: 1.5px dashed #b9c5d8; background: #f6f8fb; text-align: center; }
.drop .lens { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 999px; background: rgba(11,61,145,0.10); color: var(--accent); }
.drop h2 { font-size: 20px; line-height: 26px; color: var(--ink); }
.drop p { font-size: 14px; line-height: 20px; color: var(--ink2); }
.stage { position: relative; width: 100%; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background-color: #10151d; touch-action: none; }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.stage i { position: absolute; width: 24px; height: 24px; border: 0 solid #fff; pointer-events: none; }
.stage i.a { left: 10px; top: 10px; border-left-width: 3px; border-top-width: 3px; border-radius: 7px 0 0 0; }
.stage i.b { right: 10px; top: 10px; border-right-width: 3px; border-top-width: 3px; border-radius: 0 7px 0 0; }
.stage i.c { left: 10px; bottom: 10px; border-left-width: 3px; border-bottom-width: 3px; border-radius: 0 0 0 7px; }
.stage i.d { right: 10px; bottom: 10px; border-right-width: 3px; border-bottom-width: 3px; border-radius: 0 0 7px 0; }
.stage .hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; background: rgba(15,26,43,0.78); color: #fff;
  font-size: 12.5px; line-height: 16px; font-weight: 500; white-space: nowrap; pointer-events: none; }
.zoom { display: flex; align-items: center; gap: 10px; }
.zoom input { flex: 1; min-width: 0; height: 44px; accent-color: var(--accent); }
.zoom output { font: 500 13px var(--mono); }

/* the result */
.score { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; }
.score div { flex: 1; min-width: 0; }
.score .n { flex: none; font: 500 34px/38px var(--mono); }
.score h2 { font-size: 16px; line-height: 22px; font-weight: 600; }
.score p { margin-top: 2px; font-size: 14px; line-height: 20px; color: var(--ink); }
.score.bad { background: var(--bad-bg); border: 1px solid #f6cfcb; }
.score.ok { background: var(--ok-bg); border: 1px solid #c5e6d4; }
.score.warn { background: var(--warn-bg); border: 1px solid #f1dcae; }
.score.bad .n, .score.bad h2 { color: var(--bad); }
.score.ok .n, .score.ok h2 { color: var(--ok); }
.score.warn h2 { color: var(--warn); }
.shot { flex-direction: row; padding: 12px; }
.shot img { flex: none; width: 108px; height: 108px; border-radius: 14px; object-fit: cover; background: #e6ebf3; }
.shot div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.shot h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; line-height: 22px; }
.dx { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 5px 8px; font-size: 14px; line-height: 20px; }
.dx em { margin-left: 6px; font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--bad); }
.dx .p { font: 500 13px var(--mono); }
.dx.rest { color: var(--ink2); }
.dx progress { -webkit-appearance: none; appearance: none; grid-column: 1 / 3; display: block; width: 100%; height: 6px; border: 0; border-radius: 999px; overflow: hidden; background: #eef2f7; }
.dx progress::-webkit-progress-bar { background: #eef2f7; }
.dx progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.dx progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.dx progress.bad::-webkit-progress-value { background: var(--bad); }
.dx progress.bad::-moz-progress-bar { background: var(--bad); }
.dx.rest progress::-webkit-progress-value { background: var(--ink3); }
.dx.rest progress::-moz-progress-bar { background: var(--ink3); }
.cases { display: flex; gap: 8px; margin-right: -16px; padding-right: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cases figure { flex: none; width: 84px; display: flex; flex-direction: column; gap: 4px; font: 400 12.5px/16px var(--mono); color: var(--ink2); }
.cases img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; background: #e6ebf3; }
.cases b { display: block; font: 600 12.5px/16px 'IBM Plex Sans', system-ui, sans-serif; color: var(--ink); overflow-wrap: anywhere; }
.over { position: fixed; inset: 0; z-index: 9; display: flex; flex-direction: column; background: #0b0f15; }
.over div { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; }
.over img { display: block; width: 300vw; max-width: none; }
.over button { flex: none; min-height: 56px; padding-bottom: env(safe-area-inset-bottom); border: 0; background: #0b0f15; color: #fff; font-size: 16px; font-weight: 600; cursor: pointer; }
.wait { align-items: center; gap: 14px; padding: 36px 18px; text-align: center; }
.spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid rgba(11,61,145,0.2); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }

/* fixes of scope: a button in the page flow keeps its own height; the magnifier is a native dialog */
.main > .btn { flex: none; }
dialog.over { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; }
.btn.danger { background: var(--bad); }
.row b.bad { color: var(--bad); }
.legal { display: flex; justify-content: center; gap: 20px; margin: auto 0 0; padding-top: 8px; font-size: 13px; }
.legal a { color: var(--ink2); }
.doc { gap: 10px; padding-bottom: 32px; line-height: 23px; }
.doc h1 { margin: 12px 8px 0; font-size: 26px; line-height: 32px; font-weight: 600; }
.doc .card p, .doc .card li { font-size: 14.5px; line-height: 21px; color: var(--ink2); }
.doc .card ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.tick.off { color: var(--ink3); }
.tick.off input { opacity: 0.4; }
.seg.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.seg.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
textarea.f { height: auto; min-height: 96px; padding: 12px 14px; font: inherit; line-height: 22px; resize: vertical; }
.sign { display: block; width: 100%; height: 180px; border-radius: 14px; border: 1px solid rgba(15,30,60,0.32); background: #fff; touch-action: none; }
.signed { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.signature { display: block; width: 100%; max-width: 360px; border-radius: 12px; border: 1px solid rgba(15,30,60,0.12); background: #fff; }
.mine { display: flex; align-items: center; gap: 12px; }
.mine img { flex: none; width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: #e6ebf3; }
.mine h2 { margin: 0; font-size: 16px; line-height: 22px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.doc th, .doc td { padding: 6px 8px; text-align: left; vertical-align: top; border-top: 1px solid rgba(15,30,60,0.10); }
@media print { body { background: #fff; } .bar, .foot { display: none; } .card { box-shadow: none; border: 1px solid #ccc; } }
