:root {
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --pill: 999px;

  --shell: 30rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font-display: 'Bricolage Grotesque', 'Inter', system-ui, sans-serif;
  --font-sans:
    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- theme: dark (default) --------------------------------------------- */
/* The app resolves the active theme at boot (stored choice → system) and sets
   data-theme on <html>; this base also covers the pre-script paint. */
:root,
:root[data-theme='dark'] {
  color-scheme: dark;

  --bg: #000000;
  --surface: #0d0d0f;
  --surface-2: #1a1a1d;
  --ink: #f4f4f6;
  --muted: #9a9aa2;
  --faint: #67676e;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.17);

  --accent: #f0f0f3;
  --accent-ink: #000000;
  --live: #5fd39a;
  --danger: #e89080;
}

/* ---- theme: light ------------------------------------------------------ */
:root[data-theme='light'] {
  color-scheme: light;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f0f2;
  --ink: #16161a;
  --muted: #5e5e66;
  --faint: #9a9aa2;
  --line: rgba(0, 0, 0, 0.10);
  --line-strong: rgba(0, 0, 0, 0.16);

  --accent: #16161a;
  --accent-ink: #ffffff;
  --live: #149a5b;
  --danger: #c8492f;
}

/* deeper status tones for legibility on a light background */
:root[data-theme='light'] [data-tone='blue'] { --tone: #2f6fb0; }
:root[data-theme='light'] [data-tone='steel'] { --tone: #5b7282; }
:root[data-theme='light'] [data-tone='green'] { --tone: #2c9466; }
:root[data-theme='light'] [data-tone='ink'] { --tone: #3a4048; }
:root[data-theme='light'] [data-tone='violet'] { --tone: #7a52c4; }
:root[data-theme='light'] [data-tone='gold'] { --tone: #9c761c; }
:root[data-theme='light'] [data-tone='coral'] { --tone: #c75a3e; }
:root[data-theme='light'] [data-tone='red'] { --tone: #cc4940; }
:root[data-theme='light'] [data-tone='mint'] { --tone: #1f9b85; }
:root[data-theme='light'] [data-tone='pink'] { --tone: #c0508f; }
:root[data-theme='light'] [data-tone='night'] { --tone: #515d86; }
:root[data-theme='light'] [data-tone='gray'] { --tone: #6b6b70; }

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  min-width: 320px;
  color: var(--ink);
  background: var(--bg);
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

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

button {
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

p {
  margin: 0;
}

/* ---- type helpers ------------------------------------------------------ */

.display {
  font-family: var(--font-display);
  font-weight: 600;
  font-optical-sizing: auto;
  letter-spacing: -0.025em;
}

.overline {
  margin: 0;
  color: var(--faint);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

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

.lede {
  max-width: 26rem;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.wordmark {
  margin: 0.08em 0 0.32em;
  font-weight: 700;
  font-size: clamp(2.6rem, 13vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
}

.handle {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.handle--xl {
  font-size: clamp(2.3rem, 10vw, 3.2rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

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

.shell {
  width: min(100%, var(--shell));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: clamp(20px, 6vw, 40px) 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.shell--center {
  justify-content: center;
  gap: 26px;
}

.block {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

.banner {
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.4;
}

.banner code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82em;
}

.loader {
  display: grid;
  place-items: center;
  min-height: 60vh;
}

.loader__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  letter-spacing: -0.04em;
  color: var(--faint);
  animation: breathe 1.6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 52px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--pill);
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition:
    transform 0.18s var(--ease),
    background 0.18s var(--ease),
    border-color 0.18s var(--ease),
    opacity 0.18s var(--ease);
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.btn--primary {
  color: var(--accent-ink);
  background: var(--ink);
}

.btn--primary:hover {
  background: #fff;
}

.btn--primary .icon {
  transition: transform 0.2s var(--ease);
}

.btn--primary:hover .icon {
  transform: translateX(3px);
}

.btn--ghost {
  color: var(--ink);
  background: transparent;
  border-color: var(--line-strong);
}

.btn--ghost:hover {
  border-color: var(--ink);
}

.btn--sm {
  min-height: 42px;
  padding: 0 16px;
  font-size: 0.9rem;
}

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

/* primary "what are you doing?" action that opens the picker */
.cta-update {
  min-height: 58px;
  font-size: 1.02rem;
}

.cta-update .icon {
  width: 20px;
  height: 20px;
  transition: transform 0.2s var(--ease);
}

.cta-update:hover .icon {
  transform: rotate(90deg);
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  transition:
    border-color 0.18s var(--ease),
    background 0.18s var(--ease);
}

.iconbtn:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.iconbtn .icon {
  width: 20px;
  height: 20px;
}

.pill {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.textlink {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.18s var(--ease);
}

.textlink:hover {
  color: var(--ink);
}

.textlink .icon {
  width: 1em;
  height: 1em;
  transition: transform 0.2s var(--ease);
}

.textlink:hover .icon {
  transform: translateX(2px);
}

/* ---- avatar ------------------------------------------------------------ */

.avatar {
  display: block;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}

.avatar svg {
  display: block;
  width: 100%;
  height: 100%;
}

.avatar--sm {
  width: 46px;
  height: 46px;
}
.avatar--md {
  width: 60px;
  height: 60px;
}
.avatar--lg {
  width: 104px;
  height: 104px;
}

/* ---- onboarding -------------------------------------------------------- */

.onboard__intro {
  padding: 0 2px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 8px 14px 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.chip .icon {
  width: 16px;
  height: 16px;
  color: var(--tone, var(--accent));
}

.claim {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.claim__preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.claim__url {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.claim__url span {
  color: var(--ink);
  font-weight: 600;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.field__label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.field__label em {
  color: var(--faint);
  font-style: normal;
  font-weight: 500;
}

.input {
  display: flex;
  align-items: center;
  min-height: 54px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--bg);
  transition:
    border-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.input input,
input.input {
  width: 100%;
  height: 54px;
  min-height: 54px;
  padding: 0 16px;
  border: 0;
  background: transparent;
  outline: none;
}

input.input {
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
}

input.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.input--prefix .input__prefix {
  padding-left: 16px;
  color: var(--faint);
  font-weight: 600;
}

.input--prefix input {
  padding-left: 6px;
}

input::placeholder {
  color: var(--faint);
}

.fineprint {
  color: var(--faint);
  font-size: 0.8rem;
  line-height: 1.5;
}

/* auto-generated handle on the sign-up screen */
.genhandle {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.genhandle__top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.genhandle__top .overline {
  flex: 1;
  margin: 0;
}

.genhandle__name {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

/* a single rolling slot in the handle */
.genhandle__tok {
  display: inline-block;
  font-variant-numeric: tabular-nums;
  transition: color 0.2s var(--ease);
}

.genhandle__sep { color: var(--faint); }

.genhandle__tok.is-rolling {
  color: var(--tone, var(--muted));
  filter: blur(0.4px);
}

.genhandle__tok.is-locked {
  animation: genhandle-tok-lock 0.46s var(--ease);
}

@keyframes genhandle-tok-lock {
  0% { transform: translateY(-4px) scale(1.14); color: var(--tone, var(--accent)); filter: blur(0); }
  55% { transform: translateY(0) scale(1); }
  100% { transform: none; color: inherit; }
}

/* while a roll is in flight: the icon spins continuously */
.genhandle__shuffle.is-rolling { pointer-events: none; }
.genhandle__shuffle.is-rolling .icon {
  animation: genhandle-spin360 0.6s linear infinite;
}

@keyframes genhandle-spin360 {
  to { transform: rotate(360deg); }
}

/* avatar flip on lock */
.avatar.is-flip {
  animation: genhandle-flip 0.42s var(--ease);
}

@keyframes genhandle-flip {
  0% { transform: perspective(600px) rotateY(0); }
  50% { transform: perspective(600px) rotateY(90deg); }
  100% { transform: perspective(600px) rotateY(0); }
}

.genhandle__url {
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.genhandle__shuffle .icon {
  transition: transform 0.45s var(--ease);
}

.genhandle__shuffle:hover .icon {
  transform: rotate(180deg);
}

/* sign-up ⇄ log-in toggle link */
.authswitch {
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  transition: color 0.18s var(--ease);
}

.authswitch:hover {
  color: var(--ink);
}

.authswitch strong {
  color: var(--ink);
  font-weight: 600;
}

/* log out */
.signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  width: 100%;
  margin-top: 10px;
  padding: 11px;
  border: 0;
  background: transparent;
  color: var(--faint);
  font-size: 0.86rem;
  font-weight: 600;
  transition: color 0.18s var(--ease);
}

.signout:hover {
  color: var(--danger);
}

.signout .icon {
  width: 17px;
  height: 17px;
}

/* ---- topbar ------------------------------------------------------------ */

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 2px;
}

.topbar__id .overline {
  margin-bottom: 4px;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---- hero -------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}

.hero[data-tone] {
  background:
    radial-gradient(135% 100% at 0% 0%, color-mix(in srgb, var(--tone) 15%, transparent), transparent 58%),
    var(--surface);
  border-color: color-mix(in srgb, var(--tone) 22%, var(--line));
}

.hero.is-live::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, color-mix(in srgb, var(--tone, var(--accent)) 12%, transparent) 50%, transparent 70%);
  background-size: 240% 100%;
  pointer-events: none;
  animation: hero-sheen 7s var(--ease) infinite;
}

@keyframes hero-sheen {
  0% { background-position: 140% 0; }
  60%, 100% { background-position: -40% 0; }
}

.hero__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hero__status {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0 12px;
}

.hero__glyph {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--tone, var(--ink));
  box-shadow: inset 0 0 0 1px var(--line);
}

.hero__glyph .icon {
  width: 28px;
  height: 28px;
}

.hero__glyph--lg {
  width: 64px;
  height: 64px;
}

.hero__glyph--lg .icon {
  width: 32px;
  height: 32px;
}

.hero__label {
  margin: 0;
  font-size: clamp(2.1rem, 9vw, 2.85rem);
  line-height: 1.02;
}

.is-quiet .hero__label {
  color: var(--muted);
}

.hero__meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero__track {
  display: flex;
  gap: 6px;
  margin: 22px 0 10px;
}

.seg {
  height: 4px;
  flex: 1;
  border-radius: var(--pill);
  background: var(--line-strong);
  transition: background 0.4s var(--ease);
}

.seg.is-on {
  background: var(--accent);
}

.hero__hint {
  color: var(--faint);
  font-size: 0.82rem;
  font-weight: 500;
}

.livedot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--faint);
  flex: none;
}

.livedot[data-on='true'] {
  background: var(--live);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 50%, transparent);
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 45%, transparent); }
  70% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--live) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 0%, transparent); }
}

/* ---- search + presets -------------------------------------------------- */

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: var(--surface);
  transition:
    border-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

.search .icon {
  width: 18px;
  height: 18px;
  color: var(--faint);
}

.search input {
  flex: 1;
  min-height: 48px;
  border: 0;
  background: transparent;
  outline: none;
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* ---- category filter bar ---------------------------------------------- */

.filterbar {
  display: flex;
  gap: 8px;
  margin: -2px 0 2px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.filterbar::-webkit-scrollbar {
  display: none;
}

.filterchip {
  flex: none;
  scroll-snap-align: start;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition:
    border-color 0.16s var(--ease),
    background 0.16s var(--ease),
    color 0.16s var(--ease);
}

.filterchip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.filterchip.is-active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}

.preset-group + .preset-group {
  margin-top: 20px;
}

.group-label {
  margin: 0 0 10px;
  color: var(--faint);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  text-align: left;
  transition:
    transform 0.16s var(--ease),
    border-color 0.16s var(--ease),
    background 0.16s var(--ease);
}

.tile:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.tile:active {
  transform: translateY(0) scale(0.99);
}

.tile__glyph {
  color: var(--ink);
  margin-bottom: 8px;
}

.tile__glyph .icon {
  width: 24px;
  height: 24px;
}

.tile__dot {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone, var(--accent));
}

.tile__label {
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tile__desc {
  color: var(--faint);
  font-size: 0.8rem;
}

.tile.is-active {
  border-color: var(--accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, transparent), transparent);
}

.tile.is-active .tile__glyph {
  color: var(--accent);
}

/* templated presets open the composer — hint with a small "+" affordance */
.tile--templated::after {
  content: '+';
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tone, var(--accent)) 18%, transparent);
  color: var(--tone, var(--accent));
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  opacity: 0.85;
  transition: transform 0.16s var(--ease), opacity 0.16s var(--ease);
}

.tile--templated:hover::after {
  transform: scale(1.12);
  opacity: 1;
}

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

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}

.stat__num {
  margin: 8px 0 2px;
  font-size: 2.7rem;
  line-height: 0.95;
}

.stat__cap {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---- timeline axis ----------------------------------------------------- */

.axis-card {
  position: relative;
  padding: 20px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}

.axis-card[data-tone] {
  background:
    radial-gradient(135% 100% at 0% 0%, color-mix(in srgb, var(--tone) 13%, transparent), transparent 60%),
    var(--surface);
  border-color: color-mix(in srgb, var(--tone) 20%, var(--line));
}

.axis-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.axis {
  position: relative;
  padding: 2px 0;
}

/* the axis line — draws downward from the origin on first view */
.axis__line {
  position: absolute;
  left: 21px;
  top: 32px;
  bottom: 32px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--tone, var(--accent)) 70%, transparent) 0%,
    color-mix(in srgb, var(--tone, var(--accent)) 38%, transparent) 55%,
    var(--line) 100%
  );
}

.axis__row {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 12px;
  align-items: center;
  width: 100%;
  padding: 8px 8px 8px 0;
  border: 0;
  border-radius: 13px;
  background: transparent;
  text-align: left;
  color: inherit;
}

.axis__marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}

/* origin — the starting point the axis grows from */
.axis__seed {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent),
    0 0 14px color-mix(in srgb, var(--accent) 35%, transparent);
}

/* real update — a tone-tinted glyph tile sitting on the axis */
.axis__marker--glyph {
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--tone, var(--ink));
  box-shadow: inset 0 0 0 1px var(--line);
}

.axis__marker--glyph .icon {
  width: 22px;
  height: 22px;
}

/* ghost — a daily-target tap still to come */
.axis__marker--ghost::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px dashed var(--line-strong);
}

.axis__content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.axis__time {
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.axis__label {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.axis__label--muted,
.axis__label--ghost {
  color: var(--faint);
  font-weight: 500;
}

.axis__nowtag {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1px;
  color: var(--tone, var(--accent));
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* interactive nodes */
.axis__node {
  cursor: pointer;
  transition: background 0.16s var(--ease);
}

.axis__node .axis__marker {
  transition: transform 0.18s var(--ease);
}

.axis__node:hover {
  background: color-mix(in srgb, var(--tone, var(--accent)) 7%, transparent);
}

.axis__node:hover .axis__marker {
  transform: scale(1.06);
}

.axis__node.is-open {
  background: color-mix(in srgb, var(--tone, var(--accent)) 11%, transparent);
}

.axis__ghost {
  cursor: pointer;
  transition: background 0.16s var(--ease);
}

.axis__ghost:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.axis__ghost:hover .axis__marker--ghost::before {
  border-color: var(--accent);
}

/* live node — the leading edge of the timeline, gently pulsing */
.axis__node.is-live .axis__label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.axis__node.is-live .axis__marker--glyph {
  background: color-mix(in srgb, var(--tone, var(--accent)) 16%, var(--surface-2));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--tone, var(--accent)) 45%, var(--line)),
    0 0 22px color-mix(in srgb, var(--tone, var(--accent)) 24%, transparent);
}

.axis__live {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  pointer-events: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone, var(--accent)) 45%, transparent);
  animation: axis-pulse 2.6s var(--ease) infinite;
}

@keyframes axis-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone, var(--accent)) 42%, transparent); }
  70% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--tone, var(--accent)) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone, var(--accent)) 0%, transparent); }
}

.axis__hint {
  margin-top: 12px;
  padding-left: 4px;
  color: var(--faint);
  font-size: 0.82rem;
  font-weight: 500;
}

@keyframes axis-draw {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}

@keyframes axis-node-in {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

@keyframes axis-pop {
  0% { opacity: 0; transform: scale(0.5); }
  60% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

/* first-view entrance: the line draws down, nodes drop in along it. Gated on
   no-preference so reduced-motion users never see the hidden initial state. */
@media (prefers-reduced-motion: no-preference) {
  .axis--enter .axis__line {
    transform-origin: top;
    animation: axis-draw 0.95s var(--ease) both;
  }

  .axis--enter .axis__row {
    opacity: 0;
    animation: axis-node-in 0.5s var(--ease) forwards;
    animation-delay: calc(var(--i) * 0.1s + 0.2s);
  }

  .axis--enter .axis__marker {
    opacity: 0;
    transform: scale(0.5);
    animation: axis-pop 0.46s var(--ease) forwards;
    animation-delay: calc(var(--i) * 0.1s + 0.26s);
  }

  /* newest node popping in after a tap (no full redraw) */
  .axis__node--new {
    animation: axis-node-in 0.42s var(--ease);
  }

  .axis__node--new .axis__marker {
    animation: axis-pop 0.42s var(--ease);
  }
}

.emptyrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  color: var(--faint);
  font-size: 0.88rem;
  text-align: center;
}

.emptyrow .icon {
  width: 22px;
  height: 22px;
  opacity: 0.7;
}

/* ---- footer ------------------------------------------------------------ */

.dash__footer {
  margin-top: 4px;
}

.linkpill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  transition:
    border-color 0.18s var(--ease),
    color 0.18s var(--ease);
}

.linkpill:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.linkpill .icon {
  width: 18px;
  height: 18px;
  color: var(--faint);
}

/* ---- public profile ---------------------------------------------------- */

.public {
  text-align: center;
}

.public__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 36px 26px 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(110% 70% at 50% 0%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%),
    var(--surface);
}

.public__card[data-tone] {
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--tone) 16%, transparent), transparent 60%),
    var(--surface);
  border-color: color-mix(in srgb, var(--tone) 20%, var(--line));
}

.public__card .avatar {
  margin-bottom: 6px;
}

.public__card .handle {
  margin-bottom: 6px;
}

.public__status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
}

.public__status > .livedot {
  margin-bottom: 2px;
}

.public__status h2 {
  margin: 0;
  font-size: clamp(2rem, 9vw, 2.5rem);
  line-height: 1.02;
}

.public__status .muted {
  font-size: 0.9rem;
}

.public__card.is-resting .public__status h2 {
  color: var(--muted);
}

.public__rhythm {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.rdot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--tone, var(--ink));
  box-shadow: inset 0 0 0 1px var(--line);
}

.rdot .icon {
  width: 17px;
  height: 17px;
}

.public__count {
  margin-top: 24px;
  color: var(--faint);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.public__count strong {
  color: var(--ink);
  font-weight: 700;
}

.public__card.empty {
  gap: 14px;
}

.public__card.empty .muted {
  margin-bottom: 8px;
}

.public__actions {
  display: grid;
  gap: 10px;
  width: min(100%, 360px);
}

.public__actions .btn {
  width: 100%;
}

.sheet--install {
  background: var(--surface);
}

.install-steps {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  text-align: left;
}

.install-steps p {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
}

.install-steps .icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
}

.install-steps .muted {
  color: var(--faint);
  overflow-wrap: anywhere;
}

/* ---- tones ------------------------------------------------------------- */

[data-tone='blue'] { --tone: #7ab0e8; }
[data-tone='steel'] { --tone: #a3b6c6; }
[data-tone='green'] { --tone: #76c79a; }
[data-tone='ink'] { --tone: #c2c8cf; }
[data-tone='violet'] { --tone: #b79ae6; }
[data-tone='gold'] { --tone: #e3c073; }
[data-tone='coral'] { --tone: #ec9a86; }
[data-tone='red'] { --tone: #e8857f; }
[data-tone='mint'] { --tone: #74cdb6; }
[data-tone='pink'] { --tone: #e295bf; }
[data-tone='night'] { --tone: #8f9bc0; }
[data-tone='gray'] { --tone: #a6a39a; }

/* ---- toasts ------------------------------------------------------------ */

.toast-host {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  max-width: calc(var(--shell) - 40px);
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: rgba(26, 25, 21, 0.92);
  backdrop-filter: blur(12px);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition:
    opacity 0.26s var(--ease),
    transform 0.26s var(--ease);
}

.toast.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast .icon {
  width: 17px;
  height: 17px;
  color: var(--live);
}

.toast[data-type='error'] {
  color: var(--danger);
}

/* ---- composer sheet ---------------------------------------------------- */

.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(7, 7, 6, 0);
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  transition:
    background 0.28s var(--ease),
    backdrop-filter 0.28s var(--ease);
}

.sheet-overlay.is-in {
  background: rgba(7, 7, 6, 0.58);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
}

.sheet {
  position: relative;
  width: min(100%, var(--shell));
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 14px 22px calc(22px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background:
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--tone, var(--accent)) 13%, transparent), transparent 62%),
    var(--surface);
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(102%);
  transition: transform 0.32s var(--ease);
}

.sheet[data-tone] {
  border-top: 2px solid color-mix(in srgb, var(--tone) 55%, var(--line-strong));
}

.sheet-overlay.is-in .sheet {
  transform: translateY(0);
}

.sheet__grip {
  width: 38px;
  height: 4px;
  margin: 0 auto 14px;
  border-radius: var(--pill);
  background: var(--line-strong);
}

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

.sheet__head .overline {
  margin-bottom: 4px;
}

.sheet__preview {
  margin: 0;
  font-size: clamp(1.5rem, 6.5vw, 1.9rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.sheet__preview.is-bump {
  animation: preview-bump 0.28s var(--ease);
}

@keyframes preview-bump {
  0% { opacity: 0.4; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.sheet__close {
  width: 38px;
  height: 38px;
  align-self: start;
}

.sheet__close .icon {
  width: 18px;
  height: 18px;
}

.sheet__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 0 4px;
}

.sheet__slot .group-label {
  margin-bottom: 12px;
}

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

.optchip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 9px 14px 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  transition:
    transform 0.14s var(--ease),
    border-color 0.14s var(--ease),
    background 0.14s var(--ease),
    color 0.14s var(--ease);
}

.optchip:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: var(--ink);
}

.optchip:active {
  transform: translateY(0) scale(0.97);
}

.optchip__glyph {
  display: grid;
  place-items: center;
  color: var(--tone, var(--accent));
}

.optchip__glyph .icon {
  width: 17px;
  height: 17px;
}

.optchip.is-selected {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--tone, var(--accent)) 60%, var(--line-strong));
  background: color-mix(in srgb, var(--tone, var(--accent)) 16%, var(--surface));
}

.sheet__confirm {
  width: 100%;
  margin-top: 22px;
}

/* ---- picker sheet ------------------------------------------------------ */

.sheet--picker {
  background: var(--surface);
}

.sheet__head--picker {
  grid-template-columns: 1fr auto;
}

.sheet__search {
  margin-top: 16px;
}

.sheet--picker .filterbar {
  margin: 14px 0 2px;
}

.sheet__results {
  padding: 14px 0 6px;
}

/* ---- motion ------------------------------------------------------------ */

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.32s;
  animation-timing-function: var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  *,
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
    transition-duration: 0.001ms !important;
  }
}

@media (min-width: 600px) {
  :root {
    --shell: 32rem;
  }
}

/* ---- animated preset glyphs -------------------------------------------- */
/* Ambient motion on preset action icons. Two kinds:
   - icon--anim-*  : a transform/stroke loop on the glyph itself
   - .icon-fx      : a particle layer (notes, steam, stars, clock hand)
   Both play only on the roomy preset surfaces (tiles + hero); status dots and
   timeline markers stay calm. The global prefers-reduced-motion: reduce rule
   above stops the loops; particle layers are revealed only when motion is OK. */

.icon-fx {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  /* glyph-transform loops */
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon--anim-beat {
    animation: ig-beat 1.6s ease-in-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon--anim-breathe {
    animation: ig-breathe 4.2s ease-in-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon--anim-lift {
    animation: ig-lift 1.9s ease-in-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon--anim-ring {
    animation: ig-ring 2.7s ease-in-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon--anim-wiggle {
    animation: ig-wiggle 1.7s ease-in-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon--anim-spin {
    animation: ig-spin 16s linear infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon--anim-sparkle {
    animation: ig-sparkle 2.4s ease-in-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon--anim-bob {
    animation: ig-bob 2.4s ease-in-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon--anim-flicker {
    transform-origin: 50% 78%;
    animation: ig-flicker 0.95s ease-in-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon--anim-sway {
    transform-origin: 50% 92%;
    animation: ig-sway 3.4s ease-in-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon--anim-swirl {
    transform-origin: 50% 95%;
    animation: ig-swirl 2.8s ease-in-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon--anim-swing {
    transform-origin: 50% 10%;
    animation: ig-swing 2.8s ease-in-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon--anim-drip {
    animation: ig-drip 2.3s ease-in-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon--anim-sweep path {
    stroke-dasharray: 40;
    animation: ig-sweep 2s linear infinite;
  }

  /* particle layers — tiles, hero, and composer option chips */
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .icon-fx {
    display: inline;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .ig-note {
    transform-box: fill-box;
    transform-origin: center;
    animation: ig-note-rise 2.8s var(--d, 0s) ease-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .ig-steam {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    animation: ig-steam 2.7s var(--d, 0s) ease-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .ig-star {
    transform-box: fill-box;
    transform-origin: center;
    animation: ig-twinkle 2.5s var(--d, 0s) ease-in-out infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .ig-bubble {
    transform-box: fill-box;
    transform-origin: center;
    animation: ig-bubble 2.4s var(--d, 0s) ease-in infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .ig-spoke {
    transform-box: fill-box;
    transform-origin: center;
    animation: ig-roll 1.3s var(--d, 0s) linear infinite;
  }
  :is(.tile__glyph, .hero__glyph, .optchip__glyph, .lp-tile__glyph, .lp-card__glyph, .lp-cycler__glyph, .lp__float, .lp-feature__glyph, .lp-use__glyph, .lp-use__sample-glyph) .ig-hand {
    transform-box: view-box;
    transform-origin: 12px 12px;
    animation: ig-tick 8s steps(8, end) infinite;
  }
}

@keyframes ig-beat {
  0%, 50%, 100% { transform: scale(1); }
  15% { transform: scale(1.17); }
  30% { transform: scale(1.04); }
  43% { transform: scale(1.11); }
}
@keyframes ig-breathe {
  0%, 100% { transform: scale(0.93); }
  50% { transform: scale(1.06); }
}
@keyframes ig-lift {
  0%, 100% { transform: translateY(1.2px); }
  50% { transform: translateY(-2px); }
}
@keyframes ig-ring {
  0%, 62%, 100% { transform: rotate(0); }
  6%, 18%, 30% { transform: rotate(11deg); }
  12%, 24%, 36% { transform: rotate(-11deg); }
}
@keyframes ig-wiggle {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}
@keyframes ig-spin {
  to { transform: rotate(360deg); }
}
@keyframes ig-sparkle {
  0%, 100% { transform: scale(0.86) rotate(-8deg); opacity: 0.75; }
  50% { transform: scale(1.08) rotate(8deg); opacity: 1; }
}
@keyframes ig-flicker {
  0%, 100% { transform: scale(1, 1) skewX(0); }
  25% { transform: scale(1.05, 1.1) skewX(-3deg); }
  50% { transform: scale(0.97, 1.05) skewX(2deg); }
  75% { transform: scale(1.04, 1.08) skewX(-1.5deg); }
}
@keyframes ig-sway {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(7deg); }
}
@keyframes ig-drip {
  0%, 100% { transform: translateY(-1px) scaleY(0.98); }
  55% { transform: translateY(1.5px) scaleY(1.07); }
}
@keyframes ig-sweep {
  from { stroke-dashoffset: 40; }
  to { stroke-dashoffset: -40; }
}
@keyframes ig-note-rise {
  0% { opacity: 0; transform: translateY(2px) scale(0.5); }
  20% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-7px) scale(1); }
}
@keyframes ig-steam {
  0% { opacity: 0; transform: translateY(2px) scaleY(0.6); }
  30% { opacity: 0.75; }
  100% { opacity: 0; transform: translateY(-6px) scaleY(1.15); }
}
@keyframes ig-twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.5) rotate(0); }
  50% { opacity: 1; transform: scale(1) rotate(45deg); }
}
@keyframes ig-tick {
  to { transform: rotate(360deg); }
}
@keyframes ig-bob {
  0%, 100% { transform: translateY(1px) rotate(-3deg); }
  50% { transform: translateY(-1.5px) rotate(3deg); }
}
@keyframes ig-swirl {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}
@keyframes ig-swing {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}
@keyframes ig-bubble {
  0% { opacity: 0; transform: translateY(1px) scale(0.5); }
  25% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-7px) scale(1); }
}
@keyframes ig-roll {
  to { transform: rotate(360deg); }
}

/* ---- statusful improvements (1, 2, 4) ------------------------------------ */

/* Dynamic theme background and glow effects */
.public__card[data-tone] {
  box-shadow: 0 0 80px -20px color-mix(in srgb, var(--tone) 25%, transparent);
  transition: box-shadow 0.4s ease;
}

.public[data-tone] {
  background: radial-gradient(circle at 50% -20%, color-mix(in srgb, var(--tone) 8%, transparent), transparent 70%), var(--bg);
  transition: background 0.4s ease;
}

/* Expiration selector dropdown style */
.select-wrapper {
  position: relative;
  width: 100%;
}

.select-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 0.95rem;
  appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

.select-input:focus {
  border-color: var(--tone, var(--accent));
}

/* Recent optchips */
.optchip.optchip--recent {
  border-color: color-mix(in srgb, var(--tone, var(--accent)) 40%, var(--line));
  background: color-mix(in srgb, var(--tone, var(--accent)) 6%, var(--surface));
  color: var(--ink);
}

.optchip.optchip--recent .optchip__glyph {
  color: var(--tone, var(--accent));
}

/* History Accordion styles */
.history-details {
  margin-top: 24px;
  width: min(100%, var(--shell));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.history-details[open] {
  border-color: var(--line-strong);
}

.history-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.history-summary::-webkit-details-marker {
  display: none;
}

.history-summary__arrow {
  display: inline-flex;
  transition: transform 0.2s ease;
}

.history-details[open] .history-summary__arrow {
  transform: rotate(90deg);
}

.history-content {
  padding: 0 20px 20px;
  border-top: 1px solid var(--line);
}

.history-day {
  margin-top: 16px;
}

.history-day:first-child {
  margin-top: 12px;
}

.history-day__title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 10px 0;
}

.history-day__items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  font-size: 0.9rem;
}

.history-item__time {
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 50px;
}

.history-item__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tone, var(--muted)) 12%, transparent);
  color: var(--tone, var(--muted));
}

.history-item__glyph svg {
  width: 14px;
  height: 14px;
}

.history-item__label {
  color: var(--ink);
  font-weight: 500;
}
