/* Owldid — design.md system. Two colours. Three fonts. */

@import url("https://fonts.googleapis.com/css2?family=Romanesco&family=Fragment+Mono&family=Inter:wght@400;500;600;700;800;900&display=swap");

:root {
  --sage: #c0d0c0;
  --navy: #030B11;
  --sage-2: #b3c5b3;
  --sage-3: #d2dfd2;
  --navy-2: #061524;
  --navy-3: #0d2035;

  --on-sage: var(--navy);
  --on-sage-2: rgba(3, 11, 17, 0.62);
  --on-sage-3: rgba(3, 11, 17, 0.38);
  --on-sage-placeholder: rgba(3, 11, 17, 0.18);

  --on-navy: var(--sage);
  --on-navy-2: rgba(192, 208, 192, 0.62);
  --on-navy-3: rgba(192, 208, 192, 0.38);
  --on-navy-placeholder: rgba(192, 208, 192, 0.16);

  --line-sage: rgba(3, 11, 17, 0.10);
  --line-navy: rgba(192, 208, 192, 0.10);

  --f-ui: "Inter", system-ui, sans-serif;
  --f-mono: "Fragment Mono", ui-monospace, monospace;
  --f-brand: "Romanesco", "Inter", serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;
  --r-pill: 999px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-ui);
  background: var(--sage);
  color: var(--on-sage);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.page-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 32px;
}
@media (max-width: 720px) { .page-wrap { padding: 0 20px; } }

.section { padding: 96px 0; }
.section-sm { padding: 48px 0; }
.section-lg { padding: 140px 0; }
@media (max-width: 720px) {
  .section { padding: 72px 0; }
  .section-lg { padding: 96px 0; }
}

.bg-sage { background: var(--sage); color: var(--on-sage); }
.bg-navy { background: var(--navy); color: var(--on-navy); }

/* ---------- typography ---------- */
.h-display {
  font-family: var(--f-ui);
  font-weight: 800;
  font-size: clamp(56px, 9vw, 132px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin: 0;
}
.h-1 {
  font-family: var(--f-ui);
  font-weight: 800;
  font-size: clamp(40px, 5.5vw, 76px);
  line-height: 0.96;
  letter-spacing: -0.04em;
  margin: 0;
}
.h-2 {
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 0;
}
.h-3 {
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0;
}
.lead { font-size: 18px; line-height: 1.55; margin: 0; }
.body { font-size: 16px; line-height: 1.60; margin: 0; }

.eyebrow {
  font-family: var(--f-mono);
  font-size: 13px;
  letter-spacing: 0;
  text-transform: lowercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before { content: "·"; font-size: 22px; line-height: 0; }

em.brand, .em-brand {
  font-family: var(--f-brand);
  font-style: normal;
  font-weight: 400;
  letter-spacing: -0.005em;
  font-size: 1.1em;
  line-height: 1;
}

/* ---------- navbar banner ---------- */
.nav-banner {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--navy);
  color: var(--sage);
  font-family: var(--f-mono);
  font-size: 12px;
  text-align: center;
  padding: 6px 16px;
  z-index: 40;
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  top: 36px; left: 16px; right: 16px;
  max-width: 1280px;
  margin: 0 auto;
  z-index: 50;
  transition: top 0.3s ease, max-width 0.3s ease;
}
.nav.scrolled { top: 32px; max-width: 980px; }

.nav-inner {
  background: rgba(3, 11, 17, 0.86);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  color: var(--sage);
  border-radius: 999px;
  padding: 10px 12px 10px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-logo {
  font-family: var(--f-brand);
  font-size: 28px;
  color: var(--sage);
  letter-spacing: -0.005em;
  display: inline-flex; align-items: baseline; gap: 2px;
}
.nav-logo span.dot { color: var(--sage); }

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: 24px;
  background: rgba(192, 208, 192, 0.08);
  border-radius: 999px;
  padding: 4px;
}
.nav-links a {
  font-family: var(--f-ui);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  color: rgba(192, 208, 192, 0.78);
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(192, 208, 192, 0.12);
  color: var(--sage);
}

.nav-cta {
  margin-left: auto;
  background: var(--sage);
  color: var(--navy);
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  transition: transform 0.15s ease;
}
.nav-cta:hover { transform: translateY(-1px); }

.nav-spacer { height: 96px; }
.nav-spacer.with-banner { height: 120px; }

/* ---------- buttons ---------- */
.pill-navy, .pill-sage, .btn-outline-sage, .btn-outline-navy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 15px;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.pill-navy { background: var(--navy); color: var(--sage); }
.pill-navy:hover { transform: translateY(-1px); background: var(--navy-2); }
.bg-navy .pill-navy { background: var(--sage); color: var(--navy); }
.bg-navy .pill-navy:hover { background: var(--sage-2); }
.pill-sage { background: var(--sage); color: var(--navy); }
.pill-sage:hover { transform: translateY(-1px); background: var(--sage-2); }
.btn-outline-sage { background: transparent; color: var(--navy); border-color: var(--line-sage); }
.btn-outline-navy { background: transparent; color: var(--sage); border-color: var(--line-navy); }

button { font-family: var(--f-ui); }

/* ---------- card surfaces ---------- */
.card {
  background: var(--sage-3);
  border-radius: var(--r-lg);
  padding: 26px;
  border: 0;
}
.bg-navy .card { background: var(--navy-2); color: var(--on-navy); }

/* ---------- forms ---------- */
.form-stack { display: grid; gap: 16px; }
.form-label {
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: 0;
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  color: var(--on-sage-2);
}
.bg-navy .form-label { color: var(--on-navy-2); }
.form-input, .form-select, .form-textarea {
  font-family: var(--f-ui);
  font-size: 15px;
  width: 100%;
  background: rgba(3, 11, 17, 0.04);
  color: var(--on-sage);
  border: 1px solid var(--line-sage);
  padding: 13px 16px;
  border-radius: var(--r-md);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.bg-navy .form-input, .bg-navy .form-select, .bg-navy .form-textarea {
  background: rgba(192, 208, 192, 0.06);
  color: var(--on-navy);
  border-color: var(--line-navy);
}
.form-input::placeholder { color: var(--on-sage-placeholder); }
.bg-navy .form-input::placeholder { color: var(--on-navy-placeholder); }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--navy);
}
.bg-navy .form-input:focus, .bg-navy .form-select:focus { border-color: var(--sage); }

/* ---------- tags / pills ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 12px;
  background: rgba(3, 11, 17, 0.06);
  color: var(--on-sage);
}
.bg-navy .tag { background: rgba(192, 208, 192, 0.08); color: var(--on-navy); }

/* ---------- hero ---------- */
.hero {
  background: var(--navy);
  color: var(--sage);
  padding: 140px 0 120px;
  border-radius: 0 0 32px 32px;
  margin-top: -1px;
}
.hero .hero-pre { color: var(--on-navy-2); margin-bottom: 24px; }
.hero-title {
  font-family: var(--f-ui);
  font-weight: 800;
  font-size: clamp(56px, 9vw, 132px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin: 0 0 24px;
  max-width: 14ch;
}
.hero-title em { font-style: normal; font-family: var(--f-brand); font-weight: 400; }
.hero-sub { font-size: 19px; line-height: 1.5; color: var(--on-navy-2); max-width: 56ch; margin: 0 0 36px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 56px; }
.hero-trust { font-family: var(--f-mono); font-size: 12px; color: var(--on-navy-3); }

/* ---------- footer ---------- */
.footer {
  background: var(--navy);
  color: var(--sage);
  border-radius: 32px 32px 0 0;
  padding: 96px 0 32px;
  margin-top: 0;
}
.footer-wordmark {
  font-family: var(--f-brand);
  font-size: clamp(80px, 18vw, 280px);
  line-height: 1;
  letter-spacing: -0.005em;
  margin: 56px 0 32px;
}
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--f-mono); font-size: 12px; color: var(--on-navy-3);
  padding-top: 24px; border-top: 1px solid var(--line-navy);
}

/* ---------- dashboard layout ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}
.col-12 { grid-column: span 12; }
.col-8 { grid-column: span 8; }
.col-6 { grid-column: span 6; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
@media (max-width: 960px) {
  .col-8, .col-6, .col-4, .col-3 { grid-column: span 12; }
}

.metric { display: flex; flex-direction: column; gap: 6px; }
.metric-label { font-family: var(--f-mono); font-size: 12px; color: var(--on-sage-2); text-transform: uppercase; }
.bg-navy .metric-label { color: var(--on-navy-2); }
.metric-value {
  font-family: var(--f-ui);
  font-weight: 800;
  font-size: clamp(40px, 5vw, 88px);
  line-height: 1;
  letter-spacing: -0.04em;
}
.metric-value .unit { font-family: var(--f-brand); font-weight: 400; font-size: 0.55em; margin-left: 6px; }

/* ---------- tables ---------- */
.tbl {
  width: 100%; border-collapse: collapse; font-size: 14px;
}
.tbl th, .tbl td {
  text-align: left; padding: 14px 16px;
  border-bottom: 1px solid var(--line-sage);
}
.tbl th { font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; color: var(--on-sage-2); font-weight: 400; }
.bg-navy .tbl th { color: var(--on-navy-2); border-color: var(--line-navy); }
.bg-navy .tbl td { border-color: var(--line-navy); }

/* ---------- status pills ---------- */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 11px; text-transform: uppercase;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-paid { background: rgba(3, 11, 17, 0.10); color: var(--on-sage); }
.status-partial { background: rgba(3, 11, 17, 0.06); color: var(--on-sage-2); }
.status-unpaid { background: rgba(3, 11, 17, 0.04); color: var(--on-sage-3); }
.bg-navy .status-paid { background: rgba(192, 208, 192, 0.16); color: var(--on-navy); }
.bg-navy .status-partial { background: rgba(192, 208, 192, 0.10); color: var(--on-navy-2); }
.bg-navy .status-unpaid { background: rgba(192, 208, 192, 0.06); color: var(--on-navy-3); }

/* ---------- side layout (for app pages) ---------- */
html, body.app-shell { overflow-x: hidden; }
.app-shell { min-height: 100vh; background: var(--sage); }

.app-head {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 28px;
  border-bottom: 1px solid var(--line-sage);
  background: var(--sage);
  position: sticky; top: 0; z-index: 30;
  max-width: 100vw;
}
.app-head .nav-logo { font-size: 30px; color: var(--navy); flex-shrink: 0; }

/* Tabs: claim leftover space, scroll horizontally if they overflow */
.app-tabs {
  display: flex; gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  margin-left: 18px;
  padding: 4px;
  background: rgba(3,11,17,0.04);
  border-radius: 999px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
}
.app-tabs::-webkit-scrollbar { display: none; }
.app-tabs a {
  font-family: var(--f-ui); font-weight: 500; font-size: 14px;
  padding: 8px 14px; border-radius: 999px;
  color: var(--on-sage-2);
  white-space: nowrap;
  flex: 0 0 auto;
  scroll-snap-align: start;
}
.app-tabs a:hover, .app-tabs a.active { background: var(--navy); color: var(--sage); }

/* ---------- global search in app head ---------- */
.app-search {
  flex-shrink: 0;
  position: relative;
  width: 240px;
  max-width: 32vw;
}
.app-search input {
  width: 100%;
  font-family: var(--f-ui);
  font-size: 13px;
  padding: 9px 14px 9px 36px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(3,11,17,0.05);
  color: var(--on-sage);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.app-search input::placeholder { color: var(--on-sage-3); }
.app-search input:focus {
  background: var(--sage-3);
  border-color: var(--line-sage);
  box-shadow: 0 0 0 3px rgba(3,11,17,0.06);
}
.app-search .ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; opacity: 0.45; pointer-events: none;
}
.app-search .kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--f-mono); font-size: 10px;
  background: rgba(3,11,17,0.06); color: var(--on-sage-2);
  padding: 2px 6px; border-radius: 6px;
  pointer-events: none;
}
.app-search:focus-within .kbd { display: none; }

.search-results {
  position: absolute;
  top: calc(100% + 8px); left: 0; right: 0;
  background: var(--sage-3);
  border-radius: 16px;
  border: 1px solid var(--line-sage);
  box-shadow: 0 16px 40px rgba(3,11,17,0.22);
  padding: 6px;
  max-height: 380px; overflow-y: auto;
  display: none;
  z-index: 70;
  min-width: 320px;
}
.search-results.open { display: block; }
.search-results .empty,
.search-results .hint {
  padding: 16px 14px;
  font-family: var(--f-mono); font-size: 11px;
  color: var(--on-sage-2); text-transform: uppercase;
  text-align: center;
}
.search-results .item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.1s ease;
}
.search-results .item:hover,
.search-results .item.focused { background: rgba(3,11,17,0.06); }
.search-results .item .badge {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--navy); color: var(--sage);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--f-ui); font-weight: 700; font-size: 11px;
  flex-shrink: 0;
}
.search-results .item.is-student .badge { background: #2da57a; color: var(--sage); }
.search-results .item .body { min-width: 0; flex: 1; }
.search-results .item .ttl {
  font-family: var(--f-ui); font-weight: 600; font-size: 13px;
  color: var(--on-sage); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.search-results .item .sub {
  font-family: var(--f-mono); font-size: 11px; color: var(--on-sage-2);
  margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (max-width: 880px) {
  .app-search {
    order: 4;
    width: 100%; max-width: 100%;
    flex-basis: 100%;
  }
  .search-results { left: 0; right: 0; }
}

/* ---------- inline list filter ---------- */
.list-filter {
  position: relative;
  max-width: 380px;
  flex: 1 1 280px;
}
.list-filter input {
  width: 100%;
  font-family: var(--f-ui); font-size: 14px;
  padding: 11px 16px 11px 38px;
  border-radius: 999px;
  border: 1px solid var(--line-sage);
  background: var(--sage-3);
  outline: none;
}
.list-filter input:focus { border-color: var(--navy); }
.list-filter .ico {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; opacity: 0.5; pointer-events: none;
}
.list-filter .count {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--f-mono); font-size: 11px; color: var(--on-sage-2);
  pointer-events: none;
}

/* ---------- install (download) button in navbar ---------- */
.app-install {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-ui); font-weight: 600; font-size: 13px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--sage);
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.app-install:hover { transform: translateY(-1px); background: var(--navy-2); box-shadow: 0 6px 16px rgba(3,11,17,0.18); }
.app-install svg { width: 16px; height: 16px; }
.app-install::after {
  content: ""; position: absolute;
  top: -4px; right: -4px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #2da57a;
  border: 2px solid var(--sage);
  animation: install-pulse 2.4s ease-in-out infinite;
}
@keyframes install-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.25); opacity: 0.6; }
}
@media (max-width: 720px) {
  .app-install .lbl { display: none; }
  .app-install { padding: 9px 11px; }
}
/* Hide install button once the app is launched in standalone (already installed) */
@media (display-mode: standalone) {
  .app-install { display: none !important; }
}

.app-user {
  flex-shrink: 0;
  position: relative;
  display: flex; align-items: center;
}
.app-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--sage);
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.app-avatar:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(3,11,17,0.18); }
.app-avatar:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
.app-avatar::after {
  content: ""; position: absolute;
  right: -1px; bottom: -1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #2da57a;
  border: 2px solid var(--sage);
}

.app-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  background: var(--sage-3);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 16px 40px rgba(3,11,17,0.22), 0 2px 4px rgba(3,11,17,0.06);
  border: 1px solid var(--line-sage);
  display: none;
  z-index: 80;
  animation: app-menu-rise 0.18s cubic-bezier(0.2,0.8,0.2,1);
}
.app-menu.open { display: block; }
.app-menu .who {
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line-sage);
  margin-bottom: 6px;
}
.app-menu .who .name {
  font-family: var(--f-ui); font-weight: 700; font-size: 14px;
  color: var(--on-sage); line-height: 1.2;
}
.app-menu .who .role {
  font-family: var(--f-mono); font-size: 11px;
  color: var(--on-sage-2); margin-top: 4px;
  text-transform: uppercase; letter-spacing: 0.02em;
}
.app-menu a, .app-menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font-family: var(--f-ui); font-weight: 500; font-size: 13px;
  color: var(--on-sage);
  background: transparent;
  border: 0;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}
.app-menu a:hover, .app-menu button:hover { background: rgba(3,11,17,0.06); }
.app-menu .danger { color: #6b0e0e; }
.app-menu .danger:hover { background: rgba(181,23,23,0.08); }
@keyframes app-menu-rise {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.app-main { padding: 36px 32px 96px; max-width: 1320px; margin: 0 auto; }

/* ---------- auth pages ---------- */
.auth-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--navy); color: var(--sage);
}
.auth-wrap > .auth-left {
  padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-wrap > .auth-right {
  background: var(--sage); color: var(--navy);
  padding: 56px; display: flex; flex-direction: column; justify-content: center;
}
.auth-wrap .wordmark {
  font-family: var(--f-brand);
  font-size: clamp(80px, 9vw, 156px);
  line-height: 1;
  margin: 24px 0;
}
.auth-wrap .auth-card {
  background: var(--sage-3);
  border-radius: var(--r-lg);
  padding: 36px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}
.auth-wrap form { display: grid; gap: 16px; }
@media (max-width: 880px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-wrap > .auth-left { padding: 36px; }
  .auth-wrap > .auth-right { padding: 36px; }
}

/* ---------- alert / nudge ---------- */
.alert {
  font-family: var(--f-mono);
  font-size: 12px;
  text-transform: uppercase;
  padding: 12px 16px;
  border-radius: var(--r-md);
  margin-bottom: 16px;
  background: rgba(3,11,17,0.06);
}
.bg-navy .alert { background: rgba(192,208,192,0.08); }

/* ---------- utility ---------- */
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.muted { color: var(--on-sage-2); }
.bg-navy .muted { color: var(--on-navy-2); }
.mono { font-family: var(--f-mono); }
.brand { font-family: var(--f-brand); }
.ksh { font-family: var(--f-mono); font-size: 12px; color: var(--on-sage-2); margin-right: 4px; }
.bg-navy .ksh { color: var(--on-navy-2); }
.num { font-family: var(--f-ui); font-weight: 700; letter-spacing: -0.02em; }
.right { text-align: right; }
.center { text-align: center; }

/* ---------- marquee ---------- */
.marquee {
  overflow: hidden; padding: 32px 0; border-top: 1px solid var(--line-sage); border-bottom: 1px solid var(--line-sage);
}
.marquee-track { display: flex; gap: 56px; white-space: nowrap; animation: marquee 60s linear infinite; }
.marquee-track .item { font-family: var(--f-ui); font-weight: 700; font-size: 30px; letter-spacing: -0.02em; }
.marquee-track .stat { font-family: var(--f-mono); font-size: 13px; color: var(--on-sage-2); }
.marquee-track .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); align-self: center; }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2,0.8,0.2,1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- section heads ---------- */
.section-head { margin-bottom: 64px; max-width: 720px; }
.section-head .eyebrow { margin-bottom: 16px; color: var(--on-sage-2); }
.bg-navy .section-head .eyebrow { color: var(--on-navy-2); }

/* ---------- services grid ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 960px) { .svc-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .svc-grid { grid-template-columns: 1fr; } }
.svc-card {
  background: var(--sage-3);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
  cursor: default;
  display: flex; flex-direction: column; gap: 14px; min-height: 240px;
}
.svc-card .num { font-family: var(--f-mono); font-size: 13px; color: var(--on-sage-2); }
.svc-card h3 { font-family: var(--f-ui); font-weight: 700; font-size: 26px; line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.svc-card p { font-size: 14px; line-height: 1.55; margin: 0; color: var(--on-sage-2); }
.svc-card:hover { background: var(--navy); color: var(--sage); transform: translateY(-4px); }
.svc-card:hover .num, .svc-card:hover p { color: var(--on-navy-2); }
.svc-card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

/* ---------- stat block ---------- */
.stats {
  background: var(--navy); color: var(--sage);
  border-radius: var(--r-lg);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 56px 32px;
}
.stats .stat { padding: 0 24px; border-right: 1px solid var(--line-navy); }
.stats .stat:last-child { border-right: 0; }
.stats .num-big { font-family: var(--f-ui); font-weight: 800; font-size: clamp(48px, 6vw, 88px); line-height: 1; letter-spacing: -0.045em; }
.stats .num-big .unit { font-family: var(--f-brand); font-weight: 400; font-size: 0.55em; margin-left: 4px; }
.stats .label { font-family: var(--f-mono); font-size: 13px; color: var(--on-navy-2); margin-top: 8px; }
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 24px; padding: 32px; }
  .stats .stat { border-right: 0; padding: 0; }
}

/* ---------- rental banner ---------- */
.rental-banner {
  padding: 10px 24px;
  font-family: var(--f-mono);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line-sage);
}
.rental-banner a { border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.rental-warn   { background: #fdf1d8; color: #5a3a00; }
.rental-locked { background: var(--navy); color: var(--sage); }

/* ---------- staff & generic table polish ---------- */
.chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-family: var(--f-mono);
  font-size: 11px;
  background: rgba(3,11,17,0.06);
  color: var(--on-sage-2);
}
.chip.on { background: var(--navy); color: var(--sage); }

.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.perm-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(3,11,17,0.04);
  border-radius: var(--r-sm);
  font-family: var(--f-mono);
  font-size: 12px;
  cursor: pointer;
}
.perm-grid input[type=checkbox] { accent-color: var(--navy); }

/* paste-out-blocked hint */
.app-shell { user-select: none; }
.app-shell input, .app-shell textarea, .app-shell [contenteditable], .app-shell .allow-select { user-select: text; }
body.allow-export { user-select: text; }

/* ---------- floating messages icon + panel ---------- */
.owl-fab {
  position: fixed;
  right: 22px; bottom: 22px;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--sage);
  border: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 70;
  box-shadow: 0 12px 28px rgba(3,11,17,0.28), 0 2px 6px rgba(3,11,17,0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.owl-fab:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(3,11,17,0.32); }
.owl-fab:active { transform: translateY(0); }
.owl-fab svg { width: 26px; height: 26px; }
.owl-fab .fab-mark {
  position: absolute;
  bottom: -2px; right: -2px;
  font-family: var(--f-brand);
  font-size: 16px; line-height: 1;
  background: var(--sage);
  color: var(--navy);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 400;
  border: 2px solid var(--navy);
}
.owl-fab .fab-badge {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px;
  background: #d23a3a;
  color: white;
  font-family: var(--f-mono); font-size: 11px; font-weight: 700;
  display: none;
  align-items: center; justify-content: center;
  border: 2px solid var(--sage);
}
.owl-fab .fab-badge.show { display: flex; }
.owl-fab.open { background: var(--navy-2); transform: rotate(90deg); }

.owl-fab-panel {
  position: fixed;
  right: 22px; bottom: 92px;
  width: 380px; max-width: calc(100vw - 32px);
  height: 540px; max-height: calc(100vh - 130px);
  background: var(--sage-3);
  border-radius: 22px;
  box-shadow: 0 24px 64px rgba(3,11,17,0.32);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 69;
  border: 1px solid var(--line-sage);
  animation: fab-rise 0.22s cubic-bezier(0.2,0.8,0.2,1);
}
.owl-fab-panel.open { display: flex; }
@keyframes fab-rise {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.owl-fab-head {
  background: var(--navy); color: var(--sage);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.owl-fab-head .ttl {
  font-family: var(--f-brand); font-size: 22px; line-height: 1;
  flex: 1;
}
.owl-fab-head .actions { display: flex; gap: 6px; }
.owl-fab-head button {
  background: rgba(192,208,192,0.10);
  color: var(--sage);
  border: 0; border-radius: 50%;
  width: 32px; height: 32px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: background 0.12s ease;
}
.owl-fab-head button:hover { background: rgba(192,208,192,0.20); }

.owl-fab-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }
.owl-fab-list { flex: 1; overflow-y: auto; padding: 6px; }
.owl-fab-list .empty {
  padding: 28px 18px; text-align: center;
  font-family: var(--f-mono); font-size: 12px; color: var(--on-sage-2);
}
.owl-fab-list .ci {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 12px;
  cursor: pointer;
}
.owl-fab-list .ci:hover { background: rgba(3,11,17,0.06); }
.owl-fab-list .ci .badge {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--navy); color: var(--sage);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-ui); font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}
.owl-fab-list .ci.group .badge { background: #2da57a; }
.owl-fab-list .ci .body { min-width: 0; flex: 1; }
.owl-fab-list .ci .ttl { font-family: var(--f-ui); font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owl-fab-list .ci .sub { font-family: var(--f-mono); font-size: 11px; color: var(--on-sage-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.owl-fab-list .ci .unread {
  background: var(--navy); color: var(--sage);
  padding: 2px 8px; border-radius: 999px;
  font-family: var(--f-mono); font-size: 10px;
}

.owl-fab-thread { flex: 1; display: none; flex-direction: column; min-height: 0; }
.owl-fab-thread.open { display: flex; }
.owl-fab-thead {
  padding: 10px 12px; border-bottom: 1px solid var(--line-sage);
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  background: var(--sage-3);
}
.owl-fab-thead .back {
  background: transparent; border: 0; font-size: 18px;
  cursor: pointer; padding: 4px 8px;
  color: var(--on-sage);
}
.owl-fab-thead .info { flex: 1; min-width: 0; }
.owl-fab-thead .info .n { font-family: var(--f-ui); font-weight: 700; font-size: 14px; }
.owl-fab-thead .info .r { font-family: var(--f-mono); font-size: 10px; color: var(--on-sage-2); }
.owl-fab-tbody {
  flex: 1; overflow-y: auto;
  padding: 14px;
  background: var(--sage);
  display: flex; flex-direction: column; gap: 8px;
}
.owl-fab-tbody .day-sep {
  align-self: center;
  font-family: var(--f-mono); font-size: 10px;
  color: var(--on-sage-2);
  background: rgba(3,11,17,0.05);
  padding: 3px 10px; border-radius: 999px;
  margin: 6px 0 2px;
}
.owl-fab-tbody .m { max-width: 80%; display: flex; flex-direction: column; gap: 3px; }
.owl-fab-tbody .m.me { align-self: flex-end; align-items: flex-end; }
.owl-fab-tbody .m.them { align-self: flex-start; align-items: flex-start; }
.owl-fab-tbody .b {
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 13px; line-height: 1.4;
  word-wrap: break-word; white-space: pre-wrap;
}
.owl-fab-tbody .m.me .b { background: var(--navy); color: var(--sage); border-bottom-right-radius: 4px; }
.owl-fab-tbody .m.them .b { background: var(--sage-3); color: var(--on-sage); border-bottom-left-radius: 4px; }
.owl-fab-tbody .meta { font-family: var(--f-mono); font-size: 9px; color: var(--on-sage-2); padding: 0 4px; }

.owl-fab-compose {
  flex-shrink: 0;
  padding: 10px; border-top: 1px solid var(--line-sage);
  display: flex; gap: 8px; align-items: flex-end;
  background: var(--sage-3);
}
.owl-fab-compose textarea {
  flex: 1; resize: none;
  font-family: var(--f-ui); font-size: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line-sage);
  background: var(--sage);
  max-height: 100px;
  outline: none;
}
.owl-fab-compose textarea:focus { border-color: var(--navy); }
.owl-fab-compose .send {
  background: var(--navy); color: var(--sage);
  border: 0; border-radius: 50%;
  width: 36px; height: 36px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.owl-fab-compose .send:disabled { background: rgba(3,11,17,0.15); cursor: not-allowed; }

/* New-chat panel inside the FAB */
.owl-fab-new { display: none; flex-direction: column; min-height: 0; flex: 1; }
.owl-fab-new.open { display: flex; }
.owl-fab-new .head {
  padding: 10px 12px; border-bottom: 1px solid var(--line-sage);
  display: flex; gap: 8px; align-items: center; flex-shrink: 0;
}
.owl-fab-new .head input {
  flex: 1; font-family: var(--f-ui); font-size: 13px;
  padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--line-sage); background: var(--sage);
  outline: none;
}
.owl-fab-new .body { flex: 1; overflow-y: auto; padding: 6px; }
.owl-fab-new .ct {
  display: flex; gap: 10px; align-items: center;
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
}
.owl-fab-new .ct:hover { background: rgba(3,11,17,0.06); }
.owl-fab-new .ct input { accent-color: var(--navy); }
.owl-fab-new .ct .n { font-family: var(--f-ui); font-weight: 600; font-size: 13px; flex: 1; }
.owl-fab-new .ct .r { font-family: var(--f-mono); font-size: 10px; padding: 2px 6px; border-radius: 999px; background: rgba(3,11,17,0.06); color: var(--on-sage-2); }
.owl-fab-new .foot {
  padding: 10px 12px; border-top: 1px solid var(--line-sage);
  display: flex; gap: 8px; align-items: center; flex-shrink: 0;
}
.owl-fab-new .foot input[type=text] {
  flex: 1; font-family: var(--f-ui); font-size: 13px;
  padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--line-sage); background: var(--sage);
  outline: none;
}
.owl-fab-new .foot button {
  background: var(--navy); color: var(--sage);
  border: 0; border-radius: 999px;
  padding: 8px 14px; font-family: var(--f-ui); font-weight: 600; font-size: 12px;
  cursor: pointer;
}
.owl-fab-new .foot button:disabled { background: rgba(3,11,17,0.15); cursor: not-allowed; }

@media (max-width: 600px) {
  .owl-fab { right: 14px; bottom: 14px; }
  .owl-fab-panel {
    right: 0; left: 0; bottom: 0; top: 0;
    width: 100%; height: 100%; max-width: 100%; max-height: 100%;
    border-radius: 0;
    border: 0;
  }
  .owl-fab.open { display: none; } /* hide button when full-screen panel open */
}
@media (display-mode: standalone) {
  .owl-fab { bottom: max(22px, env(safe-area-inset-bottom)); }
}

/* hide the FAB on the dedicated /chat page (redundant there) */
body[data-active-tab="chat"] .owl-fab,
body[data-active-tab="chat"] .owl-fab-panel { display: none !important; }

/* ---------- billing state chips ---------- */
.status-active   { background: rgba(22, 174, 149, 0.12); color: #0a5f50; }
.status-expiring { background: #fdf1d8; color: #5a3a00; }
.status-locked   { background: rgba(181, 23, 23, 0.12); color: #6b0e0e; }
.status-trialing { background: rgba(3, 11, 17, 0.06); color: var(--on-sage); }

/* ---------- wizard / slider form ---------- */
.wizard { display: flex; flex-direction: column; gap: 22px; }

.wizard-progress {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--f-mono); font-size: 12px; color: var(--on-sage-2);
  text-transform: uppercase; letter-spacing: 0.02em;
}
.bg-navy .wizard-progress { color: var(--on-navy-2); }
.wizard-progress .count { white-space: nowrap; }
.wizard-progress .bar {
  flex: 1; height: 3px; border-radius: 999px;
  background: rgba(3,11,17,0.10); overflow: hidden;
}
.bg-navy .wizard-progress .bar { background: rgba(192,208,192,0.12); }
.wizard-progress .bar > i {
  display: block; height: 100%; width: 0%;
  background: var(--navy);
  border-radius: 999px;
  transition: width 0.45s cubic-bezier(0.2,0.8,0.2,1);
}
.bg-navy .wizard-progress .bar > i { background: var(--sage); }

.wizard-dots { display: flex; gap: 8px; align-items: center; }
.wizard-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(3,11,17,0.14);
  transition: background 0.3s ease, transform 0.3s ease, width 0.3s ease;
}
.bg-navy .wizard-dot { background: rgba(192,208,192,0.18); }
.wizard-dot.done { background: var(--navy); }
.wizard-dot.current { background: var(--navy); width: 22px; border-radius: 999px; }
.bg-navy .wizard-dot.done,
.bg-navy .wizard-dot.current { background: var(--sage); }

.wizard-track { position: relative; overflow: hidden; }
.wizard-slides {
  display: flex; align-items: flex-start;
  transition: transform 0.5s cubic-bezier(0.2,0.8,0.2,1);
  will-change: transform;
}
.wizard-step {
  flex: 0 0 100%; min-width: 0;
  display: grid; gap: 14px;
  padding: 4px 2px;
  opacity: 0.35; transition: opacity 0.4s ease;
}
.wizard-step.active { opacity: 1; }
.wizard-step .step-title {
  font-family: var(--f-ui); font-weight: 700;
  font-size: clamp(22px, 3.2vw, 28px);
  letter-spacing: -0.02em; line-height: 1.15; margin: 0;
}
.wizard-step .step-hint {
  font-family: var(--f-mono); font-size: 12px; color: var(--on-sage-2);
  margin-top: -6px;
}
.bg-navy .wizard-step .step-hint { color: var(--on-navy-2); }

.wizard-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.wizard-actions .ghost {
  background: transparent; border: 0; color: var(--on-sage-2);
  font-family: var(--f-mono); font-size: 12px; padding: 12px 4px;
  cursor: pointer; text-transform: uppercase;
}
.bg-navy .wizard-actions .ghost { color: var(--on-navy-2); }
.wizard-actions .ghost:disabled { opacity: 0.35; cursor: not-allowed; }
.wizard-actions .grow { flex: 1; }

/* ---------- modals (shared) ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(3, 11, 17, 0.62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 60;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  animation: modal-fade 0.18s ease;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  background: var(--sage-3);
  border-radius: var(--r-lg);
  padding: 32px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(3, 11, 17, 0.25);
  animation: modal-rise 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-rise {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@media (max-width: 600px) {
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-card {
    padding: 24px 20px 28px;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    animation: modal-sheet 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  @keyframes modal-sheet {
    from { transform: translateY(100%); }
    to   { transform: none; }
  }
}

/* ---------- responsive: auth pages, wizard ---------- */
@media (max-width: 600px) {
  .auth-wrap > .auth-left,
  .auth-wrap > .auth-right { padding: 28px 22px; }
  .auth-wrap .auth-card { padding: 26px 22px; }
}

/* ---------- responsive: app shell head + tabs ---------- */
@media (max-width: 880px) {
  .app-head {
    flex-wrap: wrap;
    padding: 14px 20px;
    gap: 10px 14px;
  }
  .app-head .nav-logo { font-size: 26px; }
  .app-tabs {
    order: 3;
    width: 100%;
    margin-left: 0;
    flex: 1 1 100%;
  }
  .app-tabs a { padding: 8px 14px; font-size: 13px; }
  .app-user { margin-left: auto; gap: 10px; font-size: 11px; }
  .app-main { padding: 28px 20px 80px; }
}
@media (max-width: 560px) {
  .app-head { padding: 12px 14px; }
  .app-head .nav-logo { font-size: 22px; }
  .app-avatar { width: 34px; height: 34px; font-size: 12px; }
  .app-menu { right: -4px; min-width: 200px; }
  .app-main { padding: 22px 14px 88px; }
  .spread { flex-wrap: wrap; }
  .spread .pill-navy, .spread .pill-sage { width: 100%; justify-content: center; }
  .card { padding: 20px; border-radius: 20px; }
  .h-1 { font-size: clamp(34px, 9vw, 56px); }
  .h-2 { font-size: clamp(26px, 7vw, 40px); }
}

/* ---------- responsive: tables (horizontal scroll) ---------- */
.card .tbl { min-width: 560px; }
@media (max-width: 720px) {
  .card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .card .tbl { font-size: 13px; }
  .tbl th, .tbl td { padding: 12px 12px; }
}

/* ---------- responsive: forms grids ---------- */
@media (max-width: 480px) {
  .form-input, .form-select, .form-textarea { font-size: 16px; padding: 12px 14px; } /* 16px avoids iOS zoom */
  .pill-navy, .pill-sage, .btn-outline-sage, .btn-outline-navy { padding: 13px 20px; font-size: 14px; }
  .rental-banner { padding: 10px 16px; font-size: 12px; text-align: left; }
}

/* ---------- toast: bottom-safe area on phones ---------- */
@media (max-width: 600px) {
  #owl-toast { bottom: max(16px, env(safe-area-inset-bottom)) !important; left: 16px !important; right: 16px !important; transform: none !important; text-align: center; }
}

/* =================================================================
   Mobile pass — phase 14
   ================================================================= */

/* ---------- elegant circle checkboxes (global) ----------
   Native <input type="checkbox"> is replaced with a circle that fills navy
   when checked and animates in a sage tick. Works everywhere, no JS needed.
   Override: add class="legacy-check" to keep the native control. */
input[type="checkbox"]:not(.legacy-check),
input[type="radio"]:not(.legacy-check) {
  appearance: none;
  -webkit-appearance: none;
  width: 22px; height: 22px;
  min-width: 22px;
  border: 1.5px solid var(--line-sage);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  vertical-align: middle;
  transition: all 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
  flex-shrink: 0;
  margin: 0;
  position: relative;
}
input[type="checkbox"]:not(.legacy-check):hover,
input[type="radio"]:not(.legacy-check):hover {
  border-color: var(--navy);
  background: rgba(3, 11, 17, 0.04);
}
input[type="checkbox"]:not(.legacy-check):checked,
input[type="radio"]:not(.legacy-check):checked {
  background: var(--navy);
  border-color: var(--navy);
  transform: scale(1.04);
}
/* ✓ tick inside the circle when checked */
input[type="checkbox"]:not(.legacy-check)::after {
  content: '';
  width: 10px; height: 6px;
  border-left: 2px solid var(--sage);
  border-bottom: 2px solid var(--sage);
  transform: rotate(-45deg) translateY(-1px) scale(0);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
input[type="checkbox"]:not(.legacy-check):checked::after {
  transform: rotate(-45deg) translateY(-1px) scale(1);
}
/* radio: small filled dot in the centre */
input[type="radio"]:not(.legacy-check)::after {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sage);
  transform: scale(0);
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}
input[type="radio"]:not(.legacy-check):checked::after { transform: scale(1); }
input[type="checkbox"]:not(.legacy-check):focus-visible,
input[type="radio"]:not(.legacy-check):focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
/* dark-background variant (e.g. on owldid-admin) */
.bg-navy input[type="checkbox"]:not(.legacy-check),
.bg-navy input[type="radio"]:not(.legacy-check) { border-color: var(--line-navy); }
.bg-navy input[type="checkbox"]:not(.legacy-check):checked,
.bg-navy input[type="radio"]:not(.legacy-check):checked { background: var(--sage); border-color: var(--sage); }
.bg-navy input[type="checkbox"]:not(.legacy-check)::after { border-color: var(--navy); }
.bg-navy input[type="radio"]:not(.legacy-check)::after { background: var(--navy); }

/* labelled checkbox row: tighter alignment, full row clickable feel */
label.row > input[type="checkbox"]:not(.legacy-check),
label.row > input[type="radio"]:not(.legacy-check) { margin-right: 2px; }

/* ---------- tables → card list on phones ----------
   Each <tr> stacks as a card with labels from the corresponding <th>.
   Works for any `.tbl` (no markup change needed); supply data-label attrs
   on <td> if a column should keep a custom mobile label. */
@media (max-width: 640px) {
  .card { overflow: visible; }              /* override the horizontal-scroll override */
  .card .tbl { min-width: 0; }
  .tbl, .tbl thead, .tbl tbody, .tbl tr, .tbl th, .tbl td { display: block; }
  .tbl thead { position: absolute; left: -9999px; }   /* hide headers; we'll inline-label rows */
  .tbl tr {
    background: var(--sage-3);
    border: 1px solid var(--line-sage);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 0 rgba(3,11,17,0.02);
  }
  .bg-navy .tbl tr { background: var(--navy-3, rgba(192,208,192,0.04)); border-color: var(--line-navy); }
  .tbl td {
    border: 0;
    padding: 6px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    text-align: right;
    font-size: 13px;
  }
  .tbl td.right, .tbl td[class*="right"] { text-align: right; }
  .tbl td::before {
    content: attr(data-label);
    font-family: var(--f-mono);
    font-size: 11px;
    color: var(--ink-2);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    flex: 0 0 auto;
  }
  .bg-navy .tbl td::before { color: var(--on-navy-2); }
  /* first cell = the "name" — full-width header inside the card */
  .tbl td:first-child {
    border-bottom: 1px dashed var(--line-sage);
    padding-bottom: 10px;
    margin-bottom: 6px;
    font-size: 16px;
  }
  .bg-navy .tbl td:first-child { border-bottom-color: var(--line-navy); }
  .tbl td:first-child::before { display: none; }
  /* an empty last cell with just an action button should sit on its own row */
  .tbl td:last-child { justify-content: flex-end; padding-top: 8px; }
  .tbl td:empty { display: none; }
}

/* ---------- modal: drag-handle visual cue (bottom-sheet on phone) ---------- */
@media (max-width: 600px) {
  .modal-card { position: relative; padding-top: 32px; }
  .modal-card::before {
    content: '';
    position: absolute;
    top: 10px; left: 50%;
    transform: translateX(-50%);
    width: 42px; height: 4px;
    border-radius: 999px;
    background: rgba(3, 11, 17, 0.18);
  }
  .bg-navy .modal-card::before { background: rgba(192, 208, 192, 0.28); }
  .modal-card { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
}

/* ---------- collapse rigid inline grid forms to 1 col on phones ----------
   Many pages set `style="display:grid;grid-template-columns:repeat(4,1fr)"`
   on quick-add forms. Override per-screen-size without editing each file. */
@media (max-width: 720px) {
  form[style*="grid-template-columns"],
  div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  form[style*="grid-template-columns"] button[type="submit"],
  div[style*="grid-template-columns"] button[type="submit"] {
    width: 100%;
  }
}

/* ---------- spread / row utility responsive ---------- */
@media (max-width: 640px) {
  .spread { flex-wrap: wrap; gap: 16px; }
  .spread > div:first-child { width: 100%; }
  .spread .row { width: 100%; flex-wrap: wrap; gap: 8px; }
  .spread .row > * { flex: 1 1 calc(50% - 4px); }
  .spread .row > a, .spread .row > button { min-height: 44px; justify-content: center; display: inline-flex; align-items: center; }
  .row { flex-wrap: wrap; }
}

/* ---------- bigger tap targets on phone ---------- */
@media (max-width: 600px) {
  a, button, .pill-navy, .pill-sage, .btn-outline-sage, .btn-outline-navy {
    -webkit-tap-highlight-color: rgba(3, 11, 17, 0.05);
  }
  /* the small inline action buttons inside tables should still feel pressable */
  .tbl button, .tbl a.mono { min-height: 36px; padding: 8px 14px; font-size: 13px; }
}

/* ---------- dashboard grid: single column on phones, 2-col on tablets ---------- */
@media (max-width: 720px) {
  .dash-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .dash-grid .col-3, .dash-grid .col-4, .dash-grid .col-6 { grid-column: span 1; }
}
@media (max-width: 480px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid .num { font-size: 32px !important; }
}

/* ---------- avatar menu: full-width sheet on small phones ---------- */
@media (max-width: 480px) {
  .app-menu {
    position: fixed;
    inset: auto 8px max(8px, env(safe-area-inset-bottom)) 8px;
    min-width: 0;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(3, 11, 17, 0.30);
  }
  .app-menu a, .app-menu button { padding: 14px 18px; font-size: 15px; }
}

/* ---------- filter input + count on phone ---------- */
@media (max-width: 600px) {
  .list-filter { width: 100%; }
  .list-filter input { width: 100%; }
}

/* ---------- pin/install pill, install button visibility on phone ---------- */
@media (max-width: 720px) {
  .app-install .lbl { display: none; }       /* icon-only on phone */
  .app-install { padding: 8px; min-width: 38px; min-height: 38px; justify-content: center; }
}

/* ---------- chat full-bleed on phone ---------- */
@media (max-width: 600px) {
  .owl-fab { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); }
  .owl-fab-panel { width: calc(100vw - 16px); right: 8px; bottom: 76px; max-height: calc(100vh - 100px); border-radius: 22px; }
}

/* ---------- a couple of base resets that pay off on phone ---------- */
* { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; }

/* viewport-safe bottom padding for fixed bottom UI */
@media (max-width: 600px) {
  body.app-shell { padding-bottom: env(safe-area-inset-bottom); }
}
