:root {
  --bg: #e9eef5;
  --surface: #ffffff;
  --surface-alt: #f7f9fc;
  --line: #d5dee8;
  --text: #17202a;
  --muted: #5d6c7a;
  --accent: #ff5b2e;
  --accent-dark: #d94419;
  --blue: #1b5fcf;
  --danger: #a61e2e;
  --success: #216e39;
  --shadow: 0 18px 45px rgba(26, 38, 54, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background:
    radial-gradient(circle at top left, rgba(255, 91, 46, 0.12), transparent 22rem),
    linear-gradient(180deg, #eef3f8 0%, #e5ebf2 100%);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  max-width: 100%;
  display: block;
  border-radius: 14px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(16, 24, 32, 0.9);
  backdrop-filter: blur(12px);
}

.brand {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff5ef;
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
}

.status-pill {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #f7fafc;
  font-size: 0.92rem;
}

.button,
button {
  border: none;
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}

.button,
.action-row button,
.topnav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.1rem;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.button:hover,
button:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: linear-gradient(135deg, var(--accent), #ff7e48);
  color: white;
}

.button.secondary {
  background: var(--blue);
  color: white;
}

.button.ghost {
  background: #eef3f8;
  color: var(--text);
}

.button.danger {
  background: #ffe0df;
  color: var(--danger);
}

.button.wide {
  width: 100%;
}

.page-shell {
  width: min(1200px, calc(100% - 2rem));
  margin: 2rem auto 3rem;
}

.flash-stack {
  width: min(1200px, calc(100% - 2rem));
  margin: 1.25rem auto 0;
  display: grid;
  gap: 0.75rem;
}

.flash {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  box-shadow: var(--shadow);
  background: var(--surface);
}

.flash.success {
  border-left: 6px solid var(--success);
}

.flash.error {
  border-left: 6px solid var(--danger);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
}

.single-column {
  width: min(900px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.main-column {
  display: grid;
  gap: 1rem;
}

.sidebar {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.section-header,
.auth-shell {
  display: grid;
  gap: 1rem;
}

.section-header {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent-dark);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(213, 222, 232, 0.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.post-card {
  display: grid;
  grid-template-columns: 82px 1fr;
  overflow: hidden;
}

.vote-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 0.75rem;
  background: linear-gradient(180deg, #f7f9fc 0%, #edf2f8 100%);
  border-right: 1px solid var(--line);
}

.vote-rail button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: white;
  color: var(--muted);
}

.post-body,
.detail-card,
.report-card,
.form-card,
.sidebar-card,
.comment-card,
.empty-state {
  padding: 1.35rem;
}

.post-body h2 {
  font-size: 1.45rem;
  line-height: 1.35;
}

.meta,
.helper {
  color: var(--muted);
  font-size: 0.96rem;
}

.media-list {
  display: grid;
  gap: 0.9rem;
  margin: 1rem 0;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1rem;
}

.plain-list {
  margin: 0;
  padding-left: 1rem;
  color: var(--muted);
}

.auth-shell {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 430px);
  align-items: center;
  min-height: calc(100vh - 14rem);
}

.auth-shell.single {
  grid-template-columns: minmax(320px, 460px);
  justify-content: center;
}

.auth-hero {
  padding: 2rem;
}

.auth-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.05;
  margin-bottom: 1rem;
}

.auth-card {
  display: grid;
  gap: 1rem;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  font: inherit;
  color: var(--text);
}

textarea {
  resize: vertical;
}

.inline-form {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
}

.inline-form.compact {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.score-line {
  font-size: 1.05rem;
}

.comment-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.sort-form select {
  min-width: 120px;
}

@media (max-width: 900px) {
  .layout,
  .auth-shell,
  .section-header {
    grid-template-columns: 1fr;
  }

  .post-card {
    grid-template-columns: 1fr;
  }

  .vote-rail {
    flex-direction: row;
    justify-content: flex-start;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }

  .page-shell,
  .flash-stack {
    width: min(100% - 1rem, 1200px);
  }

  .topbar {
    padding: 1rem;
  }
}
