@import url('/assets/fonts/poppins.css');
/* ===========================================================================
   Creacity Anket - mobile-first UI
   Design tokens taken from creacity.com.tr so the survey app reads as part of
   the same family. Breakpoints are min-width: the phone layout is the base.
   =========================================================================== */

:root {
  /* Creacity palette */
  --ink: #0B1220;
  --ink-2: #101B2E;
  --ink-3: #1B2942;
  --slate: #5B6880;
  --slate-2: #7A8699;
  --line: #E3E8F0;
  --line-2: #D3DAE6;
  --bg: #F6F8FC;
  --card: #FFFFFF;
  --brand: #E8384A;
  --brand-dark: #C42539;
  --brand-soft: #FDECEE;
  --tech: #2563EB;
  --tech-2: #38BDF8;
  --tech-soft: #EAF1FE;
  --ok: #059669;
  --ok-soft: #E7F7F1;
  --warn: #B45309;
  --warn-soft: #FEF3C7;
  --danger: #B91C1C;
  --danger-soft: #FDECEC;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 16px;
  --sp-4: 24px;
  --sp-5: 32px;
  --sp-6: 48px;

  --shadow-sm: 0 1px 2px rgba(11, 18, 32, .06);
  --shadow: 0 4px 16px rgba(11, 18, 32, .08);
  --shadow-lg: 0 12px 32px rgba(11, 18, 32, .14);

  /* Thumb-friendly minimum. Every tappable thing is at least this tall. */
  --tap: 48px;

  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F2F5FA;
    --ink-2: #E2E8F2;
    --ink-3: #C9D2E0;
    --slate: #9AA6BC;
    --slate-2: #7D8899;
    --line: #233049;
    --line-2: #2E3C56;
    --bg: #0B1220;
    --card: #131D30;
    --brand-soft: #3A1A20;
    --tech-soft: #16233C;
    --ok-soft: #11291F;
    --warn-soft: #2E2410;
    --danger-soft: #3A1717;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 4px 16px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
  }
}

:root[data-theme="dark"] {
  --ink: #F2F5FA;
  --ink-2: #E2E8F2;
  --ink-3: #C9D2E0;
  --slate: #9AA6BC;
  --slate-2: #7D8899;
  --line: #233049;
  --line-2: #2E3C56;
  --bg: #0B1220;
  --card: #131D30;
  --brand-soft: #3A1A20;
  --tech-soft: #16233C;
  --ok-soft: #11291F;
  --warn-soft: #2E2410;
  --danger-soft: #3A1717;
}

/* --------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  /* Respect the notch on phones. */
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
           env(safe-area-inset-bottom) env(safe-area-inset-left);
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 { margin: 0 0 var(--sp-2); line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 var(--sp-3); }

a { color: var(--tech); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--tech);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.muted   { color: var(--slate); }
.small   { font-size: .875rem; }
.tiny    { font-size: .78rem; }
.strong  { font-weight: 650; }
.center  { text-align: center; }
.right   { text-align: right; }
.nowrap  { white-space: nowrap; }
.hidden  { display: none !important; }
.mono    { font-variant-numeric: tabular-nums; }

.stack > * + * { margin-top: var(--sp-3); }
.stack-sm > * + * { margin-top: var(--sp-2); }

/* 16px side gutter on phones, as a hard rule. */
.wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}
.wrap-narrow { max-width: 560px; }

/* ===========================================================================
   App shell
   =========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 56px;
  padding: var(--sp-2) 16px;
  max-width: 1200px;
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  font-size: 1.05rem;
}
.brand:hover { text-decoration: none; }
.brand > span:last-child { min-width: 0; }
.brand .crea-logo { height: 22px; flex: none; }
.brand-text {
  display: flex; flex-direction: column; min-width: 0;
  padding-left: var(--sp-2); margin-left: var(--sp-1);
  border-left: 1px solid var(--line-2);
}
.brand-title { font-size: .95rem; font-weight: 750; line-height: 1.2; }
/* Own line, one line only: a long "Ad Soyad" must not break mid-name. */
.brand-sub {
  display: block;
  color: var(--slate);
  font-weight: 500;
  font-size: .78rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}
@media (min-width: 640px) { .brand-sub { max-width: 320px; } }
.topbar-spacer { flex: 1; }

main { padding: var(--sp-4) 0 var(--sp-6); }

/* Bottom tab bar - the primary navigation on a phone. */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 12px rgba(11, 18, 32, .06);
}
.tabbar button {
  flex: 1;
  min-height: 58px;
  border: 0;
  background: none;
  color: var(--slate);
  font: inherit;
  font-size: .72rem;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  padding: 6px 2px;
}
.tabbar button .ic { font-size: 1.25rem; line-height: 1; }
.tabbar button svg.ic { width: 22px; height: 22px; fill: currentColor; }
.tabbar button[aria-current="page"] { color: var(--brand); }
.has-tabbar main { padding-bottom: 92px; }

@media (min-width: 860px) {
  .tabbar { display: none; }
  .has-tabbar main { padding-bottom: var(--sp-6); }
}

/* Desktop nav in the top bar */
.topnav { display: none; gap: var(--sp-1); }
@media (min-width: 860px) { .topnav { display: flex; } }
.topnav button {
  border: 0; background: none; font: inherit; font-weight: 600;
  color: var(--slate); cursor: pointer;
  padding: 8px 12px; border-radius: var(--r-pill);
  min-height: 40px;
}
.topnav button:hover { background: var(--bg); color: var(--ink); }
.topnav button[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); }

/* ===========================================================================
   Cards, tiles
   =========================================================================== */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: var(--sp-3); }
.card-head {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-bottom: var(--sp-3); flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-head .topbar-spacer { flex: 1; }

.grid { display: grid; gap: var(--sp-3); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
  box-shadow: var(--shadow-sm);
}
.tile-label {
  font-size: .76rem; font-weight: 650; color: var(--slate);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: 6px;
}
.tile-value {
  font-size: 1.75rem; font-weight: 750; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.tile-note { font-size: .8rem; color: var(--slate); margin-top: 4px; }
.tile-value.ok { color: var(--ok); }
.tile-value.warn { color: var(--warn); }
.tile-value.danger { color: var(--danger); }

/* ===========================================================================
   Buttons
   =========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 12px 20px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: var(--tech);
  color: #fff;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-align: center;
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-tech:hover:not(:disabled) { background: #1D4ED8; }
.btn-ok { background: var(--ok); }
.btn-danger { background: var(--danger); }
.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line-2);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg); }
.btn-quiet {
  background: none; color: var(--tech); border-color: transparent;
  padding: 10px 12px;
}
.btn-quiet:hover:not(:disabled) { background: var(--tech-soft); }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: .875rem; border-radius: var(--r-sm); }
.btn-lg { min-height: 56px; font-size: 1.05rem; padding: 14px 24px; }

.btn-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; }

/* ===========================================================================
   Forms
   =========================================================================== */

.field { display: block; }
.field > label, .label {
  display: block;
  font-weight: 650;
  font-size: .9rem;
  margin-bottom: 6px;
  color: var(--ink-2);
}
.hint { font-size: .82rem; color: var(--slate); margin-top: 5px; }

.input, .select, .textarea {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 14px;
  font: inherit;
  /* 16px minimum stops iOS Safari zooming in on focus. */
  font-size: 16px;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-md);
  appearance: none;
}
.textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%235B6880' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 40px;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--tech);
  box-shadow: 0 0 0 3px var(--tech-soft);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--slate-2); }

.field-error { color: var(--danger); font-size: .84rem; font-weight: 600; margin-top: 5px; }

/* ===========================================================================
   Survey answer options - the big tappable rows
   =========================================================================== */

.q-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
  box-shadow: var(--shadow-sm);
}
.q-card + .q-card { margin-top: var(--sp-3); }
.q-card[data-invalid="true"] { border-color: var(--danger); }

.q-index {
  display: inline-block;
  font-size: .74rem; font-weight: 700;
  color: var(--slate);
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 4px;
}
.q-text { font-size: 1.08rem; font-weight: 650; line-height: 1.35; margin-bottom: 4px; }
.q-req { color: var(--brand); margin-left: 3px; }
.q-help { font-size: .86rem; color: var(--slate); margin-bottom: var(--sp-3); }

.options { display: grid; gap: 10px; margin-top: var(--sp-3); }

/* The whole row is the hit area, never just the dot. */
.opt {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 12px 16px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--card);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.35;
  transition: border-color .12s ease, background .12s ease;
  user-select: none;
}
.opt:hover { border-color: var(--slate-2); }
.opt input { position: absolute; opacity: 0; width: 0; height: 0; }

.opt-mark {
  flex: none;
  width: 26px; height: 26px;
  border: 2px solid var(--line-2);
  background: var(--card);
  display: grid; place-items: center;
  transition: all .12s ease;
}
.opt-radio .opt-mark { border-radius: 50%; }
.opt-check .opt-mark { border-radius: 7px; }
.opt-mark::after {
  content: "";
  opacity: 0;
  transition: opacity .12s ease, transform .12s ease;
}
.opt-radio .opt-mark::after {
  width: 12px; height: 12px; border-radius: 50%; background: #fff;
}
.opt-check .opt-mark::after {
  width: 7px; height: 12px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translateY(-1px) scale(.6);
}

.opt-text { flex: 1; }

.opt:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  font-weight: 600;
}
.opt:has(input:checked) .opt-mark {
  border-color: var(--brand);
  background: var(--brand);
}
.opt:has(input:checked) .opt-mark::after { opacity: 1; }
.opt-check:has(input:checked) .opt-mark::after { transform: rotate(45deg) translateY(-1px) scale(1); }
.opt:has(input:focus-visible) { outline: 3px solid var(--tech); outline-offset: 2px; }

/* Scale (1-5) as a row of big round buttons */
.scale {
  display: flex;
  gap: 8px;
  margin-top: var(--sp-3);
}
.scale-btn {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.scale-btn[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.scale-labels {
  display: flex; justify-content: space-between;
  font-size: .78rem; color: var(--slate); margin-top: 6px;
}

/* ===========================================================================
   Badges, pills, alerts
   =========================================================================== */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: .76rem; font-weight: 650;
  background: var(--bg); color: var(--slate);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.badge-ok     { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn   { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-tech   { background: var(--tech-soft); color: var(--tech); border-color: transparent; }
.badge-brand  { background: var(--brand-soft); color: var(--brand-dark); border-color: transparent; }
.badge-dot::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor; flex: none;
}

.alert {
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: .92rem;
}
.alert-ok     { background: var(--ok-soft); border-color: transparent; color: #065F46; }
.alert-warn   { background: var(--warn-soft); border-color: transparent; color: #78350F; }
.alert-danger { background: var(--danger-soft); border-color: transparent; color: #7F1D1D; }
.alert-tech   { background: var(--tech-soft); border-color: transparent; color: #1E3A8A; }
.alert strong { font-weight: 700; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .alert-ok     { color: #6EE7B7; }
  :root:not([data-theme="light"]) .alert-warn   { color: #FCD34D; }
  :root:not([data-theme="light"]) .alert-danger { color: #FCA5A5; }
  :root:not([data-theme="light"]) .alert-tech   { color: #93C5FD; }
}

/* ===========================================================================
   Progress
   =========================================================================== */

.bar {
  height: 8px;
  background: var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.bar > span {
  display: block; height: 100%;
  background: var(--tech);
  border-radius: var(--r-pill);
  transition: width .3s ease;
}
.bar.done > span { background: var(--ok); }
.bar.low > span  { background: var(--warn); }

.progress-row {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: .84rem; font-variant-numeric: tabular-nums;
}
.progress-row .bar { flex: 1; }

/* ===========================================================================
   Tables - they scroll sideways on a phone rather than squash
   =========================================================================== */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--slate); font-weight: 700; white-space: nowrap;
  background: var(--bg); position: sticky; top: 0;
}
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--bg); }

/* ===========================================================================
   Assignment cards (field home)
   =========================================================================== */

.task {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--tech);
  border-radius: var(--r-md);
  padding: var(--sp-3);
  box-shadow: var(--shadow-sm);
}
.task + .task { margin-top: var(--sp-3); }
.task.is-done { border-left-color: var(--ok); }
.task.is-closed { border-left-color: var(--slate-2); opacity: .75; }
.task-title { font-weight: 700; font-size: 1.02rem; margin-bottom: 2px; }
.task-place { color: var(--slate); font-size: .88rem; margin-bottom: var(--sp-3); }
.task-place strong { color: var(--ink-2); font-weight: 650; }

/* ===========================================================================
   Modal / sheet - slides up from the bottom on a phone
   =========================================================================== */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(11, 18, 32, .55);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 640px) { .sheet-backdrop { align-items: center; padding: var(--sp-4); } }

.sheet {
  background: var(--card);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--sp-4) var(--sp-3) calc(var(--sp-4) + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
}
@media (min-width: 640px) { .sheet { border-radius: var(--r-xl); padding: var(--sp-4); } }
.sheet-head { display: flex; align-items: flex-start; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.sheet-head h2 { flex: 1; margin: 0; }
.sheet-close {
  border: 0; background: var(--bg); color: var(--ink);
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 1.1rem; cursor: pointer; flex: none; line-height: 1;
}

/* ===========================================================================
   Toasts
   =========================================================================== */

.toasts {
  position: fixed;
  left: 16px; right: 16px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 200;
  display: flex; flex-direction: column; gap: var(--sp-2);
  pointer-events: none;
}
@media (min-width: 640px) { .toasts { left: auto; width: 380px; bottom: var(--sp-4); right: var(--sp-4); } }

.toast {
  background: var(--ink);
  color: #fff;
  padding: 13px 16px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  font-size: .92rem;
  font-weight: 500;
  display: flex; align-items: flex-start; gap: 10px;
}
.toast-ok     { background: #047857; }
.toast-danger { background: #991B1B; }
.toast-warn   { background: #92400E; }

/* ===========================================================================
   Login
   =========================================================================== */

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--sp-4) 16px;
  background:
    radial-gradient(900px 500px at 15% -10%, var(--brand-soft), transparent 70%),
    radial-gradient(800px 500px at 110% 110%, var(--tech-soft), transparent 70%),
    var(--bg);
}
.login-box {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--sp-5) var(--sp-4);
  box-shadow: var(--shadow-lg);
}
.login-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: var(--sp-3);
}
.login-logo .crea-logo { height: 34px; }
.login-title { text-align: center; font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; }
.login-sub { text-align: center; color: var(--slate); font-size: .92rem; margin-bottom: var(--sp-4); }
.login-foot { text-align: center; color: var(--slate-2); font-size: .74rem; margin: var(--sp-4) 0 0; letter-spacing: .02em; }

/* --------------------------------------------------------------------------
   Login: split layout with the animated field scene
   -------------------------------------------------------------------------- */

html:has(.lp), body.login-page:has(.lp) { height: 100%; }
body.login-page:has(.lp) { display: block; place-items: normal; padding: 0; background: #0B1220; }

.lp {
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
}
@media (min-width: 900px) {
  .lp { grid-template-rows: none; grid-template-columns: minmax(0, 1.15fr) minmax(420px, .85fr); }
}

.lp-scene {
  position: relative;
  overflow: hidden;
  min-height: 300px;
  background: linear-gradient(160deg, #0F1A2E 0%, #0B1220 55%, #140F1B 100%);
  color: #F2F5FA;
  isolation: isolate;
}
.lp-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 30%, transparent 80%);
}
.lp-glow {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
  animation: lp-drift 18s ease-in-out infinite alternate;
}
.lp-glow-a { width: 520px; height: 520px; left: -160px; top: -120px; background: #E8384A; opacity: .28; }
.lp-glow-b { width: 460px; height: 460px; right: -140px; bottom: -160px; background: #2563EB; opacity: .22; animation-delay: -9s; }
@keyframes lp-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(60px, 40px, 0) scale(1.12); }
}

.lp-map {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .9;
  animation: lp-pan 40s ease-in-out infinite alternate;
}
@keyframes lp-pan {
  from { transform: scale(1.04) translate(0, 0); }
  to   { transform: scale(1.12) translate(-2%, -2%); }
}
.lp-streets path { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: lp-draw 6s ease-out forwards; }
.lp-streets path:nth-child(2) { animation-delay: .4s; }
.lp-streets path:nth-child(3) { animation-delay: .8s; }
.lp-streets path:nth-child(4) { animation-delay: 1.1s; }
.lp-streets path:nth-child(5) { animation-delay: 1.4s; }
.lp-streets path:nth-child(6) { animation-delay: 1.7s; }
@keyframes lp-draw { to { stroke-dashoffset: 0; } }
.lp-blocks rect { opacity: 0; animation: lp-rise .9s cubic-bezier(.2,.8,.2,1) forwards; }
.lp-blocks rect:nth-child(odd) { animation-delay: 1.2s; }
.lp-blocks rect:nth-child(even) { animation-delay: 1.6s; }
.lp-blocks rect:nth-child(3n) { animation-delay: 2s; }
@keyframes lp-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.lp-pin { opacity: 0; animation: lp-drop .7s cubic-bezier(.2,.9,.3,1.3) forwards; }
.lp-pin-1 { animation-delay: 2.2s; }
.lp-pin-2 { animation-delay: 2.9s; }
.lp-pin-3 { animation-delay: 3.6s; }
.lp-pin-4 { animation-delay: 4.3s; }
@keyframes lp-drop { from { opacity: 0; transform: translateY(-26px); } to { opacity: 1; transform: none; } }
.lp-ring { fill: none; stroke: #E8384A; stroke-width: 1.5; opacity: 0; transform-box: fill-box; transform-origin: center; animation: lp-pulse 3.2s ease-out infinite; }
.lp-ring-2 { animation-delay: 1.6s; }
.lp-pin-2 .lp-ring { animation-delay: .7s; } .lp-pin-2 .lp-ring-2 { animation-delay: 2.3s; }
.lp-pin-3 .lp-ring { animation-delay: 1.4s; } .lp-pin-3 .lp-ring-2 { animation-delay: 3s; }
.lp-pin-4 .lp-ring { animation-delay: 2.1s; } .lp-pin-4 .lp-ring-2 { animation-delay: 3.7s; }
@keyframes lp-pulse {
  0%   { opacity: .8; transform: scale(.4); }
  70%  { opacity: 0; transform: scale(3.2); }
  100% { opacity: 0; transform: scale(3.2); }
}
.lp-route path { stroke-dashoffset: 0; animation: lp-flow 2.4s linear infinite; }
@keyframes lp-flow { to { stroke-dashoffset: -28; } }

.lp-cards { position: absolute; inset: 0; pointer-events: none; }
.lp-card {
  position: absolute;
  width: 230px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(19, 29, 48, .82);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
  opacity: 0;
  animation: lp-card-in 1s cubic-bezier(.2,.8,.2,1) forwards, lp-float 7s ease-in-out infinite;
}
.lp-card-1 { left: 8%; top: 18%; animation-delay: 2.6s, 3.6s; }
.lp-card-2 { right: 7%; top: 44%; animation-delay: 3.4s, 4.4s; }
.lp-card-3 { right: 10%; top: 10%; animation-delay: 4.2s, 5.2s; width: 190px; }
@keyframes lp-card-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes lp-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.lp-card-q { display: block; font-size: .8rem; font-weight: 600; line-height: 1.35; color: #E2E8F2; margin-bottom: 10px; }
.lp-card-opts { display: grid; gap: 6px; }
.lp-card-opts i {
  display: block; height: 10px; border-radius: 5px;
  background: rgba(255,255,255,.12);
  position: relative;
}
.lp-card-opts i::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 5px;
  background: #E8384A;
}
.lp-card-opts i.on::before { animation: lp-fill 1.2s ease-out 3.8s forwards; }
.lp-card-opts i:nth-child(1) { width: 78%; } .lp-card-opts i:nth-child(2) { width: 54%; }
.lp-card-opts i:nth-child(3) { width: 66%; } .lp-card-opts i:nth-child(4) { width: 40%; }
@keyframes lp-fill { to { width: 100%; } }
.lp-card-scale { display: flex; gap: 6px; }
.lp-card-scale b {
  flex: 1; height: 30px; border-radius: 8px; display: grid; place-items: center;
  font-size: .78rem; font-weight: 700; color: #9AA6BC;
  background: rgba(255,255,255,.08);
}
.lp-card-scale b.on { color: #fff; background: #2563EB; animation: lp-pop .5s cubic-bezier(.2,.9,.3,1.4) 4.6s both; }
@keyframes lp-pop { from { transform: scale(.6); background: rgba(255,255,255,.08); } to { transform: scale(1); } }
.lp-card-bars { display: flex; gap: 5px; height: 54px; align-items: flex-end; }
.lp-card-bars i {
  flex: 1; border-radius: 4px 4px 2px 2px; background: #38BDF8; height: var(--h);
  transform: scaleY(0); transform-origin: bottom;
  animation: lp-bar .8s cubic-bezier(.2,.8,.2,1) forwards;
}
.lp-card-bars i:nth-child(1) { animation-delay: 5.0s; } .lp-card-bars i:nth-child(2) { animation-delay: 5.1s; }
.lp-card-bars i:nth-child(3) { animation-delay: 5.2s; } .lp-card-bars i:nth-child(4) { animation-delay: 5.3s; }
.lp-card-bars i:nth-child(5) { animation-delay: 5.4s; } .lp-card-bars i:nth-child(6) { animation-delay: 5.5s; background: #E8384A; }
.lp-card-bars i:nth-child(7) { animation-delay: 5.6s; }
@keyframes lp-bar { to { transform: scaleY(1); } }

.lp-copy {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 32px 32px;
  background: linear-gradient(to top, rgba(11,18,32,.92) 40%, rgba(11,18,32,0));
}
.lp-kicker {
  margin: 0 0 8px; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #E8384A;
}
.lp-headline { margin: 0 0 14px; font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; color: #fff; }
.lp-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; color: #C9D2E0; }
.lp-points li { display: flex; align-items: center; gap: 10px; }
.lp-dot { width: 6px; height: 6px; border-radius: 50%; background: #38BDF8; flex: none; box-shadow: 0 0 0 4px rgba(56,189,248,.15); }

.lp-panel {
  display: grid; place-items: center;
  padding: var(--sp-4) 16px;
  background: var(--bg);
}
.lp-panel .login-box { box-shadow: var(--shadow); }

@media (max-width: 899px) {
  .lp-scene { min-height: 46vh; }
  .lp-card { display: none; }
  .lp-card-1 { display: block; width: 200px; left: auto; right: 6%; top: 10%; }
  .lp-copy { padding: 20px 20px 24px; }
  .lp-headline { font-size: 1.35rem; }
  .lp-points { display: none; }
  .lp-panel { margin-top: -28px; position: relative; z-index: 2; border-radius: 22px 22px 0 0; padding-top: var(--sp-5); }
}
@media (min-width: 900px) {
  .lp-scene { min-height: 100vh; min-height: 100dvh; }
  .lp-copy { padding: 40px 48px 44px; }
  .lp-headline { font-size: 2.2rem; max-width: 520px; }
  .lp-panel { padding: var(--sp-5) var(--sp-5); }
  .lp-panel .login-box { max-width: 440px; padding: var(--sp-6) var(--sp-5); }
}
@media (min-width: 1400px) {
  .lp-headline { font-size: 2.6rem; }
}

/* --------------------------------------------------------------------------
   Admin shell: sidebar on desktop, topbar + tabbar on phones
   -------------------------------------------------------------------------- */

.sidebar { display: none; }

@media (min-width: 960px) {
  body.admin-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
  body.admin-shell .topbar-mobile { display: none; }
  body.admin-shell .tabbar { display: none; }
  body.admin-shell main { padding: var(--sp-5) 0 var(--sp-6); }
  body.admin-shell .wrap { max-width: 1240px; padding: 0 var(--sp-5); margin: 0; }

  .sidebar {
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
    background: linear-gradient(180deg, #0F1A2E, #0B1220);
    color: #C9D2E0;
    padding: 22px 16px 18px;
    border-right: 1px solid rgba(255,255,255,.06);
  }
  .sidebar-brand { padding: 2px 10px 22px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 14px; }
  .sidebar-brand .crea-logo { height: 26px; }
  .sidebar-brand-sub { display: block; margin-top: 8px; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #7D8899; }

  .sidenav { display: grid; gap: 4px; }
  .sidenav button {
    display: flex; align-items: center; gap: 12px;
    width: 100%; min-height: 44px; padding: 0 12px;
    border: 0; border-radius: 10px; background: none;
    color: #9AA6BC; font: inherit; font-weight: 600; font-size: .95rem;
    cursor: pointer; text-align: left;
    transition: background .15s ease, color .15s ease;
  }
  .sidenav button svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
  .sidenav button:hover { background: rgba(255,255,255,.06); color: #F2F5FA; }
  .sidenav button[aria-current="page"] { background: rgba(232,56,74,.16); color: #fff; box-shadow: inset 3px 0 0 #E8384A; }

  .sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
  .sidebar-user { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; }
  .sidebar-avatar {
    width: 36px; height: 36px; border-radius: 10px; flex: none;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #E8384A, #C42539); color: #fff; font-weight: 800;
  }
  .sidebar-user-text { min-width: 0; display: flex; flex-direction: column; }
  .sidebar-user-name { font-weight: 650; color: #F2F5FA; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
  .sidebar-user-role { font-size: .76rem; color: #7D8899; }
  .sidebar-logout {
    display: flex; align-items: center; gap: 10px; width: 100%;
    min-height: 40px; padding: 0 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px;
    background: none; color: #C9D2E0; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
  }
  .sidebar-logout svg { width: 18px; height: 18px; }
  .sidebar-logout:hover { background: rgba(255,255,255,.06); color: #fff; }
  .sidebar-copy { margin: 14px 0 0; font-size: .68rem; color: #5B6880; text-align: center; letter-spacing: .02em; }

  .admin-main { min-width: 0; }
}

.builder { max-width: 820px; }
.builder .card { margin-bottom: var(--sp-3); }

h1 { font-size: 1.6rem; }
@media (min-width: 960px) { h1 { font-size: 1.85rem; } }

.tile { position: relative; overflow: hidden; padding: var(--sp-3) var(--sp-3) var(--sp-3) calc(var(--sp-3) + 6px); }
.tile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--tech);
}
.tile:has(.tile-value.warn)::before { background: var(--warn); }
.tile:has(.tile-value.danger)::before { background: var(--danger); }
.tile:has(.tile-value.ok)::before { background: var(--ok); }

.pw-wrap { position: relative; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  min-height: 40px; padding: 0 12px;
  border: 0; background: none; color: var(--tech);
  font: inherit; font-size: .84rem; font-weight: 650; cursor: pointer;
  border-radius: var(--r-sm);
}

/* ===========================================================================
   Misc
   =========================================================================== */

.empty {
  text-align: center;
  padding: var(--sp-5) var(--sp-3);
  color: var(--slate);
}
.empty-ic { font-size: 2.2rem; margin-bottom: var(--sp-2); opacity: .5; }

.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex: none;
}
.spinner-dark { border-color: var(--line-2); border-top-color: var(--tech); }
@keyframes spin { to { transform: rotate(360deg); } }

.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: var(--sp-5); color: var(--slate); }

/* Sticky action bar at the bottom of a long form.
   Opaque on purpose: a translucent bar lets the question underneath show
   through the button and the two sets of text collide. */
.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--bg);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(11, 18, 32, .08);
  padding: var(--sp-3) 0 calc(var(--sp-3) + env(safe-area-inset-bottom));
  margin: var(--sp-4) -16px 0;
  padding-left: 16px;
  padding-right: 16px;
}
.has-tabbar .sticky-actions { bottom: 58px; }
@media (min-width: 860px) { .has-tabbar .sticky-actions { bottom: 0; } }

/* Offline / sync status strip */
.netbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  font-size: .86rem; font-weight: 600;
  background: var(--warn-soft); color: #78350F;
}
.netbar.is-syncing { background: var(--tech-soft); color: #1E3A8A; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .netbar { color: #FCD34D; }
  :root:not([data-theme="light"]) .netbar.is-syncing { color: #93C5FD; }
}

.map { height: 320px; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--sp-3); font-size: .9rem; }
.kv dt { color: var(--slate); }
.kv dd { margin: 0; font-weight: 600; }

@media print {
  .topbar, .tabbar, .sticky-actions, .toasts, .btn { display: none !important; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ===========================================================================
   Creacity logo
   =========================================================================== */

.crea-logo { display: block; height: 26px; width: auto; }
.crea-logo-light { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .crea-logo-dark  { display: none; }
  :root:not([data-theme="light"]) .crea-logo-light { display: block; }
}
:root[data-theme="dark"] .crea-logo-dark  { display: none; }
:root[data-theme="dark"] .crea-logo-light { display: block; }

.crea-byline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: var(--sp-4);
  color: var(--slate-2);
  font-size: .74rem;
}
.crea-byline .crea-logo { height: 18px; opacity: .85; }

.topbar .crea-logo { height: 20px; opacity: .9; }
.topbar-logo {
  display: none;
  padding-left: var(--sp-3);
  margin-left: var(--sp-1);
  border-left: 1px solid var(--line);
}
@media (min-width: 760px) { .topbar-logo { display: block; } }

/* ===========================================================================
   Motion
   Everything here is suppressed by the prefers-reduced-motion rule further
   down the file, so none of it is load-bearing.
   =========================================================================== */

@keyframes crea-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes crea-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes crea-slide-in-right {
  from { opacity: 0; transform: translateX(28px); }
  to   { opacity: 1; transform: none; }
}
@keyframes crea-slide-in-left {
  from { opacity: 0; transform: translateX(-28px); }
  to   { opacity: 1; transform: none; }
}
@keyframes crea-sheet-up {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: none; }
}
@keyframes crea-sheet-pop {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes crea-toast-in {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes crea-pop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.16); }
  100% { transform: scale(1); }
}
@keyframes crea-shimmer {
  from { background-position: -420px 0; }
  to   { background-position: 420px 0; }
}
@keyframes crea-grow-x {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes crea-grow-y {
  from { transform: scaleY(0); }
  to   { transform: scaleY(1); }
}
@keyframes crea-ring {
  0%   { box-shadow: 0 0 0 0 rgba(5, 150, 105, .45); }
  100% { box-shadow: 0 0 0 14px rgba(5, 150, 105, 0); }
}
@keyframes crea-check-draw {
  from { stroke-dashoffset: 40; }
  to   { stroke-dashoffset: 0; }
}

/* Entrance: lists and cards come in with a short stagger. */
.anim-in > * {
  animation: crea-fade-up .34s cubic-bezier(.22, .8, .3, 1) both;
}
.anim-in > *:nth-child(1) { animation-delay: .02s; }
.anim-in > *:nth-child(2) { animation-delay: .06s; }
.anim-in > *:nth-child(3) { animation-delay: .10s; }
.anim-in > *:nth-child(4) { animation-delay: .14s; }
.anim-in > *:nth-child(5) { animation-delay: .18s; }
.anim-in > *:nth-child(6) { animation-delay: .22s; }
.anim-in > *:nth-child(7) { animation-delay: .26s; }
.anim-in > *:nth-child(8) { animation-delay: .30s; }
.anim-in > *:nth-child(n+9) { animation-delay: .32s; }

.anim-fade { animation: crea-fade-in .25s ease both; }
.anim-up   { animation: crea-fade-up .34s cubic-bezier(.22, .8, .3, 1) both; }

.sheet          { animation: crea-sheet-up .32s cubic-bezier(.22, .9, .25, 1) both; }
.sheet-backdrop { animation: crea-fade-in .2s ease both; }
@media (min-width: 640px) {
  .sheet { animation: crea-sheet-pop .26s cubic-bezier(.22, .9, .25, 1) both; }
}

.toast { animation: crea-toast-in .26s cubic-bezier(.22, .9, .25, 1) both; }

/* Cards lift a little under the pointer; phones never see this. */
@media (hover: hover) and (min-width: 860px) {
  .card, .task, .tile {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  }
  .card:hover, .task:hover, .tile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
  }
}

/* Bars grow from the baseline on first paint. */
.bar > span { transform-origin: left center; animation: crea-grow-x .5s cubic-bezier(.22, .8, .3, 1) both; }
.opt-bar-fill { transform-origin: left center; animation: crea-grow-x .55s cubic-bezier(.22, .8, .3, 1) both; }
.chart-bar    { transform-origin: bottom center; animation: crea-grow-y .5s cubic-bezier(.22, .8, .3, 1) both; }

/* Loading skeleton */
.skeleton {
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--line) 25%, var(--line-2) 50%, var(--line) 75%);
  background-size: 420px 100%;
  animation: crea-shimmer 1.1s linear infinite;
  min-height: 16px;
}

/* Saved-confirmation tick */
.done-badge {
  width: 76px; height: 76px; margin: 0 auto var(--sp-3);
  border-radius: 50%;
  background: var(--ok-soft);
  display: grid; place-items: center;
  animation: crea-pop .5s cubic-bezier(.22, .9, .25, 1) both, crea-ring 1s ease-out .2s both;
}
.done-badge svg path {
  stroke-dasharray: 40;
  animation: crea-check-draw .45s ease-out .22s both;
}

/* ===========================================================================
   Survey stepper - one question at a time
   Deliberately plain: a single question, large options, and nothing else
   competing for the surveyor's attention while a resident is waiting.
   =========================================================================== */

.quiz {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.quiz-top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
}
.quiz-track {
  height: 5px;
  background: var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.quiz-track > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--ok), #10B981);
  border-radius: var(--r-pill);
  transition: width .4s cubic-bezier(.22, .8, .3, 1);
}
.quiz-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px;
  font-size: .78rem; color: var(--slate);
}
.quiz-meta strong { color: var(--ink-2); font-weight: 650; }
.quiz-meta .spacer { flex: 1; }

/* The question column: comfortable on a phone, centred on a tablet. */
.quiz-body {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: var(--sp-4) 16px var(--sp-3);
}
@media (min-width: 700px) {
  .quiz-body { max-width: 640px; padding-top: var(--sp-5); }
}
@media (min-width: 1024px) {
  .quiz-body { max-width: 680px; }
}

.quiz-step { animation: crea-slide-in-right .3s cubic-bezier(.22, .8, .3, 1) both; }
.quiz-step.back { animation-name: crea-slide-in-left; }

.quiz-counter {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .76rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ok);
  background: var(--ok-soft);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  margin-bottom: var(--sp-3);
}

.quiz-question {
  font-size: 1.35rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -.015em;
  margin-bottom: 6px;
}
@media (min-width: 700px) { .quiz-question { font-size: 1.55rem; } }

.quiz-help { color: var(--slate); font-size: .92rem; margin-bottom: var(--sp-4); }
.quiz-required { color: var(--brand); }

.quiz-options { display: grid; gap: 12px; margin-top: var(--sp-4); }
@media (min-width: 700px) { .quiz-options { gap: 14px; } }

/* Bigger hit areas than the general .opt: this is the main interaction. */
.quiz .opt { min-height: 64px; padding: 14px 18px; font-size: 1.05rem; }
@media (min-width: 700px) { .quiz .opt { min-height: 68px; font-size: 1.1rem; } }

.quiz .opt:active { transform: scale(.985); }
.quiz .opt { transition: border-color .14s ease, background .14s ease, transform .1s ease; }
.quiz .opt:has(input:checked) .opt-mark { animation: crea-pop .34s cubic-bezier(.22, .9, .25, 1); }

.quiz .scale { gap: 10px; margin-top: var(--sp-4); }
.quiz .scale-btn { min-height: 64px; font-size: 1.25rem; }
.quiz .scale-btn:active { transform: scale(.96); }
.quiz .scale-btn { transition: transform .1s ease, background .14s ease, border-color .14s ease; }

/* Footer: actions, then the numbered pager. */
.quiz-foot {
  position: sticky;
  bottom: 0;
  z-index: 30;
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(11, 18, 32, .07);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
}
.quiz-foot-inner { width: 100%; max-width: 640px; margin: 0 auto; }

.quiz-actions { display: flex; gap: 10px; }
.quiz-actions .btn { flex: 1; }
.quiz-actions .btn-back { flex: 0 0 auto; min-width: 56px; padding-left: 14px; padding-right: 14px; }

/* Numbered question pager */
.quiz-pager {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 12px 2px 2px;
  margin-top: 4px;
  scroll-behavior: smooth;
}
.quiz-pager::-webkit-scrollbar { display: none; }

.quiz-dot {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  background: var(--card);
  color: var(--slate);
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform .18s cubic-bezier(.22, .9, .25, 1),
              background .18s ease, color .18s ease, border-color .18s ease;
}
.quiz-dot:disabled { cursor: default; opacity: .55; }

/* answered */
.quiz-dot[data-state="done"] {
  background: var(--ok-soft);
  border-color: transparent;
  color: var(--ok);
}
/* the question being asked right now */
.quiz-dot[data-state="current"] {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
  transform: scale(1.14);
  box-shadow: 0 4px 12px rgba(5, 150, 105, .35);
}
/* required and left blank, flagged after a failed save */
.quiz-dot[data-state="missing"] {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}

/* Review / saved screens */
.quiz-review { text-align: center; padding: var(--sp-5) 0; }

/* ===========================================================================
   Admin panel on small screens
   Wide tables turn into one card per row: a sideways-scrolling table is
   unusable on a phone, and the panel has to work on one.
   =========================================================================== */

@media (max-width: 720px) {
  .table-wrap.as-cards { border: 0; background: none; overflow: visible; }
  .table-wrap.as-cards table,
  .table-wrap.as-cards tbody,
  .table-wrap.as-cards tr,
  .table-wrap.as-cards td { display: block; width: 100%; }

  .table-wrap.as-cards thead { display: none; }

  .table-wrap.as-cards tr {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
  }
  .table-wrap.as-cards tr:hover { background: var(--card); }

  .table-wrap.as-cards td {
    border: 0;
    padding: 5px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
  }
  /* The column name comes from the cell's own data-label. */
  .table-wrap.as-cards td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 38%;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--slate);
  }
  .table-wrap.as-cards td.num { justify-content: flex-start; text-align: left; }
  /* The first cell is the card's heading. */
  .table-wrap.as-cards td:first-child {
    display: block;
    padding-bottom: 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--line);
  }
  .table-wrap.as-cards td:first-child::before { content: none; }
  .table-wrap.as-cards td:empty { display: none; }
}

/* Sub-tab rows scroll sideways instead of wrapping into a tall block. */
.tab-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: var(--sp-4);
}
.tab-scroll::-webkit-scrollbar { display: none; }
.tab-scroll > .btn { flex: 0 0 auto; }

/* Filters stack on a phone, sit in a row from tablet up. */
.filter-row { display: grid; gap: var(--sp-3); }
@media (min-width: 640px) { .filter-row { grid-template-columns: 1fr 1fr auto; align-items: end; } }

/* ===========================================================================
   Per-question breakdown by mahalle
   Sequential single-hue ramp: light = few, dark = many. Never a rainbow.
   =========================================================================== */

.xt-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.xtab { border-collapse: separate; border-spacing: 2px; width: 100%; font-size: .82rem; }
.xtab th {
  background: none;
  position: static;
  font-size: .68rem;
  padding: 6px 4px;
  vertical-align: bottom;
  color: var(--slate);
  text-transform: none;
  letter-spacing: 0;
}
.xtab th.rowhead, .xtab td.rowhead {
  text-align: left;
  min-width: 130px;
  position: sticky;
  left: 0;
  background: var(--card);
  z-index: 1;
  border: 0;
  font-weight: 650;
}
.xtab td {
  border: 0;
  text-align: center;
  padding: 0;
}
.xtab .cell {
  border-radius: 6px;
  padding: 9px 6px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  min-width: 54px;
  animation: crea-fade-in .35s ease both;
}
.xtab .cell.empty { color: var(--slate-2); font-weight: 400; }

.xt-legend {
  display: flex; align-items: center; gap: 8px;
  font-size: .72rem; color: var(--slate);
  margin-top: 10px;
}
.xt-legend .ramp {
  display: flex; height: 10px; border-radius: 3px; overflow: hidden; width: 110px;
}
.xt-legend .ramp span { flex: 1; }

/* While a questionnaire is open the app chrome gets out of the way: the
   question is the only thing on screen. */
body.quiz-mode .tabbar { display: none; }
body.quiz-mode main { padding: 0; }
#view.quiz-host { max-width: none; padding: 0; }

/* On a tablet the question block sits in the optical centre rather than
   clinging to the top of a very tall screen. */
@media (min-width: 700px) and (min-height: 760px) {
  .quiz-body { display: flex; flex-direction: column; justify-content: center; }
  .quiz-step { width: 100%; }
}


/* ===========================================================================
   Field app: home, stats, history, theme toggle
   =========================================================================== */

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2);
  display: grid; place-items: center; cursor: pointer; flex: none;
  transition: background .15s ease, transform .15s ease;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .ic-moon { display: none; }
.theme-toggle[aria-pressed="true"] .ic-sun { display: none; }
.theme-toggle[aria-pressed="true"] .ic-moon { display: block; }

.home-hero {
  position: relative; overflow: hidden;
  border-radius: 22px;
  padding: 26px 22px;
  color: #fff;
  background:
    radial-gradient(420px 220px at 110% -20%, rgba(56,189,248,.35), transparent 70%),
    radial-gradient(360px 220px at -10% 120%, rgba(232,56,74,.45), transparent 70%),
    linear-gradient(145deg, #121E36, #0B1220);
  box-shadow: 0 18px 40px rgba(11,18,32,.22);
  margin-bottom: 18px;
}
.home-hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to left, #000, transparent 70%);
  -webkit-mask-image: linear-gradient(to left, #000, transparent 70%);
  pointer-events: none;
}
.home-kicker { margin: 0 0 4px; font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #9FD8F5; }
.home-title { margin: 0 0 8px; font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; color: #fff; line-height: 1.2; }
.home-sub { margin: 0; color: #C9D2E0; font-size: .92rem; }
.home-cta { margin-top: 18px; width: 100%; box-shadow: 0 10px 24px rgba(232,56,74,.35); }
@media (min-width: 560px) {
  .home-hero { display: flex; align-items: center; gap: 20px; padding: 30px 28px; }
  .home-hero-text { flex: 1; }
  .home-cta { margin-top: 0; width: auto; }
  .home-title { font-size: 1.8rem; }
}

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat::before {
  content: ""; position: absolute; right: -24px; top: -24px; width: 84px; height: 84px; border-radius: 50%;
  opacity: .14; background: var(--stat-c);
}
.stat-brand { --stat-c: #E8384A; }
.stat-tech  { --stat-c: #2563EB; }
.stat-sky   { --stat-c: #38BDF8; }
.stat-ok    { --stat-c: #059669; }
.stat-warn  { --stat-c: #B45309; }
.stat-label { font-size: .74rem; font-weight: 600; color: var(--slate); text-transform: uppercase; letter-spacing: .06em; }
.stat-value { font-size: 1.9rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin-top: 6px; color: var(--stat-c); font-variant-numeric: tabular-nums; }
.stat-note { font-size: .76rem; color: var(--slate); margin-top: 2px; }

.spark { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding-top: 6px; }
.spark-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.spark-bar {
  display: block; width: 100%; max-width: 22px; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #60A5FA, #2563EB);
  transform-origin: bottom; animation: crea-grow-y .6s cubic-bezier(.2,.8,.2,1) both;
}
.spark-col.is-today .spark-bar { background: linear-gradient(180deg, #F87171, #E8384A); }
.spark-day { font-size: .66rem; color: var(--slate-2); font-weight: 600; }
.spark-col.is-today .spark-day { color: var(--brand); }

.hist {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 14px; margin-top: 10px;
  box-shadow: var(--shadow-sm);
}
.hist-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-weight: 700;
  background: var(--ok-soft); color: var(--ok);
}
.hist.is-rejected .hist-mark { background: var(--danger-soft); color: var(--danger); }
.hist-body { flex: 1; min-width: 0; }
.hist-title { font-weight: 600; font-size: .95rem; line-height: 1.3; }
.hist-sub { font-size: .8rem; color: var(--slate); margin-top: 2px; }
.hist-sub strong { color: var(--ink-2); font-weight: 600; }
.hist-time { text-align: right; font-size: .78rem; color: var(--slate); display: flex; flex-direction: column; gap: 2px; flex: none; }

.task { border-left: 0; border-radius: 18px; }
.task.is-done { box-shadow: inset 4px 0 0 var(--ok); }
.task.is-closed { box-shadow: inset 4px 0 0 var(--slate-2); }

body.field-shell .topbar { backdrop-filter: blur(10px); background: color-mix(in srgb, var(--card) 86%, transparent); }
body.field-shell .tabbar { backdrop-filter: blur(10px); background: color-mix(in srgb, var(--card) 90%, transparent); }
.tabbar button[aria-current="page"] .ic { transform: translateY(-2px) scale(1.08); }
.tabbar button .ic { transition: transform .2s cubic-bezier(.2,.8,.2,1); }

.anim-fade { animation: crea-fade-in .25s ease both; }
.anim-up   { animation: crea-fade-up .4s cubic-bezier(.2,.8,.2,1) both; }

.btn-primary { box-shadow: 0 6px 16px rgba(232,56,74,.25); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 20px rgba(232,56,74,.32); }
.card, .stat, .task, .hist { border-color: color-mix(in srgb, var(--line) 80%, transparent); }
