/* WoundSight AI - v3 app-style design, light + dark, desktop + mobile. Used only by py_v3.py. */

/* Dark is the default. Light is applied only when the visitor picks it (data-theme="light"). */
:root {
  --bg: #0b1220; --card: #111a2e; --card2: #16213a; --text: #e5e7eb; --navy: #dbe7ff; --muted: #94a3b8; --line: #23304d;
  --primary: #3b82f6; --primary-dk: #2563eb; --primary-soft: #1a2a4a; --ring: #1e3a8a;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.35); --shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --warn-bg: #3a2a08; --warn-fg: #fcd34d; --danger-bg: #3f1220; --danger-fg: #fda4af; --success-bg: #0f2e22; --success-fg: #86efac;
  --info-bg: #0e2a35; --info-fg: #7dd3fc; --indigo-bg: #1e1b4b; --indigo-fg: #c7d2fe; --neutral-bg: #1c2740; --neutral-fg: #cbd5e1;
  --dark-bg: linear-gradient(135deg, #1d4ed8, #0f172a); --dark-fg: #f8fafc;
  --hi: #4ade80; --hi-bg: #14532d; --md: #fbbf24; --md-bg: #78350f; --lo: #f87171; --lo-bg: #7f1d1d;
  --grid: #23304d;
  --opt1: #60a5fa; --opt1-bg: rgba(59, 130, 246, 0.16); --opt2: #2dd4bf; --opt2-bg: rgba(20, 184, 166, 0.16); --opt2-tint: #12263f;
}
html[data-theme="light"] {
  --bg: #f3f5f9; --card: #ffffff; --card2: #f8fafc; --text: #0f172a; --navy: #1e3a5f; --muted: #64748b; --line: #e5e9f0;
  --primary: #2563eb; --primary-dk: #1d4ed8; --primary-soft: #eff6ff; --ring: #bfdbfe;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.06); --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.10);
  --warn-bg: #fff7e6; --warn-fg: #8a5a00; --danger-bg: #fdecec; --danger-fg: #9f1239; --success-bg: #ecfdf3; --success-fg: #065f46;
  --info-bg: #e8f7fb; --info-fg: #155e75; --indigo-bg: #eef2ff; --indigo-fg: #3730a3; --neutral-bg: #f1f5f9; --neutral-fg: #334155;
  --dark-bg: linear-gradient(135deg, #1e3a5f, #0f172a); --dark-fg: #f8fafc;
  --hi: #16a34a; --hi-bg: #dcfce7; --md: #d97706; --md-bg: #fef3c7; --lo: #dc2626; --lo-bg: #fee2e2;
  --grid: #e2e8f0;
  --opt1: #1d4ed8; --opt1-bg: #dbeafe; --opt2: #0f766e; --opt2-bg: #ccfbf1; --opt2-tint: #f0fdfa;
}

* { box-sizing: border-box; }
/* The hidden attribute must beat any class that sets display, otherwise a closed overlay stays
   in the page invisibly (opacity 0) and swallows every click. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 16px; line-height: 1.5; transition: background 0.25s, color 0.25s; }
a { color: var(--primary); }
svg { display: inline-block; vertical-align: middle; }
.ws-app { max-width: 900px; margin: 0 auto; padding: 12px 14px 44px; }

/* ---------- header ---------- */
.ws-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 2px 16px; }
.ws-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ws-logo { width: 46px; height: 46px; border-radius: 13px; flex: 0 0 auto; object-fit: cover; background: #fff; box-shadow: var(--shadow); }
.ws-title { font-weight: 800; font-size: 1.22rem; letter-spacing: -0.01em; color: var(--navy); line-height: 1.15; }
.ws-sub { font-size: 0.74rem; color: var(--muted); line-height: 1.25; }
.ws-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.ws-lang { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px 4px 10px; box-shadow: var(--shadow); }
.ws-lang select { border: none; background: transparent; font: inherit; font-weight: 600; font-size: 0.9rem; color: var(--navy); padding: 6px 0; cursor: pointer; outline: none; max-width: 120px; }
.ws-theme { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--navy); cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); padding: 0; }
.ws-theme svg { width: 20px; height: 20px; }
.ws-theme:hover { background: var(--primary-soft); }

/* ---------- cards & buttons ---------- */
.ws-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin: 0 0 14px; }
.ws-form-card { max-width: 640px; margin: 0 auto 14px; }
.ws-h2 { margin: 0 0 4px; font-size: 1.35rem; font-weight: 800; text-align: center; color: var(--navy); }
.ws-hint { margin: 0 0 14px; text-align: center; color: var(--muted); font-size: 0.82rem; }
.ws-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; border-radius: 13px; padding: 13px 18px; font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; text-decoration: none; transition: transform 0.06s, box-shadow 0.15s, background 0.15s; }
.ws-btn svg { width: 18px; height: 18px; }
.ws-btn:active { transform: scale(0.98); }
.ws-btn-primary { background: linear-gradient(135deg, var(--primary), #4f46e5); color: #fff; box-shadow: 0 8px 20px rgba(37, 99, 235, 0.32); }
.ws-btn-primary:hover { filter: brightness(1.06); }
.ws-btn-ghost { background: var(--card); color: var(--navy); border: 1px solid var(--line); }
.ws-btn-ghost:hover { background: var(--primary-soft); }
.ws-btn-sm { padding: 7px 13px; font-size: 0.8rem; border-radius: 9px; }
.ws-btn-sm svg { width: 15px; height: 15px; transition: transform 0.2s; }
.ws-btn-sm.ws-open svg { transform: rotate(180deg); }
.ws-btn-block { width: 100%; margin-top: 14px; }
.ws-btn-off { opacity: 0.45; pointer-events: none; }
input[type="submit"].ws-btn { -webkit-appearance: none; appearance: none; }

/* ---------- upload zone ---------- */
.ws-drop { position: relative; display: block; min-height: 240px; border-radius: 16px; background: var(--card2); border: 1.5px dashed #94a3b8; cursor: pointer; overflow: hidden; transition: border-color 0.15s, background 0.15s; }
.ws-drop:hover, .ws-drop.ws-dragover, .ws-drop:focus { border-color: var(--primary); background: var(--primary-soft); outline: none; }
.ws-drop.ws-has-img { border-style: solid; border-color: transparent; background: #0f172a; }
.ws-corner { position: absolute; width: 26px; height: 26px; border: 3px solid #fff; pointer-events: none; opacity: 0; z-index: 2; }
.ws-drop.ws-has-img .ws-corner { opacity: 0.95; }
.ws-corner.tl { top: 12px; left: 12px; border-right: none; border-bottom: none; border-top-left-radius: 6px; }
.ws-corner.tr { top: 12px; right: 12px; border-left: none; border-bottom: none; border-top-right-radius: 6px; }
.ws-corner.bl { bottom: 12px; left: 12px; border-right: none; border-top: none; border-bottom-left-radius: 6px; }
.ws-corner.br { bottom: 12px; right: 12px; border-left: none; border-top: none; border-bottom-right-radius: 6px; }
.ws-drop-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted); padding: 16px; text-align: center; }
.ws-drop-empty .ws-ico { width: 64px; height: 64px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 8px; animation: wsPulse 2.6s ease-in-out infinite; }
.ws-drop-empty .ws-ico svg { width: 30px; height: 30px; }
.ws-drop-empty b { color: var(--navy); font-size: 1.02rem; }
.ws-drop-hint { font-size: 0.8rem; }
@media (hover: none) { .ws-drop-hint { display: none; } }
.ws-drop.ws-has-img .ws-drop-empty { display: none; }
#image-previews { display: grid; gap: 4px; grid-template-columns: 1fr; }
#image-previews img { width: 100%; height: 290px; object-fit: contain; display: block; background: #0f172a; }
#image-previews.ws-multi { grid-template-columns: repeat(2, 1fr); }
#image-previews.ws-multi img { height: 170px; object-fit: cover; }
.ws-drop-pill { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2; background: rgba(15, 23, 42, 0.72); color: #fff; font-size: 0.8rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; display: none; white-space: nowrap; backdrop-filter: blur(4px); }
.ws-drop.ws-has-img .ws-drop-pill { display: inline-flex; gap: 6px; align-items: center; }
.ws-field { margin-top: 14px; }
.ws-field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: var(--navy); }
.ws-field textarea { width: 100%; min-height: 118px; border: 1px solid var(--line); border-radius: 13px; padding: 12px; font: inherit; font-size: 0.93rem; resize: vertical; background: var(--card2); color: var(--text); }
.ws-field textarea::placeholder { font-size: 0.82rem; color: var(--muted); }
.ws-field textarea:focus { outline: 2px solid var(--ring); border-color: var(--primary); background: var(--card); }

/* bottom sheet (phones): take photo / choose from gallery */
.ws-sheet { position: fixed; inset: 0; z-index: 1000; }
.ws-sheet-bg { position: absolute; inset: 0; background: rgba(2, 6, 23, 0.55); opacity: 0; transition: opacity 0.2s; }
.ws-sheet-box { position: absolute; left: 0; right: 0; bottom: 0; background: var(--card); border-radius: 22px 22px 0 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform 0.22s ease-out; box-shadow: var(--shadow-lg); }
.ws-sheet-on .ws-sheet-bg { opacity: 1; }
.ws-sheet-on .ws-sheet-box { transform: translateY(0); }
.ws-sheet-box::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 999px; background: var(--line); margin: 0 auto 12px; }
.ws-sheet-box button { display: flex; align-items: center; gap: 12px; width: 100%; border: none; background: var(--card2); color: var(--navy); border-radius: 14px; padding: 15px 16px; font: inherit; font-weight: 700; font-size: 1rem; margin-bottom: 8px; cursor: pointer; }
.ws-sheet-box button svg { width: 22px; height: 22px; color: var(--primary); }
.ws-sheet-box #ws-sheet-cancel { justify-content: center; background: transparent; color: var(--muted); margin-bottom: 0; }

/* ---------- samples ---------- */
.ws-samples { max-width: 640px; margin: 0 auto 14px; text-align: center; }
.ws-samples h3 { font-size: 0.88rem; color: var(--muted); font-weight: 600; margin: 6px 0 10px; }
.sample-images { display: flex; gap: 10px; justify-content: center; }
.sample-image { width: 31%; max-width: 180px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; cursor: pointer; border: 2px solid transparent; box-shadow: var(--shadow); transition: transform 0.12s, border-color 0.12s; }
.sample-image:hover { transform: translateY(-2px); border-color: var(--primary); }
.ws-credit { font-size: 0.72rem; color: var(--muted); margin: 10px 0 0; }

/* ---------- loader ---------- */
#loader { text-align: center; padding: 26px 16px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); max-width: 640px; margin: 0 auto 14px; }
#loader img { max-width: 150px; height: auto; border-radius: 12px; }
#countdown { font-size: 1.5rem; font-weight: 800; color: var(--navy); margin-top: 8px; font-variant-numeric: tabular-nums; }

/* ---------- result: header ---------- */
.ws-result { margin-top: 4px; }
.ws-result > .wound-photo { display: inline-block; max-width: 220px; width: auto; height: auto; border-radius: 12px; margin: 0 8px 8px 0; vertical-align: top; }
.ws-result > p, .ws-result > div[style*="text-align:center"] { background: var(--card); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); margin: 0 0 14px; }
.ws-rhead { display: flex; gap: 14px; align-items: stretch; }
.ws-photos { display: flex; gap: 6px; flex-wrap: wrap; flex: 0 0 auto; max-width: 42%; align-content: flex-start; }
.ws-photos .wound-photo { width: 120px; height: 120px; object-fit: cover; border-radius: 14px; display: block; margin: 0; box-shadow: var(--shadow); }
.ws-photos .wound-photo:only-child { width: 150px; height: 150px; }
.ws-status { flex: 1; min-width: 0; background: var(--card2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.ws-status-top { display: flex; align-items: center; gap: 10px; }
.ws-check { width: 36px; height: 36px; border-radius: 50%; background: var(--hi-bg); color: var(--hi); display: grid; place-items: center; flex: 0 0 auto; animation: wsPop 0.5s cubic-bezier(.2,1.4,.4,1) both; }
.ws-check svg { width: 20px; height: 20px; }
.ws-status-title { font-weight: 800; }
.ws-status-sub { font-size: 0.8rem; color: var(--muted); }
.ws-bar-row { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.ws-bar { height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; flex: 1; }
.ws-bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #4f46e5); transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.ws-bar.ws-lv-hi > i { background: linear-gradient(90deg, #16a34a, #4ade80); }
.ws-bar.ws-lv-md > i { background: linear-gradient(90deg, #d97706, #fbbf24); }
.ws-bar.ws-lv-lo > i { background: linear-gradient(90deg, #dc2626, #f87171); }
.ws-summary-line { color: var(--text); opacity: 0.85; font-size: 0.9rem; line-height: 1.45; min-height: 1.4em; }
.ws-typing::after { content: '▍'; color: var(--primary); animation: wsBlink 0.8s steps(1) infinite; }

/* ---------- metric tiles ---------- */
.ws-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 700px) { .ws-metrics { grid-template-columns: repeat(4, 1fr); } }
.ws-metric { position: relative; overflow: hidden; background: var(--card); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; min-width: 0; transition: transform 0.15s, box-shadow 0.15s; }
.ws-metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ws-metric::after { content: ''; position: absolute; top: -40px; right: -40px; width: 110px; height: 110px; border-radius: 50%; opacity: 0.12; background: var(--primary); pointer-events: none; }
.ws-metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ws-metric-ico { width: 42px; height: 42px; border-radius: 13px; color: #fff; display: grid; place-items: center; flex: 0 0 auto; box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25); animation: wsFloat 3.4s ease-in-out infinite; }
.ws-metric-ico svg { width: 22px; height: 22px; }
.ws-metric-0 .ws-metric-ico { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.ws-metric-1 .ws-metric-ico { background: linear-gradient(135deg, #f59e0b, #ef4444); animation-delay: 0.4s; }
.ws-metric-1::after { background: #f59e0b; }
.ws-metric-2 .ws-metric-ico { background: linear-gradient(135deg, #06b6d4, #2563eb); animation-delay: 0.8s; }
.ws-metric-2::after { background: #06b6d4; }
.ws-metric-3 .ws-metric-ico { background: linear-gradient(135deg, #ef4444, #be123c); animation-delay: 1.2s; }
.ws-metric-3::after { background: #ef4444; }
.ws-metric-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); font-weight: 500; }
.ws-metric-value { font-weight: 500; font-size: 0.92rem; line-height: 1.35; overflow-wrap: anywhere; min-height: 1.35em; color: var(--text); }
.ws-pill { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 9px; font-size: 0.75rem; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ws-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ws-pill-hi { background: var(--hi-bg); color: var(--hi); }
.ws-pill-md { background: var(--md-bg); color: var(--md); }
.ws-pill-lo { background: var(--lo-bg); color: var(--lo); }

/* ---------- toolbar, notes ---------- */
.ws-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.ws-toolbar .ws-btn { flex: 1; }
.ws-ai-note { display: flex; gap: 10px; align-items: center; background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); font-size: 0.82rem; color: var(--muted); margin: 14px 0; }
.ws-ai-note svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--primary); }
.ws-report-head { font-weight: 800; color: var(--navy); margin: 4px 0 10px; padding: 0 4px; font-size: 1.05rem; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ws-footer { text-align: center; color: var(--muted); font-size: 0.74rem; margin-top: 22px; }

/* ---------- app view: generic boxes (no left borders) ---------- */
.ws-view { margin-bottom: 14px; }
.ws-pre { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ws-box { border-radius: 16px; padding: 14px 16px; background: var(--neutral-bg); color: var(--neutral-fg); line-height: 1.5; }
.ws-box strong, .ws-box b { display: block; margin-bottom: 4px; font-weight: 800; }
.ws-box-warn { background: var(--warn-bg); color: var(--warn-fg); }
.ws-box-danger { background: var(--danger-bg); color: var(--danger-fg); }
.ws-box-success { background: var(--success-bg); color: var(--success-fg); }
.ws-box-info { background: var(--info-bg); color: var(--info-fg); }
.ws-box-indigo { background: var(--indigo-bg); color: var(--indigo-fg); }
.ws-box-dark { background: var(--dark-bg); color: var(--dark-fg); padding: 18px 20px; box-shadow: var(--shadow-lg); }
.ws-box-dark .ws-box, .ws-box-dark .ws-box-neutral { background: rgba(255, 255, 255, 0.12); color: inherit; margin-top: 10px; }
.ws-box .ws-box { margin-top: 10px; }
.ws-box p { margin: 6px 0; }
.ws-summary-wrap { margin-top: 6px; }
.ws-disclaimer { position: relative; background: var(--warn-bg); color: var(--warn-fg); border-radius: 14px; padding: 10px 14px 30px; font-size: 0.72rem; line-height: 1.4; }
.ws-disclaimer .ws-box { background: transparent; padding: 0; font-size: inherit; color: inherit; max-height: 2.9em; overflow: hidden; }
.ws-disclaimer .ws-box strong { display: inline; margin: 0; }
.ws-disclaimer.ws-exp .ws-box { max-height: none; }
.ws-more { position: absolute; right: 12px; bottom: 6px; border: none; background: transparent; color: inherit; font: inherit; font-size: 0.72rem; font-weight: 800; cursor: pointer; text-decoration: underline; padding: 2px 4px; }
html[dir="rtl"] .ws-more { right: auto; left: 12px; }
.ws-rest { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.ws-rest > * + * { margin-top: 10px; }

/* ---------- section cards ---------- */
.ws-sec { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 12px; overflow: hidden; }
.ws-sec-hd { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: default; user-select: none; }
.ws-sec-hd[role="button"] { cursor: pointer; }
.ws-sec-hd[role="button"]:hover { background: var(--card2); }
.ws-sec-num { width: 30px; height: 30px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 0.85rem; display: grid; place-items: center; flex: 0 0 auto; }
.ws-sec-ico { width: 36px; height: 36px; border-radius: 12px; background: linear-gradient(135deg, var(--primary), #4f46e5); color: #fff; display: grid; place-items: center; flex: 0 0 auto; box-shadow: 0 6px 14px rgba(37, 99, 235, 0.25); }
.ws-sec-ico svg { width: 19px; height: 19px; }
.ws-sec-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ws-sec-title { font-weight: 800; color: var(--navy); font-size: 1rem; line-height: 1.25; }
.ws-sec-key { font-size: 0.8rem; color: var(--muted); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ws-sec-chev { color: var(--muted); flex: 0 0 auto; transition: transform 0.2s; }
.ws-sec-chev svg { width: 20px; height: 20px; }
.ws-sec.ws-open .ws-sec-chev { transform: rotate(180deg); }
.ws-sec-ins { padding: 0 16px 14px; }
.ws-sec-dt { padding: 4px 16px 16px; border-top: 1px solid var(--line); font-size: 0.93rem; line-height: 1.55; }
.ws-sec-dt > * + * { margin-top: 10px; }
.ws-sec-dt .ws-h { font-size: 0.95rem; font-weight: 800; color: var(--navy); margin: 14px 0 4px; }
.ws-sec-dt p { margin: 6px 0; }
.ws-list { padding-left: 20px; margin: 6px 0; }
html[dir="rtl"] .ws-list { padding-left: 0; padding-right: 20px; }
.ws-list li { margin: 4px 0; }
.ws-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.86rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ws-table th, .ws-table td { padding: 8px 10px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
.ws-table th { background: var(--card2); font-weight: 800; color: var(--navy); }
.ws-table tr:last-child td { border-bottom: none; }
.ws-track { height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 4px 0 8px; }
.ws-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), #4f46e5); transition: width 1s cubic-bezier(.2,.8,.2,1); }

/* ---------- insights ---------- */
.ws-ins-row { display: flex; align-items: center; gap: 16px; }
.ws-ins-meta { min-width: 0; flex: 1; }
.ws-ins-big { font-weight: 800; font-size: 1.15rem; color: var(--text); line-height: 1.25; min-height: 1.3em; }
.ws-ins-sub { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.ws-donut { position: relative; width: 84px; height: 84px; flex: 0 0 auto; }
.ws-donut svg { width: 84px; height: 84px; transform: rotate(-90deg); }
.ws-donut circle { fill: none; stroke-width: 4; }
.ws-donut .bg { stroke: var(--line); }
.ws-donut .fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1); }
.ws-donut.ws-lv-hi .fg { stroke: var(--hi); } .ws-donut.ws-lv-md .fg { stroke: var(--md); } .ws-donut.ws-lv-lo .fg { stroke: var(--lo); }
.ws-donut b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.ws-size .ws-size-svg { width: 130px; height: 122px; flex: 0 0 auto; }
.ws-size-svg .grid path { stroke: var(--grid); stroke-width: 1; fill: none; }
.ws-size-svg .blob { fill: #f87171; fill-opacity: 0.85; stroke: #b91c1c; stroke-width: 1.5; transition: transform 0.9s cubic-bezier(.2,1.2,.4,1); }
.ws-size-svg .dim { stroke: var(--primary); stroke-width: 2; stroke-linecap: round; }
.ws-ins-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .ws-ins-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.ws-ins-block { background: var(--card2); border-radius: 14px; padding: 12px 14px; }
.ws-ins-title { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 10px; }
.ws-ins-title svg { width: 16px; height: 16px; color: var(--primary); }
.ws-stack { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--line); }
.ws-stack i { display: block; height: 100%; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.ws-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 0.78rem; color: var(--text); }
.ws-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.ws-legend b { color: var(--navy); }
.ws-meter { display: flex; gap: 5px; height: 14px; }
.ws-meter i { flex: 1; border-radius: 6px; background: var(--line); transition: background 0.35s, transform 0.35s; }
.ws-meter.ws-go i.on { transform: scaleY(1.15); }
.ws-meter-0.ws-go i.on { background: #94a3b8; } .ws-meter-1.ws-go i.on { background: #38bdf8; } .ws-meter-2.ws-go i.on { background: #f59e0b; } .ws-meter-3.ws-go i.on { background: #ef4444; }
.ws-meter-label { font-weight: 800; color: var(--navy); margin-top: 8px; font-size: 0.95rem; }
.ws-chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ws-chip-c { display: inline-flex; gap: 5px; align-items: center; border-radius: 999px; padding: 5px 11px; font-size: 0.8rem; font-weight: 600; }
.ws-chip-c b { font-size: 0.95rem; }
.ws-c-yes { background: var(--lo-bg); color: var(--lo); } .ws-c-unk { background: var(--md-bg); color: var(--md); } .ws-c-no { background: var(--hi-bg); color: var(--hi); }
.ws-steps { display: flex; flex-direction: column; gap: 8px; }
.ws-step { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; line-height: 1.4; }
.ws-step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; font-size: 0.78rem; display: grid; place-items: center; flex: 0 0 auto; margin-top: 1px; }
.ws-step-n svg { width: 14px; height: 14px; }

/* ---------- dressing cards ---------- */
.ws-dress-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .ws-dress-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } .ws-dress-or { display: none; } }
/* the two options are visually distinct: numbered badge, own accent colour, own border and tint */
.ws-dress { background: var(--card2); border: 1px solid var(--line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; transition: transform 0.15s, box-shadow 0.15s; }
.ws-dress-1 { border-color: var(--opt1); }
.ws-dress-2 { border-color: var(--opt2); background: var(--opt2-tint); }
.ws-dress-head { display: flex; align-items: center; justify-content: space-between; }
.ws-opt { display: inline-flex; align-items: center; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; border-radius: 999px; padding: 4px 10px; }
.ws-opt-1 { background: var(--opt1-bg); color: var(--opt1); }
.ws-opt-2 { background: var(--opt2-bg); color: var(--opt2); }
.ws-dress-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.ws-dress-or::before, .ws-dress-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
@media (min-width: 700px) { .ws-dress-grid .ws-dress-or { display: none; } }   /* side by side on desktop: no divider needed */
.ws-dress:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ws-dress-top { display: flex; gap: 12px; align-items: center; }
.ws-dress-art { position: relative; width: 132px; height: 100px; flex: 0 0 auto; border-radius: 12px; background: var(--card); display: grid; place-items: center; overflow: hidden; transition: transform 0.15s, box-shadow 0.15s; }
.ws-dress-art > svg { width: 132px; height: 100px; }
/* contain = the entire product stays visible; the white ground matches typical pack shots */
.ws-dress-art img { width: 132px; height: 100px; object-fit: contain; background: #ffffff; display: block; }
.ws-dress-art img.ws-fit-cover { object-fit: cover; background: transparent; }
.ws-zoom { position: absolute; right: 5px; bottom: 5px; width: 26px; height: 26px; border-radius: 8px; background: rgba(15, 23, 42, 0.72); color: #fff; display: none; place-items: center; pointer-events: none; }
.ws-zoom svg { width: 15px; height: 15px; }
.ws-dress-art.ws-zoomable { cursor: zoom-in; }
.ws-dress-art.ws-zoomable .ws-zoom { display: grid; opacity: 0.85; }
.ws-dress-art.ws-zoomable:hover { transform: scale(1.03); box-shadow: var(--shadow-lg); }
.ws-dress-art.ws-zoomable:hover .ws-zoom { opacity: 1; }
.ws-dress-art.ws-zoomable:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- product image lightbox ---------- */
body.ws-lb-open { overflow: hidden; }
.ws-lb { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 20px; }
.ws-lb:not(.ws-lb-on) { pointer-events: none; }
.ws-lb.ws-lb-on { pointer-events: auto; }
.ws-lb-bg { position: absolute; inset: 0; background: rgba(2, 6, 23, 0.8); opacity: 0; transition: opacity 0.2s; backdrop-filter: blur(3px); }
.ws-lb-box { position: relative; margin: 0; background: var(--card); border-radius: 16px; padding: 14px; max-width: min(560px, 92vw);
             box-shadow: var(--shadow-lg); transform: scale(0.94); opacity: 0; transition: transform 0.2s cubic-bezier(.2,1.2,.4,1), opacity 0.2s; }
.ws-lb-on .ws-lb-bg { opacity: 1; }
.ws-lb-on .ws-lb-box { transform: scale(1); opacity: 1; }
.ws-lb-box img { display: block; width: 100%; max-width: 520px; max-height: min(62vh, 460px); object-fit: contain; background: #fff; border-radius: 10px; }
.ws-lb-box figcaption { margin-top: 12px; display: flex; flex-direction: column; gap: 2px; }
.ws-lb-name { font-weight: 800; font-size: 1.05rem; color: var(--text); }
.ws-lb-maker { font-size: 0.82rem; color: var(--muted); }
.ws-lb-cat { align-self: flex-start; margin-top: 6px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; border-radius: 999px; padding: 3px 9px; background: var(--primary-soft); color: var(--primary); }
.ws-lb-info { margin: 8px 0 0; font-size: 0.84rem; line-height: 1.5; color: var(--muted); }
.ws-lb-x { position: absolute; top: -12px; right: -12px; width: 34px; height: 34px; border-radius: 50%; border: none; background: var(--card); color: var(--text);
           box-shadow: var(--shadow-lg); cursor: pointer; display: grid; place-items: center; }
.ws-lb-x svg { width: 18px; height: 18px; }
.ws-lb-x:hover { background: var(--primary-soft); color: var(--primary); }
@media (max-width: 600px) { .ws-lb { padding: 14px; } .ws-lb-x { top: -10px; right: -6px; } }
@media (prefers-reduced-motion: reduce) { .ws-lb-bg, .ws-lb-box { transition: none; } }
.ws-dress-art img ~ svg { display: none; }
.ws-dress-meta { min-width: 0; }
.ws-dress-name { font-weight: 800; font-size: 1rem; color: var(--text); line-height: 1.2; }
.ws-dress-maker { font-size: 0.76rem; color: var(--muted); margin-top: 2px; line-height: 1.3; }
.ws-cat { display: inline-block; margin-top: 6px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; border-radius: 999px; padding: 3px 8px; background: var(--primary-soft); color: var(--primary); }
.ws-cat-fibreAg { background: var(--neutral-bg); color: var(--neutral-fg); } .ws-cat-alginate { background: var(--warn-bg); color: var(--warn-fg); } .ws-cat-dacc { background: var(--success-bg); color: var(--success-fg); }
.ws-cat-gel { background: var(--indigo-bg); color: var(--indigo-fg); } .ws-cat-tlc { background: #fce7f3; color: #9d174d; } .ws-cat-odour { background: #374151; color: #e5e7eb; } .ws-cat-cream, .ws-cat-plaster { background: var(--warn-bg); color: var(--warn-fg); }
.ws-dress-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-dress-tags span { font-size: 0.72rem; background: var(--card); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; }
.ws-dress-info { font-size: 0.82rem; line-height: 1.45; color: var(--muted); background: var(--card); border-radius: 10px; padding: 8px 10px; }
.ws-dress-why { font-size: 0.86rem; line-height: 1.45; color: var(--text); }
.ws-dress-why b { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 2px; }
.ws-dress-dt { font-size: 0.84rem; line-height: 1.45; color: var(--text); border-top: 1px solid var(--line); padding-top: 8px; }
.ws-dress-dt p { margin: 4px 0; }
.ws-dress-dt b { color: var(--navy); }
.ws-dress-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.ws-aff-note { grid-column: 1 / -1; font-size: 0.72rem; line-height: 1.45; color: var(--muted); padding: 2px 2px 0; }
.ws-dress-actions .ws-btn-primary { box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25); }

/* ---------- start-page About / How it works / FAQ (indexable content) ---------- */
.ws-seo { max-width: 640px; margin: 4px auto 14px; }
.ws-seo-h { font-size: 1.05rem; font-weight: 800; color: var(--navy); margin: 0 0 6px; }
.ws-seo-h3 { font-size: 0.9rem; font-weight: 700; color: var(--navy); margin: 14px 0 6px; }
.ws-seo p, .ws-seo li { font-size: 0.86rem; color: var(--muted); line-height: 1.55; margin: 0; }
.ws-seo ol { padding-left: 20px; margin: 0; }
.ws-seo li { margin: 3px 0; }
html[dir="rtl"] .ws-seo ol { padding-left: 0; padding-right: 20px; }
.ws-faq { border-top: 1px solid var(--line); padding: 8px 0; }
.ws-faq summary { cursor: pointer; font-weight: 600; font-size: 0.88rem; color: var(--text); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ws-faq summary::-webkit-details-marker { display: none; }
.ws-faq summary::after { content: '+'; color: var(--muted); font-weight: 700; flex: 0 0 auto; }
.ws-faq[open] summary::after { content: '\2212'; }
.ws-faq p { margin: 6px 0 0; }

/* ---------- misc ---------- */
.ws-hide, .assessment-container .ws-hide { display: none !important; }
.ws-original { display: none; }
body.ws-printing .ws-original { display: block !important; margin-top: 20px; }
.ws-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 0.85rem; font-weight: 700; z-index: 1100; box-shadow: var(--shadow-lg); }
#pdf-download-bar { margin: 0 0 14px !important; }
#pdf-download-bar button { width: 100%; border-radius: 13px !important; background: var(--primary) !important; }
.ws-in { animation: wsIn 0.5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes wsIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes wsFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes wsPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.25); } 50% { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); } }
@keyframes wsPop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes wsBlink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ws-in, .ws-metric-ico, .ws-check, .ws-drop-empty .ws-ico { animation: none !important; } .ws-bar > i, .ws-fill, .ws-stack i, .ws-donut .fg { transition: none !important; } }

/* ---------- review ---------- */
#review-section { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-top: 18px; color: var(--text); }
#review-section .section-header { margin: 0 0 6px; font-size: 1.1rem; color: var(--navy); text-align: center; }
#review-section .form-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
#review-section .form-column { flex: 1; min-width: 220px; }
#review-section label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; color: var(--navy); }
#review-section textarea, #review-section input[type="email"] { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px; font: inherit; background: var(--card2); color: var(--text); }
#review-section textarea { min-height: 90px; }
#review-section input[type="submit"] { margin-top: 12px; width: 100%; border: 1px solid var(--line); background: var(--card); color: var(--navy); border-radius: 13px; padding: 12px; font: inherit; font-weight: 700; cursor: pointer; }
#review-section input[type="submit"]:hover { background: var(--primary-soft); }
#review-stars input[type="radio"] { display: none; }
#review-stars { display: flex; justify-content: center; gap: 12px; flex-direction: row-reverse; direction: ltr; }
#review-stars-label { display: block; text-align: center; margin-bottom: 4px; }
#review-stars label { color: var(--line); font-size: 40px; line-height: 1; cursor: pointer; }
#review-stars input[type="radio"]:checked ~ label, #review-stars label:hover, #review-stars label:hover ~ label { color: #f59e0b; }
.rating-info { display: block; font-size: 0.78rem; color: var(--muted); text-align: center; margin-bottom: 8px; }

/* ---------- mobile ---------- */
@media (max-width: 600px) {
  .ws-app { padding: 8px 10px 30px; }
  .ws-header { padding: 4px 0 12px; }
  .ws-title { font-size: 1.02rem; white-space: nowrap; }
  .ws-sub { display: none; }
  .ws-brand { gap: 8px; }
  .ws-logo { width: 38px; height: 38px; border-radius: 11px; }
  .ws-tools { gap: 6px; }
  .ws-theme { width: 36px; height: 36px; }
  .ws-lang select { max-width: 92px; font-size: 0.85rem; }
  .ws-card { padding: 14px; border-radius: 16px; }
  .ws-rhead { gap: 10px; }
  .ws-photos { max-width: 40%; }
  .ws-photos .wound-photo, .ws-photos .wound-photo:only-child { width: 96px; height: 96px; }
  .ws-status { padding: 10px 12px; }
  .ws-toolbar { flex-direction: column; }
  .ws-drop { min-height: 210px; }
  #image-previews img { height: 240px; }
  .ws-sec-hd { padding: 12px 12px; gap: 10px; }
  .ws-sec-ins { padding: 0 12px 12px; }
  .ws-sec-dt { padding: 4px 12px 14px; font-size: 0.88rem; }
  .ws-sec-num { display: none; }
  .ws-ins-big { font-size: 1.05rem; }
  .ws-table { display: block; overflow-x: auto; white-space: nowrap; }
  .ws-table th, .ws-table td { white-space: normal; font-size: 0.82rem; padding: 7px 8px; }
  #review-stars label { font-size: 34px; }
}
