/* The interactive demo on the landing page: an iPhone frame and, inside it,
   the app drawn with the app's own tokens (src/theme). site.css loads first.
   The canvas is authored at 390px wide, the app's point size, and scaled to
   the frame by demo.js, so every value below is the app's point value. */

/* ---- the column around the phone ---- */
.demo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}
@media (min-width: 760px) {
  .demo {
    max-width: 320px;
  }
}
.demo-invite {
  margin: 0;
  font-weight: 600;
  text-align: center;
}
.demo-note {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  text-align: center;
  max-width: 34ch;
}
.demo-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: 44px;
}
.demo-reset {
  background: none;
  border: 0;
  padding: 0 var(--space-1);
  min-height: 44px;
  font: inherit;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.demo-reset:hover {
  color: var(--text);
}
/* Hidden until the script has mounted the demo; without it the frame shows
   the static preview and there is nothing to reset. */
.demo-reset,
.demo-invite {
  display: none;
}
.demo:has(.d-live) .demo-reset,
.demo:has(.d-live) .demo-invite {
  display: block;
}

.demo-slot {
  width: 100%;
}
.demo-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.demo-expand {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.demo-expand:hover {
  background: var(--surface);
}
.demo:has(.d-live) .demo-expand {
  display: inline-flex;
}
.demo-expand svg {
  color: var(--accent);
}
/* Expanded: the stage is lifted out of the page; the slot keeps its height.
   pointer-events: none on the stage lets clicks beside the phone reach the
   backdrop. */
.demo-stage[data-demo-stage="desktop"],
.demo-stage[data-demo-stage="mobile"] {
  position: fixed;
  inset: 0;
  z-index: 80;
  justify-content: center;
  pointer-events: none;
}
.demo-stage[data-demo-stage="desktop"] > *,
.demo-stage[data-demo-stage="mobile"] > * {
  pointer-events: auto;
}
html.demo-expanded {
  overflow: hidden;
}
.demo-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 79;
  background: rgba(25, 31, 26, 0.6);
  opacity: 0;
  transition: opacity 0.3s ease-out;
}
@media (prefers-color-scheme: dark) {
  .demo-backdrop {
    background: rgba(0, 0, 0, 0.7);
  }
}
.demo-backdrop-shown {
  display: block;
}
.demo-backdrop-on {
  opacity: 1;
}
.demo-close {
  display: none;
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 81;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.demo-stage[data-demo-stage="desktop"]:not([data-demo-zooming]) .demo-close {
  display: inline-flex;
}
/* Phones: the frame collapses and the app fills the viewport. While
   data-demo-frame is set (the zoom out) the frame is back, sized by the
   script so the screen stays put. */
.demo-stage[data-demo-stage="mobile"]:not([data-demo-frame]) .phone {
  padding: 0;
  border-radius: 0;
  aspect-ratio: auto;
  box-shadow: none;
}
.demo-stage[data-demo-stage="mobile"]:not([data-demo-frame]) .phone::after,
.demo-stage[data-demo-stage="mobile"]:not([data-demo-frame]) .phone-island {
  display: none;
}
.demo-stage[data-demo-stage="mobile"]:not([data-demo-frame]) .phone-screen {
  inset: 0;
  border-radius: 0;
}
.demo-stage[data-demo-frame] .phone {
  box-shadow: none;
}
.demo-stage[data-demo-frame] .phone::after {
  display: none;
}

/* ---- the frame: a dark rail, a Dynamic Island, a clipped screen. Bezel and
   corners are fractions of the width, so the shape holds at any size. ---- */
.phone {
  position: relative;
  isolation: isolate;
  flex: none;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  padding: 2.4%;
  background: #1b1916;
  border-radius: 13% / 6%;
  box-shadow:
    0 40px 80px -34px rgba(20, 16, 10, 0.42),
    0 14px 30px -16px rgba(20, 16, 10, 0.28);
}
@media (prefers-color-scheme: dark) {
  .phone {
    background: #090705;
  }
}
.phone::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 13% / 6%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 3;
}
.phone-screen {
  position: absolute;
  inset: 2.4%;
  overflow: hidden;
  border-radius: 11% / 5%;
  background: var(--bg);
}
/* The phone has its own appearance setting, like the app. */
.phone-screen[data-theme="light"] {
  background: #f8fbf9;
}
.phone-screen[data-theme="dark"] {
  background: #0f1310;
}
.phone-island {
  position: absolute;
  top: 1.8%;
  left: 50%;
  z-index: 2;
  width: 30%;
  aspect-ratio: 6 / 1.7;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #090705;
}

/* The static preview inside the frame before the script runs (and for
   visitors without JavaScript). demo.js removes it. */
.phone-screen .preview {
  position: absolute;
  inset: 12% 6% auto;
  max-width: none;
  border: 0;
}

/* ---- the canvas: 390 wide, scaled; the app's tokens per theme ---- */
.d-canvas {
  --bg: #f8fbf9;
  --surface: #edf1ee;
  --text: #191f1a;
  --muted: #565d57;
  --border: #d7dcd8;
  --border-strong: #818883;
  --accent: #1d723e;
  --accent-pressed: #116031;
  --on-accent: #f6fcf7;
  --danger: #b6322d;
  --scrim: rgba(25, 31, 26, 0.32);
  --mark-green: #25984d;
  --mark-yellow: #b98800;
  --mark-orange: #d06300;
  --mark-red: #e24942;
  --mark-pink: #cd568b;
  --mark-purple: #9b6bce;
  --mark-blue: #4087de;
  --mark-gray: #818883;
  --member-green: #057d38;
  --member-yellow: #85670b;
  --member-orange: #a6560a;
  --member-red: #c9302d;
  --member-pink: #b54076;
  --member-purple: #8555b5;
  --member-blue: #226bc0;
  --member-gray: #656c67;
  --ios-blue: #007aff;
  --ios-red: #ff3b30;
  --alert-bg: rgba(249, 249, 249, 0.96);
  --alert-rule: rgba(60, 60, 67, 0.36);
  color-scheme: light;
}
.d-canvas[data-theme="dark"] {
  --bg: #0f1310;
  --surface: #191d1a;
  --text: #e7ede8;
  --muted: #9fa7a1;
  --border: #2d322e;
  --border-strong: #646b66;
  --danger: #f47c70;
  --scrim: rgba(0, 0, 0, 0.55);
  --mark-green: #5ac576;
  --mark-yellow: #f6c330;
  --mark-orange: #fa8927;
  --mark-red: #ff7266;
  --mark-pink: #f77cb0;
  --mark-purple: #c190f6;
  --mark-blue: #65adff;
  --mark-gray: #a6ada7;
  --member-green: #5ac576;
  --member-yellow: #f6c330;
  --member-orange: #fa8927;
  --member-red: #ff7266;
  --member-pink: #f77cb0;
  --member-purple: #c190f6;
  --member-blue: #65adff;
  --member-gray: #a6ada7;
  --ios-blue: #0a84ff;
  --ios-red: #ff453a;
  --alert-bg: rgba(37, 37, 37, 0.96);
  --alert-rule: rgba(84, 84, 88, 0.65);
  color-scheme: dark;
}
.d-canvas {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: "Familjen Grotesk", system-ui, sans-serif;
  font-size: 17px;
  line-height: 24px;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  /* No gray flash on taps in iOS Safari, and no double-tap zoom delay. */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.d-canvas * {
  box-sizing: border-box;
}
.d-canvas input {
  -webkit-user-select: text;
  user-select: text;
}
/* :where() keeps these resets below every class rule in specificity. */
:where(.d-canvas) button,
:where(.d-canvas) input {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
:where(.d-canvas) button {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
}
:where(.d-canvas) p,
:where(.d-canvas) h1,
:where(.d-canvas) h2 {
  margin: 0;
  max-width: none;
}
/* Body text and captions up by their optical offset (2pt / 1.5pt). */
:where(.d-canvas) p {
  transform: translateY(-2px);
}
:where(.d-canvas) p.d-caption {
  transform: translateY(-1.5px);
}
.d-alert p,
.d-as-title {
  transform: none;
}
:where(.d-canvas) a {
  color: inherit;
  text-decoration: none;
}
/* Keyboard focus ring on buttons and rows. Fields keep their own border
   and corners (they turn accent when focused). */
.d-canvas :is(button, a, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  border-radius: 4px;
}
.d-statusbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  pointer-events: none;
  height: 54px;
  padding: 16px 26px 0 32px;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}
.d-banner-close {
  display: none;
}
/* Fullscreen on a phone: the band clears the real status bar and holds
   Close, in the app's accent so it reads as the one way out. */
.d-canvas.d-fullscreen .d-statusbar {
  position: static;
  pointer-events: auto;
  height: auto;
  padding: calc(var(--d-safe, 0px) + 6px) 12px 6px;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.d-statusbar-icons {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 20px;
}
.d-statusbar-icons svg {
  display: block;
}
.d-canvas.d-fullscreen .d-statusbar-icons,
.d-canvas.d-fullscreen .d-statusbar-time {
  display: none;
}
.d-canvas.d-fullscreen .d-banner-close {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-weight: 600;
  color: var(--accent);
}
.d-screens {
  flex: 1;
  min-height: 0;
  position: relative;
}
.d-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  /* Each screen is its own stacking context, so a lower screen's rows
     (z-index 1 inside swipe rows) never paint through the one above. */
  isolation: isolate;
  /* Horizontal drags from the left edge are the back swipe. */
  touch-action: pan-y;
  /* Room for the status bar, which floats above. */
  padding-top: 54px;
}
.d-canvas.d-fullscreen .d-screen {
  padding-top: 0;
}
/* Parked under another screen (demo.js animates between the two states). */
.d-screen.d-under {
  transform: translateX(-30%);
}
.d-screen.d-sliding {
  will-change: transform;
}
/* A shadow along the moving screen's left edge only, so nothing spills
   above or below it. */
.d-screen.d-sliding::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 100%;
  width: 24px;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.14), rgba(0, 0, 0, 0));
}
.d-dim {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
.d-screen.d-under > .d-dim {
  opacity: 0.1;
}
[data-demo-zooming] .d-screen {
  will-change: auto !important;
}
[data-demo-zooming] .d-scroll,
[data-demo-zooming] .d-sheet-scroll {
  overflow: hidden !important;
}
.d-gutter {
  padding-left: 24px;
  padding-right: 24px;
}
.d-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 48px;
  scrollbar-width: none;
}
.d-scroll::-webkit-scrollbar {
  display: none;
}
.d-flex1 {
  flex: 1;
  min-width: 0;
}
.d-muted {
  color: var(--muted);
}
.d-danger {
  color: var(--danger);
}
.d-accent {
  color: var(--accent);
}
.d-semibold {
  font-weight: 600;
}
.d-center {
  text-align: center;
}
.d-block {
  display: block;
}
.d-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.d-tabular {
  font-variant-numeric: tabular-nums;
}
.d-caption {
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0.1px;
}
.d-empty {
  padding-top: 4px;
}

/* Header: a 44pt row with 8pt above, as in the app. */
.d-header {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 4px;
  padding-top: 8px;
  flex: none;
}
.d-header-back {
  margin-left: -12px;
}
.d-header-actions {
  display: flex;
  align-items: center;
  margin-right: -12px;
}
/* Next to the logo, the buttons line up with the name's letters; next to a
   title, with its capitals (wordmarkLetterOffset / capCenterOffset). */
.d-actions-logo {
  transform: translateY(2px);
}
.d-actions-title,
.d-back {
  transform: translateY(-1px);
}
.d-iconbtn,
.d-target {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.d-iconbtn:active,
.d-target:active {
  opacity: 0.5;
}
.d-langbtn {
  min-width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  /* Capitals only: the cap height centred, 90/1200 em up. */
  transform: translateY(-1.3px);
}
.d-langbtn:active {
  opacity: 0.5;
}
.d-title {
  flex: 1;
  min-width: 0;
  font-size: 28px;
  line-height: 34px;
  letter-spacing: -0.2px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* Letters up by the optical offset (3pt at 28), as the app's Text does. */
  transform: translateY(-3px);
}
.d-title-btn {
  min-height: 44px;
}
.d-title-input {
  border: 0;
  border-bottom: 1.5px solid var(--accent);
  background: none;
  padding: 0;
  border-radius: 0;
  outline: none;
}
.d-wordmark {
  display: inline-flex;
  align-items: center;
  flex: 1;
  min-height: 44px;
}
.d-mark {
  display: inline-flex;
  flex: none;
}
.d-mark svg {
  width: 100%;
  height: 100%;
}
.d-wordmark-name {
  font-weight: 700;
}
/* Frozen lockup: mark 28/22 of the name, gap 8/22, tracking -0.01em, the L's
   stem centred on the mark (up 90/1200 em). */
.d-wordmark-title {
  gap: 10.2px;
}
.d-wordmark-title .d-mark {
  width: 35.6px;
  height: 35.6px;
}
.d-wordmark-title .d-wordmark-name {
  font-size: 28px;
  line-height: 34px;
  letter-spacing: -0.28px;
  transform: translateY(-2.1px);
}
.d-wordmark-display {
  gap: 14.5px;
}
.d-wordmark-display .d-mark {
  width: 50.9px;
  height: 50.9px;
}
.d-wordmark-display .d-wordmark-name {
  font-size: 40px;
  line-height: 46px;
  letter-spacing: -0.4px;
  transform: translateY(-3px);
}

/* Buttons, as in the app: 48pt filled, 44pt plain. */
.d-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
}
.d-btn-icon {
  display: inline-flex;
}
/* Labels up by the optical offset (2pt at 17), as the app's Text does. */
.d-btn > span:last-child {
  transform: translateY(-2px);
}
.d-btn-primary,
.d-btn-secondary,
.d-btn-apple {
  min-height: 48px;
  border-radius: 8px;
  padding: 0 16px;
  width: 100%;
}
.d-btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.d-btn-primary:active {
  background: var(--accent-pressed);
}
.d-btn-secondary {
  border: 1.5px solid var(--border-strong);
}
.d-btn-secondary:active {
  background: var(--surface);
}
.d-btn-apple {
  background: #000;
  color: #fff;
}
.d-canvas[data-theme="dark"] .d-btn-apple {
  background: #fff;
  color: #000;
}
.d-btn-plain,
.d-btn-danger {
  min-height: 44px;
  color: var(--accent);
  align-self: flex-start;
}
.d-btn-danger {
  color: var(--danger);
}
.d-btn-plain:active,
.d-btn-danger:active {
  opacity: 0.6;
}
.d-btn:disabled {
  opacity: 0.4;
}

/* Fields */
.d-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 24px;
}
.d-fieldwrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* 48 tall; the text sits in the upper 44 (bottom padding 4), which lifts
   it 2pt like the app's field. Browsers centre input text in the content
   box, so padding is the one lever that works everywhere. */
.d-field {
  width: 100%;
  height: 48px;
  line-height: 24px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  padding: 0 12px 4px;
  outline: none;
}
.d-field:focus {
  border-color: var(--accent);
}
.d-field-error {
  border-color: var(--danger);
}
.d-field::placeholder {
  color: var(--muted);
}

/* Home */
.d-home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 24px;
}
.d-section {
  padding-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.d-heading {
  font-size: 22px;
  line-height: 28px;
  letter-spacing: -0.1px;
  font-weight: 600;
  transform: translateY(-2.5px);
}
.d-group {
  border-bottom: 1px solid var(--border);
}
.d-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.d-listrow {
  min-height: 56px;
  padding: 0 24px;
}
.d-listrow:active,
.d-itemrow:active {
  background: var(--surface);
}
.d-row-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* Optical offset at 17pt: 2pt. */
  transform: translateY(-2px);
}
.d-row-star {
  display: inline-flex;
  color: var(--accent);
}
/* An item's name is its own button (tap to rename); the fill after it keeps
   the checkbox at the right edge. */
.d-itemrow .d-name-target {
  flex: 0 1 auto;
  padding: 10px 0;
  margin: -10px 0;
  text-align: left;
}
.d-row-fill {
  flex: 1;
}
.d-checked {
  color: var(--muted);
  text-decoration: line-through;
}

/* Items */
.d-bell {
  width: 44px;
  height: 44px;
  margin-right: -8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
}
.d-bell:active {
  opacity: 0.6;
}
.d-bell-sent {
  color: var(--muted);
  cursor: default;
}
.d-add {
  padding-top: 16px;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.d-addslot {
  min-height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.d-addactions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.d-addrow {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.d-addrow .d-btn-primary {
  width: auto;
}
.d-itemrow {
  min-height: 52px;
  padding: 4px 14px 4px 8px;
  gap: 0;
}
.d-dot-target {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: -4px;
  flex: none;
}
.d-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.d-ring {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
}
.d-box {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  position: relative;
}
.d-box::before {
  content: "";
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1.5px solid var(--border-strong);
}
.d-box-on::before {
  background: var(--accent);
  border-color: var(--accent);
}
.d-box-on::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 7px;
  border: solid var(--on-accent);
  border-width: 0 0 2px 2px;
  transform: translate(-50%, -50%) translateY(-1px) rotate(-45deg);
}
.d-rename {
  flex: 1;
  min-width: 0;
  height: 40px;
  line-height: 24px;
  background: none;
  border: 0;
  border-bottom: 1.5px solid var(--accent);
  padding: 0 0 4px;
  outline: none;
  border-radius: 0;
}
.d-footer {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  min-height: 9px;
}

/* Swipe rows: the red action behind on the right, the panel on the left. */
.d-swipe {
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
}
.d-swipe-front {
  position: relative;
  z-index: 1;
  will-change: transform;
}
.d-swipe-action {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  min-width: 96px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px;
  background: var(--danger);
  color: var(--bg);
  font-weight: 600;
  opacity: 0;
}
.d-swipe-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: var(--surface);
  opacity: 0;
  color: var(--accent);
}
.d-colors {
  display: flex;
  align-items: center;
  gap: 4px;
}
.d-circle-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.d-circle-active {
  border-color: var(--text);
}
.d-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
@keyframes d-arrive {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.d-arrive {
  animation: d-arrive 0.25s ease-out;
}

/* Sign-in */
.d-signin-name {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.d-signin-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
}
.d-signin-note {
  min-height: 18px;
}

/* Settings */
.d-settings {
  display: flex;
  flex-direction: column;
}
.d-account {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px 0;
}
.d-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 24px;
}
.d-links .d-btn {
  align-self: center;
}
.d-dangerblock {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Members */
.d-memberlist {
  padding-top: 16px;
}
.d-settingsblock {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.d-sectionhead {
  padding-top: 24px;
  padding-bottom: 8px;
}
.d-setting {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  padding-top: 12px;
  padding-bottom: 12px;
  border-top: 1px solid var(--border);
}
.d-settingtext {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.d-switch {
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: 16px;
  background: var(--border);
  flex: none;
  transition: background 0.2s ease-out;
}
.d-switch-on {
  background: var(--accent);
}
.d-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15), 0 1px 1px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s ease-out;
}
.d-switch-on .d-knob {
  transform: translateX(20px);
}
.d-hint {
  padding-bottom: 16px;
}
.d-memberrow {
  min-height: 64px;
  padding: 0 14px 0 24px;
}
.d-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex: none;
}
.d-who {
  flex: 1;
  min-width: 0;
}
.d-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-block;
}
.d-swatch-empty {
  border: 1.5px solid var(--border-strong);
}

/* Sheets: the scrim and a bottom sheet with a grabber, as in the app. */
.d-sheets {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}
.d-scrim {
  --d-scrim: 1;
  position: absolute;
  inset: 0;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.d-scrim::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--scrim);
  opacity: 0;
  transition: opacity 0.28s ease-out;
}
.d-scrim.d-in::before {
  opacity: var(--d-scrim);
}
.d-scrim-btn {
  position: absolute;
  inset: 0;
  width: 100%;
  cursor: default;
}
.d-sheet {
  position: relative;
  width: 100%;
  max-height: 90%;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  padding-bottom: 34px;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  touch-action: none;
}
.d-in .d-sheet {
  transform: none;
}
.d-sheet-help {
  max-height: 65%;
}
.d-grabber-area {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.d-grabber {
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--border);
}
.d-sheet-body {
  padding: 8px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.d-sheet-heading {
  transform: none;
}
.d-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 12px;
}
.d-sheet-row {
  display: flex;
  justify-content: center;
  gap: 24px;
}
.d-codeblock {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-top: 8px;
}
.d-code {
  font-size: 28px;
  line-height: 34px;
  font-weight: 600;
  letter-spacing: 4px;
  font-variant-numeric: tabular-nums;
  user-select: all;
  -webkit-user-select: all;
}
.d-colorgrid {
  display: flex;
  flex-wrap: wrap;
  row-gap: 12px;
  padding: 8px 0;
}
.d-colorpick {
  width: 25%;
  min-height: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.d-colorpick:active {
  opacity: 0.6;
}
.d-swatchring {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.d-swatchring-on {
  border-color: var(--text);
}
.d-swatch32 {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
.d-help-title {
  padding: 8px 24px 12px;
  flex: none;
}
.d-sheet-scrollarea {
  position: relative;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.d-sheet-scroll {
  overflow-y: auto;
  padding: 0 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  scrollbar-width: none;
  touch-action: pan-y;
}
.d-sheet-scroll::-webkit-scrollbar {
  display: none;
}
.d-helpgroup {
  display: flex;
  flex-direction: column;
}
.d-helpgroup > .d-caption {
  padding-bottom: 8px;
}
.d-helprow {
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.d-more {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.d-more::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
}
.d-more svg {
  position: relative;
  color: var(--muted);
}
.d-more[hidden] {
  display: none;
}

/* iOS alert (Alert.alert) */
.d-alert-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.16s ease-out;
}
.d-alert-backdrop.d-in {
  opacity: 1;
}
.d-alert {
  width: 270px;
  border-radius: 14px;
  background: var(--alert-bg);
  color: var(--text);
  font-family: -apple-system, "SF Pro Text", system-ui, sans-serif;
  text-align: center;
  overflow: hidden;
  transform: scale(1.1);
  transition: transform 0.16s ease-out;
}
.d-in .d-alert {
  transform: none;
}
.d-alert-text {
  padding: 19px 16px 15px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.d-alert-title {
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
}
.d-alert-msg {
  font-size: 13px;
  line-height: 16px;
}
.d-alert-actions {
  display: flex;
  border-top: 0.5px solid var(--alert-rule);
}
.d-alert-btn {
  flex: 1;
  min-height: 44px;
  font-size: 17px;
  color: var(--ios-blue);
  text-align: center;
  justify-content: center;
}
.d-alert-btn + .d-alert-btn {
  border-left: 0.5px solid var(--alert-rule);
}
.d-alert-destructive {
  color: var(--ios-red);
}
.d-alert-ok {
  font-weight: 600;
}
.d-alert-btn:active {
  background: rgba(0, 0, 0, 0.06);
}

/* iOS action sheet (ActionSheetIOS) */
.d-actionsheet {
  position: relative;
  padding: 0 8px 34px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: -apple-system, "SF Pro Text", system-ui, sans-serif;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.d-in .d-actionsheet {
  transform: none;
}
.d-as-group {
  border-radius: 13px;
  background: var(--alert-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.d-as-title {
  font-size: 13px;
  line-height: 18px;
  color: #8e8e93;
  text-align: center;
  padding: 14px 16px;
  border-bottom: 0.5px solid var(--alert-rule);
}
.d-as-btn {
  min-height: 57px;
  font-size: 20px;
  color: var(--ios-blue);
  text-align: center;
  justify-content: center;
  display: inline-flex;
  align-items: center;
}
.d-as-btn + .d-as-btn {
  border-top: 0.5px solid var(--alert-rule);
}
.d-as-btn:active {
  background: rgba(0, 0, 0, 0.06);
}
.d-as-cancel {
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .demo-backdrop,
  .d-screen,
  .d-swipe-front,
  .d-scrim::before,
  .d-sheet,
  .d-actionsheet,
  .d-alert-backdrop,
  .d-alert,
  .d-switch,
  .d-knob {
    transition: none !important;
  }
  .d-arrive {
    animation: none;
  }
}

.d-center-self,
.d-btn.d-center-self {
  align-self: center;
}
