:root {
  --bg: #08111f;
  --bg-deep: #050b15;
  --panel: #121d2d;
  --panel-2: #1a2635;
  --line: #28364a;
  --text: #ecf4ff;
  --muted: #aab9ca;
  --orange: #ffb42a;
  --orange-2: #ff8a00;
  --discord: #5865f2;
  --green: #47d6b6;
  --radius: 8px;
  --shadow: 0 24px 80px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html, body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 65% 0%, rgba(255, 180, 42, .08), transparent 30%), var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.topbar {
  height: 72px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 13, 25, .92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 6vw, 108px);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; }
.brand img { width: 46px; height: 46px; object-fit: contain; }
.brand small { display: block; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.nav-links, .account-actions { display: flex; align-items: center; gap: 14px; }
.nav-links a { color: #dce6f2; font-weight: 800; padding: 10px 12px; border-radius: 8px; }
.nav-links a.active, .nav-links a:hover { background: #1b2940; }
.button {
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  color: #07101d;
  font-weight: 900;
  background: #eaf0f8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  min-height: 44px;
}
.button.primary { background: linear-gradient(180deg, var(--orange), var(--orange-2)); color: #0b0f17; }
.button.light { background: #edf3fb; color: #101722; }
.button.discord { background: var(--discord); color: white; }
.user-pill, .login-state {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: #101b2b;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 800;
}
.user-pill img, .login-state img { width: 26px; height: 26px; object-fit: contain; }

.shell { width: min(1136px, calc(100% - 32px)); margin: 28px auto 48px; flex: 1; }
.panel {
  background: linear-gradient(145deg, rgba(18, 29, 45, .98), rgba(24, 38, 54, .96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero {
  min-height: 330px;
  padding: clamp(32px, 5vw, 54px);
  display: grid;
  grid-template-columns: 1fr 340px;
  align-items: center;
  gap: 40px;
}
.eyebrow { margin: 0 0 12px; color: #bdc9dc; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 16px; font-size: clamp(42px, 7vw, 78px); line-height: .96; }
h2 { font-size: 25px; }
.hero-copy { max-width: 650px; color: #d8e6f7; font-size: 18px; line-height: 1.6; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.status-card {
  border: 1px solid #3a4656;
  border-radius: 8px;
  padding: 28px 24px;
  background: rgba(255, 255, 255, .08);
}
.status-card span { display: block; margin-bottom: 8px; }
.status-card strong { color: var(--orange); font-size: 48px; line-height: 1; }
.status-card p { color: #dbe6f4; line-height: 1.45; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini-stats b {
  border: 1px solid #465568;
  border-radius: 7px;
  padding: 13px;
  text-align: center;
  background: rgba(255, 255, 255, .07);
}
.tabs { margin: 24px 0 46px; padding: 13px; display: flex; gap: 10px; flex-wrap: wrap; box-shadow: none; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  background: #0c1728;
}
.chip span { background: var(--orange); color: #12100a; min-width: 24px; height: 24px; border-radius: 999px; display: inline-grid; place-items: center; font-weight: 900; }
.section-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin: 0 0 18px; }
.section-heading p:last-child { color: #b8cce4; }
.forum-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.forum-card {
  min-height: 250px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #1c2a38, #101b2b);
  position: relative;
  overflow: hidden;
}
.forum-card:before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--accent); }
.forum-topline { display: flex; justify-content: space-between; color: #cbd8e8; font-size: 13px; font-weight: 900; }
.forum-card h3 { margin: 34px 0 12px; font-size: 26px; }
.forum-card p { color: var(--muted); line-height: 1.55; }
.latest-thread { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 16px; display: grid; gap: 4px; }
.latest-thread span { color: #8fa0b8; font-size: 12px; text-transform: uppercase; font-weight: 900; }
.latest-thread a { color: white; font-weight: 900; }
.newsletter-heading { margin-top: 46px; }
.newsletter-list, .thread-list { display: grid; gap: 12px; }
.newsletter-row, .thread-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101b2b;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: 130px 1fr 110px;
  align-items: center;
  gap: 16px;
}
.newsletter-row span, .tag { color: #111722; background: var(--orange); border-radius: 999px; padding: 6px 10px; width: fit-content; font-size: 12px; font-weight: 900; }
.newsletter-row em { color: var(--muted); font-style: normal; text-align: right; }
.forum-hero { padding: 42px; border-top: 4px solid var(--accent); margin-bottom: 22px; }
.forum-hero h1 { font-size: clamp(38px, 6vw, 64px); }
.thread-row { grid-template-columns: 1fr 92px 92px; }
.thread-row h2 { margin: 10px 0 4px; }
.thread-row p { color: var(--muted); margin: 0; }
.thread-metrics { text-align: center; color: var(--muted); }
.thread-metrics b { display: block; color: white; font-size: 24px; }
.reader { padding: clamp(24px, 5vw, 46px); }
.reader-header { display: flex; justify-content: space-between; gap: 24px; }
.reader-header h1 { font-size: clamp(34px, 5vw, 58px); }
.back-link { color: var(--orange); font-weight: 900; }
.reader-image, .newsletter-hero { width: 100%; max-height: 420px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); margin: 0 0 24px 0; }
.rich-content { color: #dbe7f5; line-height: 1.72; font-size: 17px; }
.rich-content h2 { color: white; margin-top: 24px; }
.rich-content img { border-radius: 8px; margin: 16px 0; border: 1px solid var(--line); }
.reply-box { margin-top: 18px; padding: 24px; display: grid; gap: 14px; }
textarea, input, select, .editor {
  width: 100%;
  border: 1px solid #33445a;
  border-radius: 8px;
  background: #0b1524;
  color: white;
  padding: 13px 14px;
  font: inherit;
}
textarea { min-height: 120px; resize: vertical; }
.admin-head { padding: 34px; display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 22px; }
.admin-head h1 { font-size: clamp(36px, 5vw, 62px); }
.admin-head p { color: var(--muted); }
.admin-data { margin: 22px 0; }
.admin-data h2 { margin-bottom: 8px; }
.db-good, .db-warn { margin-bottom: 18px; border-radius: 8px; padding: 12px 14px; font-weight: 800; }
.db-good { color: #bdf9e8; background: rgba(71, 214, 182, .1); border: 1px solid rgba(71, 214, 182, .28); }
.db-warn { color: #ffd58a; background: rgba(255, 180, 42, .1); border: 1px solid rgba(255, 180, 42, .28); }
.data-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mini-form { border: 1px solid var(--line); background: #0d1828; border-radius: 8px; padding: 18px; display: grid; gap: 14px; }
.mini-form h3 { margin: 0; font-size: 20px; }
.mini-form label { display: grid; gap: 8px; color: #cbd8e8; font-weight: 900; }
.check-row { display: flex !important; grid-template-columns: none; align-items: center; gap: 10px !important; }
.check-row input { width: 18px; height: 18px; accent-color: var(--orange); }
input[type="color"] { height: 46px; padding: 5px; }
.locked { padding: 34px; text-align: center; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.composer, .preview, .admin-list, .admin-data { padding: 22px; }
.composer { display: grid; gap: 16px; }
.composer label { display: grid; gap: 8px; color: #cbd8e8; font-weight: 900; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar button {
  border: 1px solid var(--line);
  background: #18263b;
  color: white;
  border-radius: 7px;
  min-width: 42px;
  height: 38px;
  font-weight: 900;
  cursor: pointer;
}
.editor { min-height: 270px; line-height: 1.65; overflow: auto; }
.submit-row { display: flex; flex-wrap: wrap; gap: 12px; }
.preview-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #0e1928;
}
.preview-card img { width: 100%; height: 170px; object-fit: cover; background: #172436; display: none; }
.preview-card h2, .preview-card #preview-content { padding: 0 18px; }
.preview-card h2 { margin-top: 18px; }
.preview-card #preview-content { padding-bottom: 18px; color: #dbe7f5; line-height: 1.55; }
.preview-card.sunset { border-top: 4px solid var(--orange); }
.preview-card.ocean { border-top: 4px solid var(--green); }
.preview-card.staff { border-top: 4px solid #7aa7ff; }
.newsletter-reader { background: #111d2d; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.newsletter-reader.sunset { border-top: 4px solid var(--orange); }
.newsletter-reader.ocean { border-top: 4px solid var(--green); }
.newsletter-reader.staff { border-top: 4px solid #7aa7ff; }
.newsletter-body { padding: clamp(26px, 5vw, 54px); }
.newsletter-body h1 { font-size: clamp(38px, 6vw, 68px); }
.footer {
  border-top: 1px solid var(--line);
  color: #93a6bd;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 6vw, 108px);
  background: var(--bg-deep);
  margin-top: auto;
}

@media (max-width: 900px) {
  .topbar { height: auto; min-height: 72px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 12px; }
  .nav-links { order: 3; width: 100%; overflow-x: auto; }
  .hero, .editor-layout, .data-forms { grid-template-columns: 1fr; }
  .forum-grid { grid-template-columns: 1fr; }
  .newsletter-row, .thread-row { grid-template-columns: 1fr; }
  .newsletter-row em { text-align: left; }
  .section-heading, .reader-header, .admin-head, .footer { align-items: stretch; flex-direction: column; }
}

@media (max-width: 540px) {
  .account-actions { width: 100%; justify-content: space-between; }
  .form-grid { grid-template-columns: 1fr; }
  h1 { font-size: 42px; }
  .hero, .forum-hero, .reader, .admin-head { padding: 24px; }
}



.notice { margin: 18px 0; padding: 16px 18px; color: #ffd58a; border-color: rgba(255, 180, 42, .35); }
.thread-stat-stack { display: flex; gap: 12px; align-items: center; }
.replies { margin-top: 18px; padding: 24px; }
.reply-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 18px; }
.empty-state { color: var(--muted); margin: 0; }
.reply-card { border: 1px solid var(--line); border-radius: 8px; background: #0d1828; padding: 18px; display: grid; gap: 14px; margin-top: 12px; }
.reply-author { display: flex; align-items: center; gap: 12px; }
.reply-author img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #0b1524; }
.reply-author strong, .reply-author span { display: block; }
.reply-author span, .reply-meta { color: var(--muted); font-size: 13px; }
.reply-body { border-top: 1px solid var(--line); padding-top: 14px; }
.reply-meta { display: flex; gap: 12px; }
.reply-edit { border-top: 1px solid var(--line); padding-top: 12px; }
.reply-edit summary { cursor: pointer; color: var(--orange); font-weight: 900; margin-bottom: 10px; }
.reply-edit form, .reply-form, .inline-delete { display: grid; gap: 12px; }
.button.danger { background: #ff5a66; color: #15070a; }
.user-pill.disabled, .user-row.disabled { opacity: .68; }
.admin-users { margin: 22px 0; padding: 22px; }
.compact-heading { align-items: start; }
.user-table { display: grid; gap: 12px; }
.user-row { border: 1px solid var(--line); border-radius: 8px; background: #0d1828; padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr) 90px minmax(260px, 360px); gap: 16px; align-items: center; }
.user-status { text-align: center; color: var(--muted); }
.user-status b { color: white; display: block; font-size: 24px; }
.disable-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
@media (max-width: 900px) {
  .thread-stat-stack, .reply-heading { align-items: stretch; flex-direction: column; }
  .user-row, .disable-form { grid-template-columns: 1fr; }
}
