/* SafetyWallet v3 — brand-themed mobile styling.
   Identity: dark warm background (login + app bar), SafetyWallet gold/orange
   accents, light cards for field readability. No vendor template. */

:root {
  --dark: #1c1710;         /* app bar / login background */
  --dark-2: #262019;       /* raised dark surface (login card, inputs on dark) */
  --dark-line: #3a3128;    /* hairline on dark */
  --gold: #f2a93c;         /* primary action + highlights */
  --gold-dark: #d9922a;    /* pressed */
  --orange: #e8731c;       /* secondary accent / bands */
  --ink: #1c2733;          /* body text on light */
  --ink-soft: #5a6b76;
  --line: #dde5e9;
  --bg: #f2f5f7;           /* light content background */
  --card: #ffffff;
  --danger: #c0392b;
  --ok: #2e8b57;
  --radius: 12px;
}

* { box-sizing: border-box; }

/* Any class that sets `display` would otherwise beat the browser's own rule for
   the hidden attribute, silently leaving "hidden" elements on screen. This makes
   hidden mean hidden, everywhere. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

/* ---------- App bar (dark, branded) ---------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--dark);
  color: #fff;
  padding: 0.3rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 2px solid var(--gold);
}
.appbar .brand-logo { height: 37px; width: auto; display: block; }
.appbar .spacer { flex: 1; }
.appbar .who {
  font-size: 0.8rem;
  opacity: 0.85;
  max-width: 30vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appbar a { color: var(--gold); text-decoration: none; font-size: 0.85rem; font-weight: 600; }

.sync-badge {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
}
.sync-badge .badge-icon { font-size: 0.95rem; }
.sync-badge .badge-num { font-size: 0.78rem; }
/* Waiting to reach the server */
.sync-badge.has-pending { background: var(--orange); cursor: pointer; }
/* The server would not take it */
.sync-badge.has-refused { background: var(--danger); cursor: pointer; }
/* Everything has arrived */
.sync-badge.all-sent { background: rgba(255, 255, 255, 0.14); color: #8be0a6; }

/* The "waiting to send" strip — v2 gave no visible sign work was stuck. */
.sync-line {
  margin: 0 1rem 0.5rem;
  background: #fff6e6;
  border: 1px solid #f0d5a8;
  color: #7a5a00;
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

/* Page-title strip under the app bar */
.page-head {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 0.7rem 1rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.page-head h2 { margin: 0; font-size: 1.1rem; font-weight: 700; color: #21323e; }
.page-head .count { font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- Offline banner ---------- */
.offline-banner {
  background: #fdf0d0;
  color: #7a5a00;
  text-align: center;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  border-bottom: 1px solid #ecd9a0;
}

/* ---------- Login (dark, branded) ---------- */
.login-body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(120% 60% at 50% 0%, #2b2117 0%, var(--dark) 60%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.login-wrap {
  width: 100%;
  max-width: 420px;
  padding: 3rem 1.25rem 2rem;
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo img { width: 220px; max-width: 70%; height: auto; }
.login-logo p { margin: 1rem 0 0; color: #cdbfa8; font-size: 0.92rem; }

.login-card {
  background: var(--dark-2);
  border: 1px solid var(--dark-line);
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
}

.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: #e7ddcd;
}
.field input {
  width: 100%;
  font-size: 1rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--dark-line);
  border-radius: var(--radius);
  background: #18130d;
  color: #fff;
  outline: none;
}
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 169, 60, 0.2); }
.field input:disabled { opacity: 0.6; }

.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: var(--gold);
  color: #2a1e0c;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 0.9rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { background: var(--gold-dark); }
.btn:disabled { opacity: 0.65; }

.btn-small {
  width: auto;
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
}

.msg {
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
/* On the dark login these read on dark; on the light list they read on light. */
.msg.error { background: #3a1f1b; color: #f6c9c2; border: 1px solid #6b3229; }
.msg.info { background: #2a2519; color: #f0dfbf; border: 1px solid #55492c; }

/* ---------- Progress ---------- */
.progress-wrap { margin-top: 1.25rem; }
.progress-label { font-size: 0.85rem; color: #d8ccb6; margin-bottom: 0.4rem; text-align: center; }
.progress-track { height: 10px; background: #171009; border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: var(--gold); border-radius: 999px; transition: width 0.25s ease; }
.progress-bar.indeterminate { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

/* ---------- List screen ---------- */
.toolbar { padding: 0.75rem 1rem 0.25rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.toolbar input[type="search"] {
  flex: 1 1 100%;
  font-size: 0.95rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  outline: none;
}
.toolbar input[type="search"]:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 169, 60, 0.18); }
.toolbar select {
  flex: 1 1 auto;
  font-size: 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0.5rem;
}
.toolbar .btn-small { flex: 0 0 auto; }

.status-line { padding: 0.35rem 1rem 0.6rem; font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- Collapsible advanced filters ---------- */
.filters { padding: 0 1rem 0.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.filters-toggle {
  background: none;
  border: 0;
  padding: 0.25rem 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #33434f;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.filters-toggle .chev { display: inline-block; transition: transform 0.15s ease; font-size: 1rem; }
.filters-toggle.open .chev { transform: rotate(90deg); }
.filter-count {
  background: var(--gold);
  color: #2a1e0c;
  font-size: 0.7rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.filters-clear {
  margin-left: auto;
  background: none;
  border: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-dark);
  cursor: pointer;
}
.filters-panel {
  flex: 1 1 100%;
  display: grid;
  gap: 0.5rem;
  padding: 0.6rem 0 0.35rem;
}
/* A class that sets display beats the browser's own rule for the hidden
   attribute, so the panel must be told explicitly to stay hidden. */
.filters-panel[hidden] { display: none; }
.filter-field { display: grid; gap: 0.2rem; }
.filter-field span { font-size: 0.75rem; font-weight: 600; color: var(--ink-soft); }
.filter-field select {
  width: 100%;
  font-size: 0.9rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.list { padding: 0 1rem 2rem; display: grid; gap: 0.75rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: 0 1px 2px rgba(16, 42, 56, 0.05);
}
.card.is-overdue { border-left-color: var(--danger); }
.card.is-posted { border-left-color: var(--ok); }

.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.35rem; gap: 0.5rem; }
.card-ref { font-size: 0.78rem; color: var(--ink-soft); }
.card-title { font-size: 1rem; font-weight: 700; margin: 0 0 0.4rem; color: #21323e; }
.card-line { display: flex; gap: 0.5rem; font-size: 0.85rem; margin: 0.15rem 0; color: #33434f; }
.card-line span:first-child { color: var(--ink-soft); flex: 0 0 7rem; }
.card-line span:last-child { min-width: 0; overflow-wrap: anywhere; }

.badge { font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 0.22rem 0.6rem; white-space: nowrap; }
.badge-posted { background: #e3f4ea; color: #1e6b41; }
.badge-overdue { background: #fdecea; color: #a03329; }
.badge-days { background: #fdefda; color: #955a12; }

/* The whole card is the tap target on a phone — no separate Open control. */
.card { cursor: pointer; -webkit-tap-highlight-color: rgba(242, 169, 60, 0.2); }
.card:active { background: #fffdf8; }

/* Readiness stamp — large, unmissable "can I work on this?" indicator */
.card-main { display: flex; gap: 0.85rem; align-items: flex-start; }
.card-body-col { min-width: 0; flex: 1; }
.ready-stamp {
  flex: 0 0 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.25rem;
}
.ready-stamp .stamp-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  line-height: 1;
  border: 3px solid;
}
.ready-stamp .stamp-text { font-size: 0.68rem; font-weight: 700; line-height: 1.2; }

.ready-stamp.ready .stamp-icon { background: #fff5e4; border-color: var(--gold); color: var(--gold-dark); }
.ready-stamp.ready .stamp-text { color: var(--gold-dark); }

.ready-stamp.done .stamp-icon { background: #e3f4ea; border-color: #4aa877; color: #1e6b41; }
.ready-stamp.done .stamp-text { color: #1e6b41; }

.ready-stamp.notready .stamp-icon { background: #f1f4f6; border-color: #b9c6cd; color: #7d8f9a; border-style: dashed; }
.ready-stamp.notready .stamp-text { color: #7d8f9a; }

.empty-state { text-align: center; color: var(--ink-soft); padding: 3rem 1.5rem; font-size: 0.95rem; }

.version-tag { text-align: center; color: #9db0ba; font-size: 0.75rem; padding: 1rem 0 2rem; }
.login-body .version-tag { color: #7c6f59; }

/* ---------- Detail / answering screen ---------- */
.appbar .back-link { flex: 0 0 auto; margin-right: 0.25rem; }

.insp-head { background: #fff; border-bottom: 1px solid var(--line); padding: 0.9rem 1rem; }
.insp-head h2 { margin: 0 0 0.5rem; font-size: 1.05rem; color: #21323e; }
.head-line { display: flex; gap: 0.5rem; font-size: 0.85rem; margin: 0.15rem 0; color: #33434f; }
.head-line span:first-child { color: var(--ink-soft); flex: 0 0 6.5rem; }
.insp-head .err, .questions .err { color: var(--danger); }

.ready-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--dark);
  color: #fff;
  padding: 0.5rem 1rem;
  border-bottom: 2px solid var(--gold);
}
.ready-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.ready-count { font-size: 0.85rem; font-weight: 700; }
.ready-count.all-ready { color: #8be0a6; }
.ready-action {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

/* ---------- Focus view: one question at a time ---------- */
.focus-view { padding: 0.75rem 1rem 1rem; }
.focus-progress { margin-bottom: 0.6rem; }
.q-position { display: block; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 0.35rem; }
.progress-track.slim { height: 6px; background: #e2e9ed; }
.focus-view .progress-bar { background: var(--gold); }

.q-card.focus { padding: 1.1rem 1rem; }
/*
 * The question text gets a FIXED height, so the answer buttons land in exactly
 * the same place on every question — the thumb learns one position.
 *
 * It has to be fixed rather than merely reserved: the real question set (3,654
 * of them) averages 94 characters but runs to 391, which is about twelve lines
 * on a phone. Anything that long scrolls inside its own box instead of shoving
 * the controls down the screen. The fade at the bottom edge signals there is
 * more to read.
 */
.q-card.focus .q-text-wrap {
  position: relative;
  height: 5.94rem; /* four lines */
  margin: 0.35rem 0 1rem;
}
.q-card.focus .q-text {
  font-size: 1.1rem;
  line-height: 1.35;
  margin: 0;
  height: 100%;
  overflow-y: auto;
  padding-right: 0.2rem;
  -webkit-overflow-scrolling: touch;
}
.q-card.focus .q-text-wrap.is-scrollable::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1.6rem;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 85%);
}
/* Only appears when the question really is taller than its box. */
.q-card.focus .more-hint { display: none; }
.q-card.focus .q-text-wrap.is-scrollable .more-hint {
  display: block;
  position: absolute;
  right: 0.1rem;
  bottom: -0.15rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold-dark);
  background: #fff;
  padding-left: 0.3rem;
}
.q-card.focus .seg-btn { padding: 0.85rem 0; font-size: 1rem; }
/* ---------- Control Measure Checklist wording ---------- */
/* Asked once, above the control itself — the way the desktop system reads. */
.q-card.focus .cm-lead {
  margin: 0.1rem 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
}
/* The control measure's category, e.g. "F) Admin Control - Training". */
.q-card.focus .cm-category,
.ov-cat {
  display: block;
  background: #eaf4f9;
  border-left: 3px solid var(--brand, #276c89);
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1d5064;
}
.ov-cat {
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
}
/* A control measure name is short, so it needs less reserved height than a
   full audit question — but the height stays FIXED so the buttons do not move. */
.q-card.focus .cm-category + .q-text-wrap { height: 4.45rem; }

/* Reserve the photo row's height too, so a photo thumbnail appearing does not
   shift the comment box below it. */
.q-card.focus .q-photo { min-height: 52px; }
.q-comment .opt { color: var(--ink-soft); font-weight: 500; }

/* Previous / Next are pinned to the bottom of the screen: same place on every
   question, always in thumb reach, never chased down the page by a long
   question or a comment box. */
.focus-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  gap: 0.6rem;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 0.6rem 1rem;
  padding-bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -2px 10px rgba(16, 42, 56, 0.06);
}
/* Room so the pinned bar never covers the end of the card. */
.focus-view { padding-bottom: 5.5rem; }
.nav-btn {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  color: #33434f;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.85rem 0.5rem;
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-btn.primary { background: var(--gold); border-color: var(--gold-dark); color: #2a1e0c; }
.nav-btn:disabled { opacity: 0.45; }

/* ---------- Overview: jump to any question ---------- */
.overview-view { padding: 0.75rem 1rem 1.5rem; }
.overview-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.ov-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid #cfd9df;
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  cursor: pointer;
}
.ov-item.ok { border-left-color: #4aa877; }
.ov-item.warn { border-left-color: var(--orange); background: #fffaf3; }
.ov-item.todo { border-left-color: #cfd9df; }
.ov-item.sign-jump { border-left-color: var(--gold); background: #fffdf6; }
.ov-mark { font-size: 1.1rem; font-weight: 800; line-height: 1.2; flex: 0 0 1.2rem; text-align: center; }
.ov-item.ok .ov-mark { color: #1e6b41; }
.ov-item.warn .ov-mark { color: var(--orange); }
.ov-item.todo .ov-mark { color: #a9b8c0; }
.ov-item.sign-jump .ov-mark { color: var(--gold-dark); }
.ov-body { display: grid; gap: 0.15rem; min-width: 0; }
.ov-num { font-size: 0.72rem; font-weight: 700; color: var(--ink-soft); }
.ov-text {
  font-size: 0.88rem;
  color: #21323e;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.questions { padding: 0.75rem 1rem 1rem; display: grid; gap: 0.75rem; }

.q-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  box-shadow: 0 1px 2px rgba(16, 42, 56, 0.05);
}
.q-card.needs { border-color: #f0c9a0; background: #fffaf3; }
.q-top { display: flex; justify-content: space-between; align-items: center; }
.q-num { font-size: 0.75rem; font-weight: 700; color: var(--ink-soft); }
.q-state { font-weight: 800; font-size: 1rem; }
.q-state.ok { color: var(--ok); }
.q-state.warn { color: var(--orange); }
.q-text { font-size: 0.95rem; font-weight: 600; color: #21323e; margin: 0.25rem 0 0.7rem; }

.seg { display: flex; gap: 0.4rem; }
.seg-btn {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  color: #33434f;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.55rem 0;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.seg-btn.active { background: var(--gold); border-color: var(--gold-dark); color: #2a1e0c; }
.seg-btn[data-val="0"].active { background: var(--orange); border-color: #c85f12; color: #fff; }
.seg-btn:disabled { opacity: 0.55; }

.q-comment { margin-top: 0.7rem; }
.q-comment label { display: block; font-size: 0.8rem; font-weight: 600; color: #33434f; margin-bottom: 0.25rem; }
.q-comment .req { color: var(--orange); font-weight: 700; }
.q-comment textarea {
  width: 100%;
  font-size: 0.95rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  resize: vertical;
  font-family: inherit;
}
.q-comment textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 169, 60, 0.15); }

.q-photo { margin-top: 0.7rem; display: flex; align-items: center; gap: 0.75rem; }
.photo-btn {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #33434f;
  background: #f3f6f8;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}
.photo-btn.disabled { opacity: 0.55; pointer-events: none; }
.photo-preview img { height: 48px; width: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.photo-remove {
  margin-left: auto;
  background: none;
  border: 1px solid #e3c3bf;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.photo-remove:active { background: #fdecea; }
.photo-loading { font-size: 0.8rem; color: var(--ink-soft); }
.photo-error { font-size: 0.8rem; color: var(--danger); }

/* ---------- Signature ---------- */
.sign-section { background: #fff; border-top: 1px solid var(--line); margin-top: 0.5rem; padding: 1rem; }
.sign-section h3 { margin: 0 0 0.75rem; font-size: 1rem; color: #21323e; }
.sign-section .field label { color: #33434f; }
.sign-section .field input {
  width: 100%; font-size: 1rem; padding: 0.7rem 0.8rem;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); outline: none;
}
.sign-section .field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(242, 169, 60, 0.15); }
.sig-pad-wrap { position: relative; margin: 0.25rem 0 0.75rem; }
.sig-pad {
  width: 100%;
  height: 160px;
  background: #fbfcfd;
  border: 1px dashed #b9c6cd;
  border-radius: var(--radius);
  touch-action: none;
  display: block;
}
.sig-clear {
  position: absolute; top: 8px; right: 8px;
  font-size: 0.75rem; font-weight: 700; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 0.25rem 0.5rem; cursor: pointer;
}
/* The signature saves itself, like every other field — this just says so. */
.sig-status { margin: 0.1rem 0 0.6rem; font-size: 0.8rem; font-weight: 700; min-height: 1.1rem; }
.sig-status.saving { color: var(--ink-soft); }
.sig-status.saved { color: var(--ok); }
.sig-status.saved::before { content: "✓ "; }

.saved-sig { background: #f3f6f8; border: 1px solid var(--line); border-radius: 10px; padding: 0.6rem 0.8rem; margin-bottom: 0.75rem; font-size: 0.85rem; }
.saved-sig p { margin: 0.15rem 0; }
.sig-img { max-width: 100%; height: auto; margin-top: 0.5rem; background: #fff; border: 1px solid var(--line); border-radius: 8px; }

.btn-secondary { background: #33434f; color: #fff; }
.btn-secondary:active { background: #22303a; }

.submit-section { padding: 1rem; }
.submit-note { font-size: 0.85rem; color: var(--ink-soft); margin: 0.9rem 0 0.6rem; text-align: center; }

/* The "not finished yet" warning has to be impossible to miss — it is the
   reason the Submit button will not work. */
.submit-note.warn {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  text-align: left;
  background: #fff4e5;
  border: 1px solid #f0c088;
  border-left: 4px solid var(--orange);
  border-radius: 10px;
  padding: 0.8rem 0.9rem;
  color: #7a4a10;
  font-size: 0.9rem;
  line-height: 1.4;
}
.submit-note.warn .warn-icon {
  flex: 0 0 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.submit-note.info { background: #eef4f8; border: 1px solid #cadeea; border-radius: 10px; padding: 0.7rem; color: #1d5064; }
.submit-note.ok { color: #1e6b41; font-weight: 700; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--gold-dark);
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
}

/* Inline "you must comment" message — replaces v2's popup alert. */
.block-msg {
  margin: 0.45rem 0 0;
  color: #a03329;
  background: #fdecea;
  border: 1px solid #f2c4bf;
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Brief cue before the app moves on by itself after Yes / N/A. */
.advance-hint {
  margin: 0.6rem 0 0;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-dark);
}
