/* Shared stats: the stand-alone page of a snapshot link (share.html, lib/share-page.js) and the card it shows (lib/share-card.js),
   and More, Share with a friend's link box. Shared pieces are css/widgets.css; colours come from the tokens
   in style.css only. The grade pills follow Insights' (css/insights.css), so a grade reads the same on both. */

/* The page: the app's top-bar look without the shell, one column of cards on the paper. */
.shr-top{position:relative;z-index:var(--z-page);display:flex;align-items:center;gap:10px;max-width:430px;margin:0 auto;padding:calc(env(safe-area-inset-top) + 18px) 20px 6px;min-height:60px}
.shr-top .grow{flex:1}
.shr-toggle{width:auto;padding-inline:12px;gap:6px;display:inline-flex;font:inherit;font-size:.8rem;font-weight:800}
.shr-app{position:relative;z-index:var(--z-page);display:flex;flex-direction:column;gap:18px;max-width:430px;margin:0 auto;padding:6px 20px 32px}
.shr-head{display:flex;flex-direction:column;gap:6px;width:fit-content;max-width:100%;background:var(--paper);box-shadow:0 0 10px 8px var(--paper);border-radius:10px}
.shr-sub{margin:0;color:var(--ink2);font-weight:600}
.shr-msg{margin:24px 0;color:var(--ink2)}
/* a link that ended: the mark above the title, centred, never on its first line (a card is not a flex column) */
.shr-state{display:flex;flex-direction:column}
.shr-foot{margin:0;color:var(--ink2);text-align:center;align-self:center;width:fit-content;max-width:100%;background:var(--paper);box-shadow:0 0 10px 8px var(--paper);border-radius:10px}

/* The card: tiles two across at 390 px, each a name, a big value and its grade word. */
.shr-card{display:flex;flex-direction:column;gap:14px}
.shr-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.shr-tile{display:flex;flex-direction:column;align-items:flex-start;gap:6px;padding:12px;border-radius:var(--rm);background:var(--surface2);min-width:0}
.shr-tname{font-size:.8rem;color:var(--ink2);line-height:1.25}
.shr-tval{font-size:1.35rem;font-weight:800;color:var(--ink)}
.shr-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.shr-fact{display:flex;flex-direction:column;gap:4px}
.shr-fact span{font-size:.8rem;color:var(--ink2)}
.shr-fact b{font-size:1.6rem;font-weight:800;color:var(--ink)}
.shr-fact small{color:var(--mut);font-size:.78rem}
.shr-card .sec{margin:0}

.shr-grade{display:inline-flex;align-items:center;min-height:26px;padding:0 10px;border-radius:var(--pill);border:1px solid var(--line);background:var(--surface);color:var(--mut);font-size:.76rem;font-weight:800;white-space:nowrap}
.shr-good{color:var(--c);border-color:var(--c)}
.shr-fair{color:var(--d);border-color:var(--d)}
.shr-poor{color:var(--red);border-color:var(--red)}
.shr-good.shr-s1{background:color-mix(in srgb,var(--c-soft) 45%,var(--surface))}
.shr-good.shr-s2{background:color-mix(in srgb,var(--c-soft) 75%,var(--surface))}
.shr-good.shr-s3{background:var(--c-soft)}
.shr-fair.shr-s1{background:color-mix(in srgb,var(--d-soft) 45%,var(--surface))}
.shr-fair.shr-s2{background:color-mix(in srgb,var(--d-soft) 75%,var(--surface))}
.shr-fair.shr-s3{background:var(--d-soft)}
.shr-poor.shr-s1{background:color-mix(in srgb,var(--red-t) 45%,var(--surface))}
.shr-poor.shr-s2{background:color-mix(in srgb,var(--red-t) 75%,var(--surface))}
.shr-poor.shr-s3{background:var(--red-t)}
.shr-unknown{font-weight:600}

/* The typical day: the middle half as a soft area, the median as the accent line. */
.shr-chart .shr-iqr{fill:var(--a-soft);stroke:none}
.shr-chart .shr-median{stroke:var(--a)}

/* More, Share with a friend: the link made, with its Copy and Send. */
.shr-actions{display:flex;flex-wrap:wrap;gap:10px}
.shr-actions .btn{min-height:48px}
.shr-link{display:block;padding:10px 12px;border-radius:var(--rm);background:var(--surface2);color:var(--ink);font-size:.78rem;word-break:break-all}

/* More -> Access and sharing: one row per link. */
.shr-rows{display:flex;flex-direction:column}
.shr-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;min-height:52px;padding:8px 0}
.shr-row+.shr-row{border-top:1px solid var(--line)}
.shr-row .tt{display:flex;flex-direction:column;min-width:0}
.shr-row small{color:var(--mut)}

/* Biohacking: three small gauges in a row, every band in full colour, the band of the score thicker. */
.shr-gauges{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.shr-gauge{display:flex;flex-direction:column;align-items:center;gap:2px;text-align:center;min-width:0}
.shr-gauge svg{display:block;width:100%;height:auto;overflow:visible}
.shr-arc{fill:none;stroke:currentColor;stroke-width:9}
.shr-arc.on{stroke-width:12}
.shr-g0{color:var(--gauge-0)}.shr-g1{color:var(--gauge-1)}.shr-g2{color:var(--gauge-2)}.shr-g3{color:var(--gauge-3)}.shr-g4{color:var(--gauge-4)}
.shr-needle{fill:var(--ink);transform-box:view-box;transform-origin:50px 50px}
.shr-gauge.empty .shr-needle{fill:var(--mut)}
.shr-gauge b{font-family:var(--serif);font-weight:600;font-size:1.6rem;line-height:1}
[lang=he] .shr-gauge b{font-family:var(--sans);font-weight:800}
.shr-glabel{font-weight:800;font-size:.82rem}
.shr-gword{font-weight:700;font-size:.76rem;color:var(--ink2)}

/* Graded pills: the name, the value left to right, and the grade's word beside a dot of its band's colour. */
.shr-pills{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.shr-pill{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:'name value' 'word date';gap:2px 10px;align-items:baseline;padding:10px 12px;border-radius:var(--rm);background:var(--surface2);border-inline-start:4px solid var(--line)}
.shr-pname{grid-area:name;font-size:.86rem;color:var(--ink2);min-width:0}
.shr-pill b{grid-area:value;font-size:1.05rem;font-weight:800;color:var(--ink);white-space:nowrap}
.shr-pword{grid-area:word;font-size:.78rem;font-weight:800;color:var(--ink)}
.shr-pdate{grid-area:date;justify-self:end;font-size:.74rem;color:var(--ink2);white-space:nowrap}
.shr-pill.shr-b0,.shr-pill.shr-bmi-obese{border-inline-start-color:var(--gauge-0)}
.shr-pill.shr-b1,.shr-pill.shr-bmi-under{border-inline-start-color:var(--gauge-1)}
.shr-pill.shr-b2,.shr-pill.shr-bmi-over{border-inline-start-color:var(--gauge-2)}
.shr-pill.shr-b3{border-inline-start-color:var(--gauge-3)}
.shr-pill.shr-b4,.shr-pill.shr-bmi-healthy{border-inline-start-color:var(--gauge-4)}

/* Workouts: the kinds as chips that do nothing, the tests as pills. */
.shr-kinds{display:flex;flex-wrap:wrap;gap:8px;margin:0}
.shr-kinds .chip{min-height:34px;cursor:default;font-weight:600}
.shr-h3{margin:0;font-size:.9rem;font-weight:800;color:var(--ink2)}
/* Biohacking measures two across at 390 px: nineteen measures in one column would run long. */
.shr-pills.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
/* the invitation to start one's own score, under what was shared */
.shr-join{display:flex;flex-direction:column;gap:10px;margin-block-start:16px}
.shr-join h3{margin:0}

/* A panel that opens its drill-down (lib/share-detail.js): a pill with a chevron at its end, a tile that opens its
   meaning in place, the link under a card, the readings' details folded. */
.shr-tap{cursor:pointer}
.shr-pill.shr-tap{grid-template-columns:minmax(0,1fr) auto auto;grid-template-areas:'name value chev' 'word date chev'}
.shr-pill.shr-tap .chev{grid-area:chev;align-self:center;width:18px;height:18px;color:var(--ink2)}
.shr-tile.shr-tap[aria-expanded=true]{outline:2px solid var(--a);outline-offset:-2px}
.shr-tx{margin:0;color:var(--ink2);line-height:1.4}
.shr-more{align-self:flex-start;display:inline-flex;align-items:center;gap:4px;min-height:48px;font-weight:800}
.shr-more .chev{width:16px;height:16px}

/* Me, Share with a friend: the line under an open panel whose items can grow, and the friend's page drawn in a sheet
   (views/share-friend.js fs-preview). In the sheet the page's head and foot need no paper halo: there is no napkin
   background behind them. */
.fs-grow{margin:4px 4px 0}
.fs-preview{display:flex;flex-direction:column;gap:18px;margin-block-start:12px}
.fs-preview .shr-head,.fs-preview .shr-foot{background:none;box-shadow:none}
.fs-preview .card{margin:0}
