/* Infinite Care platform: sign-in, Home, People, My profile. The desks' palette and type (system fonts only). */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f0f2f4;
  --line: #e0e4e8;
  --line-strong: #c9d0d7;
  --text: #16202a;
  --muted: #56636f;
  --faint: #646f79;
  --brand: #0c6f79;
  --brand-strong: #09565e;
  --brand-soft: #e2f1f2;
  --on-brand: #ffffff;
  --accent: #6aa84f;         /* the logo's green, for the tagline rule only */
  --ok: #1b7a44;       --ok-soft: #e3f3e9;
  --warn: #8f5400;     --warn-soft: #fbefd9;
  --bad: #b02a22;      --bad-soft: #fbe6e4;
  --neutral-soft: #eceff2;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 6px rgba(16, 24, 40, .05);
  --shadow-hover: 0 6px 18px rgba(16, 24, 40, .10), 0 1px 3px rgba(16, 24, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1417; --surface: #161d21; --surface-2: #1c252a; --line: #273238; --line-strong: #35434b;
    --text: #e5ebee; --muted: #9dabb4; --faint: #84939d;
    --brand: #3fb4be; --brand-strong: #6cc9d1; --brand-soft: #143238; --on-brand: #06262a; --accent: #8cc873;
    --ok: #5fc98b; --ok-soft: #133224; --warn: #f0b660; --warn-soft: #36280f; --bad: #f08a80; --bad-soft: #3a1a17;
    --neutral-soft: #222c31; --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-hover: 0 6px 18px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1417; --surface: #161d21; --surface-2: #1c252a; --line: #273238; --line-strong: #35434b;
  --text: #e5ebee; --muted: #9dabb4; --faint: #84939d;
  --brand: #3fb4be; --brand-strong: #6cc9d1; --brand-soft: #143238; --on-brand: #06262a; --accent: #8cc873;
  --ok: #5fc98b; --ok-soft: #133224; --warn: #f0b660; --warn-soft: #36280f; --bad: #f08a80; --bad-soft: #3a1a17;
  --neutral-soft: #222c31; --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-hover: 0 6px 18px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
a { color: var(--brand); }
a:hover { color: var(--brand-strong); }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: 1.6rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 60; background: var(--surface); padding: 8px 12px; }
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; outline: none; }
.loading, .empty { color: var(--muted); padding: 40px 0; text-align: center; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .88rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* ------------------------------------------------------------ buttons + fields */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 600 .95rem/1.2 var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-brand); }
.btn.big { min-height: 48px; width: 100%; font-size: 1.02rem; }
.btn.small { min-height: 32px; padding: 4px 10px; font-size: .85rem; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: .55; cursor: default; }
.linkish { all: unset; color: var(--brand); cursor: pointer; text-decoration: underline; }
.field { display: grid; gap: 6px; }
.field .label { font-weight: 600; font-size: .92rem; }
.field .label small { color: var(--muted); font-weight: 500; }
input[type=text], input[type=tel], input[type=email], input[type=password] { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: 1rem/1.3 var(--font); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 8px; }
.err { color: var(--bad); font-weight: 600; min-height: 1.4em; }
.pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 650; background: var(--neutral-soft); color: var(--muted); }
.pill.brand { background: var(--brand-soft); color: var(--brand-strong); }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ sign-in */
.auth { max-width: 460px; margin: 5vh auto 0; text-align: center; }
.auth-logo { display: block; width: 220px; max-width: 70%; height: auto; margin: 0 auto 14px; background: #fff; border-radius: 12px; padding: 8px 12px; }
.auth h1 { font-size: 1.35rem; }
.auth .tag { color: var(--muted); margin: 2px 0 18px; }
.people { display: grid; gap: 8px; margin-top: 14px; text-align: left; }
.person { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); cursor: pointer; font-weight: 600; background: var(--surface); }
.person:hover, .person:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); display: inline-grid; place-items: center;
  font-weight: 700; font-size: .8rem; flex: none; }
.pin { width: 100%; text-align: center; letter-spacing: .5em; font-size: 1.6rem; min-height: 56px; margin: 8px 0; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); }
.setup-hint { text-align: left; background: var(--warn-soft); color: var(--warn); border-radius: var(--radius-sm); padding: 12px 14px; font-weight: 600; margin-top: 12px; }
.setup-hint code { display: block; margin-top: 6px; font: .9rem/1.4 ui-monospace, "SF Mono", Menlo, monospace; color: var(--text); overflow-wrap: anywhere; }

/* ------------------------------------------------------------ Home */
.hero { text-align: center; padding: 28px 0 8px; }
.hero-logo { display: block; width: 300px; max-width: 72vw; height: auto; margin: 0 auto 20px; background: #fff; border-radius: 16px; padding: 10px 16px;
  box-shadow: var(--shadow); }
.tagline { font-size: clamp(1.45rem, 3.4vw, 2.2rem); font-weight: 750; letter-spacing: -.015em; color: var(--text); }
.tagline::after { content: ""; display: block; width: 72px; height: 3px; border-radius: 3px; margin: 14px auto 0;
  background: linear-gradient(90deg, var(--brand), var(--accent)); }
.powered { margin-top: 10px; color: var(--muted); font-size: 1rem; font-weight: 600; letter-spacing: .02em; }
.greet { display: flex; align-items: baseline; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; margin: 36px 0 14px; }
.greet h2 { font-size: 1.3rem; }
.greet .date { color: var(--muted); font-weight: 550; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 196px; padding: 20px 22px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); text-decoration: none;
  transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease; }
a.tile:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); box-shadow: var(--shadow-hover); transform: translateY(-1px); color: var(--text); }
.tile-top { display: flex; align-items: flex-start; gap: 14px; }
.tile-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-strong); flex: none; }
.tile-icon svg { width: 26px; height: 26px; }
.tile h3 { font-size: 1.12rem; }
.tile .blurb { color: var(--muted); font-size: .93rem; margin-top: 2px; }
.tile-num { display: flex; align-items: baseline; gap: 10px; margin-top: auto; }
.tile-num .n { font-size: 2.5rem; font-weight: 750; line-height: 1; letter-spacing: -.02em; color: var(--brand-strong); font-variant-numeric: tabular-nums; }
.tile-num .lbl { font-weight: 600; color: var(--text); }
.tile-num.linked { cursor: pointer; }
.tile-num.linked:hover .n, .tile-num.linked:hover .lbl { text-decoration: underline; text-underline-offset: 4px; }
.tile-sub { color: var(--muted); font-size: .9rem; min-height: 1.35em; }
.tile-sub.down { color: var(--warn); font-weight: 600; }
.tile .go { position: absolute; top: 20px; right: 20px; color: var(--faint); font-size: 1.2rem; }
.tile.soon { background: var(--surface-2); box-shadow: none; border-style: dashed; color: var(--muted); }
.tile.soon .tile-icon { background: var(--neutral-soft); color: var(--muted); }
.tile.soon h3 { color: var(--muted); }
.tile.soon .soon-row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.nothing { text-align: center; }
.foot { margin-top: 40px; text-align: center; color: var(--faint); font-size: .85rem; }
@media (max-width: 640px) {
  .hero { padding-top: 12px; }
  .hero-logo { width: 220px; }
  .tiles { grid-template-columns: 1fr; }
  .tile { min-height: 0; }
  .greet { margin-top: 26px; }
}

/* ------------------------------------------------------------ People, My profile */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.back { display: inline-block; margin-bottom: 10px; text-decoration: none; font-weight: 600; }
.plist { display: grid; gap: 10px; }
.prow { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto; gap: 10px 16px; align-items: center; padding: 14px 18px; }
.prow .who b { display: block; }
.prow .who .small { overflow-wrap: anywhere; }
.switches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 99px;
  border: 1px solid var(--line-strong); cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--muted); background: var(--surface); }
.sw::before { content: ""; width: 26px; height: 16px; border-radius: 99px; background: var(--line-strong); box-shadow: inset 0 0 0 2px var(--line-strong);
  transition: background .12s; }
.sw[aria-pressed="true"] { color: var(--brand-strong); border-color: var(--brand); background: var(--brand-soft); }
.sw[aria-pressed="true"]::before { background: var(--brand); box-shadow: inset -10px 0 0 2px var(--brand), inset 0 0 0 2px var(--brand); }
.sw:disabled, .sw[aria-disabled="true"] { cursor: default; opacity: .6; }
.sw.admin[aria-pressed="true"] { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.sw.admin[aria-pressed="true"]::before { background: var(--warn); box-shadow: inset -10px 0 0 2px var(--warn), inset 0 0 0 2px var(--warn); }
.acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.prow.inactive { opacity: .7; }
.soonlist { display: grid; gap: 8px; }
.soonlist .row { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.plain { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.plain th, table.plain td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl-wrap { overflow-x: auto; }
@media (max-width: 760px) {
  .prow { grid-template-columns: 1fr; }
  .acts { justify-content: flex-start; }
}

/* ------------------------------------------------------------ plain pages (office only, not answering) */
.plain-page { display: grid; place-items: center; min-height: 80vh; }
.notice { max-width: 520px; text-align: center; }
.notice .notice-logo { width: 180px; height: auto; background: #fff; border-radius: 10px; padding: 6px 10px; margin: 0 auto 14px; display: block; }
.notice h1 { font-size: 1.3rem; margin-bottom: 8px; }
.notice p + p { margin-top: 16px; }

/* ------------------------------------------------------------ toasts */
#toasts { position: fixed; bottom: 16px; left: 16px; right: 16px; display: grid; justify-items: center; gap: 8px; z-index: 70; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; box-shadow: var(--shadow-hover); max-width: 520px; }
.toast.error { background: var(--bad); color: #fff; }
