/* ==========================================================================
   KoalaCare — the app
   Same design language as the landing page: the same token values, the same
   pill buttons, the same product card, the same tick marks and status pills
   that the marketing site uses to demonstrate the product.
   Mobile first; the desktop sidebar appears at 900px.
   ========================================================================== */

:root {
  color-scheme: light;

  /* Brand — deep eucalyptus (identical to the landing page) */
  --brand-900: #052b27;
  --brand-800: #08443d;
  --brand-700: #0d5c53;
  --brand-600: #12756a;
  --brand-500: #1a9082;
  --brand-300: #7cc4b8;
  --brand-200: #b3ddd4;
  --brand-100: #dff0eb;
  --brand-050: #f0f8f5;

  /* Accent — used sparingly, never for body text */
  --accent-700: #7a4c07;
  --accent-500: #d08a24;
  --accent-200: #f2d9ae;
  --accent-100: #fdf2e0;

  /* Neutrals — warm, so the app reads calm rather than clinical */
  --ink-900: #0f2226;
  --ink-800: #173236;
  --ink-700: #21464a;
  --ink-600: #35595d;
  --ink-500: #507579;
  --ink-400: #7a9699;
  --ink-300: #a7bcbd;

  --line-300: #cfdad7;
  --line-200: #dfe7e4;
  --line-100: #edf2f0;

  --sand-050: #fcfaf7;
  --sand-100: #f6f3ee;
  --sand-200: #efeae2;
  --white: #ffffff;

  --success-800: #0f5133;
  --success-100: #e0f3e8;
  --danger-800: #8a1f17;
  --danger-100: #fce9e7;
  --danger-line: #f0c4bf;
  --warn-800: #6f4506;
  --warn-100: #fdf0da;
  --warn-line: #eed6a8;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  --fs-2xs: 0.75rem;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.1875rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.125rem;
  --fs-hero: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);

  --lh-tight: 1.1;
  --lh-snug: 1.28;
  --lh-normal: 1.62;

  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --tracking-tight: -0.021em;
  --tracking-wide: 0.07em;

  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 2.5rem;
  --sp-8: 3rem;

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  --sh-xs: 0 1px 2px rgba(15, 34, 38, 0.06);
  --sh-sm: 0 2px 5px rgba(15, 34, 38, 0.05), 0 1px 2px rgba(15, 34, 38, 0.04);
  --sh-md: 0 14px 30px -16px rgba(15, 34, 38, 0.24), 0 3px 8px rgba(15, 34, 38, 0.05);
  --sh-lg: 0 40px 70px -34px rgba(11, 46, 42, 0.36), 0 8px 22px rgba(15, 34, 38, 0.07);

  --wrap: 1120px;
  --gutter: clamp(1.125rem, 4vw, 2.5rem);
  --tabbar-h: 66px;

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --dur-fast: 130ms;
  --dur: 220ms;

  --focus-ring: 0 0 0 3px var(--white), 0 0 0 5px var(--brand-600);
}

/* ------------------------------------------------------------------ reset */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--sand-050);
  color: var(--ink-700);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}

h1,
h2,
h3 {
  color: var(--ink-900);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-snug);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-hero);
  line-height: var(--lh-tight);
}

h2 {
  font-size: var(--fs-lg);
}

h3 {
  font-size: var(--fs-md);
}

p {
  text-wrap: pretty;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

a {
  color: var(--brand-700);
  text-decoration-color: rgba(18, 117, 106, 0.45);
  text-underline-offset: 0.18em;
  transition: color var(--dur-fast) var(--ease);
}

a:hover {
  color: var(--brand-800);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-xs);
}

::selection {
  background: var(--brand-200);
  color: var(--brand-900);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

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

/* ----------------------------------------------------------------- layout */

.shell {
  max-width: var(--wrap);
  margin-inline: auto;
}

.sidebar {
  display: none;
}

.content {
  display: grid;
  gap: var(--sp-5);
  align-content: start;
  padding: var(--sp-5) var(--gutter) var(--sp-8);
}

.grid-2 {
  display: grid;
  gap: var(--sp-5);
}

/* --------------------------------------------------------------- app bar */

.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--gutter);
  background: rgba(252, 250, 247, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-200);
}

.appbar__mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--brand-700);
  color: var(--brand-100);
}

.appbar__circle {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.appbar__name {
  color: var(--ink-900);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.appbar__who {
  color: var(--ink-400);
  font-size: var(--fs-2xs);
}

.appbar__spacer {
  margin-left: auto;
}

.iconbtn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-300);
  border-radius: var(--r-full);
  background: var(--white);
  color: var(--ink-600);
  box-shadow: var(--sh-xs);
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.iconbtn:hover {
  background: var(--brand-050);
  color: var(--brand-800);
}

.dot {
  position: absolute;
  top: -2px;
  right: -2px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--accent-500);
  color: var(--white);
  font-size: 11px;
  font-weight: var(--fw-bold);
}

/* ----------------------------------------------------------- page header */

.page-head {
  display: grid;
  gap: var(--sp-2);
}

.page-head__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

.page-head__lead {
  color: var(--ink-500);
  font-size: var(--fs-sm);
}

.eyebrow {
  color: var(--brand-600);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

/* The landing page's hero glow, reused as the Today header. */
.page-hero {
  position: relative;
  overflow: hidden;
  margin: calc(var(--sp-5) * -1) calc(var(--gutter) * -1) 0;
  padding: var(--sp-6) var(--gutter) var(--sp-5);
}

.page-hero__backdrop {
  position: absolute;
  inset: -40% -10% auto -10%;
  height: 420px;
  background: radial-gradient(
      60% 70% at 78% 18%,
      rgba(26, 144, 130, 0.16) 0%,
      rgba(26, 144, 130, 0) 68%
    ),
    radial-gradient(
      48% 60% at 12% 8%,
      rgba(208, 138, 36, 0.12) 0%,
      rgba(208, 138, 36, 0) 70%
    );
  pointer-events: none;
}

.page-hero__inner {
  position: relative;
  display: grid;
  gap: var(--sp-2);
}

/* ------------------------------------------------------------------ cards */

.card {
  display: grid;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}

/* The landing page's product card: rounder, floating, more important. */
.card--feature {
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
}

.card--flush {
  padding: 0;
  overflow: hidden;
}

.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.card__title {
  color: var(--ink-900);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}

.card__hint {
  color: var(--ink-400);
  font-size: var(--fs-xs);
}

.card__lead {
  max-width: 62ch;
  color: var(--ink-500);
  font-size: var(--fs-sm);
}

/* Spacing for flush cards, declared here rather than as inline styles:
   the Content-Security-Policy blocks style attributes, so a `style="..."`
   in a template is silently inert. */
.card--flush > .card__head {
  padding: var(--sp-5) var(--sp-5) 0;
}

.card--flush > .rows {
  margin-top: var(--sp-4);
}

.card--flush > .empty {
  margin: var(--sp-4) var(--sp-5);
}

.card--flush > .card__hint {
  padding: 0 var(--sp-5);
}

/* ------------------------------------------------------------------ rows */

.rows {
  display: grid;
}

.row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line-100);
}

.row:last-child {
  border-bottom: 0;
}

.row--attention {
  background: var(--warn-100);
}

.row__time {
  flex: none;
  width: 4.75rem;
  padding-top: 0.15rem;
  color: var(--ink-400);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

.row__body {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.row__title {
  color: var(--ink-900);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.row__sub {
  color: var(--ink-500);
  font-size: var(--fs-sm);
  overflow-wrap: anywhere;
}

.row__action {
  flex: none;
}

.row--done .row__title {
  color: var(--ink-400);
  text-decoration: line-through;
}

/* ------------------------------------------------------- doses and ticks
   The same tick circle the landing page shows on its task list. */

.dose {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--line-100);
}

.dose:last-child {
  border-bottom: 0;
}

.dose form {
  display: grid;
}

.dose__tick {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--line-300);
  border-radius: var(--r-full);
  background: var(--white);
  color: transparent;
  transition: background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.dose__tick:hover {
  border-color: var(--brand-500);
  transform: translateY(-1px);
}

.dose--taken .dose__tick {
  border-color: var(--brand-600);
  background: var(--brand-600);
  color: var(--white);
}

.dose__name {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.dose--taken .dose__name .row__title {
  color: var(--ink-400);
  text-decoration: line-through;
}

/* --------------------------------------------------------------- pills */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.28rem 0.7rem;
  border-radius: var(--r-full);
  background: var(--brand-100);
  color: var(--brand-800);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pill--accent {
  background: var(--accent-100);
  color: var(--accent-700);
}

.pill--quiet {
  background: var(--sand-100);
  color: var(--ink-600);
}

.pill--warn {
  background: var(--warn-100);
  color: var(--warn-800);
}

.pill--good {
  background: var(--success-100);
  color: var(--success-800);
}

.pill--live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--r-full);
  background: var(--brand-500);
}

/* -------------------------------------------------------------- avatars */

.avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--r-full);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.02em;
}

.avatar--a {
  background: var(--brand-100);
  color: var(--brand-800);
}

.avatar--b {
  background: var(--accent-100);
  color: var(--accent-700);
}

.avatar--c {
  background: var(--sand-200);
  color: var(--ink-700);
}

.avatar--d {
  background: var(--brand-700);
  color: var(--white);
}

.avatar--sm {
  width: 30px;
  height: 30px;
  font-size: 10px;
}

/* ---------------------------------------------------------------- stats */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: var(--sp-3);
}

.stat {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-5);
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xs);
}

.stat__value {
  color: var(--ink-900);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
  line-height: 1.05;
}

.stat__label {
  color: var(--ink-500);
  font-size: var(--fs-xs);
}

/* -------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 0.75rem 1.4rem;
  background: var(--brand-700);
  color: var(--white);
  border: 1px solid transparent;
  border-radius: var(--r-full);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.005em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.btn:hover {
  background: var(--brand-800);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}

.btn--ghost {
  background: var(--white);
  color: var(--brand-800);
  border-color: var(--line-300);
  box-shadow: var(--sh-xs);
}

.btn--ghost:hover {
  background: var(--brand-050);
  border-color: var(--brand-300);
  color: var(--brand-900);
}

.btn--quiet {
  min-height: 38px;
  padding: 0.35rem 0.7rem;
  background: transparent;
  color: var(--ink-500);
  font-size: var(--fs-xs);
}

.btn--quiet:hover {
  background: var(--brand-050);
  color: var(--brand-800);
  box-shadow: none;
  transform: none;
}

.btn--warn {
  background: var(--danger-800);
}

.btn--warn:hover {
  background: #6f180f;
}

.btn--sm {
  min-height: 38px;
  padding: 0.4rem 0.95rem;
  font-size: var(--fs-xs);
}

.btn--block {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

/* ---------------------------------------------------------------- forms */

.field {
  display: grid;
  gap: var(--sp-2);
}

.field__label {
  color: var(--ink-800);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.field__optional {
  color: var(--ink-400);
  font-weight: var(--fw-regular);
}

.field__control {
  width: 100%;
  min-height: 50px;
  padding: 0.7rem 1rem;
  background: var(--white);
  color: var(--ink-900);
  border: 1px solid var(--line-300);
  border-radius: var(--r-sm);
  font-size: var(--fs-md);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

.field__control:hover {
  border-color: var(--ink-300);
}

.field__control:focus-visible {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px var(--brand-100);
}

textarea.field__control {
  min-height: 104px;
  resize: vertical;
}

select.field__control {
  appearance: none;
  padding-right: 2.75rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-500) 50%),
    linear-gradient(135deg, var(--ink-500) 50%, transparent 50%);
  background-position: calc(100% - 20px) 23px, calc(100% - 14px) 23px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.field__hint {
  color: var(--ink-500);
  font-size: var(--fs-xs);
}

.form-stack {
  display: grid;
  gap: var(--sp-4);
}

.form-grid {
  display: grid;
  gap: var(--sp-4);
}

.checkline {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--sand-050);
  border: 1px solid var(--line-200);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
}

.checkline input {
  width: 22px;
  height: 22px;
  flex: none;
  accent-color: var(--brand-700);
}

/* --------------------------------------------------------------- alerts */

.alert {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
}

.alert--error {
  background: var(--danger-100);
  border-color: var(--danger-line);
  color: var(--danger-800);
}

.alert--good {
  background: var(--success-100);
  border-color: #b6e0c8;
  color: var(--success-800);
}

.alert--warn {
  background: var(--warn-100);
  border-color: var(--warn-line);
  color: var(--warn-800);
}

.alert--info {
  background: var(--brand-050);
  border-color: var(--brand-200);
  color: var(--brand-800);
}

/* --------------------------------------------------------- empty states */

.empty {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-6) var(--sp-5);
  border: 1px dashed var(--line-300);
  border-radius: var(--r-md);
  color: var(--ink-500);
  font-size: var(--fs-sm);
  text-align: center;
}

.empty__title {
  color: var(--ink-800);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}

/* --------------------------------------------------------- the care feed */

.feed {
  display: grid;
  gap: var(--sp-5);
}

.feed__item {
  display: grid;
  gap: var(--sp-3);
  padding-left: var(--sp-4);
  border-left: 3px solid var(--line-200);
}

.feed__item--handover {
  border-left-color: var(--brand-500);
}

.feed__item--medication {
  border-left-color: var(--accent-500);
}

.feed__item--appointment {
  border-left-color: var(--brand-300);
}

.feed__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  color: var(--ink-400);
  font-size: var(--fs-xs);
}

.feed__body {
  color: var(--ink-700);
  font-size: var(--fs-md);
  line-height: 1.6;
}

/* The structured lines a handover produces — the same block the landing
   page uses to demonstrate what "End visit" writes. */
.feed__items {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-4);
  background: var(--brand-050);
  border: 1px solid var(--brand-200);
  border-radius: var(--r-md);
}

.feed__item-line {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  color: var(--ink-700);
  font-size: var(--fs-sm);
}

.feed__item-kind {
  flex: none;
  width: 6.75rem;
  padding-top: 0.15rem;
  color: var(--brand-600);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

/* --------------------------------------------------- the floating status */

.float-note {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0.8rem 1.1rem;
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
  font-size: var(--fs-xs);
}

.float-note__dot {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: var(--r-full);
  background: var(--success-100);
  color: var(--success-800);
  font-weight: var(--fw-bold);
}

.float-note strong {
  display: block;
  color: var(--ink-800);
}

.float-note span {
  color: var(--ink-400);
}

/* --------------------------------------------------------------- people */

.person {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line-100);
}

.person:last-child {
  border-bottom: 0;
}

.times {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* -------------------------------------------------------------- toolbar */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: var(--r-full);
  box-shadow: var(--sh-xs);
}

.segmented a {
  padding: 0.4rem 0.95rem;
  border-radius: var(--r-full);
  color: var(--ink-500);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  text-decoration: none;
}

.segmented a[aria-current="true"] {
  background: var(--brand-700);
  color: var(--white);
}

.searchbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.searchbar .field__control {
  flex: 1;
  min-width: 12rem;
}

.reveal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  background: var(--brand-050);
  border: 1px dashed var(--brand-300);
  border-radius: var(--r-md);
}

.reveal code {
  color: var(--brand-800);
  font-size: var(--fs-xs);
  overflow-wrap: anywhere;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  color: var(--ink-400);
  font-size: var(--fs-xs);
}

/* ------------------------------------------------------------ proposals */

.proposal {
  display: grid;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
}

.proposal__quote {
  padding-left: var(--sp-4);
  border-left: 2px solid var(--line-300);
  color: var(--ink-500);
  font-size: var(--fs-sm);
  font-style: italic;
}

/* ----------------------------------------------------------------- auth */

.auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: var(--sp-6) var(--gutter);
  background: radial-gradient(
      60% 70% at 78% 10%,
      rgba(26, 144, 130, 0.14) 0%,
      rgba(26, 144, 130, 0) 68%
    ),
    var(--sand-050);
}

.auth__card {
  display: grid;
  gap: var(--sp-4);
  width: min(100%, 27rem);
  padding: var(--sp-6);
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
}

.auth__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--brand-800);
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.auth__foot {
  color: var(--ink-400);
  font-size: var(--fs-xs);
}

/* --------------------------------------------------------------- tab bar */

.tabbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: var(--sp-2) var(--sp-2) calc(var(--sp-2) + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-200);
}

.tabbar a {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: var(--sp-2) 2px;
  border-radius: var(--r-md);
  color: var(--ink-500);
  font-size: 11px;
  font-weight: var(--fw-semibold);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}

.tabbar a[aria-current="page"] {
  color: var(--brand-700);
  background: var(--brand-050);
}

.tabbar svg {
  width: 22px;
  height: 22px;
}

/* ---------------------------------------------------------------- drawer */

.drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: var(--sp-5) var(--gutter) calc(var(--tabbar-h) + var(--sp-5));
  background: var(--brand-900);
  color: var(--brand-200);
  overflow-y: auto;
}

.drawer:target {
  display: block;
}

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}

.drawer__title {
  color: var(--white);
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}

.drawer__close {
  color: var(--brand-300);
  font-size: var(--fs-sm);
  text-decoration: none;
}

.drawer__group {
  margin-bottom: var(--sp-5);
}

.drawer__label {
  margin-bottom: var(--sp-2);
  color: var(--brand-300);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.drawer a.drawer__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 0.7rem 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--brand-200);
  font-size: var(--fs-md);
  text-decoration: none;
}

.drawer a.drawer__link:hover {
  color: var(--white);
}

/* ================================================================ desktop */

@media (min-width: 900px) {
  body {
    padding-bottom: 0;
    padding-left: 264px;
  }

  .tabbar {
    display: none;
  }

  .appbar {
    display: none;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: var(--sp-5);
    width: 264px;
    padding: var(--sp-5) var(--sp-4);
    background: var(--brand-900);
    color: var(--brand-200);
    overflow-y: auto;
  }

  .sidebar__brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    color: var(--white);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    letter-spacing: -0.02em;
    text-decoration: none;
  }

  .sidebar__brand .appbar__mark {
    background: rgba(255, 255, 255, 0.14);
  }

  .sidebar__who {
    display: grid;
    gap: 2px;
    color: var(--brand-300);
    font-size: var(--fs-xs);
  }

  .sidebar__who strong {
    color: var(--white);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
  }

  .sidebar__nav {
    display: grid;
    gap: 2px;
  }

  .sidebar__nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: 0.6rem 0.7rem;
    border-radius: var(--r-sm);
    color: var(--brand-200);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    text-decoration: none;
    transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  }

  .sidebar__nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
  }

  .sidebar__nav a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.16);
    color: var(--white);
  }

  .sidebar__label {
    margin: var(--sp-5) 0 var(--sp-2);
    color: var(--brand-300);
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
  }

  .sidebar__foot {
    display: grid;
    gap: var(--sp-3);
    margin-top: auto;
    padding-top: var(--sp-5);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .content {
    padding: var(--sp-6) var(--sp-6) var(--sp-8);
  }

  .page-hero {
    margin: calc(var(--sp-6) * -1) calc(var(--sp-6) * -1) 0;
    padding: var(--sp-7) var(--sp-6) var(--sp-5);
  }

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

@media (min-width: 1180px) {
  body {
    padding-left: 264px;
  }

  .content {
    padding-inline: var(--sp-7);
  }

  .page-hero {
    margin: calc(var(--sp-6) * -1) calc(var(--sp-7) * -1) 0;
    padding-inline: var(--sp-7);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   Graphics
   Hand-authored SVG only — no icon font, no sprite sheet, no third-party
   request — so the Content-Security-Policy stays at default-src 'self'.
   ========================================================================== */

.icon {
  flex: none;
}

.navlabel {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}

.nav-ico {
  flex: none;
  opacity: 0.7;
  transition: opacity var(--dur-fast) var(--ease);
}

.sidebar__nav a:hover .nav-ico,
.sidebar__nav a[aria-current="page"] .nav-ico,
.drawer__link:hover .nav-ico {
  opacity: 1;
}

.tabbar a {
  position: relative;
}

.tabbar__count {
  position: absolute;
  top: 0;
  right: 50%;
  transform: translateX(16px);
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--brand-100);
  color: var(--brand-800);
  font-size: 10px;
  font-weight: var(--fw-bold);
}

/* Every empty state carries the care-circle motif, so a sparse page still
   looks designed rather than broken. This one rule reaches all of them. */
.empty {
  position: relative;
}

.empty::before {
  content: "";
  display: block;
  width: 104px;
  height: 68px;
  margin: 0 auto var(--sp-3);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 104 68'%3E%3Ccircle cx='52' cy='34' r='21' fill='none' stroke='%23b3ddd4' stroke-width='2'/%3E%3Ccircle cx='52' cy='34' r='8' fill='%23dff0eb'/%3E%3Ccircle cx='52' cy='13' r='5' fill='%237cc4b8'/%3E%3Ccircle cx='34' cy='45' r='5' fill='%237cc4b8'/%3E%3Ccircle cx='70' cy='45' r='5' fill='%237cc4b8'/%3E%3C/svg%3E");
}

/* Who is in this circle, shown as pills under the Today header. */
.member-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-4);
}

.member-strip__item {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: var(--r-full);
  box-shadow: var(--sh-xs);
  color: var(--ink-600);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}

/* The care ring: the person being cared for in the middle, everyone else
   around them. Positions are CSS-only, so the markup stays a plain list. */
.care-ring {
  position: relative;
  width: 232px;
  height: 232px;
  margin: var(--sp-5) auto;
}

.care-ring::before {
  content: "";
  position: absolute;
  inset: 26px;
  border: 1.5px dashed var(--brand-200);
  border-radius: var(--r-full);
}

.care-ring__centre {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: var(--r-full);
  background: var(--brand-700);
  color: var(--brand-100);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  box-shadow: var(--sh-md);
}

.care-ring__item {
  position: absolute;
  inset: 50% auto auto 50%;
  margin: -20px 0 0 -20px;
  box-shadow: 0 0 0 3px var(--white), var(--sh-sm);
}

.care-ring__item:nth-child(2) { transform: translate(0, -92px); }
.care-ring__item:nth-child(3) { transform: translate(80px, -46px); }
.care-ring__item:nth-child(4) { transform: translate(80px, 46px); }
.care-ring__item:nth-child(5) { transform: translate(0, 92px); }
.care-ring__item:nth-child(6) { transform: translate(-80px, 46px); }
.care-ring__item:nth-child(7) { transform: translate(-80px, -46px); }
.care-ring__item:nth-child(8) { transform: translate(0, -92px); }
.care-ring__item:nth-child(9) { transform: translate(80px, -46px); }

.care-ring__count {
  position: absolute;
  inset: auto auto 0 50%;
  transform: translateX(-50%);
  padding: 0.2rem 0.7rem;
  background: var(--white);
  border: 1px solid var(--line-200);
  border-radius: var(--r-full);
  box-shadow: var(--sh-xs);
  color: var(--ink-500);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.stat__ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: var(--sp-2);
  border-radius: var(--r-sm);
  background: var(--brand-050);
  color: var(--brand-600);
}

/* A little brand art on the sign-in card. */
.auth__art {
  height: 72px;
  margin-bottom: calc(var(--sp-1) * -1);
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 68'%3E%3Ccircle cx='46' cy='34' r='19' fill='none' stroke='%23b3ddd4' stroke-width='2'/%3E%3Ccircle cx='46' cy='34' r='7' fill='%23dff0eb'/%3E%3Ccircle cx='46' cy='15' r='4.5' fill='%237cc4b8'/%3E%3Ccircle cx='29' cy='44' r='4.5' fill='%237cc4b8'/%3E%3Ccircle cx='63' cy='44' r='4.5' fill='%237cc4b8'/%3E%3Cpath d='M92 34h20' stroke='%23b3ddd4' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M104 50h96' stroke='%23dff0eb' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M118 34h82' stroke='%23dff0eb' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M104 18h58' stroke='%23dff0eb' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
