/* Palette carried over from the legacy clinic site (legacy/index.html). */
:root {
  --brand-dark: #3a4a17;
  --brand-mid: #63722c;
  --brand-light: #93a83e;
  --brand-pale: #eef2de;
  --brand-pale-2: #f7f8ef;
  --bg: #fdfbf6;
  --surface: #ffffff;
  --border: #e4e2d6;
  --text: #3b2a22;
  --text-soft: #5b4a43;
  --danger: #a13a3a;
  --danger-tint: #f8e3e1;
  --on-brand: #ffffff;
  --shadow: 0 10px 30px -12px rgba(59, 42, 34, 0.18);
  --radius: 14px;
  /* Appointment status colours (text on tint). */
  --st-pending: #8a5420;
  --st-pending-bg: #f8ecdd;
  --st-confirmed: #3a5a17;
  --st-confirmed-bg: #dff0d0;
  --st-completed: #36506b;
  --st-completed-bg: #e2ebf4;
  --st-cancelled: #6b5b55;
  --st-cancelled-bg: #ece8e5;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand-dark: #b9d06a;
    --brand-mid: #9db854;
    --brand-light: #c7de86;
    --brand-pale: #25301a;
    --brand-pale-2: #1e2617;
    --bg: #1b1712;
    --surface: #241f19;
    --border: #3a332a;
    --text: #f0e9e2;
    --text-soft: #d8ccc3;
    --danger: #e08a8a;
    --danger-tint: #3a2020;
    --on-brand: #1b1712;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5);
    --st-pending: #f0be8a;
    --st-pending-bg: #3a2c1c;
    --st-confirmed: #b9d06a;
    --st-confirmed-bg: #2c3a1d;
    --st-completed: #a9c4e0;
    --st-completed-bg: #1f2a36;
    --st-cancelled: #c8bab3;
    --st-cancelled-bg: #2e2824;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    'Poppins',
    system-ui,
    -apple-system,
    sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--brand-mid);
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  line-height: 1.2;
}

:focus-visible {
  outline: 2.5px solid var(--brand-mid);
  outline-offset: 2px;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-inline: 20px;
}

.section {
  padding-block: 30px;
}

@media (min-width: 860px) {
  .section {
    padding-block: 56px;
  }
}

.muted {
  color: var(--text-soft);
}

.caps {
  font-family: 'Anton', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 400;
  color: var(--brand-dark);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.93rem;
  text-decoration: none;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand-dark);
  color: var(--on-brand);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  border-color: var(--brand-dark);
  color: var(--brand-dark);
}

.btn-outline:hover,
.btn-ghost:hover {
  background: var(--brand-pale);
}

.btn-primary:hover {
  box-shadow: var(--shadow);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

/* Buttons on the dark brand band — fixed colours, independent of theme. */
.btn-on-dark {
  background: #fff;
  color: #3a4a17;
}

.btn-on-dark-outline {
  border-color: #fff;
  color: #fff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--text-soft);
  cursor: pointer;
}

.link-btn:hover {
  color: var(--brand-dark);
}

.link-danger {
  color: var(--danger);
}

/* Site chrome */
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  background: var(--brand-dark);
  color: var(--on-brand);
  padding: 8px 14px;
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-n1 {
  font-family: 'Anton', sans-serif;
  color: var(--brand-dark);
  letter-spacing: 0.3px;
}

.brand-n2 {
  font-size: 0.68rem;
  color: var(--text-soft);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.links {
  display: flex;
  align-items: center;
  /* Shrinks with the viewport so the full menu stays on one line until it collapses. */
  gap: clamp(10px, 1.2vw, 20px);
}

.links a:not(.btn),
.links .link-btn {
  text-decoration: none;
  color: var(--text-soft);
  font-weight: 500;
  font-size: clamp(0.8rem, 0.62rem + 0.3vw, 0.92rem);
  white-space: nowrap;
}

.links a:not(.btn):hover,
.links a.active {
  color: var(--brand-dark);
}

.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.nav-book {
  white-space: nowrap;
}

.menu-btn {
  -webkit-appearance: none;
  appearance: none;
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  max-width: 38px;
  max-height: 38px;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  box-sizing: border-box;
  vertical-align: middle;
  line-height: 1;
  transition: all 0.15s ease;
}

.menu-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.menu-btn:hover {
  background: var(--brand-pale);
  border-color: var(--brand-dark);
  color: var(--brand-dark);
}

/* Collapse to a menu button once the full nav no longer fits. */
@media (max-width: 1080px) {
  .menu-btn {
    display: inline-flex;
  }

  .links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }

  .links.open {
    display: flex;
  }

  .nav-divider {
    width: 100%;
    height: 1px;
  }
}

@media (max-width: 480px) {
  .nav-book {
    display: none;
  }
}

.site-main {
  flex: 1;
}

.site-main:focus {
  outline: none;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--brand-pale-2);
  padding-block: 44px 24px;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 28px;
}

@media (max-width: 700px) {
  .foot-grid {
    grid-template-columns: 1fr;
  }
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.foot-h {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 12px;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin-bottom: 8px;
}

.site-footer a {
  text-decoration: none;
  color: var(--text-soft);
}

.site-footer a:hover {
  color: var(--brand-dark);
}

.foot-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}

.foot-links a {
  color: var(--brand-dark);
  font-weight: 600;
}

.foot-bottom {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
}

/* Forms */
.form-row {
  margin-bottom: 16px;
}

.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-row input,
.form-row select,
.form-row textarea,
.admin-search,
.inline-field input {
  width: 100%;
  font: inherit;
  font-size: 0.93rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}

.form-row textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row :is(input, select, textarea):focus {
  border-color: var(--brand-mid);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-mid) 25%, transparent);
}

.form-row [aria-invalid='true'] {
  border-color: var(--danger);
}

.field-hint {
  color: var(--text-soft);
  font-size: 0.8rem;
  margin: 4px 0 0;
}

.form-note {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin: 12px 0 0;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 480px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* Honeypot field: off-screen rather than display:none, which some bots detect. */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin: 4px 0 0;
}

.form-error {
  background: var(--danger-tint);
  color: var(--danger);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.88rem;
}

/* Auth pages */
.auth-page {
  display: grid;
  place-items: center;
  padding: 48px 20px;
  min-height: 70vh;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  font-size: 1.4rem;
}

.auth-lede {
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-top: -4px;
}

.auth-alt {
  text-align: center;
  font-size: 0.88rem;
  margin: 16px 0 0;
}

/* Admin */
.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.admin-nav {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-brand {
  font-family: 'Anton', sans-serif;
  color: var(--brand-dark);
  text-decoration: none;
  font-size: 1.1rem;
}

.admin-nav nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.admin-nav nav a {
  text-decoration: none;
  color: var(--text-soft);
  padding: 8px 10px;
  border-radius: 8px;
}

.admin-nav nav a.active {
  background: var(--brand-pale);
  color: var(--brand-dark);
  font-weight: 600;
}

.admin-user {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  gap: 8px;
}

.admin-main {
  padding: 28px clamp(16px, 3vw, 36px);
  min-width: 0;
}

.admin-search {
  max-width: 360px;
  margin-bottom: 16px;
}

@media (max-width: 760px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-nav {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .admin-nav nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th {
  font-weight: 600;
  background: var(--brand-pale-2);
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.pager {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-size: 0.88rem;
}

.page-loading {
  min-height: 50vh;
}

/* ---------- Clinic pages ---------- */
.section-tint {
  background: var(--brand-pale-2);
}

.section-head {
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
}

.section-head p {
  color: var(--text-soft);
  margin: 0;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2rem);
}

.page-title-sm {
  font-size: 1.6rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--brand-mid);
  margin-bottom: 10px;
}

.eyebrow::before {
  content: '';
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-light);
}

.eyebrow-center {
  justify-content: center;
}

.text-strong {
  color: var(--text);
}

.hero {
  background:
    radial-gradient(circle at 85% 12%,
      color-mix(in srgb, var(--brand-light) 22%, transparent),
      transparent 55%),
    linear-gradient(180deg, var(--brand-pale-2), var(--bg) 70%);
  padding-block: 56px 40px;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-title {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.05;
  margin-bottom: 14px;
}

.lede {
  font-size: 1.05rem;
  color: var(--text-soft);
  max-width: 540px;
  margin: 0 0 26px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 32px;
}

.doctor-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: var(--shadow);
}

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--brand-pale);
  border: 1px solid var(--border);
  color: var(--brand-dark);
}

.doctor-name {
  font-size: 1.05rem;
  margin-bottom: 2px;
}

.cred {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-mid);
  margin-bottom: 6px;
}

.doctor-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.plate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 340px;
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.plant-big {
  width: 190px;
  height: auto;
}

.hours-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 14px 20px;
  border-radius: 16px;
  background: var(--brand-pale);
  text-align: center;
}

.hours-pill .label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--brand-mid);
}

.hours-pill .val {
  font-weight: 700;
}

ul.grid,
ol.steps,
ul.pill-row {
  list-style: none;
  margin: 0;
  padding: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.teaser-grid {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 960px) {
  .teaser-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {

  .grid,
  .grid-2,
  .teaser-grid {
    grid-template-columns: 1fr;
  }
}

.card {
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 22px;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 1.02rem;
  margin-bottom: 6px;
}

.card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--brand-pale);
  color: var(--brand-dark);
}

/* Offset #hash targets so the sticky header doesn't cover them. */
[id] {
  scroll-margin-top: 90px;
}

.about-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 52px;
  align-items: center;
}

@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.about-card {
  background: var(--brand-pale);
  border-radius: 22px;
  padding: 32px;
}

.about-card ul {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.about-card li {
  padding: 9px 0;
  border-top: 1px solid color-mix(in srgb, var(--brand-mid) 25%, transparent);
  font-size: 0.92rem;
  color: var(--text-soft);
}

.about-card li:first-child {
  border-top: none;
}

.about-card li b {
  color: var(--text);
}

.about-cta {
  margin-top: 22px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-dark);
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 820px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

.step {
  text-align: center;
  padding: 10px;
}

.step-num {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--brand-dark);
  color: var(--on-brand);
  font-family: 'Anton', sans-serif;
}

.step-title {
  font-size: 1rem;
}

.step p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-soft);
}

/* Fixed dark band in both themes, as on the legacy site. */
.note-band {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  margin-top: 48px;
  padding: 38px 36px;
  border-radius: 24px;
  background: #3a4a17;
  color: #fff;
}

@media (max-width: 700px) {
  .note-band {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.note-band-title {
  color: #fff;
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.note-band p {
  margin: 0;
  opacity: 0.9;
  font-size: 0.92rem;
  max-width: 520px;
}

.note-band-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.tool-card {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px 22px;
}

.tool-card .card-title {
  padding-right: 110px;
}

.tool-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.tool-sub {
  font-weight: 500;
  font-size: 0.85rem;
}

.tool-note {
  font-size: 0.85rem;
  margin: 14px 0 0;
}

.badge {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge-soon {
  background: var(--brand-pale);
  color: var(--brand-mid);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

@media (max-width: 820px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
}

.info-row {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.info-row:first-child {
  border-top: none;
  padding-top: 0;
}

.info-row:last-child {
  padding-bottom: 0;
}

.ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-pale);
  color: var(--brand-dark);
}

.info-h {
  margin: 0 0 3px;
  font-size: 0.92rem;
}

.info-row p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.map-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 280px;
  padding: 30px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background:
    repeating-linear-gradient(45deg,
      color-mix(in srgb, var(--brand-mid) 8%, transparent) 0 12px,
      transparent 12px 24px),
    var(--brand-pale);
  color: var(--brand-dark);
  text-align: center;
}

.map-card p {
  margin: 0;
  max-width: 300px;
  font-size: 0.86rem;
  color: var(--text-soft);
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 6px;
}

.booking-done {
  text-align: center;
}

.booking-done:focus {
  outline: none;
}

.booking-done-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--st-confirmed-bg);
  color: var(--st-confirmed);
}

.ref-code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  letter-spacing: 1px;
}

/* ---------- Admin: shared ---------- */
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.admin-head h1 {
  margin: 0;
}

.mono {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.85em;
}

.pre-wrap {
  white-space: pre-wrap;
}

.status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pending {
  color: var(--st-pending);
  background: var(--st-pending-bg);
}

.status-confirmed {
  color: var(--st-confirmed);
  background: var(--st-confirmed-bg);
}

.status-completed {
  color: var(--st-completed);
  background: var(--st-completed-bg);
}

.status-cancelled {
  color: var(--st-cancelled);
  background: var(--st-cancelled-bg);
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.stat-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 110px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.stat-chip.active {
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-mid) 30%, transparent);
  color: var(--text);
}

.stat-num {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.filter-bar .admin-search {
  margin-bottom: 0;
  flex: 1 1 240px;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.inline-field input {
  width: auto;
  padding: 7px 10px;
}

.row-open {
  color: var(--brand-dark);
  font-weight: 600;
  text-align: left;
}

.row-open:hover {
  text-decoration: underline;
}

.row-today td:first-child {
  box-shadow: inset 3px 0 0 var(--brand-mid);
}

.empty-cell {
  text-align: center;
  padding-block: 28px;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.overview-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
}

.overview-card:hover {
  border-color: var(--brand-mid);
}

.overview-num {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

/* Detail drawer (native <dialog>). */
.drawer {
  margin: 0 0 0 auto;
  width: min(460px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.drawer::backdrop {
  background: rgba(20, 15, 10, 0.45);
}

.drawer-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100%;
  padding: 24px;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.drawer-head h2 {
  margin: 0;
  font-size: 1.25rem;
}

.drawer-head p {
  margin: 2px 0 0;
}

.detail-list {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px 14px;
  margin: 0;
  font-size: 0.9rem;
}

.detail-list dt {
  color: var(--text-soft);
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.status-actions legend {
  width: 100%;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.notes-save {
  margin-top: 8px;
}

.danger-zone {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
}

.danger-zone p {
  margin: 0 0 10px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- PathCalc ---------- */
/* Result tones reuse the status palette: one set of tokens, light + dark. */
.tone-neutral {
  --tone-fg: var(--st-cancelled);
  --tone-bg: var(--st-cancelled-bg);
}

.tone-info {
  --tone-fg: var(--st-completed);
  --tone-bg: var(--st-completed-bg);
}

.tone-success {
  --tone-fg: var(--st-confirmed);
  --tone-bg: var(--st-confirmed-bg);
}

.tone-warning {
  --tone-fg: var(--st-pending);
  --tone-bg: var(--st-pending-bg);
}

.tone-danger {
  --tone-fg: var(--danger);
  --tone-bg: var(--danger-tint);
}

.tone-violet {
  --tone-fg: #5b4a8a;
  --tone-bg: #ece9f7;
}

@media (prefers-color-scheme: dark) {
  .tone-violet {
    --tone-fg: #c9c0ec;
    --tone-bg: #2a2540;
  }
}

.badge-live {
  background: var(--st-confirmed-bg);
  color: var(--st-confirmed);
}

.tool-cta {
  margin: 16px 0 0;
}

.pc-hero {
  max-width: 760px;
  margin-bottom: 32px;
}

.pc-search {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 18px;
}

.pc-search:focus {
  outline: none;
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-mid) 25%, transparent);
}

.pc-empty {
  padding-block: 24px;
}

.pc-group {
  margin-top: 36px;
}

.pc-group-title {
  font-size: 1.2rem;
  margin-bottom: 4px;
}

.pc-group-desc {
  margin: 0 0 16px;
  font-size: 0.9rem;
}

.pc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pc-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease;
}

a.pc-card:hover {
  border-color: var(--brand-mid);
  transform: translateY(-2px);
}

.pc-card-soon {
  opacity: 0.6;
}

.pc-card-title {
  font-weight: 600;
  line-height: 1.3;
}

.pc-card-summary {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.pc-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.pc-tag-free {
  background: var(--st-confirmed-bg);
  color: var(--st-confirmed);
}

.pc-tag-paid {
  background: var(--st-pending-bg);
  color: var(--st-pending);
}

.pc-tag-soon {
  background: var(--st-cancelled-bg);
  color: var(--st-cancelled);
}

.pc-crumbs {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 12px;
}

.pc-calc-head {
  margin-bottom: 20px;
}

.pc-calc-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.pc-gate {
  padding: 16px 18px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--st-pending);
  background: var(--st-pending-bg);
  color: var(--text);
  transition: box-shadow 0.2s ease;
}

.pc-gate p {
  margin: 0 0 10px;
}

.pc-gate-flash {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--st-pending) 45%, transparent);
}

.pc-modules {
  display: grid;
  gap: 22px;
}

.calc-module {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}

.calc-module-title {
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.calc-module-desc {
  margin-top: 0;
}

.calc-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0 16px;
}

.calc-field {
  margin: 0 0 16px;
}

.calc-field-wide {
  grid-column: 1 / -1;
}

.calc-choice {
  grid-column: 1 / -1;
  border: 0;
  padding: 0;
}

.calc-choice legend,
.calc-group-open legend {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
  padding: 0;
}

.unit {
  font-weight: 400;
  color: var(--text-soft);
}

.choice-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calc-choice-cards .choice-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.choice-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.9rem;
}

.calc-choice-toggle .choice-option {
  border-radius: 999px;
  padding: 7px 14px;
}

/* Native radio stays focusable for keyboard users; the card shows the state. */
.choice-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-option:has(input:focus-visible) {
  outline: 2.5px solid var(--brand-mid);
  outline-offset: 2px;
}

.choice-option.selected {
  border-color: var(--brand-mid);
  background: var(--brand-pale);
}

.choice-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.85rem;
}

.choice-option.selected .choice-badge {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: var(--on-brand);
}

.choice-text {
  display: flex;
  flex-direction: column;
}

.choice-label {
  font-weight: 600;
}

.choice-desc {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.calc-checkbox label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-group {
  margin: 4px 0 16px;
  padding: 12px 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.calc-group summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
}

.calc-group[open] summary {
  margin-bottom: 10px;
}

.calc-group-open {
  border-style: solid;
}

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.result {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.rb-value {
  display: flex;
  flex-direction: column;
}

.rb-value-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-soft);
}

.rb-value-num {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.15;
}

.rb-value-unit {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-soft);
}

.rb-value-secondary {
  color: var(--text-soft);
}

.rb-badge {
  justify-self: start;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--tone-fg);
  background: var(--tone-bg);
}

.rb-grade {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 20px;
  border-radius: 14px;
  border-left: 5px solid var(--tone-fg);
  background: var(--tone-bg);
}

.rb-grade-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-soft);
}

.rb-grade-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--tone-fg);
}

.rb-grade-detail {
  font-size: 0.88rem;
  color: var(--text-soft);
}

.rb-gauge-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg,
      var(--st-completed-bg),
      var(--st-cancelled-bg),
      var(--st-pending-bg));
  border: 1px solid var(--border);
}

.rb-gauge-marker {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--brand-dark);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow);
}

.rb-gauge-ticks {
  position: relative;
  height: 18px;
  font-size: 0.75rem;
  color: var(--text-soft);
}

.rb-gauge-ticks span {
  position: absolute;
  transform: translateX(-50%);
}

.rb-gauge-ticks span:first-child {
  transform: none;
}

.rb-gauge-ticks span:last-child {
  transform: translateX(-100%);
}

.rb-gauge-ends {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.rb-steps,
.rb-table {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--brand-pale-2);
}

.rb-steps h3,
.rb-table h3 {
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.rb-steps ol {
  margin: 0;
  padding-left: 1.2em;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.rb-steps li+li {
  margin-top: 4px;
}

.rb-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.rb-table th,
.rb-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.rb-table th {
  font-weight: 500;
  color: var(--text-soft);
  width: 45%;
}

.rb-table tr:last-child th,
.rb-table tr:last-child td {
  border-bottom: 0;
}

.rb-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.rb-chip {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.rb-chip-label {
  font-size: 0.78rem;
  color: var(--text-soft);
}

.rb-chip-value {
  font-weight: 700;
}

.rb-chip-detail {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.rb-heading {
  margin: 10px 0 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
}

.rb-list,
.rb-text {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--brand-pale-2);
  font-size: 0.9rem;
}

.rb-list.tone-warning,
.rb-list.tone-danger,
.rb-list.tone-info,
.rb-list.tone-success,
.rb-list.tone-violet {
  background: var(--tone-bg);
  border-left: 4px solid var(--tone-fg);
}

.rb-list h3,
.rb-text h3 {
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.rb-list ul {
  margin: 0;
  padding-left: 1.2em;
}

.rb-list li+li {
  margin-top: 3px;
}

.rb-text p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.rb-grid-scroll {
  overflow-x: auto;
}

.rb-grid table {
  min-width: 420px;
}

.rb-grid th {
  width: auto;
  font-weight: 600;
}

.rb-grid tr.rb-grid-hit td {
  background: var(--brand-pale);
  font-weight: 600;
}

.rb-note {
  padding: 12px 14px;
  border-radius: 12px;
  border-left: 4px solid var(--tone-fg);
  background: var(--tone-bg);
  font-size: 0.9rem;
}

.rb-note p {
  margin: 0;
}

.rb-note p+p {
  margin-top: 6px;
}

.pc-disclaimer {
  margin: 22px 0 0;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.pc-reference {
  margin-top: 36px;
}

.pc-ref-section {
  margin-top: 18px;
}

.pc-ref-section h3 {
  font-size: 1rem;
}

.pc-ref-section p {
  color: var(--text-soft);
  font-size: 0.92rem;
}

/* ---------- Store: cart, orders, dashboard ---------- */
.narrow {
  max-width: 760px;
}

.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand-dark);
  color: var(--on-brand);
  font-size: 0.75rem;
  font-weight: 700;
}

.cart-list {
  list-style: none;
  margin: 20px 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.cart-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.cart-line:last-child {
  border-bottom: 0;
}

.cart-price {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.cart-total {
  background: var(--brand-pale-2);
  font-weight: 700;
}

.pay-box {
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.pay-box h2 {
  font-size: 1.05rem;
}

.plain-list {
  margin: 0;
  padding-left: 1.1em;
}

.pc-access-note {
  display: block;
  margin-top: 6px;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.save-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.save-result input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: inherit;
  font: inherit;
}

.save-result .form-error {
  flex-basis: 100%;
}

.dash-section {
  margin-top: 32px;
}

.dash-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dash-head h2 {
  margin: 0;
}

.saved-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

/* My Calculators Card View */
.dash-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-calc-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 195px;
  box-shadow: 0 2px 8px -2px rgba(59, 42, 34, 0.05);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.dash-calc-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-light);
  box-shadow: var(--shadow), 0 10px 24px -6px rgba(59, 42, 34, 0.12);
}

.dash-calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.dash-calc-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-pale);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.dash-calc-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.dash-calc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.dash-calc-badge.status-active {
  background: var(--st-confirmed-bg);
  color: var(--st-confirmed);
}

.dash-calc-badge.status-active .dash-calc-dot {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--st-confirmed) 30%, transparent);
}

.dash-calc-badge.status-expired {
  background: var(--st-cancelled-bg);
  color: var(--st-cancelled);
}

.dash-calc-badge.status-upcoming {
  background: var(--st-pending-bg);
  color: var(--st-pending);
}

.dash-calc-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.dash-calc-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.dash-calc-title a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.dash-calc-title a:hover {
  color: var(--brand-mid);
}

.dash-calc-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-top: 2px;
}

.dash-calc-meta svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.dash-calc-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.dash-calc-action {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  transition: all 0.18s ease;
}

.dash-calc-action span {
  transition: transform 0.18s ease;
}

.dash-calc-card:hover .dash-calc-action span {
  transform: translateX(3px);
}

.dash-calc-expired {
  opacity: 0.85;
  background: color-mix(in srgb, var(--surface) 95%, var(--bg));
}

.dash-calc-expired:hover {
  opacity: 1;
}

/* Bundle featured card */
.dash-bundle-card {
  background: linear-gradient(135deg, var(--brand-pale-2) 0%, var(--brand-pale) 100%);
  border: 1px solid var(--border);
  border-left: 5px solid var(--brand-dark);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  box-shadow: 0 4px 14px -4px rgba(59, 42, 34, 0.08);
}

.dash-bundle-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-dark);
  color: var(--on-brand);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.dash-bundle-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  color: var(--brand-dark);
}

.dash-bundle-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-soft);
  max-width: 580px;
}

.dash-bundle-btn {
  white-space: nowrap;
}

/* Empty state card */
.dash-empty-card {
  background: var(--surface);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 540px;
  margin: 12px auto;
}

.dash-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--brand-pale);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}

.dash-empty-card h3 {
  margin: 0;
  font-size: 1.1rem;
}

.dash-empty-card p {
  margin: 0 0 10px;
  font-size: 0.88rem;
  max-width: 440px;
}

.saved-row {
  border: 1px solid var(--border);
  border-radius: 12px;
}

.saved-open {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.saved-open:focus-visible {
  outline: 2.5px solid var(--brand-mid);
  outline-offset: -2px;
  border-radius: 12px;
}

.saved-label {
  font-weight: 600;
}

.saved-detail {
  padding: 0 16px 16px;
}

.saved-detail .row-actions {
  margin-top: 14px;
}

/* ---------- Messages (contact form, calculator reports) ---------- */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0 16px;
}

.form-success {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--st-confirmed-bg);
  color: var(--st-confirmed);
  font-weight: 600;
}

.contact-message {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  max-width: 760px;
}

.pc-report {
  margin-top: 16px;
  padding: 12px 16px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.pc-report summary {
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.pc-report[open] summary {
  margin-bottom: 12px;
}

/* ---------- Admin: Phase 5 screens ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.admin-section {
  margin-top: 24px;
}

.admin-section h2 {
  font-size: 1.05rem;
}

.settings-card {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  max-width: 860px;
}

.settings-save {
  margin-top: 8px;
  align-items: center;
}

.form-success-inline {
  color: var(--st-confirmed);
  font-weight: 600;
}

.row-editing td {
  background: var(--brand-pale-2);
  vertical-align: middle;
}

.row-editing input[type='number'] {
  width: 7em;
}

.drawer-h {
  margin: 22px 0 8px;
  font-size: 1rem;
}

.drawer-form {
  margin: 10px 0 14px;
}

.access-history li {
  margin-bottom: 10px;
}

.revoke-btn {
  margin-left: 8px;
}

.revoke-confirm {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.revoke-confirm input,
.grant-form input,
.grant-form select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: inherit;
  font: inherit;
}

.grant-form {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.grant-form h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.message-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.message-row {
  border: 1px solid var(--border);
  border-radius: 12px;
}

.message-new {
  border-left: 4px solid var(--brand-mid);
}

.message-new .saved-label {
  font-weight: 700;
}

/* Bare buttons in the drawer's flex column would otherwise stretch and centre. */
.drawer-body>.link-btn {
  align-self: flex-start;
}

/* ==========================================================================
   Navigation User Profile Menu & Dropdown
   ========================================================================== */
.nav-user-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.18s ease;
}

.nav-user-btn:hover,
.nav-user-btn[aria-expanded="true"] {
  border-color: var(--brand-mid);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-pale) 70%, transparent);
}

.nav-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-mid) 100%);
  color: var(--on-brand);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.5px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(59, 42, 34, 0.15);
}

.nav-user-caret {
  color: var(--text-soft);
  transition: transform 0.2s ease;
}

.nav-user-btn[aria-expanded="true"] .nav-user-caret {
  transform: rotate(180deg);
}

.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px -4px rgba(59, 42, 34, 0.16), 0 4px 12px rgba(59, 42, 34, 0.08);
  padding: 0;
  z-index: 100;
  overflow: hidden;
  animation: navUserFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes navUserFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.nav-user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--brand-pale) 45%, var(--surface));
  border-bottom: 1px solid var(--border);
}

.nav-user-avatar-lg {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-mid) 100%);
  color: var(--on-brand);
  font-weight: 700;
  font-size: 1rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(59, 42, 34, 0.18);
}

.nav-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.nav-user-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user-email {
  font-size: 0.76rem;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user-role {
  display: inline-block;
  align-self: flex-start;
  margin-top: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-pale);
  color: var(--brand-dark);
}

.nav-user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.nav-user-dropdown-links {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.nav-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  width: 100%;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-user-dropdown-item svg {
  color: var(--brand-dark);
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-user-dropdown-item:hover,
.nav-user-dropdown-item.active {
  background: var(--brand-pale);
  color: var(--brand-dark);
}

.nav-user-dropdown-item.active {
  font-weight: 600;
}

.nav-user-dropdown-footer {
  padding: 4px 0 6px;
}

.nav-user-logout {
  color: var(--danger) !important;
}

.nav-user-logout svg {
  color: var(--danger) !important;
}

.nav-user-logout:hover {
  background: color-mix(in srgb, var(--danger) 10%, transparent) !important;
}

@media (max-width: 1080px) {
  .nav-user-menu {
    width: 100%;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .nav-user-btn {
    width: 100%;
    justify-content: space-between;
    padding: 6px 12px;
    border-radius: 12px;
  }
  .nav-user-dropdown {
    position: static;
    box-shadow: none;
    border: 1px solid var(--border);
    margin-top: 8px;
    width: 100%;
  }
}

/* ==========================================================================
   Profile & Account Settings Page
   ========================================================================== */
.profile-page {
  padding-bottom: 48px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--brand-pale-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin: 16px 0 28px;
  box-shadow: 0 4px 16px -4px rgba(59, 42, 34, 0.06);
}

.profile-hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand-mid) 100%);
  color: var(--on-brand);
  font-size: 1.8rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(59, 42, 34, 0.2);
}

.profile-hero-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.profile-hero-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.profile-badge-role {
  background: var(--brand-dark);
  color: var(--on-brand);
}

.profile-badge-status {
  background: var(--st-confirmed-bg);
  color: var(--st-confirmed);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-badge-status .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.profile-hero-name {
  margin: 4px 0 0;
  font-size: 1.55rem;
  line-height: 1.25;
  color: var(--text);
  word-break: break-word;
}

.profile-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.86rem;
  color: var(--text-soft);
  margin-top: 4px;
}

.profile-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .profile-hero {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 18px 22px;
    gap: 14px;
    margin: 12px 0 20px;
    border-radius: 16px;
  }

  .profile-hero-avatar {
    width: 68px;
    height: 68px;
    font-size: 1.65rem;
  }

  .profile-hero-content {
    align-items: center;
    text-align: center;
    width: 100%;
    gap: 8px;
  }

  .profile-hero-badges {
    justify-content: center;
    gap: 8px;
    width: 100%;
  }

  .profile-hero-name {
    font-size: 1.35rem;
    line-height: 1.25;
    margin: 4px 0 0;
    text-align: center;
  }

  .profile-hero-meta {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    margin-top: 4px;
    width: 100%;
  }

  .profile-meta-item {
    justify-content: center;
    word-break: break-all;
  }

  .profile-card {
    padding: 18px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
  }

  .profile-card-head {
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  .profile-card-footer {
    margin-top: 16px;
    padding-top: 14px;
  }

  .profile-card-footer .btn {
    width: 100%;
  }
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 22px;
  box-shadow: 0 2px 8px -2px rgba(59, 42, 34, 0.05);
}

.profile-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.profile-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-pale);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.profile-card-title {
  margin: 0 0 3px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.profile-card-desc {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-soft);
}

.profile-card-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.input-with-badge {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-badge input {
  padding-right: 90px;
  background: color-mix(in srgb, var(--surface) 90%, var(--border));
  color: var(--text-soft);
  cursor: not-allowed;
}

.input-badge {
  position: absolute;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--st-confirmed);
  background: var(--st-confirmed-bg);
  padding: 3px 8px;
  border-radius: 999px;
  pointer-events: none;
}

.profile-access-box {
  background: var(--brand-pale-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 18px;
}

.profile-access-badge {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.access-dot-green {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--st-confirmed);
  margin-top: 5px;
  flex-shrink: 0;
}

.profile-side-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-logout-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

.btn-logout-action:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.alert-success {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--st-confirmed-bg);
  color: var(--st-confirmed);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, var(--st-confirmed) 30%, transparent);
}