/* ============================================
   mwmer — base stylesheet
   The class names here mirror the templates;
   tweak variables are injected via :root inline
   styles by the Tweaks panel.
   ============================================ */

:root {
  /* base palette */
  --ink: #0f0f0f;
  --ink-2: #2a2a2a;
  --gray-1: #6b6b6b;
  --gray-2: #9a9a9a;
  --gray-3: #c8c8c8;
  --gray-4: #ebebeb;
  --gray-5: #f6f6f6;
  --bg: #ffffff;
  --accent: oklch(0.62 0.15 240);
  --accent-soft: oklch(0.62 0.15 240 / 0.08);
  --like: oklch(0.62 0.22 18);
  --like-soft: oklch(0.62 0.22 18 / 0.08);
  --retweet: oklch(0.6 0.15 155);
  --retweet-soft: oklch(0.6 0.15 155 / 0.08);
  --danger: oklch(0.55 0.21 28);
  --danger-soft: oklch(0.55 0.21 28 / 0.08);

  /* fonts */
  --serif-display: 'Instrument Serif', 'Newsreader', Georgia, serif;
  --serif-body: 'Newsreader', Georgia, 'Iowan Old Style', serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  /* feed treatment (overridable by tweaks) */
  --feed-border-style: hairline; /* hairline | card */
  --post-pad-y: 18px;
  --post-pad-x: 0px;
  --post-gap: 0px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif-body);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

button {
  font-family: var(--sans);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* =============== nav =============== */
nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--gray-4);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 28px;
}

.nav-inner {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1;
  padding-bottom: 4px;
  text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--ink); }

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-1);
  white-space: nowrap;
}
.nav-links > * { white-space: nowrap; flex-shrink: 0; }
.nav-links a {
  color: var(--gray-1);
  font-weight: 500;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links .nav-handle {
  color: var(--ink);
  font-weight: 500;
}
.nav-links .nav-divider {
  width: 1px;
  height: 14px;
  background: var(--gray-4);
}

/* =============== main =============== */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 28px 120px;
}

.page-title {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: 38px;
  letter-spacing: -0.01em;
  margin: 36px 0 4px;
  line-height: 1.05;
}
.page-sub {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-1);
  margin: 0 0 24px;
}

.section-rule {
  height: 1px;
  background: var(--gray-4);
  margin: 0;
  border: 0;
}

/* =============== flash / error =============== */
.error {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-soft);
  padding: 10px 14px;
  border-radius: 6px;
  margin: 16px 0;
}

/* =============== post-card =============== */
.post-card {
  position: relative;
  padding: var(--post-pad-y) var(--post-pad-x);
  border-bottom: 1px solid var(--gray-4);
  transition: background-color 120ms ease;
}
.post-card:last-of-type {
  border-bottom: 1px solid var(--gray-4);
}

/* card variant */
.feed-card .post-card {
  border: 1px solid var(--gray-4);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 12px;
  background: var(--bg);
}
.feed-card .post-card:last-of-type { margin-bottom: 0; }

.post-card.is-clickable { cursor: pointer; }
.post-card.is-clickable:hover {
  background: var(--gray-5);
}
.feed-card .post-card.is-clickable:hover {
  background: var(--bg);
  border-color: var(--gray-3);
}

.post-header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--sans);
  font-size: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.post-header > * { white-space: nowrap; flex-shrink: 0; min-width: 0; }
.post-author {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.post-author:hover { text-decoration: underline; }
.username {
  color: var(--gray-1);
  font-weight: 400;
}
.post-time, .post-edited {
  color: var(--gray-2);
  font-weight: 400;
}
.post-time::before {
  content: '·';
  margin-right: 6px;
  color: var(--gray-2);
}
.post-edited::before {
  content: '·';
  margin-right: 6px;
}

/* short posts get larger type */
.post-body {
  font-family: var(--serif-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  word-wrap: break-word;
  white-space: pre-wrap;
  margin: 0;
}
.post-body.size-md {
  font-size: 22px;
  line-height: 1.35;
}
.post-body.size-lg {
  font-size: 32px;
  line-height: 1.18;
  letter-spacing: -0.005em;
  margin: 4px 0;
}
.post-body.size-xl {
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 6px 0;
}

.post-body a {
  color: var(--accent);
}

/* =============== bot badge =============== */
.bot-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-1);
  border: 1px solid var(--gray-3);
  border-radius: 999px;
  padding: 1px 7px 1px;
  line-height: 1.4;
  margin-left: 2px;
  position: relative;
  top: -1px;
}
.bot-badge::before { content: 'bot'; }

/* badge variants */
[data-bot-badge="mono-tag"] .bot-badge {
  border: none;
  padding: 0;
  color: var(--gray-2);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: lowercase;
}
[data-bot-badge="mono-tag"] .bot-badge::before { content: '[bot]'; }

[data-bot-badge="accent-chip"] .bot-badge {
  background: var(--accent);
  color: white;
  border: none;
}

[data-bot-badge="glyph"] .bot-badge {
  border: none;
  padding: 0;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gray-1);
}
[data-bot-badge="glyph"] .bot-badge::before { content: '◆ bot'; }

.bot-owner {
  color: var(--gray-2);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
}
.bot-owner::before {
  content: '·';
  margin-right: 6px;
}

/* =============== post footer =============== */
.post-footer {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-1);
}
.post-footer > * { flex-shrink: 0; white-space: nowrap; }

.post-footer .btn-like,
.post-footer .btn-retweet,
.post-footer .reply-count,
.post-footer .post-permalink {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gray-1);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  transition: color 100ms ease;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.post-footer .icon {
  display: inline-block;
  font-size: 15px;
  line-height: 1;
  transition: transform 120ms ease;
}

.btn-like:hover { color: var(--like); }
.btn-like:hover .icon { transform: scale(1.15); }
.btn-liked { color: var(--like) !important; }
.btn-liked .icon { color: var(--like); }

.btn-retweet:hover { color: var(--retweet); }
.btn-retweet:hover .icon { transform: rotate(-30deg); }
.btn-retweeted { color: var(--retweet) !important; }

.reply-count:hover, .post-permalink:hover { color: var(--accent); }

/* text-label variant */
[data-controls="text"] .post-footer .icon { display: none; }
[data-controls="text"] .post-footer .label-text::before {
  content: attr(data-label);
}
[data-controls="text"] .post-footer .btn-like::before,
[data-controls="text"] .post-footer .btn-retweet::before,
[data-controls="text"] .post-footer .reply-count::before {
  font-family: var(--sans);
}
[data-controls="text"] .post-footer .post-permalink {
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 12px;
}

/* =============== retweet / quote / reply context =============== */
.retweet-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--gray-1);
  margin-bottom: 8px;
  font-weight: 500;
}
.retweet-header::before {
  content: '↻';
  font-size: 13px;
  color: var(--retweet);
}
.retweet-header a { color: var(--gray-1); }
.retweet-header a:hover { color: var(--ink); }

.reply-context {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--gray-1);
  margin-bottom: 8px;
}
.reply-context::before {
  content: '↩ ';
  color: var(--gray-2);
  margin-right: 2px;
}
.reply-context a { color: var(--gray-1); font-weight: 500; }
.reply-context a:hover { color: var(--accent); }

.quoted-post,
.embedded-post {
  margin: 12px 0 4px;
  padding: 12px 14px;
  border: 1px solid var(--gray-4);
  border-radius: 10px;
  background: var(--bg);
}
.quoted-post .post-header,
.embedded-post .post-header {
  font-size: 13px;
  margin-bottom: 4px;
}
.quoted-post .post-body,
.embedded-post .post-body {
  font-size: 16px;
  line-height: 1.45;
}
.quoted-post .post-body.size-md,
.embedded-post .post-body.size-md {
  font-size: 18px;
}
.quoted-post .post-body.size-lg,
.embedded-post .post-body.size-lg {
  font-size: 22px;
  line-height: 1.25;
}
.quoted-post .post-body.size-xl,
.embedded-post .post-body.size-xl {
  font-size: 26px;
  line-height: 1.18;
}
.quoted-post .post-footer,
.embedded-post .post-footer {
  display: none;
}

/* =============== tombstone =============== */
.post-card.post-tombstone {
  padding: 14px var(--post-pad-x);
}
.tombstone-text {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-2);
  font-style: italic;
}
.tombstone-text::before {
  content: '✕  ';
  font-style: normal;
  color: var(--gray-3);
}

/* =============== composer =============== */
.composer,
.reply-composer,
.quote-composer {
  padding: 18px 0 14px;
  border-bottom: 1px solid var(--gray-4);
}
.composer-body {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: var(--serif-body);
  font-size: 22px;
  line-height: 1.35;
  color: var(--ink);
  background: transparent;
  padding: 6px 0;
  min-height: 60px;
  display: block;
}
.composer-body::placeholder { color: var(--gray-2); }

.reply-composer .composer-body {
  font-size: 18px;
  min-height: 44px;
}
.quote-composer .composer-body {
  font-size: 16px;
  min-height: 38px;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.composer-image-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 120ms;
  white-space: nowrap;
  flex-shrink: 0;
}
.composer-actions > * { flex-shrink: 0; white-space: nowrap; }
.composer-image-label:hover { background: var(--accent-soft); }
.composer-image-label::before {
  content: '⊞';
  font-size: 16px;
  line-height: 1;
}
.composer-image-input { display: none; }

.image-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gray-1);
}

.composer-submit {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: white;
  background: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: background 120ms;
}
.composer-submit:hover { background: var(--accent); }
.composer-submit:disabled { background: var(--gray-3); cursor: not-allowed; }

.edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

/* =============== inline edit =============== */
.post-card.edit-form {
  background: var(--gray-5);
  border-bottom: 1px solid var(--gray-4);
}
.post-card.edit-form .composer-body {
  font-size: 18px;
  background: white;
  border: 1px solid var(--gray-4);
  border-radius: 8px;
  padding: 10px 12px;
}

.btn-edit, .btn-delete, .btn-cancel {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-1);
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--gray-4);
  background: white;
  cursor: pointer;
}
.btn-edit:hover { color: var(--accent); border-color: var(--accent); }
.btn-delete:hover { color: var(--danger); border-color: var(--danger); }

/* =============== image grid =============== */
.image-grid {
  display: grid;
  gap: 2px;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--gray-4);
}
.image-grid-1 { grid-template-columns: 1fr; }
.image-grid-2 { grid-template-columns: 1fr 1fr; }
.image-grid-3 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.image-grid-3 > :first-child { grid-row: span 2; }
.image-grid-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.image-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 1.6 / 1;
  background: var(--gray-5);
}
.image-grid-1 img { aspect-ratio: 1.7 / 1; max-height: 420px; }
.image-grid-3 > :first-child img { aspect-ratio: 1 / 2; }

/* placeholder image — striped svg */
.img-ph {
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(45deg, #f3f3f3 0 8px, #ececec 8px 16px);
  position: relative;
}
.img-ph::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gray-1);
  letter-spacing: 0.04em;
}

/* =============== link preview =============== */
.link-preview {
  display: block;
  margin-top: 12px;
  border: 1px solid var(--gray-4);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms;
}
.link-preview:hover {
  border-color: var(--gray-3);
  text-decoration: none;
}
.link-preview-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  background: var(--gray-5);
}
.link-preview-body { padding: 12px 14px; }
.link-preview-title {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  margin: 0 0 4px;
}
.link-preview-desc {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-1);
  margin: 0 0 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-preview-url {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gray-2);
  text-transform: lowercase;
}

/* =============== profile =============== */
.profile-header {
  padding: 28px 0 18px;
  border-bottom: 1px solid var(--gray-4);
}
.profile-header h1 {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 400;
  font-size: 36px;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1;
}
.profile-handle {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--gray-1);
  margin-top: 2px;
}
.profile-bio {
  font-family: var(--serif-body);
  font-size: 17px;
  line-height: 1.5;
  margin: 14px 0 12px;
  color: var(--ink-2);
  max-width: 540px;
}
.profile-counts {
  display: flex;
  gap: 22px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-1);
  margin-bottom: 14px;
}
.profile-counts a { color: var(--gray-1); }
.profile-counts a:hover { color: var(--ink); }
.profile-counts strong {
  color: var(--ink);
  font-weight: 600;
  margin-right: 4px;
}

.profile-top {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 12px;
}
.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.profile-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-details .profile-counts {
  margin-bottom: 0;
}

.btn-edit-profile {
  display: inline-block;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  background: white;
  transition: all 120ms;
}
.btn-edit-profile:hover {
  background: var(--gray-5);
  text-decoration: none;
}

/* ---- Edit profile form ---- */
.edit-profile-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 480px;
  margin-top: 16px;
}
.edit-profile-current-avatar {
  margin-bottom: 4px;
}
.form-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-1);
  font-weight: 500;
}
.form-label-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--ink);
}
.form-input {
  font-family: var(--serif-body);
  font-size: 16px;
  padding: 8px 10px;
  border: 1px solid var(--gray-3);
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}
.form-input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}
.btn-primary {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 999px;
  border: none;
  background: var(--ink);
  color: white;
  cursor: pointer;
  transition: background 120ms;
}
.btn-primary:hover { background: var(--accent); }

.btn-follow, .btn-unfollow {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: all 120ms;
}
.btn-follow {
  background: var(--ink);
  color: white;
}
.btn-follow:hover { background: var(--accent); border-color: var(--accent); }
.btn-unfollow {
  background: white;
  color: var(--ink);
}
.btn-unfollow:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}
.btn-unfollow:hover::after { content: ''; }

/* tabs on profile */
.profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--gray-4);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 0;
}
.profile-tabs a {
  padding: 14px 18px;
  color: var(--gray-1);
  position: relative;
  text-decoration: none;
}
.profile-tabs a.active { color: var(--ink); }
.profile-tabs a.active::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -1px;
  height: 2px;
  background: var(--ink);
}
.profile-tabs a:hover { color: var(--ink); text-decoration: none; }

/* =============== user list =============== */
.user-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.user-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-4);
}
.user-list-item .avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--gray-4);
  flex-shrink: 0;
  object-fit: cover;
  display: block;
}
.user-list-item .meta {
  flex: 1;
  min-width: 0;
}
.user-list-item .display-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}
.user-list-item .handle {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-1);
}
.user-list-item .bio {
  font-family: var(--serif-body);
  font-size: 14px;
  color: var(--ink-2);
  margin-top: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.empty-list {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--gray-1);
  padding: 60px 0;
  text-align: center;
}

/* =============== auth =============== */
.auth-shell {
  max-width: 360px;
  margin: 0 auto;
  padding: 80px 0 60px;
}
.auth-shell .brand {
  font-size: 56px;
  display: block;
  text-align: center;
  margin-bottom: 28px;
}
.auth-shell h1 {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: 26px;
  margin: 0 0 4px;
  letter-spacing: -0.005em;
}
.auth-shell .sub {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-1);
  margin-bottom: 24px;
}
.field {
  display: block;
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-1);
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}
.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--gray-4);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 15px;
  background: white;
  outline: none;
  transition: border-color 120ms;
  font-family: var(--sans);
}
.field input:focus,
.field textarea:focus {
  border-color: var(--ink);
}
.field input::placeholder { color: var(--gray-2); }

.auth-submit {
  width: 100%;
  margin-top: 8px;
  background: var(--ink);
  color: white;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  padding: 11px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}
.auth-submit:hover { background: var(--accent); }

.auth-foot {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-1);
  margin-top: 22px;
  text-align: center;
}

/* =============== bot settings =============== */
.bot-create {
  padding: 18px 0;
  border-bottom: 1px solid var(--gray-4);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.bot-create .field { margin: 0; }

.bot-list {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 0;
}
.bot-card {
  padding: 18px 0;
  border-bottom: 1px solid var(--gray-4);
}
.bot-card:last-child { border-bottom: none; }
.bot-card-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.bot-card-head > * { flex-shrink: 0; white-space: nowrap; }
.bot-card-head .display-name {
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.bot-card-head .handle {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-1);
}

.bot-feed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-1);
  margin: 6px 0 12px;
}
.bot-feed-toggle input { accent-color: var(--accent); }

.token-list {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  border-top: 1px solid var(--gray-4);
}
.token-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--gray-4);
}
.token-label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.token-prefix {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray-1);
}
.token-prefix::after {
  content: '…';
  margin-left: 1px;
  color: var(--gray-2);
}

.btn-revoke,
.btn-danger {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--gray-4);
  background: white;
  color: var(--danger);
  cursor: pointer;
}
.btn-revoke:hover,
.btn-danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

/* =============== token issued =============== */
.token-warning {
  background: oklch(0.95 0.05 80);
  border: 1px solid oklch(0.78 0.13 80);
  color: oklch(0.35 0.08 60);
  padding: 14px 16px;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  margin: 16px 0;
}
.token-warning strong {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: oklch(0.3 0.1 60);
}
.token-plaintext {
  display: block;
  font-family: var(--mono);
  font-size: 14px;
  word-break: break-all;
  white-space: pre-wrap;
  background: var(--ink);
  color: white;
  padding: 18px 20px;
  border-radius: 10px;
  margin: 12px 0 6px;
  position: relative;
}
.copy-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--gray-1);
}
.copy-btn {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid var(--gray-4);
  background: white;
  cursor: pointer;
}
.copy-btn:hover { border-color: var(--ink); }

/* =============== engagement section =============== */
.engagement-forms {
  padding: 6px 0 0;
}
.quote-section {
  border-bottom: 1px solid var(--gray-4);
  padding: 0 0 10px;
}
.quote-section > summary {
  list-style: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-1);
  padding: 14px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.quote-section > summary::-webkit-details-marker { display: none; }
.quote-section > summary::before {
  content: '▸';
  font-size: 10px;
  color: var(--gray-2);
  transition: transform 120ms;
}
.quote-section[open] > summary::before {
  transform: rotate(90deg);
}
.quote-section[open] > summary {
  color: var(--ink);
}

.replies {
  margin-top: 8px;
}
.replies-head {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--gray-1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--gray-4);
}

/* permalink page big-post treatment */
.permalink-post {
  padding: 22px 0;
  border-bottom: 1px solid var(--gray-4);
}
.permalink-post .post-body {
  font-size: 24px;
  line-height: 1.4;
}
.permalink-post .post-body.size-md { font-size: 28px; }
.permalink-post .post-body.size-lg { font-size: 38px; line-height: 1.15; }
.permalink-post .post-body.size-xl { font-size: 48px; line-height: 1.05; }
.permalink-post .post-meta-row {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-1);
  padding: 14px 0 10px;
  border-top: 1px solid var(--gray-4);
  margin-top: 16px;
  display: flex;
  gap: 22px;
}
.permalink-post .post-meta-row strong {
  color: var(--ink);
  font-weight: 600;
}

/* =============== admin =============== */
.admin-nav {
  position: sticky;
  top: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--gray-4);
  padding: 0;
  font-family: var(--sans);
  font-size: 13px;
  display: flex;
  gap: 0;
  margin: 0 -28px;
  padding: 0 28px;
  z-index: 40;
}
.admin-nav a {
  padding: 14px 16px;
  color: var(--gray-1);
  font-weight: 500;
  position: relative;
  text-decoration: none;
}
.admin-nav a.active { color: var(--ink); }
.admin-nav a.active::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 2px;
  background: var(--ink);
}
.admin-nav a:hover { color: var(--ink); text-decoration: none; }

main.admin {
  max-width: 980px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 28px 0 36px;
  border: 1px solid var(--gray-4);
  border-radius: 10px;
  overflow: hidden;
  padding: 0;
}
.admin-stats > div {
  padding: 18px 20px;
  border-right: 1px solid var(--gray-4);
}
.admin-stats > div:last-child { border-right: none; }
.admin-stats dt {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--gray-1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  font-weight: 500;
}
.admin-stats dd {
  font-family: var(--serif-display);
  font-size: 36px;
  margin: 4px 0 0;
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.admin-stats .delta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gray-1);
  margin-top: 6px;
  display: block;
}
.admin-stats .delta.up { color: oklch(0.55 0.15 155); }
.admin-stats .delta.down { color: var(--danger); }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13px;
  margin-top: 12px;
}
.admin-table thead th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  color: var(--gray-1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-4);
  background: white;
  position: sticky;
  top: 100px;
}
.admin-table tbody td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--gray-4);
  vertical-align: top;
  color: var(--ink-2);
}
.admin-table tbody tr:hover {
  background: var(--gray-5);
}
.admin-table .col-handle {
  font-weight: 500;
  color: var(--ink);
}
.admin-table .col-handle .at { color: var(--gray-1); font-weight: 400; }
.admin-table .num {
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 12px;
}
.admin-table .col-time {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray-1);
  white-space: nowrap;
}
.admin-table .col-actions {
  text-align: right;
  white-space: nowrap;
}
.admin-table .col-actions button {
  margin-left: 6px;
}

.deleted-row td {
  color: var(--gray-2) !important;
}
.deleted-row .post-body-preview {
  text-decoration: line-through;
  color: var(--gray-2);
}
.deleted-row .col-handle { color: var(--gray-2); }
.deleted-row .col-handle .at { color: var(--gray-3); }

.post-body-preview {
  font-family: var(--serif-body);
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.4;
  max-width: 420px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.status-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--gray-3);
  color: var(--gray-1);
}
.status-pill.active { color: oklch(0.5 0.15 155); border-color: oklch(0.7 0.12 155); }
.status-pill.deleted { color: var(--danger); border-color: oklch(0.78 0.12 28); }
.status-pill.bot { color: var(--accent); border-color: oklch(0.78 0.1 240); }
.status-pill.pending { color: oklch(0.5 0.13 60); border-color: oklch(0.78 0.13 70); }

.admin-section-title {
  font-family: var(--serif-display);
  font-weight: 400;
  font-size: 24px;
  margin: 32px 0 4px;
  letter-spacing: -0.005em;
}
.admin-section-sub {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--gray-1);
  margin: 0 0 12px;
}

.admin-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 8px 0 14px;
  font-family: var(--sans);
  font-size: 13px;
}
.admin-toolbar .search {
  flex: 1;
  border: 1px solid var(--gray-4);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
}
.admin-toolbar .search:focus { border-color: var(--ink); }
.admin-toolbar .seg {
  display: inline-flex;
  border: 1px solid var(--gray-4);
  border-radius: 8px;
  overflow: hidden;
}
.admin-toolbar .seg button {
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-1);
  background: white;
  border: none;
  border-right: 1px solid var(--gray-4);
}
.admin-toolbar .seg button:last-child { border-right: none; }
.admin-toolbar .seg button.on {
  background: var(--ink);
  color: white;
}

.invite-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-4);
  font-family: var(--sans);
  font-size: 13px;
}
.invite-code {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.invite-meta {
  color: var(--gray-1);
  font-size: 12px;
}

/* =============== type pairing variants =============== */
[data-type-pair="single-sans"] {
  --serif-display: 'IBM Plex Sans', system-ui, sans-serif;
  --serif-body: 'IBM Plex Sans', system-ui, sans-serif;
}
[data-type-pair="single-sans"] .brand,
[data-type-pair="single-sans"] .auth-shell h1,
[data-type-pair="single-sans"] .page-title,
[data-type-pair="single-sans"] .profile-header h1,
[data-type-pair="single-sans"] .admin-section-title,
[data-type-pair="single-sans"] .admin-stats dd {
  font-style: normal;
  font-weight: 700;
  letter-spacing: -0.02em;
}

[data-type-pair="display-chunky"] {
  --serif-display: 'Fraunces', 'Newsreader', Georgia, serif;
  --serif-body: 'IBM Plex Sans', system-ui, sans-serif;
}
[data-type-pair="display-chunky"] .post-body { font-family: var(--sans); }
[data-type-pair="display-chunky"] .brand { font-style: normal; font-weight: 600; }

[data-type-pair="mono-ui"] {
  --sans: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --serif-display: 'Newsreader', Georgia, serif;
}
[data-type-pair="mono-ui"] .brand { font-style: italic; }

/* =============== utility =============== */
.kbd {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--gray-5);
  border: 1px solid var(--gray-4);
  border-radius: 4px;
  padding: 1px 5px;
}

.muted { color: var(--gray-1); }
.tiny { font-size: 12px; }

.center-empty {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--gray-1);
  text-align: center;
  padding: 80px 0;
}
.center-empty .big {
  font-family: var(--serif-display);
  font-style: italic;
  font-size: 40px;
  color: var(--gray-2);
  display: block;
  margin-bottom: 8px;
}

/* =============== private posts =============== */

/* Locked post body — shown while DEK not available */
.post-private-locked {
  color: var(--gray-2);
  font-style: italic;
  font-size: 13px;
  user-select: none;
}

/* "Private" badge on composer label */
.composer-private-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-1);
  cursor: pointer;
  user-select: none;
}
.composer-private-label input[type="checkbox"] {
  cursor: pointer;
}

/* Private posts status link on own profile */
.profile-private-posts-link {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--gray-4);
}
.profile-private-posts-link--enabled {
  color: #2e7d32;
  border-color: #a5d6a7;
  background: #f1f8f1;
}
.profile-private-posts-link--disabled {
  color: var(--gray-1);
  border-color: var(--gray-4);
  background: var(--gray-5);
}
.profile-private-posts-link:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: white;
}

/* Unlock button on profile page */
.btn-unlock-private {
  display: none; /* shown by JS when locked posts exist */
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border: 1px solid var(--gray-3);
  border-radius: 6px;
  background: white;
  color: var(--gray-1);
  cursor: pointer;
}
.btn-unlock-private:hover { border-color: var(--ink); color: var(--ink); }

/* Unlock modal overlay */
.modal-overlay {
  display: none; /* toggled to flex by JS */
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal {
  background: white;
  border-radius: 12px;
  padding: 28px 32px;
  width: 340px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  font-family: var(--sans);
}
.modal h2 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--sans);
}
.modal p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--gray-1);
}
.modal .field { margin-bottom: 12px; }
.modal .field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-1);
  margin-bottom: 4px;
}
.modal .field input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--gray-4);
  border-radius: 6px;
  font-size: 14px;
}
.modal .field input:focus { outline: none; border-color: var(--ink); }
.modal-error {
  display: none;
  color: #c0392b;
  font-size: 12px;
  margin-bottom: 10px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 8px;
}
.modal-actions button {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
}
.modal-actions .btn-cancel {
  background: white;
  border: 1px solid var(--gray-4);
  color: var(--gray-1);
}
.modal-actions .btn-cancel:hover { border-color: var(--ink); color: var(--ink); }
.modal-actions .btn-primary {
  background: var(--ink);
  border: 1px solid var(--ink);
  color: white;
}
.modal-actions .btn-primary:hover { opacity: 0.85; }

/* Settings section for private posts enable flow */
.settings-section-private {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-4);
}
.settings-section-private h3 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  font-family: var(--sans);
}
.settings-section-private p {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--gray-1);
}
.private-enable-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.private-enable-form input[type="password"] {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--gray-4);
  border-radius: 6px;
  font-size: 14px;
}
.private-enable-form input:focus { outline: none; border-color: var(--ink); }

/* Recovery code display */
.recovery-code-display {
  display: none; /* shown by JS after enable */
  background: var(--gray-5);
  border: 1px solid var(--gray-4);
  border-radius: 8px;
  padding: 16px;
  font-family: var(--sans);
}
.recovery-code-value {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.04em;
  word-break: break-all;
  margin: 8px 0;
}
.recovery-code-warning {
  font-size: 12px;
  color: #c0392b;
  font-weight: 500;
  margin-top: 8px;
}
