/* Demo feed: it must look like the social app people know, not like NTK, or it
   confuses. So this page has its own stylesheet and does not load
   /assets/ntk.css: a white page, near-black text, grey #536471 for secondary
   text, thin #EFF3F4 dividers, round avatars, the usual post and reply layout
   with an action row of thin icons (our own, lib/icons.js), blue #1D9BF0 for its
   buttons, and the system font. No other app's name, logo or assets. The one
   thing that stays NTK's is the stamp button the web embed puts on a tag
   (/embed/ntk-embed.css). Dark mode follows the system, as such apps do. */

:root {
  --bg: #FFFFFF;
  --ink: #0F1419;
  --ink-2: #536471;
  --line: #EFF3F4;
  --border: #CFD9DE;
  --blue: #1D9BF0;
  --blue-down: #1A8CD8;
  --hover: rgba(15, 20, 25, .1);
  --bar: rgba(255, 255, 255, .85);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --ink: #E7E9EA;
    --ink-2: #71767B;
    --line: #2F3336;
    --border: #536471;
    --hover: rgba(231, 233, 234, .1);
    --bar: rgba(0, 0, 0, .65);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
p { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.column { max-width: 600px; min-height: 100vh; margin: 0 auto; }
@media (min-width: 640px) {
  .column { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* ---- the top bar --------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 53px;
  padding: 0 16px;
  background: var(--bar);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.topbar h1 { flex: 1; margin: 0; font-size: 20px; font-weight: 700; line-height: 24px; }
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: -8px;
  border-radius: 50%;
  color: var(--ink);
}
.icon-btn:hover { background: var(--hover); }
.icon-btn svg.icon { stroke-width: 1.75; }
/* The small "DEMO" label. */
.chip {
  padding: 3px 8px;
  border-radius: 9999px;
  background: var(--line);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
  letter-spacing: .04em;
}

svg.icon { display: inline-block; flex: none; vertical-align: middle; }

/* ---- posts --------------------------------------------------------------- */

.post { border-bottom: 1px solid var(--line); }
.name { font-weight: 700; color: var(--ink); }
.handle, .time, .sep, .post-time, .post-stats, .replying, .composer-note { color: var(--ink-2); }

/* Round avatars: a generated pattern on a soft colour (lib/pixel.js dotSvg). */
svg.avatar { display: block; width: 40px; height: 40px; border-radius: 50%; background: #FDE7D9; }
.avatar .dot-on { fill: #B5541C; }
.avatar .dot-off { fill: transparent; }
.avatar.tone-1 { background: #DFF1E6; }
.avatar.tone-1 .dot-on { fill: #2E7D4F; }
.avatar.tone-2 { background: #E6E3F8; }
.avatar.tone-2 .dot-on { fill: #5B4BB7; }
.mine svg.avatar, .composer svg.avatar { background: #CFD9DE; }
.mine .avatar .dot-on, .composer .avatar .dot-on { fill: #0F1419; }

.main-post { padding: 12px 16px 0; }
.post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.who { display: grid; min-width: 0; line-height: 20px; }
.post-text {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 24px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.post-time { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.post-time strong, .post-stats strong { color: var(--ink); font-weight: 700; }
.post-stats { display: flex; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.main-post .acts { justify-content: space-around; max-width: none; height: 48px; margin: 0; }

.reply {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 12px 16px;
}
.post-body { min-width: 0; }
.post-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-text {
  margin: 2px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* A tag stays on one line; the Android layer or the web embed puts a button on it. */
.ntk-tag { white-space: nowrap; }

/* The action row: reply, repost, like, views, share. */
.acts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 425px;
  margin-top: 12px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 16px;
}
.act { display: inline-flex; align-items: center; gap: 4px; min-width: 2.5rem; }
.act svg.icon { width: 18.75px; height: 18.75px; stroke-width: 1.6; }

/* ---- the reply box ------------------------------------------------------- */

.composer {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.replying { margin: 0 0 4px; }
.replying .handle { color: var(--blue); }
.composer textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin: 0;
  padding: 8px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  line-height: 24px;
  resize: none;
  overflow: hidden;
}
.composer textarea::placeholder { color: var(--ink-2); opacity: 1; }
.composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.composer-note { font-size: 13px; }

/* Buttons: pills. The main one blue with white text; a secondary one outlined. */
.btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover:not(:disabled) { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { border-color: var(--blue); background: var(--blue); color: #FFFFFF; }
.btn-primary:hover:not(:disabled) { border-color: var(--blue-down); background: var(--blue-down); }
.btn-small { min-height: 32px; font-size: 14px; }

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

.feed-foot { padding: 16px 16px 40px; color: var(--ink-2); }
.feed-foot p { margin-bottom: 12px; }
.feed-foot #embed-line { color: var(--ink); }
.fine { font-size: 13px; line-height: 18px; }

/* Without JavaScript. */
.notice { margin: 16px; color: var(--ink-2); }
