/* Nightboard '83
   Copyright (C) 2026 Ralf Wissing
   SPDX-License-Identifier: AGPL-3.0-or-later */
@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/PressStart2P-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Press Start 2P";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/PressStart2P.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "VT323";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/VT323-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "VT323";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/VT323.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Caveat";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/Caveat.woff2") format("woff2");
}

:root {
  --bg0: #191621;
  --bg1: #241b2f;
  --bg2: #2a2139;
  --bg3: #34294f;
  --fg: #d8ffe8;
  --muted: #7ec8a8;
  --comment: #4a7a68;
  --pink: #ff7edb;
  --cyan: #03edf9;
  --mint: #72f1b8;
  --yellow: #fede5d;
  --red: #fe4450;
  --orange: #f97e72;
  --line: #3d3158;
  --radius: 10px;
  --font: "VT323", "Courier New", ui-monospace, monospace;
  --font-ui: "Press Start 2P", "VT323", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
/* Author `display` rules beat the UA [hidden] { display: none } unless forced. */
[hidden] { display: none !important; }

html {
  background: #050308;
}
body {
  display: flex;
  flex-direction: column;
  padding: 12px;
  font-family: var(--font);
  font-size: 26px;
  line-height: 1.3;
  color: var(--fg);
  background:
    radial-gradient(ellipse at 50% 35%, #2a1438 0%, #120818 55%, #050308 100%);
}

#app {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border-radius: 22px 22px 16px 16px / 32px 32px 20px 20px;
  background:
    radial-gradient(1200px 500px at 50% -10%, #f92aad22, transparent 55%),
    linear-gradient(180deg, var(--bg2) 0%, var(--bg0) 70%);
  box-shadow:
    inset 0 0 90px rgba(0, 0, 0, 0.55),
    inset 0 0 2px #72f1b866,
    0 0 0 2px #2a1838,
    0 0 0 7px #0c0914,
    0 0 0 8px #ff7edb44,
    0 0 48px #03edf924;
}

/* Glass reflection on the tube */
#app::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.02) 22%,
    transparent 42%
  );
}

/* Scanlines + RGB phosphor + vignette */
body.crt::after {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.22) 2px,
      rgba(0, 0, 0, 0.22) 3px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 0, 80, 0.03) 0px,
      rgba(0, 255, 70, 0.02) 1px,
      rgba(0, 80, 255, 0.03) 2px
    ),
    radial-gradient(ellipse 78% 68% at 50% 48%, transparent 52%, rgba(0, 0, 0, 0.62) 100%);
  animation: crt-flicker 3.5s infinite;
}

/* Rolling scan */
body.crt::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(114, 241, 184, 0.045) 50%,
    transparent 100%
  );
  background-size: 100% 18%;
  background-repeat: no-repeat;
  animation: crt-roll 9s linear infinite;
}

@keyframes crt-flicker {
  0% { opacity: 0.97; }
  8% { opacity: 1; }
  9% { opacity: 0.94; }
  10% { opacity: 1; }
  70% { opacity: 0.98; }
  100% { opacity: 0.99; }
}
@keyframes crt-roll {
  from { background-position: 0 -30%; }
  to { background-position: 0 130%; }
}

@media (prefers-reduced-motion: reduce) {
  body.crt::before,
  body.crt::after { animation: none; }
  .is-ticker { animation: none !important; }
  .conn-status.is-connected { animation: none; opacity: 1; }
  .dock-icon.has-unread svg { animation: none; }
  .tos-zoom { display: none !important; }
  .sw-update-cursor { animation: none; opacity: 1; }
  .sw-update-bar i { transition: none; }
}

.is-ticker {
  animation: ticker-in 0.55s ease-out both;
}
@keyframes ticker-in {
  from {
    opacity: 0;
    transform: translateY(-40%);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #241b2fd9;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border: 1px solid var(--pink);
  color: var(--cyan);
  font-family: var(--font-ui);
  font-size: 21px;
  letter-spacing: 0;
  text-shadow: 1px 0 0 #ff7edb88, -1px 0 0 #03edf988, 0 0 8px #03edf980;
}
.brand h1 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 1px 0 0 #ff7edb66, -1px 0 0 #03edf966, 0 0 10px #03edf955;
}
.brand h1 em { color: var(--pink); font-style: normal; text-shadow: 1px 0 0 #03edf966, -1px 0 0 #ff7edb66, 0 0 10px #ff7edb88; }
.instance { margin: 0; color: var(--muted); font-size: 21px; }
.conn-status:empty { display: none; }
.conn-status::before { content: " - "; }
.conn-status.is-connected {
  color: var(--mint);
  animation: conn-pulse 1.8s ease-in-out infinite;
  text-shadow: 0 0 8px #72f1b888;
}
.conn-status.is-carrier-lost {
  color: var(--red);
  font-weight: 700;
  font-size: 1.08em;
  text-shadow: 0 0 10px #fe4450aa;
}
.conn-status.is-offline { color: var(--yellow); text-shadow: 0 0 8px #fede5d66; }
.license-line {
  margin: 12px 0 0;
  font-size: 18px;
  color: var(--comment);
}
.license-line a, .source-link {
  color: var(--cyan);
  text-decoration: none;
}
.license-line a:hover, .source-link:hover { text-decoration: underline; }
.source-link {
  margin-left: 8px;
  font-size: 16px;
  color: var(--comment);
}
@keyframes conn-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
.outbox-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 4px 8px;
  background: transparent;
  image-rendering: pixelated;
}
.outbox-glyph { display: block; image-rendering: pixelated; }
.outbox-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  padding: 1px 4px;
  background: var(--pink);
  color: #191621;
  font-family: var(--font-ui);
  font-size: 8px;
  line-height: 1.4;
  text-align: center;
}
.outbox-body { overflow: auto; padding: 12px 14px; flex: 1; min-height: 0; }
.outbox-item {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.outbox-context { opacity: 0.85; margin-bottom: 8px; }
.outbox-edit {
  width: 100%;
  min-height: 90px;
  margin: 8px 0;
  background: #191621;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--fg);
}
.outbox-actions { display: flex; gap: 8px; justify-content: flex-end; }
#outbox-dialog,
#drafts-dialog {
  width: 80vw;
  max-width: 80vw;
  height: min(860px, calc(100vh - 24px));
  min-height: 0;
}
.topbar .brand { display: none; }
.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  align-items: center;
}
.top-actions .outbox-btn {
  min-width: 48px;
  width: 48px;
  height: 48px;
  padding: 6px;
}
.top-actions .outbox-glyph {
  width: 28px;
  height: 28px;
}
.top-actions .outbox-btn.primary {
  min-width: 48px;
  padding: 6px;
}

button, select, input, textarea {
  font: inherit;
  color: var(--fg);
}
button {
  font-family: var(--font-ui);
  font-size: 10px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: var(--bg3);
  padding: 10px 12px;
  border-radius: 2px;
  cursor: pointer;
  image-rendering: pixelated;
}
button:hover { border-color: var(--cyan); }
button.primary {
  background: linear-gradient(180deg, #3a2150, #2a1638);
  border-color: var(--pink);
  color: #fff;
  text-shadow: 0 0 8px #ff7edb66;
}
button.ghost { background: transparent; }
button.danger { border-color: #fe445066; color: var(--orange); }
button.icon-btn {
  width: 40px; height: 40px; padding: 0;
  background: transparent;
  font-family: var(--font);
  font-size: 24px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
}
button.icon-btn .collapse-glyph {
  width: 16px;
  height: 16px;
  display: block;
}
button:disabled { opacity: 0.5; cursor: default; }

.login-panel {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(640px, 100%);
}
.login-wordmark {
  position: relative;
  isolation: isolate;
  display: inline-block;
  margin: 0 0 28px;
  padding: 0.22em 1.7em 0.12em 0;
  font-size: 56px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}
.login-name {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 1em;
  font-style: italic;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: skewX(-10deg);
  background-image:
    linear-gradient(
      185deg,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(255, 255, 255, 0.35) 16%,
      rgba(255, 255, 255, 0) 28%
    ),
    linear-gradient(
      180deg,
      #ffffff 0%,
      #f4f8ff 6%,
      #c5d0e0 12%,
      #7e8ea3 18%,
      #eef3fa 24%,
      #9aa8ba 32%,
      #ffffff 38%,
      #d9e0ea 44%,
      #b7c2d0 50%,
      #ffd4f2 58%,
      #ff9ae4 68%,
      #ff7edb 78%,
      #ff4ec4 90%,
      #c22e86 100%
    );
  background-blend-mode: screen, normal;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px #160c22;
  paint-order: stroke fill;
  filter:
    drop-shadow(0 -1px 0 #ffffffcc)
    drop-shadow(2px 0 0 #160c22)
    drop-shadow(-2px 0 0 #160c22)
    drop-shadow(0 2px 0 #160c22)
    drop-shadow(0 -2px 0 #160c22)
    drop-shadow(2px 3px 0 #3a1840)
    drop-shadow(0 0 14px #ffe6f888)
    drop-shadow(0 0 22px #ff7edb77);
}
.login-year {
  position: absolute;
  right: -0.06em;
  top: -0.04em;
  z-index: 0;
  margin: 0;
  font-family: "Caveat", "Comic Sans MS", cursive;
  font-size: 1.4em;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #ff3eb5;
  transform: rotate(-12deg);
  transform-origin: 10% 60%;
  opacity: 0.94;
  text-shadow:
    0 1px 0 #9a1868,
    0 0 10px #ff7edb99;
  pointer-events: none;
}
.login-card {
  width: 100%;
  background: #241b2fcc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: 0 0 40px #f92aad22;
}
.login-card h2 {
  margin: 0 0 12px;
  font-family: var(--font-ui);
  font-size: 21px;
  font-weight: 400;
  color: var(--cyan);
  text-shadow: 1px 0 0 #ff7edb66, -1px 0 0 #03edf966, 0 0 12px #03edf966;
}
.login-card p { color: var(--muted); line-height: 1.35; }
.login-card label {
  display: block;
  margin: 14px 0 8px;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 10px;
  line-height: 1.6;
}
.login-card input, .login-card textarea, #overlay-body input {
  width: 100%;
  background: #191621;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}
.row { display: flex; gap: 8px; margin-top: 10px; }
.hint { min-height: 1.2em; color: var(--yellow); font-size: 24px; }

.columns {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: row;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}
.col {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #1d1728aa;
  position: relative;
  z-index: 2;
}
.col.is-last-visible { border-right: 0; }
.col.is-collapsed {
  display: none !important;
}
.columns.is-expanded .col:not(.is-expanded) { display: none !important; }
.columns.is-expanded .col.is-expanded { border-right: 0; }

.desktop-logo {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.desktop-logo .login-wordmark { margin: 0; }

.col-dock {
  position: static;
  display: flex;
  flex-direction: row;
  flex: 1;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 0 8px;
  z-index: 5;
}
.dock-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 56px;
  min-height: 48px;
  padding: 4px;
  background: transparent;
  border: 1px dotted transparent;
  border-radius: 0;
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 7px;
  line-height: 1.3;
  text-transform: uppercase;
  image-rendering: pixelated;
}
.dock-icon svg {
  width: 36px;
  height: 36px;
  display: block;
  image-rendering: pixelated;
  filter: none;
}
.dock-icon.is-home { color: #ffd6f4; }
.dock-icon.is-local { color: #d6fbff; }
.dock-icon.is-federated { color: #fff3c2; }
.dock-icon.is-notes { color: #e4ffe8; }
.dock-icon.has-unread.is-home {
  text-shadow: 0 0 4px #fff, 0 0 8px #ff7edb, 0 0 16px #ff7edb, 0 0 28px #ff7edbee;
}
.dock-icon.has-unread.is-local {
  text-shadow: 0 0 4px #fff, 0 0 8px #03edf9, 0 0 16px #03edf9, 0 0 28px #03edf9ee;
}
.dock-icon.has-unread.is-federated {
  text-shadow: 0 0 4px #fff, 0 0 8px #fede5d, 0 0 16px #fede5d, 0 0 28px #fede5dee;
}
.dock-icon.has-unread.is-notes {
  text-shadow: 0 0 4px #fff, 0 0 8px #72f1b8, 0 0 16px #72f1b8, 0 0 28px #72f1b8ee;
}
.dock-icon.has-unread.is-home svg {
  filter:
    drop-shadow(0 0 2px #fff)
    drop-shadow(0 0 5px #ffb3ec)
    drop-shadow(0 0 12px #ff7edb)
    drop-shadow(0 0 22px #ff7edb);
}
.dock-icon.has-unread.is-local svg {
  filter:
    drop-shadow(0 0 2px #fff)
    drop-shadow(0 0 5px #9af7ff)
    drop-shadow(0 0 12px #03edf9)
    drop-shadow(0 0 22px #03edf9);
}
.dock-icon.has-unread.is-federated svg {
  filter:
    drop-shadow(0 0 2px #fff)
    drop-shadow(0 0 5px #ffe79a)
    drop-shadow(0 0 12px #fede5d)
    drop-shadow(0 0 22px #fede5d);
}
.dock-icon.has-unread.is-notes svg {
  filter:
    drop-shadow(0 0 2px #fff)
    drop-shadow(0 0 5px #b6ffd4)
    drop-shadow(0 0 12px #72f1b8)
    drop-shadow(0 0 22px #72f1b8);
}
.dock-icon.has-unread svg { animation: unread-pulse 1.6s ease-in-out infinite; }
@keyframes unread-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.dock-icon:hover,
.dock-icon:focus-visible {
  background: #d8ffe8;
  color: #191621;
  border-color: #d8ffe8;
  text-shadow: none;
}
.dock-icon:hover svg,
.dock-icon:focus-visible svg {
  filter: none;
  animation: none;
}

.statusbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-top: 1px solid var(--line);
  background: #241b2fd9;
  backdrop-filter: blur(8px);
  flex-shrink: 0;
  z-index: 5;
}
.statusbar .instance {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 21px;
}
.carrier-btn {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  min-width: 48px;
  padding: 6px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  image-rendering: pixelated;
}
.carrier-btn svg { display: block; image-rendering: pixelated; width: 32px; height: 32px; }
.carrier-btn .phone-up { display: none; }
.carrier-btn .phone-down { display: block; }
.carrier-btn.is-online .phone-up { display: block; }
.carrier-btn.is-online .phone-down { display: none; }
.carrier-btn.is-offline { border-color: var(--red); }
.carrier-btn.is-online { border-color: var(--mint); }

.tos-zoom {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
  display: none;
}
.tos-zoom.is-on { display: block; }
.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.col-head-actions { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.col-head-actions select {
  max-width: 7.8em;
  margin-right: 4px;
  padding: 2px 4px;
  background: #191621;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--font);
  font-size: 18px;
}
.oauth-fallback {
  margin-top: 12px;
  color: var(--muted);
  font-size: 20px;
}
.oauth-fallback summary { cursor: pointer; color: var(--cyan); }
.oauth-fallback label { display: block; margin-top: 8px; }
.col-head h2 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.col-head.home h2 { color: var(--pink); text-shadow: 1px 0 0 #03edf955, 0 0 8px #ff7edb55; }
.col-head.local h2 { color: var(--cyan); text-shadow: -1px 0 0 #ff7edb55, 0 0 8px #03edf955; }
.col-head.federated h2 { color: var(--yellow); text-shadow: 1px 0 0 #ff7edb55, 0 0 8px #fede5d55; }
.col-head.notes h2 { color: var(--mint); text-shadow: 1px 0 0 #03edf955, 0 0 8px #72f1b855; }
.col-body {
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.status, .notice, .empty, .error {
  padding: 12px;
  border-bottom: 1px solid #34294f66;
}
.status { cursor: pointer; }
.status:hover { background: #ff7edb0c; }
.status.is-thread-root { background: #03edf914; }
.status.is-reply-target { box-shadow: inset 3px 0 0 var(--cyan); background: #03edf912; }
.empty, .error { color: var(--muted); font-size: 24px; }
.error { color: var(--orange); }
.status-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
button.acct-open {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  image-rendering: auto;
}
button.acct-open:hover {
  background: transparent;
  border-color: transparent;
}
button.acct-open:hover .display { color: var(--cyan); }
button.acct-open-inline {
  display: inline;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  image-rendering: auto;
}
button.acct-open-inline:hover {
  background: transparent;
  border-color: transparent;
  color: var(--cyan);
}
.avatar {
  width: 40px; height: 40px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--bg3);
  flex-shrink: 0;
}
.who { min-width: 0; flex: 1; }
.display {
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct, .time {
  color: var(--muted);
  font-size: 21px;
}
.boost-line {
  color: var(--comment);
  font-size: 21px;
  margin-bottom: 6px;
}
.content {
  margin: 8px 0 0 50px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.content p { margin: 0 0 0.6em; }
.content a { color: var(--cyan); }
.content img,
.profile-note img {
  height: 1.2em;
  width: auto;
  max-height: 1.2em;
  max-width: 1.4em;
  vertical-align: -0.2em;
  display: inline;
  border: 0;
  border-radius: 0;
  background: transparent;
  image-rendering: auto;
}
.cw {
  margin: 8px 0 0 50px;
}
.cw button { margin-top: 6px; }

.poll {
  margin: 8px 0 0 50px;
  border: 1px solid var(--line);
  background: #191621aa;
  padding: 8px 10px;
  display: grid;
  gap: 6px;
}
.poll-option {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #241b2fcc;
  color: var(--fg);
  padding: 6px 8px;
  font: inherit;
  cursor: pointer;
  overflow: hidden;
}
.poll-option:hover { border-color: var(--cyan); }
.poll-option:disabled {
  cursor: default;
  opacity: 1;
}
.poll-option.is-selected { border-color: var(--pink); box-shadow: inset 0 0 0 1px var(--pink); }
.poll-option.is-own { border-color: var(--cyan); }
.poll-option-title {
  position: relative;
  z-index: 1;
  overflow-wrap: anywhere;
  line-height: 1.25;
}
.poll-option-pct {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.poll-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, #03edf933, #ff7edb22);
  pointer-events: none;
}
.poll-option.is-own .poll-bar {
  background: linear-gradient(90deg, #03edf955, #72f1b833);
}
.poll-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.3;
}
.poll-meta .poll-hint { color: var(--cyan); }
.poll-submit {
  justify-self: start;
  border: 1px solid var(--pink);
  background: transparent;
  color: var(--pink);
  padding: 4px 10px;
  font: inherit;
  cursor: pointer;
}
.poll-submit:hover { background: #ff7edb22; }
.poll-submit:disabled { opacity: 0.45; cursor: default; }

.media {
  margin: 8px 0 0 50px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.media-cell { min-width: 0; }
.media-alt {
  margin: 4px 2px 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.25;
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  cursor: pointer;
}
button.media-thumb {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  image-rendering: auto;
}
button.media-thumb:hover { border-color: var(--cyan); }
.media-thumb img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
}
.media-thumb-fallback {
  display: grid;
  place-items: center;
  height: 140px;
  color: var(--cyan);
  font-size: 36px;
}
.media-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #191621cc;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  font-size: 16px;
  line-height: 1;
  text-shadow: 0 0 8px #03edf9;
  pointer-events: none;
}

#media-dialog {
  width: min(960px, 92vw);
  max-width: 92vw;
  height: min(860px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
  min-height: 0;
}
.media-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  background: #0a0710;
  overflow: auto;
}
.media-stage img,
.media-stage video {
  max-width: 100%;
  max-height: min(70vh, 680px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #000;
}
.media-stage audio { width: min(100%, 480px); }
.media-alt-view {
  margin: 0;
  padding: 8px 14px 10px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.3;
  white-space: pre-wrap;
  max-height: 7em;
  overflow: auto;
  flex-shrink: 0;
  border-top: 1px solid var(--line);
}
.media-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0 50px;
}
.actions button {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  padding: 4px 8px;
  font-family: var(--font);
  font-size: 21px;
}
.actions button.on-fav { color: var(--yellow); }
.actions button.on-boost { color: var(--mint); }
.actions button.danger { color: var(--red); }
.notif-kind {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--pink);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  line-height: 1.6;
}

dialog {
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  border: 1px solid var(--pink);
  background: #241b2f;
  color: var(--fg);
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 0 40px #f92aad33, inset 0 0 40px rgba(0, 0, 0, 0.35);
  font-family: var(--font);
}
dialog::backdrop {
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(8, 4, 14, 0.82) 0px,
      rgba(8, 4, 14, 0.82) 2px,
      rgba(0, 0, 0, 0.9) 2px,
      rgba(0, 0, 0, 0.9) 3px
    );
}
dialog::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 6;
  border-radius: inherit;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.2) 2px,
    rgba(0, 0, 0, 0.2) 3px
  );
}
#compose-form { display: flex; flex-direction: column; }
dialog[open] { display: flex; flex-direction: column; }
#compose-form header, .overlay-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
#compose-form header h2, .overlay-head h2 {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  font-weight: 400;
  color: var(--cyan);
  text-shadow: 1px 0 0 #ff7edb55, 0 0 10px #03edf966;
}
#compose-vis:disabled { opacity: 0.55; cursor: not-allowed; }
#compose-form > input, #compose-form > textarea {
  margin: 10px 14px 0;
  width: calc(100% - 28px);
  background: #191621;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}
#compose-form > textarea { min-height: 160px; resize: vertical; }
.attach-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 8px;
}
.attach-item {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  padding-right: 18px;
}
.attach-item img,
.attach-item video {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #000;
  display: block;
}
.attach-alt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.attach-alt span {
  font-family: var(--font-ui);
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.attach-alt textarea {
  width: 100%;
  min-height: 56px;
  margin: 0;
  resize: vertical;
  background: #191621;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  color: var(--fg);
  font: inherit;
  line-height: 1.2;
}
.attach-item .attach-remove {
  position: absolute;
  top: -6px;
  right: -2px;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}
.compose-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  color: var(--muted);
}
#compose-form footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 4px 14px 16px;
}
#compose-form footer .outbox-btn {
  min-width: 52px;
  width: 52px;
  height: 52px;
  padding: 8px;
}
#compose-form footer .outbox-glyph {
  width: 28px;
  height: 28px;
}
#compose-form footer .outbox-btn.primary {
  border-color: var(--pink);
}
.draft-item {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.draft-item p { margin: 0 0 8px; }
.draft-thumbs {
  display: flex;
  gap: 6px;
  margin: 8px 0;
}
.draft-thumbs img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 4px;
}
#overlay-body { overflow: auto; padding: 14px; }

#thread-dialog {
  width: 80vw;
  max-width: 80vw;
  height: min(860px, calc(100vh - 24px));
  max-height: calc(100vh - 24px);
  min-height: 0;
}
.thread-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0;
}
.thread-body > .hint,
.thread-body > .error { padding: 14px; }
.thread-ancestors .status { opacity: 0.82; }
.thread-branch {
  margin-left: 14px;
  border-left: 1px solid var(--line);
}
.thread-replies-empty {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 21px;
}
.thread-replies-empty a { color: var(--cyan); }
.thread-reply {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  padding: 10px 14px 12px;
  background: #1d1728;
}
.thread-reply-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.thread-reply-to {
  margin: 0;
  color: var(--cyan);
  font-size: 18px;
  min-height: 1.2em;
  min-width: 0;
  flex: 1;
}
#thread-reply-text {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  background: #191621;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}
.thread-reply .attach-list { padding: 8px 0 0; }
.thread-reply-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  color: var(--muted);
}
.confirm-body { padding: 14px; }
.confirm-body p { margin: 0 0 16px; }
.confirm-body footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
#confirm-dialog {
  width: min(480px, calc(100vw - 24px));
  height: fit-content;
  max-height: none;
}

#sw-update-dialog {
  width: min(440px, calc(100vw - 24px));
  height: fit-content;
  max-height: min(70vh, 480px);
  margin: auto;
  border-color: var(--cyan);
  background: #120818;
  box-shadow: 0 0 40px #03edf944, inset 0 0 40px rgba(0, 0, 0, 0.45);
}
.sw-update-head {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--yellow);
  text-shadow: 0 0 8px #fede5d88;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.sw-update-log {
  margin: 0;
  padding: 14px 16px 10px;
  min-height: 9.2em;
  overflow: auto;
  color: var(--mint);
  font-family: var(--font);
  font-size: 22px;
  line-height: 1.35;
  text-shadow: 0 0 8px #72f1b866;
}
.sw-update-log .is-found { color: var(--cyan); text-shadow: 0 0 8px #03edf988; }
.sw-update-log .is-warn { color: var(--yellow); text-shadow: 0 0 8px #fede5d88; }
.sw-update-cursor {
  display: inline-block;
  width: 0.55em;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--mint);
  box-shadow: 0 0 8px #72f1b8;
  animation: conn-pulse 0.7s step-end infinite;
}
.sw-update-bar {
  height: 12px;
  margin: 4px 14px 16px;
  border: 1px solid var(--cyan);
  background: #0a0710;
  box-shadow: inset 0 0 8px #03edf922;
}
.sw-update-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    90deg,
    var(--mint) 0 7px,
    #191621 7px 9px
  );
  box-shadow: 0 0 10px #72f1b888;
  transition: width 0.35s linear;
}

.profile-head { display: flex; gap: 14px; align-items: flex-start; }
.profile-head img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; }
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.profile-actions .hint { margin: 0; min-height: 0; }
.profile-actions button.is-on {
  border-color: var(--cyan);
  color: var(--cyan);
}
.profile-actions button.is-block {
  border-color: var(--orange);
  color: var(--orange);
  background: #fe445022;
}
.profile-stats { display: flex; gap: 16px; margin: 12px 0; color: var(--muted); }
.profile-stats strong { color: var(--fg); display: block; }
.search-box { display: flex; gap: 8px; margin-bottom: 12px; }
.search-hit { padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.search-hit:hover { color: var(--cyan); }

@media (max-width: 960px) {
  body { padding: 6px; }
  .topbar {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 6px 6px;
  }
  .statusbar {
    gap: 8px;
    padding: 4px 8px;
  }
  .statusbar .instance {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    font-size: 16px;
    line-height: 1.15;
  }
  #instance-label {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .conn-status {
    display: block;
    margin-left: 0;
    width: 100%;
    min-width: 0;
    font-size: 13px;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .conn-status.is-carrier-lost { font-size: 13px; }
  .conn-status::before { content: none; }
  .carrier-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
  }
  .col-dock {
    flex: 1 1 auto;
    padding: 0;
    gap: 4px;
  }
  .dock-icon { width: 48px; min-height: 44px; padding: 2px 0; }
  .dock-icon span { display: none; }
  .dock-icon svg { width: 32px; height: 32px; }
  .top-actions { gap: 4px; }
  .top-actions .outbox-btn {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 4px;
  }
  .top-actions .outbox-glyph { width: 26px; height: 26px; }
  #compose-form footer {
    justify-content: space-evenly;
    gap: 20px;
    padding: 8px 16px 18px;
  }
  #compose-form footer .outbox-btn {
    min-width: 56px;
    width: 56px;
    height: 56px;
  }
  #compose-form footer .outbox-glyph {
    width: 32px;
    height: 32px;
  }
  .login-wordmark { font-size: 32px; padding-right: 1.9em; }
  .login-year { font-size: 1.56em; }
  #thread-dialog,
  #outbox-dialog,
  #drafts-dialog,
  #media-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
  }
  #sw-update-dialog {
    width: min(420px, calc(100vw - 16px));
    height: fit-content;
    max-height: min(70vh, 420px);
    margin: auto;
    border-radius: 8px;
  }
  .columns {
    flex-direction: column;
  }
  .col { border-right: 0; border-bottom: 1px solid var(--line); }
  .col.is-last-visible { border-right: 0; border-bottom: 0; }
  .columns.is-expanded .col.is-expanded { border-bottom: 0; }
  .content, .cw, .media, .poll, .actions { margin-left: 0; }
}
@media (max-width: 600px) {
  .login-wordmark { font-size: 24px; padding-right: 2.3em; }
  .login-year { font-size: 1.95em; }
}


/* Language switch (DE | EN) */
.lang-switch {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  margin-right: 6px;
  border: 2px solid var(--panel-border, #5b4a78);
  background: rgba(0, 0, 0, 0.25);
  padding: 2px;
}
.lang-btn {
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--muted, #b9a8d0);
  cursor: pointer;
}
.lang-btn.is-active,
.lang-btn[aria-pressed="true"] {
  background: var(--pink, #ff7edb);
  color: #191621;
}
.login-card .lang-switch {
  margin: 0 0 12px;
}
.top-actions .lang-switch {
  align-self: center;
}
