/* ═══════════════════════════════════════════════
   עושים חשבון — Night Forest design system
   ═══════════════════════════════════════════════ */

:root {
  --bg-0: #060f0b;
  --bg-1: #081812;
  --bg-2: #0c211a;
  --card: rgba(167, 243, 208, 0.045);
  --card-solid: #0e241c;
  --line: rgba(110, 231, 183, 0.14);
  --line-strong: rgba(110, 231, 183, 0.3);
  --ink: #e9f6ef;
  --ink-dim: #a8c7b7;
  --ink-faint: #64866f;
  --em: #34d399;
  --em-soft: #6ee7b7;
  --em-pale: #a7f3d0;
  --em-deep: #0d9673;
  --gold: #d4b483;
  --danger: #f0876f;
  --amber: #e8b34b;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.65);
  --font-body: 'Assistant', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Suez One', 'Assistant', serif;
  --tap: 46px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  font-family: var(--font-body);
  background: var(--bg-1);
  color: var(--ink);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
::selection { background: rgba(52, 211, 153, 0.35); }

/* ── Atmospheric background ── */
#bg { position: fixed; inset: 0; z-index: -1; background:
  radial-gradient(120% 90% at 85% -10%, #10352a 0%, transparent 55%),
  radial-gradient(110% 80% at 0% 110%, #0b2b1f 0%, transparent 55%),
  linear-gradient(160deg, var(--bg-0), var(--bg-1) 45%, var(--bg-2));
}
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5; will-change: transform; }
.b1 { width: 46vmax; height: 46vmax; top: -18vmax; inset-inline-start: -12vmax;
  background: radial-gradient(circle, rgba(13, 150, 115, 0.5), transparent 65%);
  animation: drift1 26s ease-in-out infinite alternate; }
.b2 { width: 38vmax; height: 38vmax; bottom: -14vmax; inset-inline-end: -10vmax;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.32), transparent 65%);
  animation: drift2 32s ease-in-out infinite alternate; }
.b3 { width: 24vmax; height: 24vmax; top: 40%; inset-inline-start: 55%;
  background: radial-gradient(circle, rgba(212, 180, 131, 0.12), transparent 60%);
  animation: drift3 40s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(9vmax, 7vmax) scale(1.12); } }
@keyframes drift2 { to { transform: translate(-8vmax, -6vmax) scale(1.08); } }
@keyframes drift3 { to { transform: translate(-10vmax, 5vmax) scale(1.25); } }
.grain { position: absolute; inset: 0; opacity: 0.05; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E"); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ── Screens / entrance ── */
.screen { min-height: 100dvh; padding: 24px; }
.center { display: flex; align-items: center; justify-content: center; }

.rise { animation: rise 0.7s cubic-bezier(0.2, 0.9, 0.25, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(0.985); } }

/* staggered children */
.stagger > * { animation: rise 0.6s cubic-bezier(0.2, 0.9, 0.25, 1) both; }
.stagger > *:nth-child(1) { animation-delay: 0.04s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.16s; }
.stagger > *:nth-child(4) { animation-delay: 0.22s; }
.stagger > *:nth-child(5) { animation-delay: 0.28s; }
.stagger > *:nth-child(6) { animation-delay: 0.34s; }
.stagger > *:nth-child(7) { animation-delay: 0.4s; }
.stagger > *:nth-child(8) { animation-delay: 0.46s; }

/* ── Login card ── */
.login-card {
  width: min(410px, 100%);
  background: linear-gradient(165deg, rgba(167, 243, 208, 0.07), rgba(167, 243, 208, 0.02) 55%);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 42px 34px 30px;
  text-align: center;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.logo-wrap { display: flex; justify-content: center; margin-bottom: 14px; }
.logo-wrap .logo-mark { width: 92px; height: 92px; filter: drop-shadow(0 6px 24px rgba(52, 211, 153, 0.35)); }
.logo-wrap.small .logo-mark { width: 64px; height: 64px; }
.logo-mark .hand-min { transform-origin: 60px 60px; animation: sweep 60s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }

.brand { font-family: var(--font-display); font-size: 34px; font-weight: 400; letter-spacing: 0.5px;
  background: linear-gradient(120deg, var(--em-pale), var(--em-soft) 55%, var(--em));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.subtitle { font-family: var(--font-display); font-size: 24px; font-weight: 400; color: var(--em-pale); }
.tagline { color: var(--ink-dim); font-size: 15px; margin: 6px 0 26px; }

/* ── Fields ── */
.field { display: block; text-align: start; margin-bottom: 16px; }
.field > span { display: block; font-size: 13.5px; color: var(--ink-dim); margin-bottom: 6px; font-weight: 600; }
.field small { display: block; color: var(--ink-faint); font-size: 12px; margin-top: 5px; }
.field input, .field select {
  width: 100%; height: 48px; padding: 0 15px;
  background: rgba(6, 15, 11, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink); font-size: 16px;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
  outline: none;
}
.field input:focus, .field select:focus {
  border-color: var(--em);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
  background: rgba(6, 15, 11, 0.8);
}
.field select { appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236ee7b7' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center; padding-inline-end: 15px; }
input[type="datetime-local"] { direction: ltr; text-align: right; }

/* ── Buttons ── */
.btn-primary {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--em-soft), var(--em) 55%, var(--em-deep));
  color: #04150e; border: none; border-radius: 999px;
  font-size: 16px; font-weight: 700; height: var(--tap); padding: 0 26px;
  box-shadow: 0 8px 26px -8px rgba(52, 211, 153, 0.55);
  transition: transform 0.18s, box-shadow 0.25s, filter 0.2s;
}
.btn-primary:hover { transform: translateY(-1.5px); box-shadow: 0 12px 32px -8px rgba(52, 211, 153, 0.65); filter: brightness(1.06); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary.big { width: 100%; height: 52px; font-size: 17px; margin-top: 8px; }
.btn-primary:disabled { opacity: 0.55; pointer-events: none; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: rgba(167, 243, 208, 0.06); color: var(--em-pale);
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 14.5px; font-weight: 600; height: 40px; padding: 0 18px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn-ghost:hover { background: rgba(167, 243, 208, 0.12); border-color: var(--line-strong); }
.btn-ghost:active { transform: scale(0.97); }
.btn-ghost.danger { color: var(--danger); border-color: rgba(240, 135, 111, 0.3); background: rgba(240, 135, 111, 0.06); }
.btn-ghost.danger:hover { background: rgba(240, 135, 111, 0.14); }

.icon-btn { background: rgba(167, 243, 208, 0.07); color: var(--em-pale);
  border: 1px solid var(--line); border-radius: 12px; width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.4s; }
/* rotate only on real hover devices — on touch, :hover sticks after a tap */
@media (hover: hover) {
  .icon-btn:hover { background: rgba(167, 243, 208, 0.14); transform: rotate(40deg); }
}

.form-error { color: var(--danger); font-size: 14px; min-height: 20px; margin-top: 12px; font-weight: 600; }
.hint { color: var(--ink-faint); font-size: 13px; margin-top: 18px; }

/* ── Ripple ── */
.ripple { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.45);
  transform: scale(0); animation: ripple 0.55s ease-out forwards; pointer-events: none; }
@keyframes ripple { to { transform: scale(3.2); opacity: 0; } }

/* ── Top bar ── */
#topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  background: rgba(8, 24, 18, 0.75);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.logo-sm .logo-mark { width: 34px; height: 34px; display: block; }
.topbar-title { font-family: var(--font-display); font-size: 19px; color: var(--em-pale); }
.topbar-side { display: flex; align-items: center; gap: 12px; position: relative; }
#greeting { color: var(--ink-dim); font-size: 14.5px; font-weight: 600; }

/* anchored to the screen-edge side so it opens INTO the page (was overflowing on mobile) */
.dropdown { position: absolute; top: 52px; inset-inline-end: 0; min-width: 170px;
  background: var(--card-solid); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow); overflow: hidden; z-index: 60;
  animation: pop 0.22s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(0.96); } }
.dropdown button { display: block; width: 100%; text-align: start; background: none; border: none;
  color: var(--ink); font-size: 15px; padding: 13px 18px; transition: background 0.15s; }
.dropdown button:hover { background: rgba(167, 243, 208, 0.08); }
.dropdown button.danger { color: var(--danger); }

/* ── Main / views ── */
#views { max-width: 680px; margin: 0 auto; padding: 22px 18px 110px; }
.view-title { font-family: var(--font-display); font-size: 22px; color: var(--em-pale); margin-bottom: 4px; }
.view-sub { color: var(--ink-faint); font-size: 14px; margin-bottom: 18px; }

/* ── Clock view ── */
.clock-hero { display: flex; flex-direction: column; align-items: center; padding: 18px 0 8px; }
.today-date { color: var(--ink-dim); font-size: 15.5px; font-weight: 600; letter-spacing: 0.2px; }

.live-timer {
  font-weight: 200; font-size: clamp(54px, 16vw, 76px); line-height: 1.1;
  font-variant-numeric: tabular-nums; letter-spacing: 2px; direction: ltr;
  color: var(--ink); margin: 6px 0 4px;
  text-shadow: 0 0 34px rgba(52, 211, 153, 0.35);
  transition: color 0.4s;
}
.live-timer.idle { color: var(--ink-faint); text-shadow: none; }
.timer-caption { min-height: 22px; color: var(--em-soft); font-size: 14.5px; font-weight: 600; }
.timer-caption.warn { color: var(--amber); }

/* Big round button */
.punch-wrap { position: relative; margin: 26px 0 10px; width: 216px; height: 216px; }
.punch-ring { position: absolute; inset: -14px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent, rgba(110, 231, 183, 0.5), transparent 32%);
  animation: spin 7s linear infinite; opacity: 0.55;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); }
@keyframes spin { to { transform: rotate(360deg); } }

.pulse { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(52, 211, 153, 0.55);
  opacity: 0; pointer-events: none; }
.running .pulse { animation: pulse 2.6s ease-out infinite; }
.running .pulse.p2 { animation-delay: 0.9s; }
.running .pulse.p3 { animation-delay: 1.8s; }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(1.55); opacity: 0; } }

#punch-btn {
  position: relative; overflow: hidden; width: 216px; height: 216px; border-radius: 50%;
  border: none; color: #04150e;
  font-family: var(--font-display); font-size: 34px; letter-spacing: 1px;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.32), transparent 42%),
    linear-gradient(150deg, var(--em-soft), var(--em) 48%, var(--em-deep));
  box-shadow: 0 24px 60px -18px rgba(52, 211, 153, 0.65), inset 0 -10px 26px rgba(4, 21, 14, 0.28);
  transition: transform 0.22s cubic-bezier(0.3, 1.4, 0.5, 1), box-shadow 0.35s, background 0.5s;
  animation: breathe 4.2s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { box-shadow: 0 24px 60px -18px rgba(52, 211, 153, 0.55), inset 0 -10px 26px rgba(4, 21, 14, 0.28); }
  50% { box-shadow: 0 24px 76px -14px rgba(52, 211, 153, 0.85), inset 0 -10px 26px rgba(4, 21, 14, 0.28); }
}
#punch-btn:hover { transform: scale(1.035); }
#punch-btn:active { transform: scale(0.965); }
#punch-btn small { display: block; font-family: var(--font-body); font-size: 14px; font-weight: 600; margin-top: 4px; opacity: 0.75; }

.running #punch-btn {
  color: #1d1509;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.3), transparent 42%),
    linear-gradient(150deg, #f2cd7b, var(--amber) 50%, #b97f24);
  box-shadow: 0 24px 60px -18px rgba(232, 179, 75, 0.6), inset 0 -10px 26px rgba(40, 24, 4, 0.3);
  animation: none;
}

/* Summary chips */
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; margin-top: 26px; }
.chip { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 10px 12px; text-align: center;
  transition: transform 0.25s, border-color 0.25s, background 0.25s; }
.chip:hover { transform: translateY(-3px); border-color: var(--line-strong); background: rgba(167, 243, 208, 0.07); }
.chip .val { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; color: var(--em-pale); }
.chip .lbl { font-size: 12.5px; color: var(--ink-faint); margin-top: 3px; font-weight: 600; }

/* ── Cards & lists ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; margin-bottom: 14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.card-title { font-size: 16px; font-weight: 700; color: var(--em-pale); margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.day-group { margin-bottom: 18px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 4px 8px; }
.day-head .d { font-weight: 700; font-size: 15px; color: var(--ink); }
.day-head .t { font-size: 13.5px; color: var(--em-soft); font-weight: 700; font-variant-numeric: tabular-nums; direction: ltr; }

.sess-row { display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px 14px; margin-bottom: 8px;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
  animation: rise 0.45s cubic-bezier(0.2, 0.9, 0.25, 1) both; }
.sess-row:hover { border-color: var(--line-strong); background: rgba(167, 243, 208, 0.06); }
.sess-times { flex: 1; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums;
  font-size: 16px; font-weight: 600; }
.sess-arrow { color: var(--ink-faint); }
.sess-dur { font-size: 14px; color: var(--em-soft); font-weight: 700; direction: ltr; }
.sess-badges { display: flex; gap: 5px; }
.badge { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 9px; }
.badge.edit { background: rgba(212, 180, 131, 0.14); color: var(--gold); border: 1px solid rgba(212, 180, 131, 0.3); }
.badge.open { background: rgba(52, 211, 153, 0.14); color: var(--em-soft); border: 1px solid rgba(52, 211, 153, 0.3); }
.badge.stale { background: rgba(232, 179, 75, 0.14); color: var(--amber); border: 1px solid rgba(232, 179, 75, 0.35); }
.sess-actions { display: flex; gap: 4px; }
.mini-btn { background: none; border: none; color: var(--ink-faint); padding: 6px; border-radius: 8px;
  display: inline-flex; transition: color 0.15s, background 0.15s; }
.mini-btn:hover { color: var(--em-soft); background: rgba(167, 243, 208, 0.08); }
.mini-btn.danger:hover { color: var(--danger); background: rgba(240, 135, 111, 0.1); }

.empty { text-align: center; color: var(--ink-faint); padding: 34px 10px; font-size: 15px; }
.empty .emoji { font-size: 34px; display: block; margin-bottom: 8px; }

/* ── Chart ── */
.chart-wrap { direction: ltr; }
.chart-bars { display: flex; align-items: flex-end; gap: 5px; height: 120px; padding-top: 8px; }
.cbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.cbar .bar { width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--em-soft), var(--em-deep));
  box-shadow: 0 4px 14px -4px rgba(52, 211, 153, 0.5);
  transform-origin: bottom; animation: grow 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.cbar.zero .bar { background: rgba(167, 243, 208, 0.1); box-shadow: none; }
.cbar.today .bar { background: linear-gradient(180deg, #f2cd7b, var(--gold)); }
@keyframes grow { from { transform: scaleY(0); } }
.cbar .cl { font-size: 10px; color: var(--ink-faint); white-space: nowrap; }

/* ── Filters row ── */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; flex: 1; min-width: 130px; }
.filters .field input { height: 42px; font-size: 14.5px; }

/* ── Team ── */
.team-grid { display: grid; gap: 12px; }
.person-card { display: flex; align-items: center; gap: 14px; width: 100%; text-align: start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 15px 16px; color: var(--ink);
  transition: transform 0.22s, border-color 0.22s, background 0.22s;
  animation: rise 0.5s cubic-bezier(0.2, 0.9, 0.25, 1) both; }
.person-card:hover { transform: translateY(-2px); border-color: var(--line-strong); background: rgba(167, 243, 208, 0.07); }
.avatar { position: relative; width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 17px; color: #04150e;
  background: linear-gradient(140deg, var(--em-pale), var(--em)); }
.avatar.off { background: linear-gradient(140deg, #3d5c4c, #23423595); color: var(--ink-dim); }
.live-dot { position: absolute; bottom: 1px; inset-inline-end: 1px; width: 13px; height: 13px;
  border-radius: 50%; background: #3ee68a; border: 2.5px solid var(--bg-1);
  box-shadow: 0 0 0 0 rgba(62, 230, 138, 0.6); animation: livedot 1.8s ease-out infinite; }
@keyframes livedot { 70% { box-shadow: 0 0 0 9px rgba(62, 230, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(62, 230, 138, 0); } }
.person-info { flex: 1; min-width: 0; }
.person-name { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.person-sub { color: var(--ink-faint); font-size: 13px; margin-top: 2px; }
.person-side { text-align: center; flex-shrink: 0; }
.person-side .val { font-weight: 700; font-size: 15.5px; color: var(--em-soft); font-variant-numeric: tabular-nums; direction: ltr; }
.person-side .lbl { font-size: 11.5px; color: var(--ink-faint); }
.role-badge { font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 2.5px 8px;
  background: rgba(110, 231, 183, 0.12); color: var(--em-soft); border: 1px solid var(--line); }
.role-badge.admin { background: rgba(212, 180, 131, 0.13); color: var(--gold); border-color: rgba(212, 180, 131, 0.3); }
.role-badge.gray { background: rgba(167, 243, 208, 0.05); color: var(--ink-faint); }

.back-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 4px 0 16px; }

/* ── Password eye toggle ──
   password inputs are dir=ltr, so use physical sides: text starts left, eye sits right */
.pw-wrap { position: relative; }
.pw-wrap input { padding-left: 15px; padding-right: 46px; }
.pw-eye { position: absolute; top: 0; right: 5px; height: 100%; width: 38px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--ink-faint); border-radius: 8px;
  transition: color 0.15s, transform 0.15s; }
.pw-eye:hover { color: var(--em-soft); }
.pw-eye.on { color: var(--em-soft); }
.pw-eye:active { transform: scale(0.88); }

/* ── Failed logins ── */
.fail-row { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline;
  padding: 10px 4px; border-bottom: 1px solid rgba(240, 135, 111, 0.1); font-size: 13.5px; }
.fail-row .when { color: var(--ink-faint); font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; }
.fr-email { color: var(--ink); font-weight: 600; unicode-bidi: embed; }
.fr-pw { font-family: Consolas, monospace; color: var(--danger); background: rgba(240, 135, 111, 0.08);
  border: 1px solid rgba(240, 135, 111, 0.22); border-radius: 7px; padding: 1.5px 9px; unicode-bidi: embed; }
.fr-ip { color: var(--ink-faint); font-size: 12px; unicode-bidi: embed; }

/* ── Audit ── */
.audit-row { display: flex; gap: 12px; padding: 11px 4px; border-bottom: 1px solid rgba(110, 231, 183, 0.07);
  font-size: 13.5px; align-items: baseline; }
.audit-row .when { color: var(--ink-faint); white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.audit-row .what { flex: 1; color: var(--ink-dim); }
.audit-row .what b { color: var(--ink); font-weight: 700; }

/* ── Tab bar ── */
#tabbar { position: fixed; bottom: calc(14px + env(safe-area-inset-bottom)); inset-inline: 0;
  display: flex; justify-content: center; gap: 6px; z-index: 50;
  width: fit-content; margin-inline: auto;
  background: rgba(10, 28, 21, 0.85); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow); }
.tab-btn { display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; color: var(--ink-faint);
  font-size: 11.5px; font-weight: 700; padding: 8px 16px; border-radius: 999px;
  transition: color 0.2s, background 0.25s; }
.tab-btn svg { width: 21px; height: 21px; }
.tab-btn.active { color: #04150e; background: linear-gradient(135deg, var(--em-soft), var(--em)); box-shadow: 0 6px 18px -6px rgba(52, 211, 153, 0.6); }
.tab-btn:not(.active):hover { color: var(--em-soft); }

/* ── Modals ── */
.modal-back { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(4, 12, 8, 0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadein 0.25s both; padding: 0; }
@keyframes fadein { from { opacity: 0; } }
.modal { width: min(480px, 100%); max-height: 88dvh; overflow-y: auto;
  background: var(--card-solid); border: 1px solid var(--line);
  border-radius: 26px 26px 0 0; padding: 26px 24px calc(26px + env(safe-area-inset-bottom));
  animation: sheetup 0.4s cubic-bezier(0.2, 1, 0.3, 1) both; }
@keyframes sheetup { from { transform: translateY(60px); opacity: 0; } }
.modal h3 { font-family: var(--font-display); font-weight: 400; font-size: 21px; color: var(--em-pale); margin-bottom: 18px; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn-primary { flex: 1; height: 48px; }
.modal-actions .btn-ghost { height: 48px; padding: 0 22px; }
@media (min-width: 560px) {
  .modal-back { align-items: center; padding: 24px; }
  .modal { border-radius: 26px; animation-name: pop; }
}

.temp-pw-box { direction: ltr; text-align: center; font-family: Consolas, monospace; font-size: 24px;
  letter-spacing: 3px; color: var(--em-soft); background: rgba(6, 15, 11, 0.7);
  border: 1px dashed var(--em); border-radius: var(--r-md); padding: 16px; margin: 12px 0; user-select: all; }

/* ── Toasts ── */
#toast-root { position: fixed; top: calc(14px + env(safe-area-inset-top)); inset-inline: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px;
  background: var(--card-solid); color: var(--ink); border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 11px 20px; font-size: 14.5px; font-weight: 600;
  box-shadow: var(--shadow); animation: toastin 0.45s cubic-bezier(0.2, 1.2, 0.4, 1) both; }
.toast.out { animation: toastout 0.35s ease both; }
.toast.ok { border-color: rgba(52, 211, 153, 0.5); }
.toast.err { border-color: rgba(240, 135, 111, 0.5); }
@keyframes toastin { from { opacity: 0; transform: translateY(-18px) scale(0.92); } }
@keyframes toastout { to { opacity: 0; transform: translateY(-14px) scale(0.94); } }
.toast .tick { width: 20px; height: 20px; }
.toast .tick path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 0.5s 0.15s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ── Loading spinner ── */
.spinner { width: 34px; height: 34px; margin: 30px auto; border-radius: 50%;
  border: 3px solid rgba(110, 231, 183, 0.15); border-top-color: var(--em);
  animation: spin 0.8s linear infinite; }

/* ── Install banner (mobile) ── */
#install-banner {
  position: fixed; bottom: calc(88px + env(safe-area-inset-bottom)); inset-inline: 12px;
  z-index: 90; display: flex; align-items: center; gap: 11px;
  background: linear-gradient(160deg, rgba(20, 46, 35, 0.97), rgba(10, 28, 21, 0.97));
  border: 1px solid var(--line-strong); border-radius: 20px;
  padding: 13px 14px; box-shadow: var(--shadow);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  animation: bannerin 0.6s cubic-bezier(0.2, 1.1, 0.35, 1) 0.2s both;
}
@keyframes bannerin { from { opacity: 0; transform: translateY(26px) scale(0.96); } }
#install-banner.out { animation: bannerout 0.35s ease both; }
@keyframes bannerout { to { opacity: 0; transform: translateY(20px) scale(0.96); } }
.ib-icon .logo-mark { width: 40px; height: 40px; display: block; }
.ib-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ib-text b { font-size: 14.5px; color: var(--em-pale); }
.ib-text span { font-size: 12.5px; color: var(--ink-dim); }
#install-banner .btn-primary { height: 38px; padding: 0 18px; font-size: 14px; flex-shrink: 0; }
.ib-close { background: none; border: none; color: var(--ink-faint); font-size: 15px;
  padding: 6px; margin-inline-start: -4px; flex-shrink: 0; border-radius: 8px; }
.ib-close:hover { color: var(--ink); }

.ios-steps { margin: 0 18px 6px 0; padding: 0; color: var(--ink-dim); font-size: 15px; line-height: 2; }
.ios-steps b { color: var(--em-pale); }

/* ── Desktop ── */
@media (min-width: 900px) {
  #views { max-width: 760px; padding-top: 34px; }
  .screen { padding: 40px; }
  #tabbar { top: calc(env(safe-area-inset-top) + 74px); bottom: auto; }
  #views { padding-top: 90px; }
  .chips { gap: 16px; }
  .team-grid { grid-template-columns: 1fr 1fr; }
}
