/* ==========================================================================
   Track Anything — web app
   Loaded after tokens.css and base.css, which are `docs/brand/system/*.css`
   vendored verbatim. Everything below is LAYOUT for surfaces the phone does
   not have (a marketing page, a sidebar, data tables) plus the handful of
   scale values a 1440-pt canvas needs and a 390-pt one does not.

   Rules kept from the brand brief:
     · no colour, radius or shadow that is not a token;
     · pastels are fills, never text;
     · one hero dot per surface;
     · calm, editorial, precise — the surreal comes from scale, layering and
       slow drift, never from confetti.
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Web-scale additions to the type and space scales
   base.css is tuned to a 390-pt phone; a desktop hero needs sizes above
   --fs-display-l and gutters above --sp-8. These are the only new scale
   values in the web app.
   -------------------------------------------------------------------------- */
:root {
  --fs-hero: clamp(42px, 6.6vw, 88px);
  --fs-display-xl: clamp(30px, 3.6vw, 46px);
  --fs-lede: clamp(16.5px, 1.35vw, 20px);
  --sp-9: 56px;
  --sp-10: 80px;
  --sp-11: 120px;
  --measure: 62ch;
  --shell-side-w: 264px;
  --site-max: 1180px;
}

/* --------------------------------------------------------------------------
   1. Document
   -------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  min-height: 100vh;
}
a {
  color: inherit;
  text-decoration: none;
}
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-ink);
  outline-offset: 3px;
  border-radius: 6px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* the brand lockup, wherever it appears */
.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-primary);
}
.brand-name {
  font-family: var(--font-display);
  font-variation-settings: var(--display-axes);
  font-weight: 560;
  font-size: 19px;
  letter-spacing: -0.012em;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   2. Public chrome: top nav + footer
   -------------------------------------------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-canvas) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-base) var(--ease-soft);
}
.site-nav-inner {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}
.site-links {
  display: none;
  gap: var(--sp-5);
  margin-left: var(--sp-4);
  font-size: var(--fs-body-m);
  font-weight: 600;
  color: var(--ink-secondary);
}
.site-links a:hover {
  color: var(--ink-primary);
}
.site-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
@media (min-width: 900px) {
  .site-links {
    display: flex;
  }
}

.site-main {
  display: block;
}

.site-foot {
  margin-top: var(--sp-11);
  border-top: 1px solid var(--glass-hairline);
  background: color-mix(in srgb, var(--bg-canvas) 60%, transparent);
}
.site-foot-inner {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: var(--sp-8) 24px var(--sp-9);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-6);
  align-items: flex-start;
  justify-content: space-between;
}
.site-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  font-size: var(--fs-body-m);
  font-weight: 600;
  color: var(--ink-secondary);
}
.site-foot-links a:hover {
  color: var(--accent-ink);
}

/* theme switch — three states, one pill */
.theme-switch {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--r-pill);
  background: var(--bg-field);
  border: 1px solid var(--glass-hairline);
}
.theme-switch button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 28px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-secondary);
  transition: background-color var(--dur-fast) var(--ease-soft),
    color var(--dur-fast) var(--ease-soft);
}
.theme-switch button:hover {
  color: var(--ink-primary);
}
.theme-switch button.is-on {
  background: var(--ink-primary);
  color: var(--ink-inverse);
}

/* --------------------------------------------------------------------------
   3. Landing page
   The surreal layer: an oversized ghost mark, a dot field, slow-drifting
   glass panels. All of it decoration — `aria-hidden`, pointer-events none,
   and stilled entirely under prefers-reduced-motion.
   -------------------------------------------------------------------------- */
.landing {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
}
.wrap-page {
  max-width: var(--site-max);
  margin: 0 auto;
  padding: 0 24px;
}

.dot-field {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: radial-gradient(
    circle at center,
    color-mix(in srgb, var(--accent-fill) 42%, transparent) 1.4px,
    transparent 1.5px
  );
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 30%, #000 0%, transparent 78%);
  mask-image: radial-gradient(70% 60% at 50% 30%, #000 0%, transparent 78%);
  opacity: 0.5;
}

.ghost-mark {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  color: var(--ink-primary);
  opacity: 0.045;
}
.ghost-mark-hero {
  top: -6vw;
  right: -14vw;
  width: min(62vw, 780px);
  transform: rotate(-8deg);
}
.ghost-mark-close {
  left: -12vw;
  bottom: -16vw;
  width: min(48vw, 560px);
  transform: rotate(12deg);
}

/* hero ------------------------------------------------------------------ */
.hero-section {
  position: relative;
  padding: clamp(48px, 8vw, 104px) 0 clamp(56px, 9vw, 120px);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}
@media (min-width: 1020px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  }
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  /* px, not ch: `ch` here resolves against the CONTAINER's 15.5px body size,
     which would give the 88px headline a 270px column to live in. */
  max-width: 560px;
}
.hero-title {
  font-family: var(--font-display);
  font-variation-settings: var(--display-axes);
  font-weight: 480;
  font-size: var(--fs-hero);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--ink-primary);
  text-wrap: balance;
  margin: 0;
}
/* the one hero dot: the period of the headline */
.hero-title .dot-inline {
  display: inline-block;
  width: 0.16em;
  height: 0.16em;
  border-radius: 50%;
  background: var(--accent-dot);
  margin-left: 0.06em;
  vertical-align: baseline;
}
.hero-lede {
  font-size: var(--fs-lede);
  line-height: 1.5;
  color: var(--ink-secondary);
  max-width: 44ch;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-2);
}
.hero-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-body-s);
  color: var(--ink-secondary);
  font-weight: 600;
}

/* the floating composition ---------------------------------------------- */
.hero-stage {
  position: relative;
  min-height: clamp(500px, 52vw, 640px);
  display: grid;
  place-items: center;
}
.hero-stage::before {
  /* a halo, the logo's own device, scaled up */
  content: "";
  position: absolute;
  width: min(80%, 460px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--glow-1) 70%, transparent) 0%,
    transparent 68%
  );
  filter: blur(26px);
  z-index: -1;
}

.float-card {
  position: absolute;
  box-shadow: var(--shadow-3), inset 0 1px 0 var(--glass-highlight);
  animation: drift 13s var(--ease-soft) infinite alternate;
  will-change: transform;
}
.float-card.c-1 {
  width: min(320px, 76%);
  top: 0;
  left: 0;
  z-index: 1;
  transform: rotate(-3.2deg);
  animation-delay: -1s;
}
.float-card.c-2 {
  width: min(300px, 72%);
  right: 0;
  top: 38%;
  z-index: 3;
  transform: rotate(2.6deg);
  animation-delay: -5s;
  animation-duration: 16s;
}
.float-card.c-3 {
  width: min(304px, 74%);
  left: 2%;
  bottom: 0;
  z-index: 2;
  transform: rotate(1.6deg);
  animation-delay: -9s;
  animation-duration: 18s;
}
@keyframes drift {
  from {
    translate: 0 -8px;
  }
  to {
    translate: 0 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .float-card {
    animation: none;
  }
}
@media (max-width: 1019px) {
  .hero-stage {
    min-height: 520px;
  }
}
@media (max-width: 560px) {
  .hero-stage {
    min-height: 470px;
  }
  .float-card.c-1 {
    width: 90%;
  }
  .float-card.c-2 {
    width: 78%;
    top: 34%;
  }
  .float-card.c-3 {
    width: 72%;
  }
}

/* the arc of dots that ties the sections together */
.dot-arc {
  display: block;
  width: 100%;
  height: 110px;
  color: var(--accent-ink);
  opacity: 0.7;
  overflow: visible;
}
.dot-arc path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 1 16;
}
.dot-arc circle {
  fill: var(--accent-dot);
}

/* sections --------------------------------------------------------------- */
.section {
  position: relative;
  padding: clamp(56px, 8vw, 104px) 0;
}
.section-intro {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-width: 640px;
  margin-bottom: var(--sp-8);
}
.section-title {
  font-family: var(--font-display);
  font-variation-settings: var(--display-axes);
  font-weight: 500;
  font-size: var(--fs-display-xl);
  line-height: 1.06;
  letter-spacing: -0.022em;
  text-wrap: balance;
  margin: 0;
}
.section-lede {
  font-size: var(--fs-lede);
  color: var(--ink-secondary);
  line-height: 1.5;
}
.section-center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  align-items: center;
}

.grid-3 {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.grid-4 {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.idea-card {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-height: 210px;
}
.idea-card .avatar {
  margin-bottom: var(--sp-2);
}
.idea-card .title-l {
  font-size: 21px;
}

/* the eight shapes a day can take */
.shape-tile {
  position: relative;
  overflow: hidden;
  padding: var(--sp-5);
  min-height: 152px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--sp-4);
  border-radius: var(--r-glass);
}
.shape-tile .mark {
  position: absolute;
  right: -20px;
  bottom: -26px;
  color: var(--kind-solid);
  opacity: 0.12;
}
.shape-tile .mark .icon {
  width: 108px;
  height: 108px;
  stroke-width: 1.1;
}
.shape-tile .name {
  font-size: var(--fs-title-l);
  font-weight: var(--fw-title);
}
.shape-tile .what {
  font-size: var(--fs-body-s);
  color: var(--ink-secondary);
  max-width: 22ch;
}

/* rhythm: a real week strip and a real dot calendar, at rest */
.rhythm-grid {
  display: grid;
  gap: var(--sp-5);
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 900px) {
  .rhythm-grid {
    grid-template-columns: 1.1fr 0.9fr;
  }
}
.demo-panel {
  padding: var(--sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.demo-panel .week-strip {
  background: var(--bg-field);
}

/* closing call to action */
.close-cta {
  position: relative;
  text-align: center;
  padding: clamp(64px, 9vw, 120px) var(--sp-5);
  border-radius: var(--r-sheet);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
}
.close-cta .big-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-dot);
  box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent-fill) 26%, transparent);
  margin-bottom: var(--sp-4);
}
.close-cta .section-title {
  max-width: 20ch;
}

/* reveal on scroll */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 620ms var(--ease-soft), transform 620ms var(--ease-soft);
}
[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   4. Auth pages
   -------------------------------------------------------------------------- */
.auth-wrap {
  min-height: calc(100vh - 180px);
  display: grid;
  place-items: center;
  padding: clamp(32px, 6vw, 72px) 24px;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: clamp(26px, 4vw, 38px);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}
.auth-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.auth-head .section-title {
  font-size: clamp(26px, 3vw, 34px);
}
.auth-head .body-m {
  color: var(--ink-secondary);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.auth-alt {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  font-size: var(--fs-body-m);
  color: var(--ink-secondary);
  font-weight: 600;
}
.auth-alt a {
  color: var(--accent-ink);
}
.checkline {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.code-input input {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.34em;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* flash banner */
.flash-group {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, calc(100vw - 40px));
}
.flash {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: var(--shadow-3);
}
.flash.is-error {
  border-color: color-mix(in srgb, var(--state-danger-ink) 45%, transparent);
  color: var(--state-danger-ink);
}
.flash-in {
  transition: opacity var(--dur-base) var(--ease-soft), transform var(--dur-base) var(--ease-soft);
}
.flash-from {
  opacity: 0;
  transform: translateY(8px);
}
.flash-to {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   5. Signed-in shell
   -------------------------------------------------------------------------- */
.shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}
.shell-drawer-toggle {
  display: none;
}
.shell-side {
  width: var(--shell-side-w);
  flex: none;
  border-right: 1px solid var(--glass-hairline);
  padding: var(--sp-5) var(--sp-4);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.shell-scrim {
  display: none;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
  height: 100%;
}
.side-brand {
  padding: 4px 10px var(--sp-2);
}
.side-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-secondary);
  padding: 0 10px var(--sp-2);
}
.side-group-admin {
  padding-top: var(--sp-4);
  border-top: 1px solid var(--glass-hairline);
}
.side-foot {
  margin-top: auto;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--glass-hairline);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.side-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-field);
  color: var(--ink-secondary);
  font-size: var(--fs-title-m);
  font-weight: 600;
  transition: background-color var(--dur-fast) var(--ease-soft),
    color var(--dur-fast) var(--ease-soft);
}
.side-item .icon {
  color: var(--ink-faint);
}
.side-item:hover {
  background: var(--bg-field);
  color: var(--ink-primary);
}
.side-item:hover .icon {
  color: var(--ink-secondary);
}
.side-item.is-active {
  background: var(--ink-primary);
  color: var(--ink-inverse);
}
.side-item.is-active .icon {
  color: var(--accent-fill);
}
.side-item > .pill {
  margin-left: auto;
  min-width: 24px;
  justify-content: center;
}
.side-mark {
  margin-left: 0;
  background: var(--accent-fill);
}

.shell-main {
  flex: 1;
  /* Without this a flex child refuses to shrink below its content, and one
     wide row in the top bar makes the WHOLE page scroll sideways on a phone. */
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.shell-top {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 12px 24px;
  border-bottom: 1px solid var(--glass-hairline);
}
.shell-top > .grow {
  min-width: 0;
}
.shell-top .eyebrow {
  display: block;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell-top .title-l {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell-burger {
  display: none;
  --btn-h: 40px;
  width: 40px;
  padding: 0;
}
.shell-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-hairline);
  background: var(--bg-field);
  max-width: 260px;
  min-width: 0;
  flex: 0 1 auto;
}
.shell-user:hover {
  background: var(--bg-glass-prominent);
}
.shell-user-text {
  display: none;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.shell-user-text .body-s {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shell-initial {
  font-size: 14px;
  font-weight: 750;
}
@media (min-width: 720px) {
  .shell-user-text {
    display: flex;
  }
}
.shell-content {
  flex: 1;
  padding: var(--sp-6) 24px var(--sp-10);
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

@media (max-width: 640px) {
  .shell-top {
    padding: 10px 14px;
    gap: var(--sp-3);
  }
  .shell-content {
    padding: var(--sp-5) 16px var(--sp-9);
    gap: var(--sp-5);
  }
  .wrap-page {
    padding: 0 18px;
  }
  .site-nav-inner {
    padding: 12px 18px;
    gap: var(--sp-3);
  }
  /* The theme switch is a convenience; on a 390-pt screen the account chip and
     the page title matter more than three colour buttons. */
  .shell-top .theme-switch {
    display: none;
  }
}

@media (max-width: 959px) {
  .shell-side {
    position: fixed;
    z-index: 60;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform var(--dur-base) var(--ease-soft);
    background: var(--bg-surface);
  }
  .shell-drawer-toggle:checked ~ .shell-side {
    transform: none;
    box-shadow: var(--shadow-3);
  }
  .shell-drawer-toggle:checked ~ .shell-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgb(47 36 48 / 0.32);
  }
  .shell-burger {
    display: grid;
    place-items: center;
  }
}

/* --------------------------------------------------------------------------
   6. Shared page furniture inside the shell
   -------------------------------------------------------------------------- */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.page-head .display-m {
  font-size: clamp(24px, 2.4vw, 30px);
}
.panel {
  padding: var(--sp-5);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  align-items: stretch;
}
/* A lone button inside a column panel would otherwise stretch the full width
   and read as a banner rather than as an action. */
.panel > .btn {
  align-self: flex-start;
}
.list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.grid-cards {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sp-4) var(--sp-5);
}
.stat-card .numeric-l {
  font-size: 30px;
}
.stat-grid {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: flex-end;
}
.toolbar .field {
  min-width: 180px;
}
.toolbar .field.grow {
  flex: 1;
}
.split {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
  /* Panels size to their own content: a short "Roles" card stretched to match
     a long list next to it is mostly empty glass. */
  align-items: start;
}
@media (min-width: 900px) {
  .split {
    grid-template-columns: 1.4fr 1fr;
  }
  .split-even {
    grid-template-columns: 1fr 1fr;
  }
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: flex-end;
}
.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.btn-icon {
  --btn-h: 36px;
  width: 36px;
  padding: 0;
}

/* Friends — permission choices stay visually attached to the person they
   affect, while shared content reads like a view-only inset rather than one
   of the owner's editable lists. */
.friend-search .toolbar {
  align-items: end;
}
.friend-person,
.friend-card-head,
.friend-identity,
.shared-item-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;
}
.friend-person,
.friend-card-head {
  justify-content: space-between;
  flex-wrap: wrap;
}
.friend-identity {
  flex: 1;
}
.friend-identity .body,
.shared-item-row .body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.friend-identity .title,
.friend-identity .body-s,
.shared-item-row .title {
  overflow: hidden;
  text-overflow: ellipsis;
}
.friend-identity .title,
.shared-item-row .title {
  font-size: var(--fs-title-m);
  font-weight: var(--fw-title);
  line-height: 1.3;
}
.sharing-panel,
.shared-content {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.sharing-options {
  display: grid;
  gap: var(--sp-2) var(--sp-4);
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.sharing-options .checkline {
  padding: 8px 10px;
  border: 1px solid var(--glass-hairline);
  border-radius: var(--r-field);
  background: var(--bg-field);
}
.sharing-save {
  align-items: center;
}
.shared-content {
  border-color: color-mix(in srgb, var(--accent-ink) 24%, var(--glass-hairline));
}
.shared-item-row {
  padding: 12px 14px;
  border: 1px solid var(--glass-hairline);
  border-radius: var(--r-field);
  background: var(--bg-field);
  align-items: flex-start;
}
.shared-item-row .meta {
  margin-top: 4px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ink-secondary);
  font-size: var(--fs-body-s);
  font-weight: 600;
}
.template-share {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.template-share > .btn {
  align-self: flex-start;
}
.notification-row.is-unread {
  border-color: color-mix(in srgb, var(--accent-ink) 38%, var(--glass-hairline));
  background: color-mix(in srgb, var(--kind-tracker-fill) 44%, var(--bg-glass));
}

@media (max-width: 639px) {
  .friend-card-head > .actions-row,
  .friend-card-head > .actions-row .btn {
    width: 100%;
  }
  .friend-card-head > .actions-row .btn {
    justify-content: center;
  }
  .shared-item-row > .pill {
    display: none;
  }
}

/* Kanban board — the actions wrap onto their own line inside a column, or a
   three-button row leaves the card title a 90px gutter to wrap in. */
.board .task-chip {
  flex-wrap: wrap;
}
.board .task-chip .body {
  flex: 1 1 100%;
}
.board .task-chip .actions-row {
  width: 100%;
  justify-content: flex-end;
  gap: 2px;
}
.board .task-chip .btn-icon {
  --btn-h: 28px;
  width: 28px;
}
.board {
  display: grid;
  gap: var(--sp-3);
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
}
.board .board-col {
  background: var(--bg-glass);
  min-height: 180px;
}

/* --------------------------------------------------------------------------
   7. Admin panel
   -------------------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-card);
  border: 1px solid var(--glass-hairline);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-body-m);
  background: var(--bg-field);
}
table.data th {
  text-align: left;
  font-size: var(--fs-label-caps);
  font-weight: var(--fw-label-caps);
  letter-spacing: var(--ls-label-caps);
  text-transform: uppercase;
  color: var(--ink-secondary);
  padding: 12px 14px;
  white-space: nowrap;
  border-bottom: 1px solid var(--glass-hairline);
}
table.data td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--glass-hairline);
  vertical-align: middle;
}
table.data tr:last-child td {
  border-bottom: 0;
}
table.data tbody tr:hover {
  background: color-mix(in srgb, var(--accent-fill) 8%, transparent);
}
table.data .mono {
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
}
table.data .right {
  text-align: right;
}
.cell-email {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  min-width: 0;
}
.cell-email span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding-top: var(--sp-2);
}
.pager .body-s {
  color: var(--ink-secondary);
}

.kv {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: 10px var(--sp-4);
  font-size: var(--fs-body-m);
}
.kv dt {
  color: var(--ink-secondary);
  font-weight: 600;
}
.kv dd {
  margin: 0;
  font-weight: 600;
}

.role-pick {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.role-option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-field);
  border: 1.5px solid var(--glass-hairline);
  background: var(--bg-field);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.role-option:hover {
  border-color: color-mix(in srgb, var(--accent-ink) 45%, transparent);
}
.role-option.is-current {
  border-color: var(--accent-ink);
  background: var(--kind-tracker-fill);
}
.role-option > span {
  min-width: 0;
}
/* Both are spans so the button stays one flat element for the screen reader;
   they have to be told to stack, or the description runs on from the name. */
.role-option .role-name {
  display: block;
  font-size: var(--fs-title-m);
  font-weight: var(--fw-title);
}
.role-option .role-what {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-body-s);
  color: var(--ink-secondary);
}
.role-option[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.danger-zone {
  border: 1.5px solid color-mix(in srgb, var(--state-danger-ink) 40%, transparent);
  background: color-mix(in srgb, var(--state-danger-fill) 55%, transparent);
}

/* growth chart: bars, because 14 points of small integers read better as
   discrete days than as a curve pretending to be continuous */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 108px;
}
.bars .bar {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  height: 100%;
}
.bars .bar i {
  display: block;
  /* Capped and squared off: a --r-pill radius on a 74px-wide, 90px-tall
     element is an ellipse, not a bar. */
  width: min(100%, 26px);
  border-radius: 7px 7px 3px 3px;
  background: var(--accent-fill);
  min-height: 3px;
}
.bars .bar.is-empty i {
  background: color-mix(in srgb, var(--ink-faint) 22%, transparent);
}
.bars .bar b {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-secondary);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   8. Utilities used across the app
   -------------------------------------------------------------------------- */
.mt-0 {
  margin-top: 0;
}
.gap-2 {
  gap: var(--sp-2);
}
.gap-4 {
  gap: var(--sp-4);
}
.between {
  justify-content: space-between;
}
.center {
  justify-content: center;
}
.right {
  text-align: right;
}
.nowrap {
  white-space: nowrap;
}
.muted {
  color: var(--ink-secondary);
}

/* form-level error banner (base.css's .banner has no error tone of its own:
   in the phone app the error state belongs to the field, but a form post has
   nowhere to put a server-side message except above the form) */
.banner.is-error {
  background: var(--state-danger-fill);
  border: 1px solid color-mix(in srgb, var(--state-danger-ink) 40%, transparent);
  color: var(--state-danger-ink);
}
.banner.is-error .icon {
  color: var(--state-danger-ink);
}
