*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #040805;
  --green: #45ff7f;
  --green-hot: #d7ffe4;
  --green-soft: #b9f5c9;
  --dim: #1e7d3f;
  --dim-2: #10502a;
  --amber: #ffb547;
  --line: rgba(69, 255, 127, 0.16);
  --grid: rgba(69, 255, 127, 0.045);
  --glow: 0 0 6px rgba(69, 255, 127, 0.55);
  --font: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Menlo,
    Consolas, "Liberation Mono", monospace;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(0px, 3vw, 32px);
  color: var(--green);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  background:
    radial-gradient(1100px 700px at 50% -10%, rgba(30, 125, 63, 0.18), transparent 70%),
    radial-gradient(900px 600px at 85% 110%, rgba(30, 125, 63, 0.08), transparent 60%),
    var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.35;
  pointer-events: none;
}

.crt {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.22) 0,
    rgba(0, 0, 0, 0.22) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.5;
  animation: flicker 7s infinite steps(60);
}

.crt::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    120% 100% at 50% 50%,
    transparent 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

@keyframes flicker {
  0%,
  100% {
    opacity: 0.5;
  }
  48% {
    opacity: 0.46;
  }
  50% {
    opacity: 0.55;
  }
  52% {
    opacity: 0.45;
  }
}

.terminal {
  position: relative;
  width: min(1200px, 100%);
  height: min(900px, 90dvh);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(5, 16, 9, 0.96), rgba(4, 10, 6, 0.98));
  box-shadow:
    inset 0 0 60px rgba(69, 255, 127, 0.03),
    0 0 0 1px #000,
    0 24px 80px rgba(0, 0, 0, 0.75),
    0 0 32px rgba(69, 255, 127, 0.06);
  overflow: hidden;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.tilde {
  color: var(--green);
  text-shadow: var(--glow);
}

.sep {
  color: var(--dim-2);
}

.chan {
  color: var(--green-hot);
  text-shadow: var(--glow);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.8ch;
  color: var(--dim);
  font-size: 11px;
  white-space: nowrap;
}

.meta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.online {
  padding-left: 14px;
  border-left: 1px solid var(--line);
  color: var(--green-soft);
  font-size: 11px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim-2);
  flex: none;
}

.status.on {
  color: #7bd99a;
}

.status.on .led {
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: pulse 2.4s ease-in-out infinite;
}

.status.off {
  color: var(--amber);
}

.status.off .led {
  background: var(--amber);
  box-shadow: 0 0 10px rgba(255, 181, 71, 0.6);
  animation: pulse 0.8s steps(2) infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.banner {
  margin: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px dashed var(--line);
  color: var(--dim);
  font-size: 11px;
  line-height: 1.4;
  white-space: pre;
  overflow: hidden;
}

.banner-tag {
  color: var(--dim);
}

.log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  scrollbar-color: var(--dim-2) transparent;
  scrollbar-width: thin;
}

.log::-webkit-scrollbar {
  width: 8px;
}

.log::-webkit-scrollbar-track {
  background: transparent;
}

.log::-webkit-scrollbar-thumb {
  background: var(--dim-2);
  border-radius: 0;
}

.log::-webkit-scrollbar-thumb:hover {
  background: var(--dim);
}

.msg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 0.8ch;
  min-width: 0;
  color: var(--dim-2);
  font-size: 11px;
  line-height: 1.35;
}

.msg {
  display: block;
  padding: 1px 0 1px 0.9ch;
  border-left: 2pt ridge rgba(7, 83, 13, 0.62);
  animation: enter 160ms ease-out;
}

.msg-item.mine .msg {
  border-left-color: #c900e0;
  box-shadow: -5px 0 12px -7px rgba(201, 0, 224, 0.85);
}

/* Hover/focus quick actions on a message row (reply + react). */
.msg-act {
  flex: none;
  margin-left: auto;
  display: inline-flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 120ms ease;
}

.msg-item:hover .msg-act,
.msg-act:focus-within {
  opacity: 1;
}

.msg-act-btn {
  padding: 0 5px;
  border: 1px solid var(--dim-2);
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 10px;
  line-height: 1.6;
  cursor: pointer;
}

.msg-act-btn:hover,
.msg-act-btn:focus-visible {
  color: var(--green);
  border-color: var(--dim);
  outline: none;
}

/* Touch screens have no hover — keep the actions reachable. */
@media (pointer: coarse) {
  .msg-act {
    opacity: 0.7;
  }
}

/* Jump-to-bottom pill with the unread count, above the composer. */
.to-bottom {
  position: absolute;
  right: 20px;
  bottom: 92px;
  z-index: 15;
  padding: 5px 12px;
  border: 1px solid var(--dim);
  border-radius: 999px;
  background: rgba(4, 8, 5, 0.92);
  color: var(--green);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(69, 255, 127, 0.18);
}

.to-bottom:hover,
.to-bottom:focus-visible {
  color: var(--green-hot);
  outline: none;
  box-shadow: 0 0 18px rgba(69, 255, 127, 0.3);
}

.to-bottom[hidden] {
  display: none;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.time {
  font-size: 10px;
  flex: none;
  color: var(--dim-2);
}

.name {
  flex: none;
  color: var(--green);
  text-shadow: 0 0 5px rgba(69, 255, 127, 0.35);
}

.tripcode {
  flex: none;
  color: var(--amber);
  text-shadow: 0 0 6px rgba(255, 181, 71, 0.35);
}

/* Bridged authors: one amber unit so remote identities never read as
   local green names. */
.name-bridged {
  color: var(--amber);
  text-shadow: 0 0 5px rgba(255, 181, 71, 0.35);
}

.body {
  flex: 1 1 0;
  min-width: 0;
  color: var(--green-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg-link {
  color: var(--amber);
  text-decoration: underline;
  text-decoration-color: rgba(255, 181, 71, 0.4);
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

.msg-link:hover,
.msg-link:focus-visible {
  color: #ffcd7a;
  text-decoration-color: var(--amber);
}

/* Inline markdown. These are the only effects md-tags.toml can select —
   style-src 'self' forbids inline styles, so custom markers map to classes. */
.md-b {
  font-weight: 700;
  color: var(--green-hot);
  text-shadow: var(--glow);
}

.md-i {
  font-style: italic;
  color: var(--green-soft);
}

.md-c {
  color: var(--green-hot);
  border: 1px solid var(--dim-2);
  background: rgba(69, 255, 127, 0.07);
  padding: 0 3px;
  white-space: pre-wrap;
}

.md-s {
  color: var(--dim);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 181, 71, 0.55);
}

.md-e-red {
  color: #ff7a7a;
}
.md-e-amber {
  color: var(--amber);
}
.md-e-green {
  color: var(--green);
}
.md-e-cyan {
  color: #7adfff;
}
.md-e-pink {
  color: #ff7ac8;
}
.md-e-white {
  color: var(--green-hot);
}
.md-e-dim {
  color: var(--dim);
}
.md-e-glow {
  text-shadow: 0 0 10px rgba(69, 255, 127, 0.7), var(--glow);
}
.md-e-invert {
  color: #041006;
  background: var(--green);
  padding: 0 2px;
  text-shadow: none;
}

.media {
  display: flex;
  flex-flow: row wrap;
  align-items: flex-start;
  gap: 6px;
  margin: 3px 0 3px;
  padding-left: 1.8ch;
}

.media-youtube {
  flex: 0 1 auto;
  width: min(100%, 384px);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--dim-2);
  background: #000;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.55);
}

.media-youtube-facade {
  position: relative;
  display: block;
  flex: 0 1 auto;
  width: min(100%, 384px);
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 1px solid var(--dim-2);
  background: #000;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.55);
}

.media-youtube-facade:hover,
.media-youtube-facade:focus-visible {
  border-color: var(--dim);
  outline: none;
}

.media-youtube-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
  transition: opacity 120ms ease;
}

.media-youtube-facade:hover .media-youtube-thumb,
.media-youtube-facade:focus-visible .media-youtube-thumb {
  opacity: 1;
}

.media-youtube-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 52px;
  height: 36px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 120ms ease,
    box-shadow 120ms ease;
}

.media-youtube-play::before {
  content: "";
  margin-left: 4px;
  border-left: 16px solid #fff;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

.media-youtube-facade:hover .media-youtube-play,
.media-youtube-facade:focus-visible .media-youtube-play {
  background: rgba(7, 83, 13, 0.92);
  box-shadow: 0 0 14px rgba(69, 255, 127, 0.45);
}

.media-thumb {
  position: relative;
  display: block;
  flex: none;
  padding: 3px;
  border: 1px solid var(--dim-2);
  background: rgba(69, 255, 127, 0.03);
  color: var(--dim);
  font: inherit;
  font-size: 10px;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.media-thumb:hover,
.media-thumb:focus-visible {
  border-color: var(--dim);
  box-shadow: 0 0 14px rgba(69, 255, 127, 0.16);
  outline: none;
}

.media-thumb-label {
  display: inline-block;
  min-width: 2.4em;
  text-align: center;
}

.media-thumb-img {
  display: block;
  max-width: 56px;
  max-height: 56px;
}

.media-video .media-thumb-video {
  display: block;
  width: min(96px, 20vw);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}

.media-thumb.open .media-full-img {
  display: block;
  max-width: min(360px, 60vw);
  max-height: 280px;
  width: auto;
  height: auto;
  background: #000;
}

.media-thumb.open .media-full-video {
  display: block;
  width: min(368px, 70vw);
  aspect-ratio: 16 / 9;
  background: #000;
}

.media-audio audio {
  width: min(280px, 70vw);
  height: 32px;
  color-scheme: dark;
}

.media video,
.media-youtube {
  color-scheme: dark;
}

.msg-item {
	padding: 1px 0;
    background-color: #16011a7a;
    margin: 3px;
}

.msg-item.jump {
  animation: jump-flash 1.3s ease-out;
}

@keyframes jump-flash {
  from {
    background: rgba(69, 255, 127, 0.16);
  }
  to {
    background: transparent;
  }
}

.post-num {
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  cursor: pointer;
  transition: color 120ms ease, text-shadow 120ms ease;
}

.post-num:hover,
.post-num:focus-visible {
  color: var(--green);
  text-shadow: var(--glow);
  outline: none;
}

/* Dim edited marker sitting right after the post number, e.g. `#12 (edited)` */
.edited-tag {
  flex: none;
  color: var(--dim-2);
  font-size: 11px;
  line-height: 1.4;
}

.reply-ref {
  display: flex;
  align-items: baseline;
  gap: 0.7ch;
  margin: 0 0 1px;
  padding-left: 1.8ch;
  font-size: 11px;
  line-height: 1.4;
  overflow: hidden;
}

.reply-arrow {
  flex: none;
  color: var(--dim-2);
}

.reply-link {
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: color 120ms ease;
}

.reply-link:hover,
.reply-link:focus-visible {
  color: var(--green);
  outline: none;
}

.reply-quote {
  min-width: 0;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-quote.missing {
  color: var(--dim-2);
  font-style: italic;
}

.reaction-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  margin: 1px 0 3px;
  padding-left: 1.8ch;
  font-size: 11px;
}

.reaction-pill {
  color: var(--dim-2);
  white-space: nowrap;
}

.reaction-pill.mine {
  color: var(--green);
  text-shadow: 0 0 8px rgba(69, 255, 127, 0.35);
}

.reply-target {
  display: flex;
  align-items: center;
  gap: 1ch;
  padding: 6px 16px;
  border-top: 1px dashed var(--line);
  background: rgba(0, 0, 0, 0.25);
  color: var(--dim);
  font-size: 12px;
}

.reply-target[hidden] {
  display: none;
}

.reply-target-label {
  flex: none;
}

.reply-target-num {
  flex: none;
  padding: 1px 7px;
  border: 1px solid var(--dim-2);
  background: transparent;
  color: var(--green);
  font: inherit;
  cursor: pointer;
  transition: box-shadow 120ms ease;
}

.reply-target-num:hover,
.reply-target-num:focus-visible {
  box-shadow: var(--glow);
  outline: none;
}

.reply-target-cancel {
  flex: none;
  margin-left: auto;
  padding: 0 6px;
  border: 1px solid var(--dim-2);
  background: transparent;
  color: var(--dim);
  font: inherit;
  line-height: 1.4;
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
}

.reply-target-cancel:hover,
.reply-target-cancel:focus-visible {
  color: var(--amber);
  border-color: var(--amber);
  outline: none;
}

.sys {
  padding: 2px 0;
  color: var(--dim);
  font-size: 12px;
}

.sys.error {
  color: var(--amber);
}

.sys-prompt {
  color: var(--dim-2);
}

.help-usage {
  color: var(--green-hot);
  text-shadow: var(--glow);
}

.help-description {
  color: var(--dim);
}

/* Whispers: live-only private lines, kept visually apart from the channel. */
.whisper {
  display: block;
  padding: 2px 0;
  color: var(--dim);
  font-size: 12px;
}

.whisper-tag {
  margin-right: 1ch;
  color: var(--amber);
}

.whisper-body {
  color: var(--dim);
}

.whisper.mine .whisper-tag {
  color: var(--green-soft);
}

.whisper.mine .whisper-body {
  color: var(--dim);
}

.prompt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1ch;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
}

/* Nothing in the composer holds focus? The bar glows until you click into it. */
.prompt:not(:focus-within) {
	background: rgb(195 63 167 / 15%);
}
.caret {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4ch;
  color: var(--green);
  text-shadow: var(--glow);
}

.prompt input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--green-hot);
  font: inherit;
  caret-color: #005500;
  caret-shape: block;
}

.prompt input::placeholder {
  color: var(--dim-2);
  opacity: 1;
}

.block {
  flex: none;
  width: 0.62ch;
  height: 1.05em;
  background: var(--green);
  box-shadow: 0 0 8px rgba(69, 255, 127, 0.8);
  animation: blink 1.1s steps(1) infinite;
}

.prompt:has(input:not(:placeholder-shown)) .block {
  opacity: 0;
}

@keyframes blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

.kao-toggle {
  flex: none;
  padding: 3px 7px;
  border: 1px solid var(--dim-2);
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.kao-toggle:hover,
.kao-toggle:focus-visible,
.kao-toggle.open {
  color: var(--green);
  border-color: var(--dim);
  box-shadow: 0 0 12px rgba(69, 255, 127, 0.15);
  outline: none;
}

.kao-toggle:disabled {
  color: var(--dim-2);
  cursor: wait;
  opacity: 0.55;
}

.kao-picker {
  position: absolute;
  right: 16px;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(720px, calc(100vw - 48px));
  max-height: min(420px, 62vh);
  padding: 8px;
  overflow: hidden;
  border: 1px solid var(--dim-2);
  background: rgba(3, 10, 6, 0.98);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.6),
    0 0 18px rgba(69, 255, 127, 0.08);
}

.kao-picker.reaction-mode {
  border-color: var(--dim);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.6),
    0 0 18px rgba(69, 255, 127, 0.16);
}

.kao-picker[hidden] {
  display: none;
}

.kao-picker-label {
  display: block;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
  color: var(--dim);
  font-size: 11px;
}

.kao-picker-label[hidden] {
  display: none;
}

.kao-categories {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 72px;
  overflow-y: auto;
  scrollbar-color: var(--dim-2) transparent;
  scrollbar-width: thin;
}

.kao-category {
  padding: 2px 7px;
  border: 1px solid var(--dim-2);
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 11px;
  line-height: 1.3;
  cursor: pointer;
  transition:
    color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.kao-category:hover,
.kao-category:focus-visible {
  color: var(--green);
  border-color: var(--dim);
  outline: none;
}

.kao-category.active {
  color: var(--green);
  border-color: var(--dim);
  box-shadow: 0 0 10px rgba(69, 255, 127, 0.14);
}

.kao-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 5px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-color: var(--dim-2) transparent;
  scrollbar-width: thin;
}

.kao-option {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 2.45em;
  padding: 5px 22px 5px 8px;
  border: 1px solid var(--dim-2);
  background: rgba(69, 255, 127, 0.025);
  color: var(--green-soft);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition:
    color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.kao-option:hover,
.kao-option:focus-visible {
  color: var(--green-hot);
  border-color: var(--dim);
  box-shadow: 0 0 10px rgba(69, 255, 127, 0.12);
  outline: none;
}

.kao-option.active {
  color: var(--green);
  border-color: var(--dim);
  box-shadow: 0 0 12px rgba(69, 255, 127, 0.18);
}

.kao-fav {
  position: absolute;
  top: 2px;
  right: 4px;
  color: var(--dim-2);
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
}

.kao-fav:hover,
.kao-fav:focus-visible {
  color: var(--amber);
  outline: none;
}

.kao-fav[aria-pressed="true"] {
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255, 181, 71, 0.5);
}

.kao-empty {
  grid-column: 1 / -1;
  padding: 12px 8px;
  color: var(--dim);
  font-size: 11px;
  text-align: center;
}

.setup-toggle {
  flex: none;
  padding: 3px 7px;
  border: 1px solid var(--dim-2);
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.setup-toggle:hover,
.setup-toggle:focus-visible,
.setup-toggle.open {
  color: var(--green);
  border-color: var(--dim);
  box-shadow: 0 0 12px rgba(69, 255, 127, 0.15);
  outline: none;
}

.setup-menu {
  position: absolute;
  right: 16px;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 240px;
  padding: 10px;
  border: 1px solid var(--dim-2);
  background: rgba(3, 10, 6, 0.98);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.6),
    0 0 18px rgba(69, 255, 127, 0.08);
}

.setup-menu[hidden] {
  display: none;
}

.setup-menu-label {
  padding-bottom: 2px;
  border-bottom: 1px dashed var(--line);
  color: var(--dim);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.setup-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2ch;
  padding: 6px 8px;
  border: 1px solid var(--dim-2);
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition:
    color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.setup-option:hover,
.setup-option:focus-visible {
  color: var(--green);
  border-color: var(--dim);
  box-shadow: 0 0 12px rgba(69, 255, 127, 0.1);
  outline: none;
}

.setup-option.active {
  color: var(--green);
  border-color: var(--dim);
  box-shadow: 0 0 12px rgba(69, 255, 127, 0.15);
}

.setup-option-state {
  flex: none;
  color: var(--dim-2);
  letter-spacing: 0.1em;
}

.setup-option.active .setup-option-state {
  color: var(--green);
  text-shadow: var(--glow);
}

.setup-name-editor {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 0 2px;
}

.setup-channels-editor {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 1px 0 2px;
}

.setup-channels-editor[hidden] {
  display: none;
}

.setup-channel {
  display: flex;
  align-items: center;
  gap: 1.2ch;
  padding: 5px 8px;
  border: 1px solid var(--dim-2);
  color: var(--dim);
  font-size: 12px;
  cursor: pointer;
}

.setup-channel:hover,
.setup-channel:focus-within {
  color: var(--green);
  border-color: var(--dim);
}

.setup-channel input {
  margin: 0;
  accent-color: #45ff7f;
}

.setup-channels-empty {
  margin: 0;
  padding: 4px 8px;
  color: var(--dim-2);
  font-size: 11px;
}

.setup-name-editor[hidden] {
  display: none;
}

.setup-name-input {
  flex: 1;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid var(--dim-2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--green-hot);
  font: inherit;
  font-size: 12px;
}

.setup-name-input:focus {
  border-color: var(--dim);
  box-shadow: 0 0 12px rgba(69, 255, 127, 0.12);
  outline: none;
}

.setup-name-save {
  flex: none;
  padding: 5px 9px;
  border: 1px solid var(--dim-2);
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.setup-name-save:hover,
.setup-name-save:focus-visible {
  color: var(--green);
  border-color: var(--dim);
  box-shadow: 0 0 12px rgba(69, 255, 127, 0.15);
  outline: none;
}

.send {
  flex: none;
  padding: 3px 10px;
  border: 1px solid var(--dim-2);
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.send:hover,
.send:focus-visible {
  color: var(--green);
  border-color: var(--dim);
  box-shadow: 0 0 12px rgba(69, 255, 127, 0.15);
  outline: none;
}

.foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 16px 8px;
  color: var(--dim-2);
  font-size: 11px;
}

.counter.warn {
  color: var(--amber);
}

:focus-visible {
  outline: 1px dashed var(--dim);
  outline-offset: 2px;
}

::selection {
  background: rgba(69, 255, 127, 0.28);
  color: var(--green-hot);
}

@media (max-width: 640px) {
  body {
    padding: 0;
  }

  .terminal {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .banner {
    padding: 10px 12px;
    font-size: 10px;
  }

  .log {
    padding: 12px;
  }

  .send {
    display: none;
  }

  .reply-ref,
  .reaction-summary {
    padding-left: 0;
  }

  .media {
    padding-left: 0;
  }

  .media-youtube,
  .media-youtube-facade {
    width: 100%;
  }

  .reply-target {
    padding: 6px 12px;
    font-size: 11px;
  }

  .kao-picker {
    right: 12px;
    width: calc(100vw - 24px);
    max-height: 56vh;
  }

  .setup-menu {
    right: 12px;
    width: calc(100vw - 24px);
  }

  .kao-toggle,
  .setup-toggle {
    padding: 3px 6px;
  }

  .prompt {
    padding: 10px 12px;
  }

  .prompt input {
    font-size: 16px; /* prevent iOS zoom */
  }

  .foot {
    padding: 6px 12px 8px;
  }

  .online {
    padding-left: 10px;
    font-size: 10px;
  }

  .foot-note {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-height: 560px) {
  .banner {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .crt,
  .block,
  .status .led,
  .msg {
    animation: none;
  }
}
