/* WoundB 2.0.8: clear app choice, direct marker access, and thumb-reachable mobile navigation. */
:root {
  --entry-ink: #172823;
  --entry-muted: #5f7069;
  --entry-green: #176b58;
  --entry-green-dark: #105344;
  --entry-border: #dce8e2;
  --entry-wash: #f4f8f6;
}

html { scroll-behavior: smooth; }
html[data-woundb-native="true"] #entryView { display: none !important; }
html[data-woundb-native="true"] #loginView { display: grid !important; }
html[data-woundb-native="true"] .auth-back { display: none !important; }
body.public-screen .account-area { display: none; }
body.browser-capture .alternate-capture > summary { display: none; }
body.browser-capture .alternate-capture { margin-top: 0; }

.entry-shell {
  width: min(960px, calc(100% - 40px));
  margin: 44px auto 30px;
  color: var(--entry-ink);
}
.entry-hero { max-width: 650px; margin: 0 auto 26px; text-align: center; }
.entry-eyebrow, .entry-kicker {
  color: var(--entry-green);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.entry-hero h1 {
  margin: 12px 0 9px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -.045em;
}
.entry-hero p { margin: 0; color: var(--entry-muted); font-size: 16px; }
.entry-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.entry-card {
  display: flex;
  flex-direction: column;
  min-height: 330px;
  padding: 27px;
  border: 1px solid var(--entry-border);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 12px 38px rgba(28, 54, 43, .06);
}
.entry-card-primary { border-color: #b6d9ca; background: #f3f8f5; }
.entry-icon {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 19px;
  place-items: center;
  border-radius: 14px;
  background: var(--entry-green);
  color: white;
  font-size: 23px;
  font-weight: 700;
}
.entry-icon-browser { background: #edf5f1; color: var(--entry-green); }
.entry-card h2 { margin: 7px 0 9px; font-size: 24px; line-height: 1.2; letter-spacing: -.03em; }
.entry-card > p { margin: 0 0 17px; color: var(--entry-muted); font-size: 14px; line-height: 1.6; }
.entry-version { margin: auto 0 11px; color: #64756d; font-size: 12px; }
.entry-version strong { color: var(--entry-ink); }
.entry-download, .entry-browser-button { min-height: 50px; justify-content: center; text-align: center; text-decoration: none; font-size: 14px; }
.entry-browser-button { margin-top: auto; border-color: var(--entry-green); color: var(--entry-green-dark); }
.entry-note { margin: 11px 0 0 !important; font-size: 11px !important; line-height: 1.5 !important; }
.entry-safety-note { margin: 17px auto 0; color: #74827c; text-align: center; font-size: 11px; line-height: 1.5; }
.entry-marker-download {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  margin-top: 16px;
  padding: 18px 20px;
  border: 1px solid var(--entry-border);
  border-radius: 16px;
  background: #fff;
}
.entry-marker-copy h2 { margin: 5px 0 3px; color: var(--entry-ink); font-size: 17px; line-height: 1.25; }
.entry-marker-copy p { max-width: 510px; margin: 0; color: var(--entry-muted); font-size: 12px; line-height: 1.5; }
.entry-marker-actions { display: grid; justify-items: end; gap: 7px; flex: 0 0 auto; }
.entry-marker-pdf { min-height: 46px; padding: 11px 15px; text-align: center; text-decoration: none; font-size: 13px; }
.entry-marker-svg { color: var(--entry-green-dark); font-size: 11px; font-weight: 750; text-underline-offset: 3px; }
.capture-quality-note {
  display: grid;
  gap: 3px;
  margin-top: 11px;
  padding: 10px 12px;
  border: 1px solid #dce8e2;
  border-radius: 11px;
  background: #f4f8f6;
  color: #354b42;
  font-size: 13px;
  line-height: 1.45;
}
.capture-quality-note strong { color: #174f40; font-size: 13px; }
.measurement-marker-download { display: grid; gap: 5px; }
.measurement-marker-download .marker-link { margin: 0; }
.marker-image-download { justify-self: start; padding: 3px 2px; color: var(--entry-green-dark); font-size: 11px; font-weight: 750; text-underline-offset: 3px; }

.auth-shell { align-items: start; padding: 34px 18px 28px; }
.auth-card { width: min(100%, 480px); margin: 0 auto; padding: 32px; border: 1px solid var(--entry-border); border-radius: 22px; box-shadow: 0 12px 38px rgba(28,54,43,.06); }
.auth-back { margin: -5px 0 18px; padding: 6px 0; color: var(--entry-green); font-size: 13px; }
.auth-card h1 { margin-top: 10px; letter-spacing: -.04em; }
.auth-fields label { display: grid; gap: 6px; color: #3e5149; font-size: 13px; font-weight: 700; }
.auth-fields input { min-height: 50px; padding: 0 14px; border: 1px solid #d7e1dc; border-radius: 12px; background: #fbfcfb; color: var(--entry-ink); font-size: 16px; }
.auth-fields input:focus { border-color: #64a890; outline: 3px solid rgba(23,107,88,.14); }
.auth-fields .primary-button { min-height: 50px; font-size: 15px; }
.demo-accounts { margin-top: 19px; }
.demo-title { color: #65756e; font-size: 11px; }
.demo-account { min-height: 52px; margin-top: 8px; padding: 10px 12px; border: 1px solid #e5ece8; border-radius: 12px; background: #fff; }
.demo-account span { color: var(--entry-ink); font-size: 13px; }
.demo-account small { font-size: 11px; }

.build-version-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 12px 16px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid #e8eeeb;
  background: #fbfcfb;
  color: #798680;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}
.build-version-footer strong { color: #40554b; font-weight: 800; }

.mobile-bottom-nav { display: none; }

@media (max-width: 680px) {
  html { scroll-padding-top: 70px; }
  body { padding-bottom: env(safe-area-inset-bottom); }
  body.public-screen .account-area { display: none; }
  .entry-shell { width: min(100% - 24px, 500px); margin: 25px auto 20px; }
  .entry-hero { margin-bottom: 19px; text-align: left; }
  .entry-eyebrow, .entry-kicker { font-size: 10px; }
  .entry-hero h1 { margin: 9px 0 7px; font-size: 30px; }
  .entry-hero p { font-size: 14px; }
  .entry-options { grid-template-columns: 1fr; gap: 11px; }
  .entry-card { min-height: auto; padding: 19px; border-radius: 18px; }
  .entry-icon { width: 40px; height: 40px; margin-bottom: 14px; border-radius: 12px; font-size: 20px; }
  .entry-card h2 { margin: 6px 0 7px; font-size: 21px; }
  .entry-card > p { margin-bottom: 12px; font-size: 13px; }
  .entry-version { margin: 4px 0 9px; }
  .entry-download, .entry-browser-button { min-height: 48px; font-size: 14px; }
  .entry-note { margin-top: 9px !important; font-size: 11px !important; }
  .entry-safety-note { max-width: 360px; margin: 14px auto; font-size: 10px; }
  .entry-marker-download { align-items: stretch; flex-direction: column; gap: 11px; margin-top: 12px; padding: 15px; border-radius: 15px; }
  .entry-marker-copy h2 { font-size: 16px; }
  .entry-marker-copy p { font-size: 12px; }
  .entry-marker-actions { justify-items: stretch; gap: 5px; }
  .entry-marker-pdf { width: 100%; min-height: 48px; font-size: 13px; }
  .entry-marker-svg { min-height: 36px; display: flex; align-items: center; }
  .capture-quality-note { margin-top: 8px; padding: 9px 10px; font-size: 12px; }
  .capture-quality-note strong { font-size: 12px; }
  .auth-shell { min-height: calc(100dvh - 160px); padding: 20px 12px 24px; }
  .auth-card { padding: 21px; border-radius: 18px; }
  .auth-back { margin-bottom: 14px; font-size: 12px; }
  .auth-card h1 { font-size: 28px; }
  .auth-card > p { font-size: 13px; }
  .auth-fields { gap: 13px; margin-top: 19px; }
  .auth-fields label { font-size: 12px; }
  .auth-fields input { min-height: 49px; font-size: 16px; }
  .demo-account { min-height: 50px; }
  .build-version-footer { gap: 4px 12px; padding: 9px 12px 12px; font-size: 9px; }
  .app-shell { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  .app-foot { padding-bottom: 10px; }
  .mobile-bottom-nav {
    position: fixed;
    z-index: 30;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 10px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    min-height: 66px;
    padding: 6px 4px;
    border: 1px solid rgba(220,232,226,.9);
    border-radius: 20px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 8px 30px rgba(18,47,36,.16);
    backdrop-filter: blur(16px);
  }
  .mobile-nav-item {
    display: grid;
    min-width: 0;
    min-height: 52px;
    align-content: center;
    justify-items: center;
    gap: 1px;
    padding: 3px 2px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #64746d;
    font-size: 10px;
    font-weight: 700;
  }
  .mobile-nav-item .nav-icon { display: grid; width: 24px; height: 22px; place-items: center; color: #65776f; }
  .mobile-nav-item .nav-icon svg { display: block; width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-nav-item.active { background: #eaf5f0; color: var(--entry-green-dark); }
  .mobile-nav-item.active .nav-icon { color: var(--entry-green); }
  .mobile-nav-item:disabled { opacity: .4; }
  .mobile-nav-item:focus-visible { outline: 3px solid rgba(23,107,88,.25); outline-offset: 1px; }
  .measure-card, #captureCard, #historySection, #patientUploadCard, #patientMore { scroll-margin-top: 72px; }
  .build-version-footer { position: relative; z-index: 1; }
}

@media (max-width: 350px) {
  .entry-hero h1 { font-size: 27px; }
  .entry-card { padding: 16px; }
  .mobile-bottom-nav { right: 6px; left: 6px; }
  .mobile-nav-item { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
