:root {
  --paper: #d7dde6;
  --paper-2: #c5cdd8;
  --ink: #141c28;
  --ink-soft: #3a4656;
  --navy: #16304f;
  --signal: #c45c2a;
  --edit: #8a5a12;
  --live: #1f7a4d;
  --line: rgba(20, 28, 40, 0.14);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: "Schibsted Grotesk", sans-serif;
  background:
    linear-gradient(180deg, #e4e9f0 0%, var(--paper) 42%, #cfd6e0 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 28, 40, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 28, 40, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(1200px 700px at 20% -10%, #000 40%, transparent 80%);
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

#app {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  min-height: 100vh;
  padding: calc(10px + var(--safe-top)) 0 calc(24px + var(--safe-bottom));
}

.masthead {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 12px;
  padding: 8px 18px 18px;
  animation: drop 420ms ease both;
}

.brand {
  font-family: "Syne", sans-serif;
  font-weight: 800;
  font-size: clamp(42px, 12vw, 72px);
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: var(--navy);
  text-transform: none;
}
.brand.small {
  font-size: 28px;
  line-height: 1;
}

.kicker {
  margin-top: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.live {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding-bottom: 6px;
}
.live.on { color: var(--live); }
.live.on::before,
.live::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  background: currentColor;
  transform: translateY(-1px);
}
.live.on::before {
  animation: blink 1.8s ease-in-out infinite;
}

.back {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-size: 22px;
  padding: 0 0 8px;
  cursor: pointer;
}
.hidden { display: none !important; }

.stage { animation: rise 280ms ease both; }

.watchlist {
  border-top: 1px solid var(--ink);
}

.row {
  width: 100%;
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 16px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition: background 160ms ease;
}
.row:active { background: rgba(22, 48, 79, 0.06); }

.when {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--ink-soft);
  padding-top: 4px;
}

.who {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.handle {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 13px;
  margin-left: 4px;
}
.preview {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.35;
  max-width: 52vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.marks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  min-width: 72px;
}
.mark {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.mark.del { color: var(--signal); }
.mark.ed { color: var(--edit); }

.empty {
  padding: 48px 22px;
}
.empty-kicker {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 10px;
}
.empty h2 {
  font-family: "Syne", sans-serif;
  font-size: 28px;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
}
.empty p { margin: 0; color: var(--ink-soft); line-height: 1.45; }

.tape {
  padding: 8px 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.entry {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  animation: rise 320ms ease both;
}
.entry.out .body { color: var(--navy); }
.clock {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  color: var(--ink-soft);
  padding-top: 3px;
}
.body {
  font-size: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.flags {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.flag-del { color: var(--signal); }
.flag-ed { color: var(--edit); }
.entry.deleted .body {
  text-decoration: line-through;
  color: #8a3b2a;
  opacity: 0.85;
}
.media {
  margin-top: 8px;
  max-width: 100%;
}
.media img, .media video {
  display: block;
  max-width: 100%;
  max-height: 280px;
}
.hist {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-soft);
}
.hist b {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--edit);
}

@keyframes drop {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
