/* ═══ RESET ═══ */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%; width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--body-weight);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ═══ THEMES ═══ */

/* 1. MIDNIGHT — teal accent, clean dark, institutional (default) */
:root, [data-theme="midnight"] {
  --bg: #0e1214; --surface: #161a1c;
  --border: rgba(255,255,255,0.08);
  --text-display: #e8eaec; --text-primary: rgba(255,255,255,0.80);
  --text-secondary: rgba(255,255,255,0.45); --text-disabled: rgba(255,255,255,0.25);
  --accent: #7EBEC5; --accent-red: #c47070;
  --status-green: #6aaa80; --status-amber: #7EBEC5;
  --font-sans: 'Open Sans', system-ui, sans-serif;
  --font-mono: 'Departure Mono', 'Source Code Pro', 'Menlo', monospace;
  --font-dot: 'Doto', monospace;
  --radius: 2px; --border-w: 1px;
  --heading-weight: 600; --body-weight: 400; --label-weight: 600;
  --label-spacing: 0.02em; --label-transform: uppercase;
  --clock-weight: 300; --clock-size: 48px;
}

/* 2. PAPER — warm cream, editorial, newspaper feel */
[data-theme="paper"] {
  --bg: #f8f5f0; --surface: #efebe4;
  --border: rgba(0,0,0,0.10);
  --text-display: #1a1a1a; --text-primary: #333333;
  --text-secondary: #666666; --text-disabled: #999999;
  --accent: #8b4513; --accent-red: #b8433a;
  --status-green: #2d6a3f; --status-amber: #8b4513;
  --font-sans: 'Source Serif 4', 'Georgia', serif;
  --font-mono: 'Source Code Pro', 'Menlo', monospace;
  --font-dot: 'Doto', monospace;
  --radius: 0px; --border-w: 1px;
  --heading-weight: 700; --body-weight: 400; --label-weight: 600;
  --label-spacing: 0.12em; --label-transform: uppercase;
  --clock-weight: 400; --clock-size: 44px;
}

/* 3. TELETEXT OG — classic Ceefax/teletext 8-color palette on black */
[data-theme="teletext-og"] {
  --bg: #000000; --surface: #111111;
  --border: rgba(255,255,255,0.10);
  --text-display: #e8e87c; --text-primary: #d8d8d8;
  --text-secondary: #7cd4d4; --text-disabled: rgba(255,255,255,0.30);
  --accent: #e8e87c; --accent-red: #e8827c;
  --status-green: #7ccf8e; --status-amber: #e8e87c;
  --font-sans: 'Doto', monospace;
  --font-mono: 'Doto', monospace;
  --font-dot: 'Doto', monospace;
  --radius: 0px; --border-w: 1px;
  --heading-weight: 500; --body-weight: 400; --label-weight: 500;
  --label-spacing: 0.08em; --label-transform: uppercase;
  --clock-weight: 400; --clock-size: 44px;
}

/* 4. BRUTALIST — high contrast, bold, raw, thick borders */
[data-theme="brutalist"] {
  --bg: #ffffff; --surface: #f0f0f0;
  --border: #000000;
  --text-display: #000000; --text-primary: #000000;
  --text-secondary: #444444; --text-disabled: #888888;
  --accent: #000000; --accent-red: #ff0000;
  --status-green: #008000; --status-amber: #000000;
  --font-sans: 'Inter', 'Helvetica', sans-serif;
  --font-mono: 'JetBrains Mono', 'Menlo', monospace;
  --font-dot: 'Doto', monospace;
  --radius: 0px; --border-w: 2px;
  --heading-weight: 800; --body-weight: 400; --label-weight: 700;
  --label-spacing: 0.06em; --label-transform: uppercase;
  --clock-weight: 800; --clock-size: 52px;
}

/* 5. MINIMAL — near-monochrome, ultra-thin, whisper quiet */
[data-theme="minimal"] {
  --bg: #fafafa; --surface: #f2f2f2;
  --border: rgba(0,0,0,0.06);
  --text-display: #222222; --text-primary: #555555;
  --text-secondary: #888888; --text-disabled: #bbbbbb;
  --accent: #555555; --accent-red: #aa6666;
  --status-green: #66aa77; --status-amber: #555555;
  --font-sans: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Menlo', monospace;
  --font-dot: 'Doto', monospace;
  --radius: 4px; --border-w: 1px;
  --heading-weight: 400; --body-weight: 300; --label-weight: 500;
  --label-spacing: 0.04em; --label-transform: none;
  --clock-weight: 300; --clock-size: 44px;
}

/* 6. EMBER — amber on dark brown, warm, copper, cozy */
[data-theme="ember"] {
  --bg: #12100e; --surface: #1a1614;
  --border: rgba(200,169,110,0.10);
  --text-display: #d4c8b0; --text-primary: rgba(212,200,176,0.80);
  --text-secondary: rgba(212,200,176,0.45); --text-disabled: rgba(212,200,176,0.22);
  --accent: #c8a96e; --accent-red: #a87060;
  --status-green: #7a9a6a; --status-amber: #c8a96e;
  --font-sans: 'Outfit', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Menlo', monospace;
  --font-dot: 'Doto', monospace;
  --radius: 2px; --border-w: 1px;
  --heading-weight: 500; --body-weight: 300; --label-weight: 500;
  --label-spacing: 0.06em; --label-transform: uppercase;
  --clock-weight: 300; --clock-size: 48px;
}

/* ═══ TYPOGRAPHY ═══ */

:root {
  --text-sm: 13px;
  --text-md: 15px;
  --text-lg: 24px;
}

/* Size overrides — sm for labels/meta, lg for headlines */
.section-label,
.clock-date,
.ticker-bar .ticker-label,
.fin-sym, .fin-price, .fin-chg, .fin-sep,
.sport-league, .sport-at, .sport-status, .sport-score,
.news-src, .news-ago, .news-cat, .news-ctr,
.poly-q, .poly-pct, .poly-sep,
.updated-label,
.set-hint, .set-check,
.w-post-when, .w-stats, .w-live-count, .w-post-ref,
.w-meta, .w-error, .w-btn, .w-post-acts,
.page-loading, .w-empty {
  font-size: var(--text-sm) !important;
}

.news-headline {
  font-size: var(--text-lg) !important;
}

/* ═══ LAYOUT ═══ */

.layout {
  height: 100vh; width: 100vw;
  display: flex;
  overflow: hidden;
}

/* Resize handles between columns */
.resize-handle {
  width: var(--border-w);
  cursor: col-resize;
  background: var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.resize-handle:hover,
.resize-handle.dragging {
  background: var(--text-disabled);
}

.resize-handle::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: -6px; right: -6px;
}

/* Modules — toggleable content blocks */
.module {
  flex-shrink: 0;
}

.module.hidden {
  display: none;
}

/* Subtle vignette — darkens edges for ambient/display feel */
.vignette {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.25) 100%);
}

[data-theme="paper"] .vignette,
[data-theme="brutalist"] .vignette,
[data-theme="minimal"] .vignette {
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.06) 100%);
}

/* Loading state */
.loading-state {
  font-family: var(--font-mono);
  color: var(--text-disabled);
  font-size: var(--text-md);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.5px;
  background: var(--text-secondary);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 3px;
}

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

/* ═══ SIDEBAR — Clock, Weather, Holidays, On This Day ═══ */

.sidebar {
  width: 340px;
  min-width: 200px;
  max-width: 500px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 32px 28px 24px;
  overflow: hidden;
  gap: 0;
}

/* Section base */
.sidebar-section {
  padding: 20px 0 0;
  flex-shrink: 0;
  min-height: 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Logo */
.sidebar-logo {
  font-family: var(--font-dot);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-display);
  letter-spacing: 0.05em;
  cursor: pointer;
  padding-bottom: 12px;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.sidebar-logo:hover { opacity: 0.6; }

/* Clock */
.clock { padding-bottom: 0; flex-shrink: 0; }

.clock-time {
  font-family: var(--font-dot);
  font-size: 56px;
  font-weight: 700;
  color: var(--text-display);
  line-height: 1;
  letter-spacing: -0.02em;
}

.clock-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Weather */
.weather-block { padding-top: 12px; }

.weather-main {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 400;
  color: var(--text-display);
  display: flex;
  align-items: center;
  gap: 0;
  padding: 2px 0;
}

.weather-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
  color: var(--text-display);
  vertical-align: middle;
}

.weather-icon svg { display: block; width: 14px; height: 14px; }

.weather-extra {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.6;
}

.wx-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 2px 0;
}

.wx-label {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 95px;
}

.wx-value {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  color: var(--text-primary);
  font-weight: 300;
}

/* Holidays */
.holidays-block {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  flex-shrink: 1;
  min-height: 60px;
  scrollbar-width: none;
}

.holidays-block::-webkit-scrollbar { display: none; }

.hol-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 2px 0;
  font-size: var(--text-md);
}

.hol-date {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 95px;
}

.hol-name {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  color: var(--text-primary);
  font-weight: 300;
}

.hol-today .hol-date,
.hol-today .hol-name {
  color: var(--text-display);
}

/* On This Day */
.otd-block {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  flex-shrink: 1;
  min-height: 60px;
  touch-action: pan-y;
}

.otd-block::-webkit-scrollbar { display: none; }

.otd-img {
  width: 100%;
  object-fit: cover;
  border: 1px solid var(--border);
  display: block;
  margin: 8px 0;
  border-radius: var(--radius);
}

.otd-content {
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.otd-content.fade-out {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.otd-year {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-secondary);
  letter-spacing: 0.06em;
}

.otd-text {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.5;
  margin-top: 4px;
}

/* ═══ MAIN — Header, Tickers, News ═══ */

.main {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  padding: 32px 40px 24px;
  overflow: hidden;
  position: relative;
}

/* Header */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.main-title {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--heading-weight);
  color: var(--text-display);
}

/* Settings gear */
.settings-toggle {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-disabled);
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.main:hover .settings-toggle { opacity: 1; }
.settings-toggle:hover { color: var(--text-primary); opacity: 1; }

/* Updated timestamp */
.updated-label {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-disabled);
  letter-spacing: 0.06em;
  padding-top: 4px;
  opacity: 0.6;
}

/* News module */
.module[data-module="news"] {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.module[data-module="news"].hidden {
  display: none;
}

/* Ticker bars */
.ticker-bar {
  flex-shrink: 0;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-md);
  display: flex; align-items: baseline;
}

.ticker-bar .ticker-label {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: var(--text-md); color: var(--text-disabled);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-right: 16px;
}

.ticker-scroll-wrap {
  flex: 1; white-space: nowrap;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x;
}

.ticker-scroll-wrap::-webkit-scrollbar { display: none; }

.ticker-track {
  display: inline-block; white-space: nowrap;
}

.ticker-track.auto-scroll {
  animation: ticker-scroll var(--ticker-speed, 30s) linear infinite;
}

.ticker-track.auto-scroll.paused { animation-play-state: paused; }

@keyframes ticker-scroll { 0%{transform:translateX(0)} 100%{transform:translateX(-50%)} }

/* Finance items */
.fin-item { display: inline; font-family: var(--font-mono); font-size: var(--text-sm); }
.fin-sym { color: var(--text-disabled); letter-spacing: 0.04em; }
.fin-price { color: var(--text-secondary); margin-left: 5px; }
.fin-chg { margin-left: 4px; font-size: var(--text-md); }
.fin-chg.up { color: var(--status-green); }
.fin-chg.down { color: var(--accent-red); }
.fin-sep { color: var(--border); margin: 0 14px; }

/* Sports scores */
.sport-game { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: var(--text-sm); vertical-align: middle; gap: 6px; }
.sport-league { color: var(--text-disabled); font-size: var(--text-sm); letter-spacing: 0.06em; padding: 1px 4px; border: 1px solid var(--border); }
.sport-team { display: inline-flex; align-items: center; color: var(--text-secondary); gap: 3px; }
.sport-logo { width: 14px; height: 14px; object-fit: contain; }
.sport-score { color: var(--text-primary); margin-left: 2px; }
.sport-at { color: var(--text-disabled); font-size: var(--text-md); }
.sport-winner .sport-score { color: var(--text-display); }
.sport-status { color: var(--text-disabled); font-size: var(--text-md); letter-spacing: 0.04em; }
.sport-live { color: var(--accent-red); }
.sport-sep { color: var(--border); margin: 0 16px; display: inline-flex; align-items: center; }

/* Polymarket predictions */
.poly-item { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 400; vertical-align: middle; gap: 6px; }
.poly-icon { width: 14px; height: 14px; border-radius: 3px; object-fit: cover; }
.poly-q { color: var(--text-secondary); }
.poly-pct { font-family: var(--font-mono); color: var(--text-display); font-size: var(--text-md); }
.poly-sep { color: var(--border); margin: 0 16px; display: inline-flex; align-items: center; }

/* News label */
.news-label {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-disabled);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 16px;
  flex-shrink: 0;
}

/* News card area */
.news-area {
  flex: 1;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  overscroll-behavior: contain;
}

.news-card {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.4s ease-out, transform 0.4s ease-out;
  will-change: opacity, transform;
  overflow-y: auto;
  scrollbar-width: none;
}

.news-card::-webkit-scrollbar { display: none; }

.news-card.active {
  opacity: 1;
  transform: translateX(0);
}

.news-card.exit-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.news-card.exit-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

/* News card — source line */
.news-src {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-disabled);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.news-src img {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 6px;
  opacity: 0.5;
}

.news-ago {
  color: var(--text-disabled);
  letter-spacing: 0.06em;
}

.news-cat {
  color: var(--text-secondary);
  letter-spacing: 0.08em;
}

/* News card — body with image */
.news-body-wrap {
  display: flex;
  gap: 32px;
  flex: 1;
  overflow: hidden;
}

.news-text { flex: 1; min-width: 0; }

/* News card — headline */
.news-headline {
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--heading-weight);
  color: var(--text-display);
  line-height: 1.15;
  margin-bottom: 20px;
  text-decoration: none;
  display: block;
}

a.news-headline:hover { text-decoration: underline; }

/* News card — image */
.news-img-wrap {
  flex-shrink: 0; align-self: flex-start;
  width: 220px; height: 260px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.news-img-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}

/* News card — bullet summaries */
.news-body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.6;
}

.news-body .bullet {
  color: var(--text-disabled);
  margin-right: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-md);
}

.news-body .line { margin-bottom: 6px; }

/* Progress dots */
.news-prog {
  display: flex;
  padding: 8px 0 0;
  align-items: center;
  flex-shrink: 0;
  width: 100%;
  gap: 2px;
}

.news-pip {
  flex: 1;
  height: 2px;
  background: var(--border);
  transition: background 0.3s ease-out;
  overflow: hidden;
  position: relative;
}

.news-pip.active { background: var(--text-display); }

.news-pip.filling {
  background: var(--border);
}

.news-pip.filling::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 0%;
  background: var(--text-display);
  animation: pipFill var(--slide-ms, 15s) linear forwards;
}

@keyframes pipFill { 0% { width: 0%; } 100% { width: 100%; } }

.news-ctr {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-disabled);
  margin-left: 12px;
  letter-spacing: 0.08em;
}

/* ═══ WALL — Compose, Posts, Actions ═══ */

.wall {
  width: 340px;
  min-width: 200px;
  max-width: 500px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Wall header */
.wall-header {
  padding: 32px 20px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.wall-title {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: var(--heading-weight);
  color: var(--text-display);
}

/* Live indicator */
.w-live {
  display: flex;
  align-items: center;
  gap: 6px;
}

.w-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--status-green);
  animation: pulse 2s ease-in-out infinite;
}

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

.w-live-count {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-disabled);
}

/* Wall stats */
.w-stats {
  padding: 6px 20px;
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-disabled);
  letter-spacing: 0.06em;
  flex-shrink: 0;
}

/* Compose area */
.w-compose {
  padding: 12px 20px;
  flex-shrink: 0;
}

.w-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 300;
  padding: 6px 10px;
  outline: none;
  transition: border-color 0.15s;
}

.w-input:focus { border-color: var(--text-secondary); }
.w-input::placeholder { color: var(--text-disabled); }
.w-name { margin-bottom: 6px; }
.w-msg-row { display: flex; gap: 6px; }

.w-msg {
  flex: 1;
  resize: none;
  min-height: 32px;
  max-height: 60px;
}

.w-send {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  padding: 0 14px;
  cursor: pointer;
  transition: all 0.15s;
}

.w-send:hover { background: var(--text-primary); color: var(--bg); }

.w-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-disabled);
  padding-top: 4px;
}

.w-error { color: var(--accent-red); }

/* Reply bar */
.w-reply-bar {
  display: none;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--text-md);
  padding-bottom: 6px;
}

.w-reply-bar.active { display: flex; }

.w-reply-x {
  background: none;
  border: none;
  color: var(--accent-red);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  cursor: pointer;
}

/* Post list */
.w-posts {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 0 20px;
}

.w-posts::-webkit-scrollbar { display: none; }

/* Individual post */
.w-post {
  padding: 10px 0;
  transition: opacity 0.2s;
}

.w-post-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.w-post-who {
  display: flex;
  align-items: center;
  gap: 6px;
}

.w-post-name {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--accent);
}

.w-post-flag { font-size: var(--text-md); }

.w-post-when {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-disabled);
}

.w-post-ref {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 0;
}

.w-post-ref:hover { color: var(--text-display); }

.w-post-text {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-word;
  cursor: pointer;
  margin-top: 4px;
}

.w-post-text a { color: var(--text-secondary); }

/* Post actions */
.w-post-acts {
  display: flex;
  gap: 12px;
  padding-top: 6px;
}

.w-btn {
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.15s;
}

.w-btn:hover { color: var(--text-display); }
.w-btn.voted { color: var(--accent-red); }
.w-btn.reported { color: var(--status-amber); }

/* Post lifespan bar */
.w-life {
  height: 2px;
  background: var(--border);
  margin-top: 8px;
}

.w-life-fill {
  height: 100%;
  background: var(--status-green);
  transition: width 0.3s;
}

.w-life-fill.fading { background: var(--accent-red); }

/* Empty wall */
.w-empty {
  color: var(--text-disabled);
  text-align: center;
  padding: 32px 0;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 300;
}

/* ═══ SETTINGS ═══ */

.settings-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--bg);
  color: var(--text-primary);
  z-index: 100;
  overflow-y: auto;
  scrollbar-width: none;
  padding: 32px 40px;
}

.settings-overlay::-webkit-scrollbar { display: none; }
.settings-overlay.open { display: block; }

.set-sec {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-display);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.set-sec:first-child { padding-top: 0; }

.set-hint {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 300;
  color: var(--text-secondary);
  padding: 2px 0 4px;
}

.set-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 0;
  padding: 4px 0 8px;
}

.set-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 3px 12px 3px 0;
  min-width: 45%;
  user-select: none;
  transition: color 0.15s;
}

.set-item:hover { color: var(--text-display); }
.set-item.on { color: var(--text-display); }
#setThemes .set-item { color: var(--text-primary); }
#setThemes .set-item.on { color: var(--text-display); }

.set-item .set-check {
  width: 14px;
  font-size: var(--text-md);
  flex-shrink: 0;
  text-align: center;
}

.set-item.on .set-check { color: var(--status-green); }

.set-add-row {
  display: flex;
  gap: 6px;
  padding: 0 0 8px;
}

.set-add-input {
  flex: 1;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: 4px 8px;
  outline: none;
}

.set-add-input:focus { border-color: var(--text-secondary); }
.set-add-input::placeholder { color: var(--text-disabled); }

.set-add-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: 4px 12px;
  cursor: pointer;
}

.set-add-btn:hover { color: var(--text-display); border-color: var(--text-secondary); }

.set-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 400;
  padding: 8px 24px;
  cursor: pointer;
  margin-top: 16px;
  display: block;
  width: 100%;
  letter-spacing: 0.06em;
  transition: border-color 0.15s;
}

.set-close:hover { border-color: var(--text-secondary); color: var(--text-display); }

/* ═══ INFO MODAL ═══ */

.info-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
}

.info-modal.open {
  display: flex;
}

.info-content {
  max-width: 480px;
  width: 90%;
  padding: 48px;
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
}

.info-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none; border: none;
  color: var(--text-disabled);
  font-size: 24px;
  cursor: pointer;
  font-family: var(--font-sans);
}

.info-close:hover { color: var(--text-primary); }

.info-logo {
  font-family: var(--font-dot);
  font-size: 36px;
  font-weight: 700;
  color: var(--text-display);
}

.info-tagline {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 300;
  color: var(--text-secondary);
  margin-top: 8px;
}

.info-body {
  margin-top: 28px;
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 300;
  color: var(--text-secondary);
  line-height: 1.7;
}

.info-body p { margin-bottom: 12px; }

.info-links {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.info-link-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}

.info-label {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  font-weight: 300;
  color: var(--text-disabled);
}

.info-value {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-secondary);
}

.info-keys {
  margin-top: 16px;
  display: flex;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-disabled);
}

/* ═══ KIOSK MODE ═══ */

:root.kiosk {
  cursor: none;
}

.kiosk .settings-toggle,
.kiosk .settings-overlay,
.kiosk .resize-handle,
.kiosk .w-compose,
.kiosk .w-reply-bar,
.kiosk .mobile-tabs,
.kiosk .w-post-acts,
.kiosk .w-stats {
  display: none !important;
}

.kiosk .w-posts {
  padding-top: 12px;
}

/* ═══ MOBILE ═══ */

.mobile-tabs {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 200;
}

.mobile-tabs-inner {
  display: flex;
}

.mobile-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0 12px;
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--text-disabled);
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0.06em;
}

.mobile-tab.active {
  color: var(--text-display);
  border-top: 2px solid var(--text-display);
}

@media (max-width: 900px) {
  html, body { overflow-x: hidden; overflow-y: hidden; }

  .mobile-tabs { display: block; }

  .layout {
    flex-direction: row;
    height: calc(100vh - 48px);
    overflow: hidden;
  }

  .resize-handle { display: none; }

  .sidebar, .main, .wall {
    width: 100% !important;
    max-width: 100%;
    min-width: 100%;
    flex-shrink: 0;
    height: 100%;
    overflow-y: auto;
    display: none;
  }

  .sidebar.mobile-active,
  .main.mobile-active,
  .wall.mobile-active {
    display: flex;
  }

  .sidebar {
    padding: 20px 20px 16px;
  }

  .clock-time { font-size: 44px; }

  .main {
    padding: 16px 16px 12px;
  }

  .main-header { padding: 0 0 12px; }

  .news-area {
    position: relative;
    min-height: 0;
    flex: 1;
  }

  .news-card {
    position: relative;
    inset: auto;
    overflow-y: auto;
  }

  .news-body-wrap { flex-direction: column; gap: 16px; }
  .news-headline { font-size: 22px; }
  .news-img-wrap { width: 100%; height: 180px; }
  .ticker-bar { font-size: var(--text-md); }

  .wall {
    max-height: none;
  }

  .wall-header { padding: 16px 16px 8px; }
  .w-compose { padding: 8px 16px; }
  .w-posts { padding: 0 16px; }
  .w-stats { padding: 4px 16px; }

  .settings-overlay.open {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 48px;
    z-index: 150;
  }
}
