/* Off Record - Front styling (restored) */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #121826;
  --muted: #566074;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --accent: #f59e0b;
  --border: #e3e8f3;
  --shadow: 0 12px 30px rgba(15, 118, 110, 0.08);
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 120px; /* for fixed comment bar */
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-strong); }

header {
  background: linear-gradient(120deg, #0f766e, #0b5f59);
  color: #f7fafc;
  padding: 8px 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  position: sticky;
  top: 0;
  z-index: 50;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

nav .brand { font-size: 20px; font-weight: 700; letter-spacing: 0.4px; }
nav .brand { display: inline-flex; align-items: center; gap: 8px; }
.brand-logo { height: 36px; width: auto; max-height: 44px; max-width: 150px; display: inline-block; }

nav .links { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: center; flex: 1; }
nav .links a { color: #e8f5f2; font-weight: 600; padding: 6px 10px; border-radius: 10px; transition: background 0.2s ease; }
nav .links a:hover { background: rgba(255, 255, 255, 0.12); }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-toggle {
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.12);
  color: #e8f5f2;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
}

.container { max-width: 1080px; margin: 0 auto; padding: 24px 18px 40px; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; }

.post-block {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 14px 0;
  box-shadow: none;
  margin-bottom: 12px;
}

.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 12px; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e7f4f2; color: var(--primary-strong); margin-right: 6px; }
.badge.secondary { background: #fff5e6; color: #ad6800; }

.list { display: flex; flex-direction: column; gap: 12px; }
.story { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; background: #ffffff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.04); }
.story .title { margin: 0 0 6px; font-weight: 700; }
.story .meta { font-size: 13px; color: var(--muted); }

form label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--border); font-size: 14px; background: #fff;
}
textarea { min-height: 100px; }
.auto-expand { min-height: 40px; resize: none; overflow: hidden; }
.form-row { margin-bottom: 14px; }
.checkbox-row { display: flex; gap: 8px; align-items: flex-start; }

button, .btn {
  display: inline-block;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.08s ease;
  text-decoration: none;
  font-size: 14px;
}
button:hover, .btn:hover { background: var(--primary-strong); }
button:active, .btn:active { transform: translateY(1px); }
.btn.secondary { background: #eef2fb; color: #0f766e; border: 1px solid #d6def5; }

.alert { border-radius: 12px; padding: 12px; margin-bottom: 14px; border: 1px solid var(--border); background: #fef3c7; color: #92400e; }
.success { background: #ecfdf3; color: #166534; border: 1px solid #c5e8d3; }
.danger { background: #fef2f2; color: #991b1b; border: 1px solid #fcdada; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 12px 0; }
.stat { background: #0f766e; color: #f8fafc; padding: 12px; border-radius: 12px; box-shadow: 0 10px 20px rgba(15, 118, 110, 0.22); }
.stat .label { font-size: 13px; opacity: 0.85; }
.stat .value { font-size: 24px; font-weight: 800; }

.social-counts, .social-counts-new {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}
.social-counts { display: none; }
.social-counts .icon, .social-counts-new .icon { margin-right: 6px; }

.fb-actions { display: none !important; }
.fb-actions-new {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.fb-actions-new .action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.05);
}

.reaction-wrapper { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.reaction-palette {
  position: absolute;
  bottom: 120%;
  left: 0;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
  padding: 6px;
  display: none;
  gap: 6px;
  z-index: 30;
}
.reaction-palette.open { display: inline-flex; }
.reaction-choice {
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

.comment-sort { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.comment-sort select { min-width: 140px; }

.comments-scroll { max-height: none; overflow: visible; padding-right: 0; margin-bottom: 12px; }
.comment {
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 10px 0;
  margin-bottom: 6px;
  background: transparent;
}
.comment .meta { display: flex; gap: 6px; align-items: center; font-weight: 700; color: var(--text); }
.comment .meta time { font-weight: 600; color: var(--muted); }
.comment p { margin: 6px 0; line-height: 1.5; }
.comment .flag { font-size: 12px; color: #8a8f9c; }
.reply-list { margin-left: 14px; padding-left: 10px; border-left: 1px solid var(--border); }
.comment.reply { background: transparent; }
.reply-form { margin-top: 6px; }
.comment-form-inline { position: relative; }
.comment-form-inline textarea { padding-right: 52px; }
.comment-form-inline .send-btn {
  position: absolute; right: 8px; bottom: 8px; width: 36px; height: 36px;
  border-radius: 50%; border: none; background: var(--primary); color: #fff; font-weight: 800; cursor: pointer;
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.08);
}
.comment-form-inline .send-btn:hover { background: var(--primary-strong); }

.comment-input-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0; width: 100%;
  background: #f0f2f5;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.12);
  z-index: 100;
}

.token-box {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  overflow-wrap: anywhere;
}

footer { display: none; }

@media (max-width: 768px) {
  .container { padding: 16px 12px 28px; }
  nav { flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap; }
  nav .brand { flex: 1 1 auto; }
  nav .brand .brand-logo { height: 30px; max-width: 135px; }
  .nav-actions { flex: 0 0 auto; justify-content: flex-end; margin-left: 0; flex-wrap: nowrap; gap: 6px; }
  .nav-actions .btn.publish-btn { padding: 5px 9px; font-size: 12px; min-width: 70px; }
  .nav-actions .btn,
  .nav-actions form button { flex: 0 0 auto; text-align: center; padding: 6px 9px; font-size: 12px; }
  .nav-toggle { margin-left: 0; }
  nav .links {
    position: absolute;
    top: 100%; right: 0; left: 0;
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
    display: none;
    z-index: 20;
  }
  nav .links a, nav .links .btn { width: 100%; text-align: left; color: var(--text); padding: 8px 10px; }
  nav .links.open { display: flex; }
  .nav-toggle { display: inline-block; align-self: flex-end; }
  .grid.two { grid-template-columns: 1fr; }
  .fb-actions-new { flex-direction: row; align-items: center; justify-content: space-between; }
  .fb-actions-new .action-btn { width: auto; justify-content: center; flex: 1 1 0; text-align: center; }
}

@media (max-width: 640px) {
  header { padding: 18px 0 14px; }
  .card { padding: 14px 14px; }
  body { font-size: 15px; }
  .badge { font-size: 11px; padding: 3px 8px; }
  .comments-scroll { max-height: 200px; }
}

@media (max-width: 480px) {
  nav .brand { font-size: 18px; }
  .nav-toggle { padding: 6px 8px; }
  .story { padding: 10px 12px; }
  .comment { padding: 8px; }
  .comment-form-inline .send-btn { width: 32px; height: 32px; right: 6px; bottom: 6px; }
  .token-box { font-size: 12px; padding: 10px; }
}
