/* jaybot.fyi dashboard. Builds on /styles.css tokens. */

body.admin { min-height: 100dvh; }

.wordmark { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 350px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.login-card .wordmark { font-size: 40px; margin-bottom: 4px; }
.login-sub { color: var(--muted); margin-bottom: 10px; }
.back { color: var(--muted); font-size: 13px; margin-top: 8px; }
.back:hover { color: var(--text); }

/* fields */
.field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  font: inherit; font-size: 16px;
  transition: border-color 150ms, box-shadow 150ms;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field .hint { font-size: 12px; color: var(--muted); }
.form-err { color: var(--like); font-size: 13px; text-align: left; }
.btn.big { height: 46px; font-size: 15px; flex: none; }
.btn.danger { color: var(--like); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; flex: none; }
.btn:disabled { opacity: 0.5; cursor: default; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; cursor: pointer; }
.switch-text strong { display: block; font-weight: 600; }
.switch-text span { color: var(--muted); font-size: 13px; }
.switch input { appearance: none; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--surface-hover); position: relative; cursor: pointer; transition: background-color 200ms; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.3); transition: translate 250ms var(--ease); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { translate: 18px 0; }

/* shell */
:root { --panel: color-mix(in srgb, var(--text) 3%, var(--bg)); }

.me-avatar {
  display: grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface) center/cover; border: 1px solid var(--border);
  font-size: 12px; font-weight: 700; color: var(--muted);
}

/* phone: top bar + bottom tab bar */
.side { display: none; }
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 4px;
  height: 52px; padding: env(safe-area-inset-top) 12px 0 8px; box-sizing: content-box;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.bar h1 { margin: 0 auto 0 8px; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-back:not([hidden]) + h1 { margin-left: 0; font-size: 17px; }
.bar-back { display: grid; place-items: center; width: 40px; height: 44px; }
.bar-action { display: flex; }
.bar-action:empty { display: none; }
.bar-action button, .bar-action a { color: var(--accent); font-weight: 700; padding: 8px 10px; font-size: 15px; }
.bar-action button:disabled { opacity: 0.4; }
.bar-live {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 34px; padding: 0 10px 0 4px; border-radius: 17px;
  background: var(--surface); font-weight: 600; font-size: 13px;
  transition: background-color 150ms;
}
.bar-live:active { background: var(--surface-hover); }
.bar-live .i { width: 14px; height: 14px; stroke-width: 2.4; color: var(--muted); }
.bar-live .me-avatar { width: 26px; height: 26px; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: flex; align-items: stretch;
  height: 56px; padding-bottom: env(safe-area-inset-bottom); box-sizing: content-box;
  background: var(--bg); border-top: 1px solid var(--border);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11px; font-weight: 600;
}
.tabbar a .i { width: 24px; height: 24px; }
.tabbar a[aria-current] { color: var(--text); }
.tabbar a[aria-current] .i { stroke-width: 2.6; }
.tabbar a:active .i { transform: scale(0.9); }
.tab-new-btn {
  display: grid; place-items: center; width: 48px; height: 36px; border-radius: 12px;
  background: var(--accent); color: var(--accent-text);
}
.tab-new-btn .i { stroke-width: 2.6; }
.tabbar a.tab-new[aria-current="page"] .tab-new-btn { background: var(--text); color: var(--bg); box-shadow: none; }

.view { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(104px + env(safe-area-inset-bottom)); outline: none; }

/* desktop: sidebar */
@media (min-width: 900px) {
  .bar, .tabbar { display: none; }
  .side {
    position: fixed; inset: 0 auto 0 0; z-index: 20;
    display: flex; flex-direction: column; gap: 2px;
    width: 256px; padding: 20px 14px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    overflow-y: auto;
  }
  .side-logo { display: flex; align-items: baseline; gap: 8px; padding: 6px 10px 18px; }
  .side-logo .wordmark { font-size: 24px; }
  .side-badge { font-size: 12px; font-weight: 600; color: var(--muted); }
  .me-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; margin-bottom: 10px; border-radius: 12px;
    background: var(--bg); border: 1px solid var(--border);
    transition: border-color 150ms, background-color 150ms;
  }
  .me-card:hover { border-color: var(--accent); }
  .me-card .me-avatar { width: 40px; height: 40px; font-size: 16px; }
  .me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .me-text strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .me-text span { font-size: 13px; color: var(--accent); font-weight: 600; }
  .me-card > .i { width: 16px; height: 16px; color: var(--muted); }
  .side-new {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 42px; margin-bottom: 14px; border-radius: 10px;
    background: var(--accent); color: var(--accent-text); font-weight: 700;
    transition: background-color 150ms, transform 150ms var(--ease);
  }
  .side-new:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
  .side-new:active { transform: scale(0.98); }
  .side-new .i { width: 18px; height: 18px; stroke-width: 2.6; }
  .side-item {
    display: flex; align-items: center; gap: 12px; width: 100%;
    height: 42px; padding: 0 10px; border-radius: 10px; font-size: 15px; color: var(--text);
    transition: background-color 150ms;
  }
  .side-item .i { width: 22px; height: 22px; }
  .side-item:hover { background: color-mix(in srgb, var(--text) 6%, transparent); }
  .side-item[aria-current] { font-weight: 700; background: color-mix(in srgb, var(--text) 8%, transparent); }
  .side-item[aria-current] .i { stroke-width: 2.6; }
  .side-item .count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 11px; background: var(--accent); color: var(--accent-text); font-size: 12px; font-weight: 700; text-align: center; }
  .side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
  .view { margin-left: 256px; max-width: 780px; padding: 40px 48px 80px; }
  .view-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
  .view-head h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
}
@media (min-width: 1360px) { .view { margin-left: max(256px, calc(50vw - 390px)); } }
.view-head { display: none; }
@media (min-width: 900px) { .view-head { display: flex; } }

/* sections */
.section { margin-bottom: 28px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.section-title a, .section-title button { color: var(--accent); font-weight: 600; font-size: 13px; }
.card { border: 1px solid var(--border); border-radius: 14px; padding: 4px 16px; }
.card + .card { margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }

/* overview */
.hero { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.hero .me-avatar { width: 72px; height: 72px; font-size: 28px; }
.hero-main { flex: 1; min-width: 0; }
.hero-main h3 { margin: 0; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.hero-main h3 .i { width: 16px; height: 16px; color: var(--accent); }
.hero-stats { display: flex; gap: 18px; margin-top: 6px; }
.hero-stats span { color: var(--muted); font-size: 13px; }
.hero-stats b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; margin-right: 3px; }
.create { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 28px; }
.create a {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--border); font-weight: 600;
  transition: border-color 150ms, background-color 150ms;
}
.create a:hover { border-color: var(--accent); }
.create a:active { background: var(--surface); }
.create a .i { color: var(--accent); }
.settings-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.settings-list > * {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 50px; padding: 0 14px; text-align: left;
  border-bottom: 1px solid var(--border);
  transition: background-color 150ms;
}
.settings-list > *:last-child { border-bottom: 0; }
.settings-list > *:hover { background: var(--panel); }
.settings-list .i { width: 20px; height: 20px; color: var(--muted); }
.settings-list span { flex: 1; }
.settings-list .chev { width: 16px; height: 16px; }
.settings-list .danger { color: var(--like); }
.settings-list .danger .i { color: var(--like); }
.hint-line { color: var(--muted); font-size: 13px; margin: -4px 0 10px; }
.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; border-radius: 10px; overflow: hidden; }
@media (min-width: 600px) { .mini-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mini-grid a, .mini-grid button { position: relative; aspect-ratio: 3 / 4; background: var(--surface) center/cover; display: block; }
.mini-grid .flag { position: absolute; top: 6px; right: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.6)); }
.mini-grid .flag .i { width: 16px; height: 16px; }
.mini-grid .expired { position: absolute; inset: auto 0 0 0; padding: 4px 6px; font-size: 11px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / 0.6)); text-align: left; }

/* composer */
.picker {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 220px; padding: 24px; border-radius: 16px;
  border: 2px dashed var(--border); text-align: center; cursor: pointer;
  transition: border-color 150ms, background-color 150ms;
}
.picker:hover, .picker.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.picker .i { width: 48px; height: 48px; stroke-width: 1.4; }
.picker strong { font-size: 17px; }
.picker span { color: var(--muted); font-size: 13px; }
.picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }

.thumbs { display: flex; min-width: 0; max-width: 100%; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.thumb { position: relative; flex: none; width: 120px; }
.thumb-img { width: 120px; aspect-ratio: 3 / 4; border-radius: 10px; background: var(--surface) center/cover; }
.thumb-tools { display: flex; justify-content: space-between; margin-top: 6px; }
.thumb-tools button { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--surface); }
.thumb-tools button:disabled { opacity: 0.35; }
.thumb-tools .i { width: 16px; height: 16px; }
.thumb .n { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.thumb input { margin-top: 6px; width: 100%; font-size: 12px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.add-more { flex: none; width: 120px; aspect-ratio: 3 / 4; border-radius: 10px; border: 2px dashed var(--border); display: grid; place-items: center; color: var(--muted); }

.progress { height: 4px; border-radius: 2px; background: var(--surface); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 200ms; }

/* lists */
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: 0; }
.item-thumb { width: 44px; height: 44px; flex: none; border-radius: 10px; background: var(--surface) center/cover; display: grid; place-items: center; color: var(--muted); }
.item-thumb.round { border-radius: 50%; }
.item-main { flex: 1; min-width: 0; }
.item-main strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-main span { display: block; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-main p { margin-top: 2px; white-space: pre-line; overflow-wrap: anywhere; }
.item-main .meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.item-tools { display: flex; gap: 2px; flex: none; }
.tool { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; color: var(--muted); }
.tool:hover { background: var(--surface); color: var(--text); }
.tool.del:hover { color: var(--like); }
.tool:disabled { opacity: 0.3; }
.tool .i { width: 18px; height: 18px; }
.item.off .item-main { opacity: 0.5; }
.item-main strong .tag, .tag { display: inline; width: auto; padding: 1px 6px; border-radius: 6px; font-size: 11px; font-weight: 700; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); margin-left: 6px; vertical-align: 1px; }

.edit-panel { padding: 12px 0 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }

.seg { display: flex; padding: 3px; border-radius: 10px; background: var(--surface); }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; }
.seg span { display: block; text-align: center; padding: 8px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg input:checked + span { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

.avatar-edit { display: flex; align-items: center; gap: 16px; }
.avatar-edit .item-thumb { width: 72px; height: 72px; font-size: 28px; font-weight: 600; }

.empty-note { color: var(--muted); padding: 20px 0; text-align: center; }

.hl-cover { display: flex; align-items: center; gap: 16px; }
.hl-cover .ring.big { width: 88px; height: 88px; border-radius: 50%; padding: 3px; border: 1px solid var(--border); flex: none; }
.hl-cover .ring.big span { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--surface) center/cover; }
.hl-cover-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.hl-strip { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 10px; }
.hl-strip button { flex: none; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hl-strip .ring { width: 64px; height: 64px; border-radius: 50%; padding: 2px; border: 1px solid var(--border); }
.hl-strip .ring span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--surface) center/cover; color: var(--muted); }
.hl-strip button[aria-pressed="true"] .ring { border: 2px solid var(--accent); }
.hl-strip small { font-size: 12px; font-weight: 600; max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

dialog.sheet { border: 0; border-radius: 16px; padding: 0; background: var(--bg); color: var(--text); box-shadow: var(--elev); }
dialog.sheet::backdrop { background: var(--scrim); }
.section-title .soft { font-weight: 400; color: var(--muted); }
.tag { white-space: nowrap; }
.create a { white-space: nowrap; }

/* ---------- motion and feedback ---------- */

/* Page changes: the next page settles in; a slim line shows when the network is slow. */
.view.view-in { animation: view-in 260ms var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
body.busy::before {
  content: ""; position: fixed; z-index: 70; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%; background-repeat: no-repeat;
  animation: busy 900ms ease-in-out infinite;
}
@keyframes busy { from { background-position: -40% 0; } to { background-position: 140% 0; } }

/* Bigger touch targets for the row and photo tools. */
.tool { width: 40px; height: 40px; transition: background-color 150ms, color 150ms; }
.tool:active { transform: scale(0.92); }
.thumb-tools button { width: 36px; height: 36px; transition: background-color 150ms; }
.thumb-tools button:hover:not(:disabled) { background: var(--surface-hover); }
.btn.small { height: 36px; }
@media (pointer: coarse) {
  .tool { width: 44px; height: 44px; }
  .thumb-tools button { width: 38px; height: 38px; }
  .thumb { width: 128px; }
  .thumb-img, .add-more { width: 128px; }
}
.btn { transition: background-color 150ms, transform 150ms var(--ease), opacity 150ms; }
.btn:active:not(:disabled) { transform: scale(0.98); }
.create a:active, .settings-list > *:active { transform: scale(0.99); }
.thumb { animation: fade 200ms ease-out; }

.item.collapsing { overflow: hidden; opacity: 0; padding-block: 0; border-bottom-width: 0; transition: height 240ms var(--ease), opacity 160ms, padding 240ms var(--ease); }

/* Toast with an action ("View") */
.toast.has-action { pointer-events: auto; display: flex; gap: 14px; align-items: center; }
.toast a { color: var(--bg); text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 900px) { .toast { margin-left: 128px; } }

/* ---------- sheets (confirmations, story options) ---------- */

dialog.sheet { width: min(400px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; animation: sheet-pop 240ms var(--ease); }
dialog.sheet::backdrop { animation: fade 200ms ease-out; }
dialog.sheet.leaving { animation: sheet-drop 180ms ease-in forwards; }
dialog.sheet.leaving::backdrop { animation: fade-out 180ms ease-in forwards; }
@keyframes sheet-pop { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes sheet-drop { to { opacity: 0; transform: translateY(12px); } }
@media (max-width: 899px) {
  /* Phones: a bottom sheet within thumb reach. */
  dialog.sheet {
    width: 100%; max-width: none; margin: auto 0 0; border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheet-up 320ms var(--ease);
  }
  dialog.sheet.leaving { animation: sheet-down 200ms ease-in forwards; }
  @keyframes sheet-up { from { transform: translateY(100%); } }
  @keyframes sheet-down { to { transform: translateY(100%); } }
  dialog.sheet::before { content: ""; display: block; width: 36px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--border); }
}
.ask form { display: flex; flex-direction: column; gap: 10px; padding: 22px 20px 20px; text-align: center; }
.ask h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.ask p { color: var(--muted); }
.ask-input { width: 100%; margin-top: 6px; padding: 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit; font-size: 16px; }
.ask-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.ask-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.btn.danger-fill { background: var(--like); color: #fff; }
.btn.danger-fill:hover { background: color-mix(in srgb, var(--like) 88%, #000); }
.sheet-body { padding: 20px; }
.sheet-photo { width: 100%; aspect-ratio: 9 / 16; max-height: 40vh; border-radius: 12px; background: #000 center / contain no-repeat; }
.sheet-btns { flex-direction: column; }
.sheet-btns .btn { width: 100%; }
.sheet-btns .i { width: 18px; height: 18px; }


/* ---------- story views, commenter faces, username ---------- */

.mini-grid .views, .story-row .views {
  position: absolute; top: 6px; left: 6px; display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px 2px 5px; border-radius: 10px; background: rgb(0 0 0 / 0.5); color: #fff;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.mini-grid .views .i, .story-row .views .i { width: 14px; height: 14px; }
.story-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.story-row::-webkit-scrollbar { display: none; }
.story-row button {
  position: relative; flex: none; width: 96px; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden;
  background: var(--surface) center / cover; transition: transform 150ms var(--ease);
}
.story-row button:active { transform: scale(0.97); }
.story-row .expired { position: absolute; inset: auto 0 0 0; padding: 14px 8px 6px; font-size: 11px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgb(0 0 0 / 0.6)); text-align: left; }
.hint-line a { color: var(--accent); font-weight: 600; }

.cmt-row { align-items: flex-start; }
.cmt-face { width: 40px; height: 40px; flex: none; border-radius: 50%; }
.post-thumb { width: 44px; height: 56px; flex: none; border-radius: 8px; background: var(--surface) center / cover; }

.settings-list em { font-style: normal; color: var(--muted); font-size: 14px; flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.handle-preview { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); }
.handle-preview .me-avatar { width: 56px; height: 56px; font-size: 22px; }
.handle-preview strong { display: block; font-size: 20px; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.handle-preview span:not(.me-avatar) { color: var(--muted); font-size: 13px; }
.at-input { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); transition: border-color 150ms, box-shadow 150ms; }
.at-input > span { padding-left: 12px; color: var(--muted); font-size: 16px; font-weight: 600; }
.field .at-input input { border: 0; box-shadow: none; padding-left: 4px; }
.at-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.field .hint.warn { color: var(--like); }
.bio-link-rows { display: grid; gap: 8px; margin-bottom: 8px; }
.bio-link-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; gap: 8px; align-items: center; }
@media (max-width: 520px) { .bio-link-row { grid-template-columns: minmax(0, 1fr) auto; } .bio-link-row [data-bio-url] { grid-column: 1; } .bio-link-row .tool { grid-row: 1 / span 2; grid-column: 2; } }
.field-link { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; }
.field-link span { flex: 1; font-size: 13px; font-weight: 600; color: var(--muted); }
.field-link strong { font-weight: 600; }
.field-link .i { width: 16px; height: 16px; color: var(--muted); }
.field-link:hover { border-color: var(--accent); }

.sheet-stat { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.sheet-stat .i { width: 18px; height: 18px; }
.sheet-stat small { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 13px; }

/* Login settings: numbered steps */
.steps ol { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.45; }
.steps .btn { width: 100%; }
.steps .btn .i { width: 18px; height: 18px; }
.steps { margin-top: 32px; }
.field > .hint { font-weight: 400; }

/* sidebar group labels */
.side-label { margin: 14px 10px 4px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }

/* your own comments in the list */
.me-face { background: var(--surface) center/cover; }

/* commenter icons */
.face-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 16px 12px; margin-top: 12px; }
.face { position: relative; display: flex; flex-direction: column; gap: 6px; }
.face.builtin { aspect-ratio: 1; }
.face-img { display: block; width: 100%; aspect-ratio: 1; padding: 0; border-radius: 50%; }
.face-name {
  width: 100%; min-width: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; text-align: center;
}
.face-name::placeholder { color: var(--muted); }
.face .face-pic { display: block; width: 100% !important; height: auto !important; aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: var(--surface); }
.face.builtin img { opacity: 0.55; }
.face-del {
  position: absolute; top: -6px; right: -6px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: var(--like); color: #fff;
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.25);
}
.face-del .i { width: 16px; height: 16px; stroke-width: 2.4; }

/* QR code */
.qr-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  max-width: 320px; margin: 8px auto 16px; padding: 24px; border-radius: 20px;
  background: #fff; color: #0c1014; border: 1px solid var(--border);
}
.qr-img { width: 100%; aspect-ratio: 1; margin-bottom: 12px; }
.qr-img svg { width: 100%; height: 100%; display: block; }
.qr-card strong { font-size: 18px; }
.qr-card span { color: #6b6f75; font-size: 14px; }

/* crop window */
.crop-sheet { max-width: 420px; }
.crop-stage { position: relative; width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #000; touch-action: none; cursor: grab; }
.crop-stage:active { cursor: grabbing; }
.crop-stage canvas { width: 100%; height: 100%; display: block; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.5); }
.crop-stage.round .crop-mask { border-radius: 50%; box-shadow: 0 0 0 999px rgb(0 0 0 / 0.5), inset 0 0 0 1px rgb(255 255 255 / 0.6); }
.crop-zoom { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.crop-zoom .i { width: 16px; height: 16px; flex: none; }
.crop-zoom .i:last-child { width: 22px; height: 22px; }
.crop-zoom input { flex: 1; accent-color: var(--accent); }

/* a cropped face (GIF): the image is positioned inside a round window */
.face-crop { position: relative; display: block; overflow: hidden; border-radius: 50%; flex: none; background: var(--surface); }
.face-crop img { position: absolute; max-width: none; }

/* ---------- music picker ---------- */
.mu-results { display: flex; flex-direction: column; gap: 2px; max-height: 52vh; overflow-y: auto; margin: 4px 0; }
.mu-item { display: flex; align-items: center; gap: 4px; }
.mu-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 6px; border-radius: 10px; text-align: left; }
.mu-pick:hover { background: var(--surface); }
.mu-item .tool.playing { color: var(--accent); }
.mu-art { flex: none; width: 44px; height: 44px; border-radius: 6px; background: var(--surface) center/cover; }
.mu-text { min-width: 0; display: flex; flex-direction: column; }
.mu-text strong, .mu-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mu-text strong { font-weight: 600; font-size: 14px; }
.mu-text span { color: var(--muted); font-size: 13px; }
.mu-picked { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--border); border-radius: 12px; }
.mu-picked .mu-text { flex: 1; }

/* ---------- mood picker ---------- */
.md-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.md-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px 6px;
  border: 1px solid transparent; border-radius: 12px; font-size: 12px; color: var(--muted); background: none;
}
.md-opt .mood-ico { width: 34px; height: 34px; }
.md-opt:hover { background: var(--surface); }
.md-opt[aria-checked="true"] { border-color: var(--accent); color: var(--text); font-weight: 600; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.md-word { margin-top: 12px; }
.cz-mood-sample { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 2px; }
.cz-mood-sample .mood-ico { width: 30px; height: 30px; }

/* ---------- stats ---------- */
.stat-range { margin-bottom: 16px; }
.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
@media (min-width: 720px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
.stat-tiles > div { padding: 14px; border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.stat-tiles b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-tiles span { color: var(--muted); font-size: 13px; }
.stat-chart { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding: 8px 0 0; }
.stat-chart i { flex: 1; min-width: 1px; border-radius: 3px 3px 0 0; background: var(--accent); opacity: 0.85; }
.stat-chart i:hover { opacity: 1; }
.stat-chart i.zero { height: 2px !important; background: var(--border); opacity: 1; }
.stat-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 6px; }
.stat-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.stat-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.stat-row:last-child { border-bottom: 0; }
a.stat-row:hover { background: var(--surface); }
.stat-row b { font-variant-numeric: tabular-nums; }
.stat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-name small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.stat-thumb { flex: none; width: 36px; height: 48px; border-radius: 4px; background: var(--surface) center/cover; }

/* ---------- storage ---------- */
.unused-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; margin: 8px 0 14px; }
.unused { position: relative; aspect-ratio: 1; cursor: pointer; }
.unused input { position: absolute; top: 6px; right: 6px; z-index: 1; width: 20px; height: 20px; accent-color: var(--like); }
.unused span { position: absolute; inset: 0; border-radius: 8px; background: var(--surface) center/cover; transition: opacity 150ms; }
.unused input:not(:checked) + span { opacity: 0.35; }
.card + .hint-line { margin-top: 10px; }
.unused.tall { aspect-ratio: 9 / 16; }

/* ---------- story polls and reactions ---------- */
.poll-field { border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; }
.poll-field[open] { padding-bottom: 14px; }
.poll-field summary { display: flex; align-items: center; gap: 8px; padding: 12px 0; font-weight: 600; cursor: pointer; list-style: none; }
.poll-field summary::-webkit-details-marker { display: none; }
.poll-field .field { margin-bottom: 10px; }
.poll-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.poll-field .hint { font-size: 12px; color: var(--muted); }
.sheet-reacts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.sheet-reacts span { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 14px; background: var(--surface); font-size: 15px; }
.sheet-reacts b { font-size: 13px; font-weight: 600; }
.sheet-poll { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.sheet-poll small { color: var(--muted); font-size: 12px; }
.sheet-poll-row { position: relative; overflow: hidden; display: flex; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 8px; background: var(--surface); font-size: 14px; }
.sheet-poll-row::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--pct); background: color-mix(in srgb, var(--accent) 22%, transparent); }
.sheet-poll-row span, .sheet-poll-row b { position: relative; }

.vid-len { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border-radius: 10px; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 11px; font-weight: 600; }
.vid-len .i { width: 10px; height: 10px; fill: #fff; stroke: #fff; }
.thumb-img { position: relative; }

.setup-card { padding: 16px 18px; margin-bottom: 20px; }
.setup-card h3 { margin: 0 0 6px; font-size: 16px; }
.setup-card p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.setup-card ol { margin: 0 0 12px; padding-left: 20px; font-size: 14px; line-height: 1.55; }
.setup-card li + li { margin-top: 4px; }

/* drafts and scheduling */
.when-card { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px 4px; display: grid; gap: 12px; }
.when-card [data-when] { display: grid; gap: 12px; }
.when-card .hint-line { margin: 0; }
[data-when] { display: grid; gap: 12px; }
[data-when] .hint-line { margin: 0; }
.when-status { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.when-status .i { width: 18px; height: 18px; color: var(--accent); }

/* links */
.item-main .taps { font-size: 12px; color: var(--muted); }
.item-thumb .site-ico { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }

/* links: type picker and Links tab backgrounds */
.seg-wrap { flex-wrap: wrap; }
.seg-wrap label { flex: 1 0 auto; }
.seg-wrap span { padding: 8px 10px; }
.edit-panel .kind-hint { margin: 0; }
.theme-pick { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.theme-pick label { display: grid; justify-items: center; gap: 6px; cursor: pointer; flex: none; }
.theme-pick input { position: absolute; opacity: 0; }
.theme-pick .sw { width: 52px; height: 72px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); transition: box-shadow 150ms; }
.theme-pick input:checked + .sw { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.theme-pick input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 4px; }
.theme-pick em { font-style: normal; font-size: 12px; color: var(--muted); }
.sw[data-sw="midnight"] { background: radial-gradient(120% 80% at 80% 0%, #6d28d9 0%, transparent 60%), linear-gradient(160deg, #1e0b3d, #0b0620 70%); }
.sw[data-sw="sunset"] { background: linear-gradient(165deg, #ff8a5b, #e0457b 55%, #6b2d8f); }
.sw[data-sw="ocean"] { background: linear-gradient(165deg, #22b8cf, #1c64d1 55%, #182a6b); }
.sw[data-sw="forest"] { background: linear-gradient(165deg, #5f9c62, #2f6a4f 55%, #16302a); }
.sw[data-sw="mono"] { background: linear-gradient(165deg, #3a3a3a, #111); }
.sw[data-sw="blush"] { background: linear-gradient(165deg, #ffe1e8, #f7b8cf 55%, #d892b4); }

/* activity feed */
.act-list { display: grid; }
.act-day { margin: 18px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.act-day:first-child { margin-top: 4px; }
.act-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; border-radius: 12px; text-align: left; width: calc(100% + 16px); color: inherit; }
.act-row:hover { background: var(--surface); }
.act-row.new { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.act-ico { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface); }
.act-ico .i { width: 18px; height: 18px; }
.act-ico.like .i { color: var(--like); }
.act-ico.follower .i, .act-ico.subscriber .i { color: var(--accent); }
.act-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.act-text strong { font-weight: 600; }
.act-text small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.act-thumb { width: 44px; height: 44px; flex: none; border-radius: 8px; background: var(--surface) center/cover; }
.settings-list em[data-activity-count] { background: var(--accent); color: var(--accent-text); border-radius: 11px; padding: 1px 8px; font-size: 12px; font-weight: 700; }

/* post insights */
.insights { display: grid; gap: 10px; }
.insights .section-title { margin: 0; }
.stat-chart.small { height: 64px; }

/* Sign in with Apple */
.apple-btn { background: #000; color: #fff; gap: 8px; }
.apple-btn:hover { background: #222; }
:root[data-theme="dark"] .apple-btn { background: #fff; color: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .apple-btn { background: #fff; color: #000; } }
.apple-logo { width: 16px; height: 19px; margin-top: -2px; }
.apple-login { display: grid; gap: 12px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* navigation: four places (Home, Content, Audience, Settings); each hub's pages nest under it */
.tab-icon { position: relative; display: grid; }
.tab-icon .dot {
  position: absolute; top: -4px; left: 15px; min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  border-radius: 8px; border: 2px solid var(--bg); background: var(--accent); color: var(--accent-text);
  font-size: 10px; font-weight: 700; line-height: 12px; text-align: center; font-variant-numeric: tabular-nums;
}
.side-subs { display: none; }
.crumb { display: none; }
@media (min-width: 900px) {
  .side-item[aria-current="true"] { background: none; }
  .side-group.open .side-subs { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 8px 21px; padding-left: 10px; border-left: 1px solid var(--border); }
  .side-sub {
    display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 8px;
    font-size: 14px; color: var(--muted); transition: background-color 150ms, color 150ms;
  }
  .side-sub:hover { color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
  .side-sub[aria-current] { color: var(--text); font-weight: 700; background: color-mix(in srgb, var(--text) 8%, transparent); }
  .side-sub .count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 700; text-align: center; }
  .side-group.open > .side-item .count { display: none; }
  .crumb {
    display: inline-flex; align-items: center; gap: 4px; margin: -18px 0 6px -4px; padding: 4px 6px 4px 2px; border-radius: 6px;
    font-size: 14px; font-weight: 600; color: var(--muted); transition: color 150ms;
  }
  .crumb:hover { color: var(--text); }
  .crumb .i { width: 16px; height: 16px; }
}

/* home */
.glance {
  display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 14px; border: 1px solid var(--border); border-radius: 12px;
  transition: background-color 150ms;
}
.glance:hover { background: var(--panel); }
.glance span { color: var(--muted); font-size: 13px; }
.glance b { display: block; color: var(--text); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.settings-list em.pill { background: var(--accent); color: var(--accent-text); border-radius: 11px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.view-head .btn .i { width: 16px; height: 16px; }

/* bigger screens: overview pages spread into columns */
.rail-only { display: none; }
@media (min-width: 700px) {
  .hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; align-items: start; }
}
@media (min-width: 900px) and (max-width: 1279px) {
  .side { width: 232px; }
  .view { margin-left: 232px; padding: 36px 36px 80px; }
}
@media (min-width: 1024px) {
  .view.wide { max-width: 1180px; }
  .home-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: 0 40px; align-items: start; }
  .home-rail { position: sticky; top: 36px; }
  .rail-only { display: block; }
  .home-rail .glance { flex-direction: column; gap: 14px; }
  .home-rail .glance span { display: flex; align-items: baseline; gap: 8px; }
  .home-rail .glance b { display: inline; min-width: 2.5ch; }
  .rail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-rail .mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content-grid { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 0 40px; align-items: start; }
  .content-side { position: sticky; top: 36px; }
  .content-side .mini-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hub-grid { gap: 0 32px; }
}
@media (min-width: 1280px) {
  .view.wide { margin-left: max(256px, calc(256px + (100vw - 256px - 1180px) / 2)); }
  .content-posts .mini-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1600px) {
  .content-posts .mini-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.link-thumb-field .avatar-edit .item-thumb { width: 48px; height: 48px; border-radius: 50%; }

/* Content: select several posts to delete them together. */
.sel-head { display: inline-flex; align-items: baseline; gap: 12px; }
.pick-mark {
  position: absolute; right: 6px; top: 6px; z-index: 2; display: none; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #fff; background: rgb(0 0 0 / 0.25); color: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.4);
}
.pick-mark .i { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.mini-grid.selecting .pick-mark { display: grid; }
.mini-grid.selecting .flag { display: none; }
.mini-grid.selecting > * { transition: opacity 150ms; }
.mini-grid.selecting > :not(.picked) { opacity: 0.75; }
.mini-grid .picked .pick-mark { background: var(--accent); border-color: var(--accent); }
.mini-grid .picked .pick-mark .i { opacity: 1; }
.mini-grid .picked::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 3px var(--accent); pointer-events: none; }
.select-bar {
  position: sticky; z-index: 15; bottom: calc(68px + env(safe-area-inset-bottom));
  display: flex; gap: 8px; margin-top: 12px; padding: 10px;
  border-radius: 14px; background: var(--bg); box-shadow: var(--elev, 0 4px 20px rgb(0 0 0 / 0.15)), 0 0 0 1px var(--border);
}
.select-bar .btn { flex: 1; }
.select-bar [data-sel-delete] { flex: 1.4; }
.select-bar [data-sel-delete]:not(:disabled) { background: var(--like); color: #fff; }
.select-bar [data-sel-delete]:disabled { opacity: 0.5; }
@media (min-width: 900px) { .select-bar { bottom: 16px; } }

/* Choose a video's cover */
.cover-stage { position: relative; align-self: center; height: min(46vh, 460px); width: auto; max-width: 100%; border-radius: 12px; overflow: hidden; background: #000; }
.cover-stage video, .cover-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-stage.is-photo video { visibility: hidden; }
.cover-scrub { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.cover-scrub input { width: 100%; }
.cover-photo { justify-content: center; }
.cover-btn { position: absolute; left: 6px; right: 6px; top: 6px; padding: 4px 6px; border-radius: 8px; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 11px; font-weight: 600; }
.cover-btn:disabled { opacity: 0.6; }

/* notifications: a bell in the top bar (phone) or sidebar (bigger screens) opens a small panel */
.bell {
  position: relative; display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%; color: var(--text);
  transition: background-color 150ms;
}
.bell:hover, .bell[aria-expanded="true"] { background: color-mix(in srgb, var(--text) 7%, transparent); }
.bell .i { width: 24px; height: 24px; }
.bell-count {
  position: absolute; top: 3px; left: 21px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 9px; border: 2px solid var(--bg); background: var(--like); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 14px; text-align: center; font-variant-numeric: tabular-nums;
}
.side .bell-count { border-color: var(--panel); }
.bar .bell { margin-right: 4px; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 12px; }
.side-top .side-logo { padding-bottom: 6px; }

.notif {
  position: fixed; z-index: 60; display: flex; flex-direction: column;
  max-height: min(72vh, 580px); overflow: hidden;
  background: var(--bg); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.16), 0 2px 8px rgb(0 0 0 / 0.08);
  transform-origin: top center;
}
.notif[hidden] { display: none; }
.notif-in { animation: notif-in 180ms var(--ease); }
@keyframes notif-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 6px; }
.notif-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.notif-read { color: var(--accent); font-weight: 600; font-size: 14px; padding: 6px 2px; }
.notif-read:hover { text-decoration: underline; text-underline-offset: 3px; }
.notif-list { overflow-y: auto; overscroll-behavior: contain; padding: 2px 8px 8px; }
.notif-list .act-row { margin: 0; width: 100%; }
.notif-list .empty-note { padding: 28px 16px; }
.notif-foot {
  display: grid; place-items: center; min-height: 46px; flex: none;
  border-top: 1px solid var(--border); color: var(--accent); font-weight: 600; font-size: 14px;
}
.notif-foot:hover { background: var(--panel); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .notif { box-shadow: 0 16px 40px rgb(0 0 0 / 0.6); background: #121417; } }
:root[data-theme="dark"] .notif { box-shadow: 0 16px 40px rgb(0 0 0 / 0.6); background: #121417; }

/* Links: the builder from the Links tab, framed */
.lb-frame { margin: 0 -16px; overflow: hidden; background: var(--bg); height: calc(100dvh - 190px); min-height: 420px; }
.lb-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
@media (min-width: 768px) {
  .lb-frame { margin: 0; border: 1px solid var(--border); border-radius: 18px; }
}
/* Big screens: the studio inside the frame has its own tiles and panels, like the Stats page. */
@media (min-width: 1000px) {
  .lb-frame { border: 0; border-radius: 0; margin: -6px -8px 0; height: calc(100dvh - 140px); }
}

/* Detailed stats */
@media (min-width: 720px) { .stat-tiles { grid-template-columns: repeat(5, 1fr); } }
.stat-series { margin-bottom: 8px; flex-wrap: wrap; }
.stat-series span { padding: 6px 4px; font-size: 12px; }
.stat-row.share { position: relative; isolation: isolate; }
.stat-row.share::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--pct); background: color-mix(in srgb, var(--accent) 12%, transparent); z-index: -1; }
.stat-row em { font-style: normal; color: var(--muted); font-size: 12px; width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
.stat-axis span { flex: 1; text-align: center; }
.stat-axis span:first-child { text-align: left; }
.stat-axis span:last-child { text-align: right; }
.visit { border-bottom: 1px solid var(--border); }
.visit:last-child { border-bottom: 0; }
.visit summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
.visit summary::-webkit-details-marker { display: none; }
.visit[open] summary, .visit summary:hover { background: var(--surface); }
.visit-flag { font-size: 22px; line-height: 1; flex: none; }
.visit-meta { flex: none; text-align: right; font-size: 13px; }
.visit-meta small { display: block; color: var(--muted); font-size: 12px; }
.visit-body { padding: 4px 14px 14px; display: grid; gap: 10px; }
.visit-body p { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.visit .chip { padding: 3px 8px; border-radius: 999px; background: var(--surface); font-size: 12px; color: var(--muted); }
.trail-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.trail { padding: 4px 9px; border-radius: 8px; border: 1px solid var(--border); font-size: 12px; color: inherit; text-decoration: none; }
.trail.post { width: 30px; height: 40px; padding: 0; border-radius: 4px; background: var(--surface) center/cover; }
@media (min-width: 720px) { .stat-tiles.four { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 719px) {
  .stat-tiles:not(.four) { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat-tiles:not(.four) > div { padding: 10px 12px; }
  .stat-tiles:not(.four) b { font-size: 19px; }
  .stat-tiles:not(.four) span { font-size: 12px; }
}

/* ---------- new post composer ---------- */
.composer { display: flex; flex-direction: column; gap: 16px; }
.cmp-empty {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  min-height: min(60vh, 460px); padding: 32px 20px; border: 2px dashed var(--border); border-radius: 18px; cursor: pointer;
  transition: border-color 150ms, background-color 150ms;
}
.cmp-empty:hover, .composer.drag .cmp-empty { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.cmp-empty-art { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--surface); color: var(--accent); }
.cmp-empty-art .i { width: 40px; height: 40px; stroke-width: 1.5; }
.cmp-empty strong { font-size: 18px; }
.cmp-empty small { color: var(--muted); font-size: 13px; max-width: 320px; }
.cmp-empty input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.composer.adding .cmp-empty strong::after { content: "…"; }
.cmp-body { display: grid; gap: 20px; }
.cmp-body[hidden] { display: none; }
.cmp-media { display: grid; gap: 10px; min-width: 0; align-content: start; }
.composer.drag .cmp-media { outline: 2px dashed var(--accent); outline-offset: 6px; border-radius: 14px; }
.cmp-preview { position: relative; display: grid; place-items: center; background: var(--surface); border-radius: 14px; overflow: hidden; aspect-ratio: 4 / 5; max-height: 56vh; width: 100%; }
@supports (height: 1dvh) { .cmp-preview { aspect-ratio: auto; height: min(125vw, 56dvh); } }
.cmp-preview img { width: 100%; height: 100%; object-fit: contain; }
.cmp-cover { position: absolute; left: 10px; bottom: 10px; background: rgb(0 0 0 / 0.65) !important; color: #fff !important; }
.cmp-preview img[data-gridcrop] { cursor: zoom-in; }
.cmp-gridcrop { position: absolute; right: 10px; bottom: 10px; gap: 8px; padding-left: 6px; background: rgb(0 0 0 / 0.65) !important; color: #fff !important; }
.grid-peek { position: relative; display: inline-block; isolation: isolate; contain: paint; flex: none; width: 21px; aspect-ratio: 3 / 4; border-radius: 3px; overflow: hidden; background: #000; box-shadow: 0 0 0 1px rgb(255 255 255 / 0.6); }
.grid-peek img { width: 100%; height: 100%; object-fit: cover; }
.grid-crop-row { display: block; }
.btn.cmp-gridcrop-inline {
  display: flex; align-items: center; justify-content: flex-start; gap: 14px; width: 100%; height: auto;
  padding: 10px 14px 10px 10px; text-align: left; border: 1px solid var(--border); border-radius: 12px; background: var(--bg);
}
.btn.cmp-gridcrop-inline:hover { background: var(--surface); }
.cmp-gridcrop-inline .grid-peek { width: 42px; border-radius: 6px; box-shadow: 0 0 0 1px var(--border); }
.cmp-gridcrop-inline > span:last-child { display: grid; gap: 2px; flex: 1; min-width: 0; }
.cmp-gridcrop-inline small { font-weight: 400; color: var(--muted); font-size: 13px; }
.cmp-of { position: absolute; top: 10px; right: 10px; padding: 3px 9px; border-radius: 12px; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 12px; font-weight: 600; }
.cmp-strip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 4px 6px; min-width: 0; scrollbar-width: thin; }
.cmp-thumb { position: relative; flex: none; width: 76px; touch-action: pan-x; }
.cmp-pic { display: block; width: 76px; aspect-ratio: 3 / 4; border-radius: 10px; background: var(--surface) center/cover; position: relative; outline: 2px solid transparent; outline-offset: 2px; transition: outline-color 150ms; cursor: grab; }
.cmp-thumb.on .cmp-pic { outline-color: var(--accent); }
.cmp-pic .n { position: absolute; top: 4px; left: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: rgb(0 0 0 / 0.6); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.cmp-pic .vid-len { left: 4px; bottom: 4px; }
.cmp-x {
  position: absolute; top: -6px; right: -6px; z-index: 2; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--like); color: #fff; border: 2px solid var(--bg);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.25);
}
.cmp-x::before { content: ""; position: absolute; inset: -8px; }
.cmp-x .i { width: 13px; height: 13px; stroke-width: 3; }
.cmp-thumb .cover-btn { top: auto; bottom: 4px; left: 4px; right: 4px; padding: 2px 4px; font-size: 10px; }
.cmp-thumb:has(.cover-btn) .vid-len { display: none; }
.cmp-add { flex: none; width: 76px; aspect-ratio: 3 / 4; border-radius: 10px; border: 2px dashed var(--border); display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.cmp-add:hover { border-color: var(--accent); color: var(--accent); }
.cmp-ghost .cmp-pic { opacity: 0.35; }
.cmp-drag .cmp-pic, .cmp-chosen .cmp-pic { box-shadow: 0 10px 24px rgb(0 0 0 / 0.3); transform: scale(1.06); }
.cmp-drag .cmp-x { display: none; }
.cmp-hint { margin: 0; }
.cmp-form { display: grid; gap: 14px; align-content: start; min-width: 0; }
.cmp-caption { position: relative; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px 26px; }
.cmp-caption:focus-within { border-color: var(--accent); }
.cmp-caption textarea { width: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 16px; line-height: 1.45; resize: none; min-height: 96px; outline: none; }
.cmp-count { position: absolute; right: 12px; bottom: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cmp-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cmp-tags[hidden] { display: none; }
.cmp-tags button { padding: 5px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 13px; font-weight: 600; }
.cmp-rows { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.cmp-row + .cmp-row { border-top: 1px solid var(--border); }
.cmp-row summary { display: flex; align-items: center; gap: 12px; padding: 13px 14px; cursor: pointer; list-style: none; font-weight: 600; }
.cmp-row summary::-webkit-details-marker { display: none; }
.cmp-row summary:hover { background: var(--surface); }
.cmp-row summary > .i:first-child { width: 20px; height: 20px; color: var(--muted); }
.cmp-row summary span { flex: 1; }
.cmp-row summary em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 14px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-row summary > .i:last-child { width: 16px; height: 16px; color: var(--muted); transition: rotate 200ms var(--ease); }
.cmp-row[open] summary > .i:last-child { rotate: 180deg; }
.cmp-row-body { display: grid; gap: 10px; padding: 2px 14px 14px; }
.cmp-row-body > input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); font: inherit; font-size: 16px; }
.cmp-row-body .switch { padding: 8px 0; }
.cmp-row-body .switch[hidden] { display: none; }
.cmp-go { width: 100%; }
.composer.busy-sharing .cmp-strip, .composer.busy-sharing .cmp-preview .cmp-cover { pointer-events: none; opacity: 0.6; }

/* iPad and desktop: New Post opens as a window over the page */
dialog.composer-sheet {
  width: min(1060px, calc(100vw - 48px)); height: min(780px, calc(100dvh - 48px)); max-width: none; max-height: none;
  padding: 0; border: 0; border-radius: 18px; background: var(--bg); color: var(--text); box-shadow: var(--elev); overflow: hidden;
  animation: sheet-pop 240ms var(--ease);
}
dialog.composer-sheet::backdrop { background: var(--scrim); animation: fade 200ms ease-out; }
.composer-root { height: 100%; display: flex; flex-direction: column; gap: 0; }
.cmp-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); flex: none; }
.cmp-head h2 { margin: 0; font-size: 16px; }
.cmp-cancel { justify-self: start; padding: 8px 6px; color: var(--muted); font-weight: 600; }
.cmp-share { justify-self: end; padding: 8px 6px; color: var(--accent); font-weight: 700; }
.cmp-share:disabled { opacity: 0.4; }
.composer-root .cmp-empty { margin: 18px; flex: 1; min-height: 0; }
.composer-root .cmp-body { flex: 1; min-height: 0; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 0; }
.composer-root .cmp-media { padding: 18px; overflow: auto; border-right: 1px solid var(--border); }
.composer-root .cmp-preview { max-height: none; aspect-ratio: auto; height: min(520px, calc(100dvh - 300px)); }
.composer-root .cmp-form { padding: 18px; overflow: auto; display: flex; flex-direction: column; }
.composer-root .cmp-form > * { flex: none; }
.composer-root .cmp-go { display: none; }
@media (max-width: 899px) {
  .composer-root .cmp-body { grid-template-columns: 1fr; overflow: auto; }
  .composer-root .cmp-media { border-right: 0; overflow: visible; }
  .composer-root .cmp-form { overflow: visible; padding-top: 0; }
  .composer-root .cmp-preview { height: min(440px, 50dvh); }
}
/* Phone page: preview, then the strip, then the form */
@media (min-width: 900px) {
  .view .composer:not(.composer-root) .cmp-body { grid-template-columns: minmax(0, 1.2fr) minmax(300px, 1fr); align-items: start; }
}

/* Messages inbox */
.msg-list { display: grid; gap: 10px; }
.msg-card { padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); }
.msg-card.new { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 5%, var(--bg)); }
.msg-card header { display: flex; align-items: center; gap: 10px; }
.msg-card header strong { display: block; }
.msg-card header small { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.msg-card.new header strong::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.msg-card > p { margin: 10px 0 12px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.msg-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.msg-tools .hint-line { margin: 0; font-size: 13px; }

/* Profile background picker */
.pbg-preview {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; margin-top: 6px;
  background: var(--surface); color: var(--text); transition: background 200ms;
}
.pbg-preview[data-tone="light"] { color: #17130f; }
.pbg-preview[data-tone="dark"] { color: #fff; }
.pbg-av { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--bg) center / cover; color: var(--muted); font-weight: 700; font-size: 20px; }
.pbg-preview strong { display: block; font-size: 15px; }
.pbg-preview small { display: block; opacity: 0.7; font-size: 13px; }
.pbg-btns { display: flex; gap: 6px; margin-top: 8px; }
.pbg-btns i { font-style: normal; font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 8px; background: rgb(255 255 255 / 0.4); }
.pbg-btns i:first-child { background: #3346f0; color: #fff; }
.pbg-preview[data-tone="dark"] .pbg-btns i { background: rgb(255 255 255 / 0.16); }
.pbg-preview[data-tone="dark"] .pbg-btns i:first-child { background: #fff; color: #111; }
.pbg-swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pbg-sw {
  width: 36px; height: 36px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  background: linear-gradient(160deg, var(--a), var(--b)); box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1);
  outline: 2px solid transparent; outline-offset: 2px; transition: outline-color 150ms, transform 150ms var(--ease);
}
.pbg-sw:active { transform: scale(0.92); }
.pbg-sw[aria-checked="true"] { outline-color: var(--accent); }
.pbg-sw.none { display: grid; place-items: center; background: var(--surface); color: var(--muted); }
.pbg-sw.none .i { width: 16px; height: 16px; }
.pbg-custom { display: flex; gap: 16px; margin-top: 12px; }
.pbg-custom label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.pbg-custom input[type=color] { width: 40px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; }
.pbg-sw.custom { display: grid; place-items: center; color: #fff; } .pbg-sw.custom .i { width: 15px; height: 15px; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 0.4)); }

/* Profile background preview: the card on the tinted page, with a hint of the grid */
.pbg-stage { margin-top: 6px; padding: 12px; border-radius: 18px; background: var(--surface); transition: background 200ms; }
.pbg-stage .pbg-preview { margin-top: 0; }
.pbg-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-top: 10px; }
.pbg-tiles i { height: 34px; border-radius: 4px; background: rgb(127 127 127 / 0.22); }
.pbg-sw.auto { display: grid; place-items: center; background: conic-gradient(#f0a15a, #f6a9c2, #bfb0f4, #93cdf5, #9fe0c5, #e8c25a, #f0a15a); }
.pbg-sw.auto span { font-size: 10px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / 0.45); }
/* Background extras: gradient style, header photo, film grain */
.pbg-styles { margin-top: 12px; }
.pbg-styles button { flex: 1; padding: 8px; border: 0; border-radius: 8px; background: none; font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.pbg-styles button[aria-checked="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.pbg-photo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.pbg-photo .hint { flex-basis: 100%; margin: 0; }
.pbg-grain { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; }
.pbg-grain small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.pbg-sw.photo { display: grid; place-items: center; background: var(--surface); color: var(--muted); }
.pbg-sw.photo .i { width: 16px; height: 16px; }
.pbg-sw.photo.has .i { display: none; }
.pbg-preview { position: relative; isolation: isolate; }
.pbg-preview.grain::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; background: var(--grain); opacity: 0.32; mix-blend-mode: overlay; }

/* Edit Profile sections */
#profile-form .pf-title { margin: 18px 0 -4px; font-size: 15px; color: var(--text); }
#profile-form .pf-title:first-child { margin-top: 0; }
.social-row-edit { grid-template-columns: 96px minmax(0, 1fr) auto; }
.social-site { align-self: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
@media (max-width: 520px) { .social-row-edit { grid-template-columns: minmax(0, 1fr) auto; } .social-row-edit [data-social-url] { grid-column: 1; } .social-site { font-size: 13px; color: var(--muted); } }

/* ---------- Stats ----------
   One story from top to bottom: a sentence that sums it up, the numbers that matter with a chart
   you can scrub, how engaged people were, then grouped cards (where from, what they opened,
   what they use, when, how long) and the latest visits. */
.stx { --good: #1a7f37; --card-pad: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; transition: opacity 200ms; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stx { --good: #4ac26b; } }
:root[data-theme="dark"] .stx { --good: #4ac26b; }
.stx-loading .stx { opacity: 0.55; pointer-events: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.stx-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.stx-range { flex: 1 1 100%; }
@media (min-width: 700px) { .stx-range { flex: 0 1 460px; } }
.stx-live { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.stx-live i { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.stx-live i::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--good); animation: stx-ping 2s var(--ease) infinite; }
@keyframes stx-ping { 0% { transform: scale(1); opacity: 0.6; } 80%, 100% { transform: scale(2.6); opacity: 0; } }

.stx-summary { margin: 4px 0 0; font-size: 17px; line-height: 1.5; letter-spacing: -0.01em; color: var(--muted); max-width: 62ch; text-wrap: pretty; }
.stx-summary b { color: var(--text); font-weight: 650; }
.stx-summary b.up { color: var(--good); }
@media (min-width: 900px) { .stx-summary { font-size: 19px; } }

/* Overview: the headline numbers are the chart's tabs. */
.stx-overview, .stx-card, .stx-engage { border: 1px solid var(--border); border-radius: 16px; background: var(--bg); }
.stx-overview { padding: 0 var(--card-pad) var(--card-pad); }
.stx-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .stx-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stx-metric {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0;
  padding: 16px 4px 12px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.stx-metric::before { content: ""; position: absolute; left: 4px; right: 12px; top: -1px; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 300ms var(--ease); }
.stx-metric[aria-selected="true"]::before { transform: scaleX(1); }
.stx-metric:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 10px; }
.stx-mlabel { font-size: 13px; font-weight: 600; color: var(--muted); transition: color 150ms; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stx-metric[aria-selected="true"] .stx-mlabel, .stx-metric:hover .stx-mlabel { color: var(--text); }
.stx-mvalue { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
@media (min-width: 900px) { .stx-mvalue { font-size: 32px; } }
.stx-delta { font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.stx-delta.up { color: var(--good); }
/* the smaller numbers under the chart */
.stx-metrics.small { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
@media (min-width: 700px) { .stx-metrics.small { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.stx-metric.small { padding: 9px 10px; border-radius: 10px; background: var(--surface); gap: 0; transition: background-color 150ms, box-shadow 150ms; }
.stx-metric.small::before { display: none; }
.stx-metric.small:hover { background: var(--surface-hover); }
.stx-metric.small[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--bg)); box-shadow: inset 0 0 0 1.5px var(--accent); }
.stx-metric.small .stx-mlabel { font-size: 12px; font-weight: 500; order: 2; white-space: normal; line-height: 1.25; }
.stx-metric.small .stx-mvalue { font-size: 17px; letter-spacing: -0.01em; }
.stx-metric.small .stx-delta { display: none; }

/* The chart */
.stx-chart { margin-top: 6px; }
.stx-legend:empty { margin-bottom: 26px; }
.stx-legend { display: flex; gap: 16px; justify-content: flex-end; min-height: 18px; margin-bottom: 30px; font-size: 12px; flex-wrap: wrap; color: var(--muted); }
.stx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.stx .key { display: inline-block; flex: none; width: 14px; height: 2px; border-radius: 2px; background: var(--accent); }
.stx .key.prev { background: var(--muted); opacity: 0.55; }
.stx .key.soft { height: 8px; width: 8px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 35%, var(--bg)); }
.stx-splitkey .key.now { height: 8px; width: 8px; border-radius: 2px; }
.stx-plot { position: relative; height: 180px; margin-top: 4px; touch-action: pan-y; cursor: crosshair; outline: none; border-radius: 4px; }
@media (min-width: 900px) { .stx-plot { height: 240px; } }
.stx-plot:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.stx-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.stx-grid { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.stx-grid span { position: absolute; left: 0; bottom: 3px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.stx-grid.zero span { display: none; }
.stx-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.stx-area { fill: url(#stx-fill); }
.stx-prev { fill: none; stroke: var(--muted); stroke-opacity: 0.45; stroke-width: 1.5; stroke-linejoin: round; }
.intro .stx-plot svg { animation: stx-reveal 900ms var(--ease) 120ms backwards; }
@keyframes stx-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.stx-peak { position: absolute; width: 0; height: 0; pointer-events: none; transition: opacity 150ms; }
.stx-peak i { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.stx-peak span {
  position: absolute; bottom: 10px; left: 0; transform: translateX(-50%); white-space: nowrap;
  padding: 3px 8px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 11px; font-weight: 600;
}
.stx-peak.left span { transform: translateX(calc(-100% + 12px)); }
.stx-peak.right span { transform: translateX(-12px); }
.intro .stx-peak { animation: stx-pop 400ms var(--ease) 900ms backwards; }
@keyframes stx-pop { from { opacity: 0; transform: translateY(4px); } }
.scrub .stx-peak { opacity: 0; }
.stx-cross { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--muted); pointer-events: none; opacity: 0.6; }
.stx-cross i { position: absolute; left: -5.5px; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.stx-tip {
  position: absolute; top: 8px; z-index: 2; pointer-events: none;
  display: grid; gap: 1px; min-width: 112px; padding: 8px 11px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border); box-shadow: var(--elev); font-size: 12px; color: var(--muted);
}
.stx-tip b { font-size: 17px; color: var(--text); font-variant-numeric: tabular-nums; }
.stx-tip small { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 11px; }
.stx-xaxis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }
.stx-chart-empty { display: flex; align-items: center; gap: 12px; margin: 8px 0 2px; padding: 16px; border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 13px; }
.stx-chart-empty p { margin: 0; }
.stx-chart-empty a { color: var(--accent); font-weight: 600; }

/* Engagement strip */
.stx-engage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stx-engage > div { display: flex; flex-direction: column; gap: 2px; padding: 14px var(--card-pad); }
.stx-engage > div:nth-child(odd) { border-right: 1px solid var(--border); }
.stx-engage > div:nth-child(-n + 2) { border-bottom: 1px solid var(--border); }
.stx-engage b { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.stx-engage span { font-size: 12px; color: var(--muted); }
@media (min-width: 700px) {
  .stx-engage { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stx-engage > div { border: 0 !important; }
  .stx-engage > div + div { border-left: 1px solid var(--border) !important; }
}

/* Cards */
.stx-cards { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) {
  .stx-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "from opened" "use stay" "when when"; align-items: start; }
  [data-card="from"] { grid-area: from; } [data-card="opened"] { grid-area: opened; } [data-card="use"] { grid-area: use; }
  .stx-when { grid-area: when; } .stx-stay { grid-area: stay; }
}
@media (min-width: 1160px) {
  .stx-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "from opened use" "when when stay"; }
}
.stx-card { padding: var(--card-pad); min-width: 0; }
.stx-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.stx-title span { font-size: 12px; font-weight: 500; color: var(--muted); }
.stx-tabs { display: flex; gap: 4px; margin: 0 calc(var(--card-pad) * -1) 10px; padding: 0 var(--card-pad) 2px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.stx-tabs::-webkit-scrollbar { display: none; }
.stx-tabs.fade { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent); }
.stx-tabs button {
  flex: none; height: 30px; padding: 0 11px; border: 0; border-radius: 999px; background: none; color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background-color 150ms, color 150ms;
}
.stx-tabs button:hover { color: var(--text); background: var(--surface); }
.stx-tabs button[aria-selected="true"] { background: var(--text); color: var(--bg); }
.stx-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.stx-pane[hidden] { display: none; }
.stx-empty { margin: 0; padding: 18px 0 6px; color: var(--muted); font-size: 13px; }
.stx-note { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.stx-note b { color: var(--text); font-weight: 600; }

/* Ranked rows: a soft bar behind each one shows its share. */
.stx-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.stx-row {
  position: relative; isolation: isolate; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 5px 10px;
  border-radius: 8px; color: inherit; text-decoration: none; font-size: 14px;
}
.stx-row::before {
  content: ""; position: absolute; inset: 0 auto 0 0; z-index: -1; width: var(--w); min-width: 4px; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 11%, transparent); transition: width 500ms var(--ease);
}
.stx-row.extra { display: none; }
a.stx-row:hover { background: var(--surface); }
.stx-row b { font-weight: 600; font-variant-numeric: tabular-nums; }
.stx-row em { width: 34px; font-style: normal; font-size: 12px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.stx-rname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stx-rname small { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.stx-lead { flex: none; font-size: 18px; line-height: 1; }
.stx-thumb { flex: none; width: 24px; height: 24px; border-radius: 5px; background: var(--surface) center/cover; }
.stx-thumb.tall { width: 24px; height: 32px; }
.stx-more {
  display: block; width: 100%; margin-top: 8px; height: 34px; border: 0; border-radius: 8px; background: none;
  color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.stx-more:hover { background: var(--surface); }

/* Little columns */
.stx-cols { position: relative; display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 30px; }
.stx-col { flex: 1; display: flex; align-items: flex-end; height: 100%; min-width: 0; cursor: pointer; outline: none; }
.stx-col i { display: block; width: 100%; max-width: 28px; margin: 0 auto; border-radius: 4px 4px 0 0; background: color-mix(in srgb, var(--accent) 38%, var(--bg)); transition: background-color 150ms, height 500ms var(--ease); }
.stx-col.best i, .stx-col.on i, .stx-col:hover i { background: var(--accent); }
.stx-cols::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; border-top: 1px solid var(--border); }
.stx-coltip { position: absolute; top: 0; z-index: 2; padding: 4px 9px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 11px; font-weight: 600; white-space: nowrap; pointer-events: none; }
.stx-colaxis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--muted); }
.stx-stay .stx-colaxis span { flex: 1; text-align: center; }
.stx-split { margin-top: 18px; }
.stx-splitbar { display: flex; gap: 2px; height: 8px; }
.stx-splitbar i { border-radius: 4px; background: var(--accent); min-width: 4px; }
.stx-splitbar i + i { background: color-mix(in srgb, var(--accent) 35%, var(--bg)); }
.stx-splitkey { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.stx-splitkey span { display: inline-flex; align-items: center; gap: 6px; }
.stx-splitkey b { color: var(--text); font-weight: 600; }

/* Recent visits */
.stx-vlist { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0 calc(var(--card-pad) * -1); }
.stx-visit { border-top: 1px solid var(--border); }
.stx-visit summary { display: flex; align-items: center; gap: 12px; padding: 10px var(--card-pad); cursor: pointer; list-style: none; transition: background-color 150ms; }
.stx-visit summary::-webkit-details-marker { display: none; }
.stx-visit summary:hover, .stx-visit[open] summary { background: var(--surface); }
.stx-visit summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stx-flag { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); font-size: 19px; line-height: 1; }
.stx-visit[open] .stx-flag, .stx-visit summary:hover .stx-flag { background: var(--bg); }
.stx-vmain { flex: 1; min-width: 0; }
.stx-vmain b, .stx-vmain small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stx-vmain b { font-weight: 600; }
.stx-vmain small, .stx-vmeta small { font-size: 12px; color: var(--muted); }
.stx-vmeta { flex: none; text-align: right; font-size: 13px; }
.stx-vmeta small { display: block; }
.stx-vbody { display: grid; gap: 10px; padding: 4px var(--card-pad) 14px calc(var(--card-pad) + 48px); background: var(--surface); }
.stx-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.stx-chips span { padding: 3px 9px; border-radius: 999px; background: var(--bg); font-size: 12px; color: var(--muted); }
.stx-trail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.stx-step { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 4px 9px; border-radius: 8px; background: var(--bg); font-size: 12px; color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stx-step .i { width: 14px; height: 14px; flex: none; color: var(--muted); }
.stx-step.post { width: 30px; height: 40px; padding: 0; border-radius: 5px; background: var(--surface-hover) center/cover; }
.stx-vbody .stx-note { margin: 0; }
@media (max-width: 520px) { .stx-vbody { padding-left: var(--card-pad); } }

.stx-privacy { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 0; padding: 14px var(--card-pad); border-radius: 14px; background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1.5; }
.stx-privacy .i { flex: none; width: 16px; height: 16px; margin-top: 1px; }

@media (prefers-reduced-motion: reduce) {
  .stx-live i::after { animation: none; }
  .stx-row::before, .stx-col i, .stx-metric::before { transition: none; }
}
/* ---------- Customize Page ---------- */
.cz { display: grid; gap: 20px; }
.cz-right { min-width: 0; }
.cz-phead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.cz-phead h3 { margin: 0; font-size: 15px; }
.cz-device { min-width: 190px; }
.cz-stage { padding: 14px; }
.cz-right .hint { margin-top: 8px; }
.cz-left { min-width: 0; }
.cz-card { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; }
.cz-card > h3 { margin: 0; font-size: 15px; }
.cz-card .pbg-field { margin: 0; }
.cz-card .pbg-swatches { margin-top: 0; }
.cz-row { display: grid; gap: 6px; }
.cz-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.cz-fonts span.lb-font { font-size: 17px; padding: 6px 4px 0; color: var(--text); }
.cz-fonts span.lb-font[data-font="mono"] { font-size: 14px !important; }
.cz-fonts span.lb-font[data-font="script"] { font-size: 21px !important; }
.cz-fonts small { display: block; text-align: center; font-size: 10px; font-weight: 600; color: var(--muted); padding-bottom: 6px; pointer-events: none; position: relative; }
.cz-fonts label { display: grid; border-radius: 8px; }
.cz-fonts input:checked + span { box-shadow: none; background: none; }
.cz-fonts label:has(input:checked) { background: var(--bg); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.cz-themes { display: flex; flex-wrap: wrap; gap: 10px; }
.cz-themes label { position: relative; cursor: pointer; }
.cz-themes input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cz-card > .btn { justify-self: start; }
.cz-save { position: sticky; bottom: calc(env(safe-area-inset-bottom) + 76px); z-index: 2; padding-top: 4px; }
.cz-save .btn { width: 100%; box-shadow: 0 6px 20px rgb(0 0 0 / 0.14); }
.cz-save .btn:disabled { opacity: 1; background: var(--surface); color: var(--muted); box-shadow: 0 0 0 1px var(--border); }
@media (min-width: 900px) {
  .cz { grid-template-columns: minmax(0, 1fr) minmax(340px, 46%); align-items: start; }
  .cz-right { order: 2; position: sticky; top: 16px; }
  .cz-save { bottom: 16px; }
}
.cz-promo { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; }
.cz-promo > .i:first-child { width: 22px; height: 22px; flex: none; }
.cz-promo span { flex: 1; min-width: 0; }
.cz-promo strong { display: block; }
.cz-promo small { display: block; color: var(--muted); font-size: 13px; }

.social-site small { display: block; color: var(--accent); font-size: 11px; font-weight: 700; text-transform: none; }
.social-row-edit { grid-template-columns: 112px minmax(0, 1fr) auto; }
@media (max-width: 520px) { .social-row-edit { grid-template-columns: minmax(0, 1fr) auto; } .social-site small { display: inline; margin-left: 6px; } }

/* Customize Page font picker: the three fonts of the chosen family, each in its own face. */
.cz-variants { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cz-variants[hidden] { display: none; }
.cz-variants label { position: relative; cursor: pointer; }
.cz-variants input { position: absolute; opacity: 0; pointer-events: none; }
.cz-variants span.lb-font { display: grid; place-items: center; min-height: 44px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 10px; text-align: center; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: border-color 150ms, background-color 150ms; }
.cz-variants input:checked + span { border-color: var(--text); background: var(--surface); }
.cz-variants input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Customize Page theme picker: a style card (with a tiny page drawn in its colors), then its colors. */
.cz-styles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 1100px) { .cz-styles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cz-style { display: grid; gap: 2px; padding: 8px 8px 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color 150ms, box-shadow 150ms; }
.cz-style:hover { border-color: color-mix(in srgb, var(--text) 35%, var(--border)); }
.cz-style[aria-checked="true"] { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.cz-style:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cz-style strong { margin-top: 6px; font-size: 14px; }
.cz-style small { color: var(--muted); font-size: 12px; line-height: 1.3; }
/* The tiny page: a profile column and a grid of six photos. */
.cz-mini { --m-bg: #fff; --m-col: #fff; --m-text: #111; --m-acc: #3346f0; --m-line: #e3e3e3;
  position: relative; display: grid; grid-template-columns: 38% 1fr; gap: 6px; height: 74px; padding: 6px; border-radius: 9px; overflow: hidden; isolation: isolate; background: var(--m-bg); border: 1px solid var(--m-line); }
.cz-mini > i { border-radius: 5px; background: var(--m-col);
  background-image: radial-gradient(circle at 26% 24%, color-mix(in srgb, var(--m-text) 26%, transparent) 0 9px, transparent 10px),
    linear-gradient(var(--m-text), var(--m-text)), linear-gradient(color-mix(in srgb, var(--m-text) 40%, transparent), color-mix(in srgb, var(--m-text) 40%, transparent)), linear-gradient(var(--m-acc), var(--m-acc));
  background-size: auto, 60% 4px, 75% 3px, 70% 9px; background-position: 0 0, 6px 30px, 6px 38px, 6px 50px; background-repeat: no-repeat; }
.cz-mini > span { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.cz-mini b { background: color-mix(in srgb, var(--m-text) 14%, var(--m-bg)); }
.cz-mini b:nth-child(1) { background: #c98a6a; } .cz-mini b:nth-child(5) { background: #7f9bb0; } .cz-mini b:nth-child(3) { background: #a9b48a; }
.cz-mini[data-dir="classic"] { --m-col: #fff; }
.cz-mini[data-dir="riso"] > i { box-shadow: inset -1px 0 0 var(--m-line); }
.cz-mini:not([data-dir="classic"])::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0.4; mix-blend-mode: multiply; background-image: var(--st-grain-img); }
/* Colors of the chosen style, around the color wheel. */
.cz-colors { display: grid; gap: 10px; }
.cz-colors[hidden] { display: none; }
.cz-colors-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.cz-colors-head .cz-label b { color: var(--text); }
.cz-color-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.cz-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; }
.cz-tsw { width: 100%; aspect-ratio: 1; padding: 0; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--text) 14%, transparent); position: relative; overflow: hidden; isolation: isolate; cursor: pointer; transition: transform 150ms var(--ease, ease); }
.cz-tsw:hover { transform: scale(1.06); }
.cz-tsw[data-dir="darkroom"] { background: radial-gradient(circle at 50% 50%, var(--b) 0 42%, transparent 43%), var(--a); }
.cz-tsw[data-dir="block"] { background: linear-gradient(90deg, var(--a) 0 55%, var(--b) 55%); }
.cz-tsw[data-dir="riso"] { background: radial-gradient(circle at 40% 42%, var(--a) 0 32%, transparent 33%), radial-gradient(circle at 60% 58%, var(--b) 0 32%, transparent 33%), #f4efe3; }
.cz-tsw::after { content: ""; position: absolute; inset: 0; opacity: 0.4; mix-blend-mode: multiply; background-image: var(--st-grain-img); }
.cz-tsw[aria-checked="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.cz-tsw:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.cz-theme .hint { margin: 0; }
.cz-mode .i { width: 16px; height: 16px; }
.cz-phead { flex-wrap: wrap; }
.cz-mode { min-width: 0; }
.cz-sub { margin: -8px 0 0; }
.cz-icons .i { width: 18px; height: 18px; }
.cz-icons label > span { display: grid; place-items: center; }
.cz-fun .hint { margin: 0; }

/* iPad Home Screen app: the status bar floats over the page and blurs whatever passes under it. A solid
   strip in the page color sits under it, and everything starts below it. */
html.pwa-wide { --sb: env(safe-area-inset-top, 0px); }
html.pwa-wide::before {
  content: ""; position: fixed; top: 0; left: 0; right: 0; z-index: 2147483000; height: var(--sb);
  background: var(--bg); pointer-events: none;
}
html.pwa-wide body { padding-top: var(--sb); }
html.pwa-wide .side { top: var(--sb); }
