:root {
  --bg: #f6f3ee;
  --panel: rgba(255, 255, 255, 0.78);
  --text: #222222;
  --muted: #7a756d;
  --accent: #1f2937;
  --border: rgba(31, 41, 55, 0.12);
  --danger: #b42318;
  --shadow: 0 24px 60px rgba(31, 41, 55, 0.12);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(210, 180, 140, 0.26), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
}

.top-auth-bar {
  position: fixed;
  z-index: 80;
  top: 18px;
  right: 22px;
  display: grid;
  gap: 10px;
  justify-items: end;
}

.top-auth-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

img,
iframe,
object,
embed {
  max-width: 100%;
}

.sidebar-toggle {
  position: fixed;
  z-index: 20;
  top: 22px;
  left: 22px;
  display: grid;
  gap: 4px;
  width: 44px;
  height: 44px;
  place-content: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.sidebar-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
}

.sidebar {
  position: fixed;
  z-index: 10;
  inset: 0 auto 0 0;
  width: 310px;
  padding: 86px 18px 24px;
  border-right: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow-y: auto;
  transition: transform 220ms ease;
}

.sidebar-hidden .sidebar {
  transform: translateX(-100%);
}

.sidebar-hidden .editor {
  margin-left: auto;
}

.sidebar-header {
  margin-bottom: 16px;
  padding: 0 8px;
}

.sidebar-header p {
  margin: 0 0 6px;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-header h2 {
  margin: 0;
  color: var(--accent);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.4rem;
}

.search-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.search-panel label,
.search-count {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-panel input,
.search-panel select {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--accent);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.clear-search {
  padding: 10px 12px;
  background: transparent;
  color: var(--accent);
}

.notification-toggle {
  justify-self: start;
  border-color: transparent;
  background: rgba(29, 155, 240, 0.1);
  color: #1d9bf0;
  font-size: 0.82rem;
}

.search-count {
  margin: 0;
  letter-spacing: 0;
  text-transform: none;
}

.publication-list {
  display: grid;
  gap: 10px;
}

.publication-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 14px;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.publication-item:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.78);
  transform: translateY(-1px);
}

.publication-item a {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.publication-item strong {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.publication-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.publication-actions button {
  justify-self: start;
  padding: 6px 10px;
  font-size: 0.75rem;
}

.share-publication,
.copy-publication {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.65);
  color: var(--accent);
}

.delete-publication {
  border-color: rgba(180, 35, 24, 0.22);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.delete-publication:hover {
  background: rgba(180, 35, 24, 0.14);
}

.empty-state {
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.86rem;
}

.empty-state {
  padding: 14px 8px;
}

.editor {
  position: relative;
  max-width: 100%;
  width: min(740px, calc(100% - 32px));
  margin: 0 auto 0 max(340px, calc((100vw - 430px) / 2));
  padding: 64px 0;
  transition: margin 220ms ease;
}

.fullscreen-toggle {
  position: absolute;
  z-index: 40;
  top: 22px;
  right: 0;
  display: grid;
  width: 42px;
  height: 42px;
  place-content: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--accent);
  box-shadow: var(--shadow);
  font-size: 1.2rem;
}

.board-fullscreen {
  overflow: hidden;
}

.board-fullscreen .sidebar,
.board-fullscreen .sidebar-toggle {
  display: none;
}

.board-fullscreen .editor {
  position: fixed;
  z-index: 50;
  inset: 0;
  width: auto;
  margin: 0;
  overflow-y: auto;
  padding: 56px max(28px, calc((100vw - 820px) / 2));
  background:
    radial-gradient(circle at top right, rgba(210, 180, 140, 0.22), transparent 28rem),
    var(--bg);
}

.board-fullscreen .fullscreen-toggle {
  position: fixed;
  z-index: 70;
  top: 18px;
  right: 22px;
}

form {
  display: grid;
  gap: 22px;
}

.admin-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.admin-panel button {
  border-color: transparent;
  background: rgba(29, 155, 240, 0.1);
  color: #1d9bf0;
}

.admin-panel button:hover {
  background: rgba(29, 155, 240, 0.16);
}

input,
.story-editor {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
}

.site-heading {
  display: grid;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
  text-align: center;
}

.site-heading h1 {
  margin: 0;
  color: var(--accent);
  font-size: clamp(2rem, 6vw, 3.8rem);
  line-height: 1.05;
}

.site-heading p {
  margin: 0;
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.title {
  font-size: clamp(2.3rem, 8vw, 4rem);
  line-height: 1.08;
}

.title::placeholder,
.story-editor:empty::before,
.toolbar input::placeholder {
  color: var(--muted);
}

.format-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: fit-content;
  border-radius: 14px;
  padding: 7px;
  background: #1f2937;
  box-shadow: 0 14px 40px rgba(31, 41, 55, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.editor-tools-visible .format-toolbar {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.read-only-mode .format-toolbar {
  display: none;
}

.format-toolbar button {
  display: grid;
  min-width: 32px;
  height: 32px;
  place-content: center;
  border: 0;
  border-radius: 9px;
  padding: 0 9px;
  background: transparent;
  color: #ffffff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
}

.format-toolbar button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.format-toolbar button:nth-child(4) {
  font-size: 1.18rem;
}

.format-toolbar button:nth-child(5) {
  font-size: 0.88rem;
}

.story-editor {
  min-height: 52vh;
  font-size: 1.35rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.read-only-mode .title,
.read-only-mode .story-editor,
.read-only-mode .toolbar input {
  cursor: default;
}

.read-only-mode .story-editor {
  user-select: text;
}

.read-only-mode .toolbar {
  opacity: 0.58;
}

.read-only-mode .toolbar button[type="submit"] {
  cursor: not-allowed;
}

.story-editor:empty::before {
  content: attr(data-placeholder);
  pointer-events: none;
}

.story-editor h3,
.story-editor h4,
.story-editor p,
.story-editor blockquote,
.story-editor pre {
  margin: 0 0 1rem;
}

.story-editor h3 {
  font-size: 1.7rem;
  line-height: 1.25;
}

.story-editor h4 {
  font-size: 1.35rem;
  line-height: 1.3;
}

.story-editor blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 18px;
  color: var(--muted);
}

.story-editor pre {
  overflow-x: auto;
  border-radius: 16px;
  padding: 16px;
  background: #1f2937;
  color: #f8fafc;
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 1rem;
  line-height: 1.5;
}

.story-editor a {
  color: var(--accent);
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.toolbar input {
  min-width: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
}

.toolbar .admin-code {
  max-width: 120px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.62);
}

button {
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  white-space: nowrap;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.result {
  margin-top: 28px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  font-family: Arial, Helvetica, sans-serif;
}

.result p {
  margin: 0 0 8px;
  color: var(--muted);
}

.result a {
  color: var(--accent);
  overflow-wrap: anywhere;
}

.social-panel {
  display: grid;
  gap: 18px;
  margin-top: 22px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  font-family: Arial, Helvetica, sans-serif;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.share-actions button {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent);
}

.comments-box {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 48px rgba(31, 41, 55, 0.08);
  overflow: hidden;
}

.public-feed {
  display: grid;
  gap: 0;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.featured-feed {
  display: grid;
  gap: 0;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.featured-feed > header {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding: 18px;
}

.featured-feed > header p {
  margin: 0;
  color: #1d9bf0;
  font-size: 0.85rem;
  font-weight: 900;
}

.featured-feed > header h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.featured-feed > header span {
  color: var(--muted);
  font-size: 0.92rem;
}

.featured-form {
  display: grid;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
  background: #ffffff;
}

.featured-auth {
  display: grid;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
  background: #ffffff;
}

.auth-popover {
  width: min(360px, calc(100vw - 28px));
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(15, 20, 25, 0.18);
}

.auth-tab {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
}

.auth-tab.active {
  border-color: transparent;
  background: #0f1419;
  color: #ffffff;
}

.featured-auth h3 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.auth-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.featured-oauth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.featured-oauth-actions button {
  background: rgba(29, 155, 240, 0.1);
  color: #1d9bf0;
}

.featured-session {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  background: rgba(29, 155, 240, 0.08);
}

.featured-session p {
  margin: 0;
  color: var(--text);
}

.featured-session button {
  background: rgba(15, 20, 25, 0.1);
  color: var(--text);
}

.featured-auth input,
.featured-auth select,
.featured-form input,
.featured-form textarea {
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 10px 0;
  background: transparent;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
}

.featured-auth select {
  appearance: none;
}

.featured-form textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.featured-form input[type="file"] {
  border: 1px dashed var(--border);
  border-radius: 18px;
  padding: 12px;
  background: rgba(29, 155, 240, 0.05);
}

.featured-form button {
  justify-self: end;
  min-width: 170px;
}

.featured-admin-panel {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
  background: rgba(255, 204, 1, 0.12);
}

.featured-admin-panel[hidden] {
  display: none;
}

.featured-admin-panel header,
.featured-admin-user {
  display: grid;
  gap: 10px;
}

.featured-admin-panel header {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.featured-admin-panel header p {
  margin: 0;
  color: var(--text);
  font-weight: 900;
}

.featured-admin-list {
  display: grid;
  gap: 10px;
}

.featured-admin-user {
  grid-template-columns: minmax(180px, 1fr) 140px minmax(160px, auto) minmax(180px, 1fr) auto;
  align-items: center;
  border: 1px solid rgba(207, 217, 222, 0.9);
  border-radius: 18px;
  padding: 12px;
  background: #ffffff;
}

.featured-admin-user div {
  display: grid;
  gap: 2px;
}

.featured-admin-user span,
.featured-admin-user small {
  color: var(--muted);
}

.featured-admin-user select,
.featured-admin-user input[type="password"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 12px;
  background: #ffffff;
  color: var(--text);
}

.featured-admin-user label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
}

.featured-post-list {
  display: grid;
  gap: 0;
}

.featured-post {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
  background: #ffffff;
}

.featured-post:last-child {
  border-bottom: 0;
}

.featured-post header {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
}

.featured-post header div:last-child {
  display: grid;
  gap: 2px;
}

.featured-post header span {
  color: #1d9bf0;
  font-size: 0.82rem;
  font-weight: 800;
}

.featured-post time {
  color: var(--muted);
  font-size: 0.8rem;
}

.featured-text {
  display: grid;
  gap: 8px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.featured-text p {
  margin: 0;
}

.featured-image,
.featured-video {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: #000000;
}

.featured-image {
  display: block;
  max-height: 520px;
  object-fit: contain;
}

.featured-video {
  aspect-ratio: 16 / 9;
  min-height: 240px;
}

.featured-media-link,
.featured-file {
  justify-self: start;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(29, 155, 240, 0.1);
  color: #1d9bf0;
  font-weight: 900;
  text-decoration: none;
}

.public-feed > header {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  padding: 18px;
}

.public-feed > header p {
  margin: 0;
  color: #1d9bf0;
  font-size: 0.85rem;
  font-weight: 900;
}

.public-feed > header h2 {
  margin: 0;
  color: var(--text);
  font-size: 1.5rem;
  letter-spacing: -0.04em;
}

.public-feed > header span {
  color: var(--muted);
  font-size: 0.92rem;
}

.global-comment-form {
  border-top: 0;
  background: #ffffff;
}

.public-feed-list {
  display: grid;
  gap: 0;
}

.public-thread {
  display: grid;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.public-thread:last-child {
  border-bottom: 0;
}

.public-thread-header {
  display: grid;
  gap: 4px;
  padding: 14px 18px 8px;
}

.public-thread-header span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.public-thread-header a {
  color: var(--text);
  font-size: 1rem;
  font-weight: 900;
  text-decoration: none;
}

.public-thread-header a:hover {
  color: #1d9bf0;
}

.public-thread-comments .comment-item {
  border-top: 0;
}

.public-thread-comments > .comment-item {
  border-top: 1px solid var(--border);
}

.reply-global-comment {
  justify-self: start;
  border-color: transparent;
  padding: 7px 0;
  background: transparent;
  color: #1d9bf0;
  font-size: 0.82rem;
}

.reply-global-comment:hover {
  text-decoration: underline;
}

.comments-box h2 {
  margin: 0 0 -8px;
  padding: 18px 18px 0;
  color: var(--accent);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
}

.comments-box p {
  margin: 0;
  padding: 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.comment-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.48);
}

.reply-target {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 0;
}

.reply-target[hidden] {
  display: none;
}

.reply-target button {
  border-color: var(--border);
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent);
  font-size: 0.78rem;
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 8px 0;
  background: transparent;
  color: var(--accent);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
}

.comment-form textarea {
  min-height: 86px;
  resize: vertical;
  font-size: 1.05rem;
  line-height: 1.45;
}

.comment-form button {
  justify-self: start;
  border-color: #1d9bf0;
  background: #1d9bf0;
  color: #ffffff;
}

.admin-reply-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(255, 204, 1, 0.55);
  border-radius: 18px;
  padding: 10px;
  background: rgba(255, 204, 1, 0.12);
}

.admin-reply-tools[hidden] {
  display: none;
}

.admin-reply-tools span {
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 900;
}

.admin-reply-tools button {
  border-color: #ffcc01;
  background: #ffcc01;
  color: #0f1419;
}

.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.reply-comment,
.delete-comment {
  justify-self: start;
  border-color: transparent;
  padding: 7px 0;
  background: transparent;
  font-size: 0.82rem;
}

.reply-comment {
  color: #1d9bf0;
}

.delete-comment {
  color: var(--danger);
}

.delete-comment:hover,
.reply-comment:hover {
  text-decoration: underline;
}

.comment-list {
  display: grid;
  gap: 0;
}

.comment-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding: 14px 18px;
  transition: background 160ms ease;
}

.comment-item:hover {
  background: rgba(29, 155, 240, 0.04);
}

.comment-avatar {
  display: grid;
  width: 44px;
  height: 44px;
  place-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #1d9bf0, #7c3aed);
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
}

.comment-content {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.comment-item header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: flex-start;
  color: var(--accent);
  font-family: Arial, Helvetica, sans-serif;
}

.comment-item time {
  color: var(--muted);
  font-size: 0.78rem;
}

.comment-item p {
  color: var(--text);
  overflow-wrap: anywhere;
}

.comment-body {
  display: grid;
  gap: 8px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.comment-body p,
.comment-body blockquote {
  margin: 0;
  padding: 0;
}

.comment-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 12px;
  color: var(--muted);
}

.comment-body code {
  border-radius: 6px;
  padding: 2px 5px;
  background: rgba(31, 41, 55, 0.1);
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 0.92em;
}

.comment-body a {
  color: var(--accent);
  font-weight: 700;
}

.comment-replies {
  display: grid;
  gap: 0;
  margin-top: 6px;
  margin-left: 0;
  border-left: 2px solid var(--border);
  padding-left: 12px;
}

.comment-replies .comment-item {
  border-top: 0;
  padding: 12px 0 0;
}

.comment-replies .comment-avatar {
  width: 36px;
  height: 36px;
  font-size: 0.82rem;
}

.error p {
  color: var(--danger);
}

.toast {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 36px));
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 48px rgba(15, 20, 25, 0.16);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.toast a {
  justify-self: start;
  border-radius: 999px;
  padding: 8px 12px;
  background: #1d9bf0;
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 640px) {
  body {
    font-size: 16px;
  }

  .top-auth-bar {
    top: 12px;
    right: 12px;
  }

  .top-auth-bar .auth-tab {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  .sidebar-toggle {
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
  }

  .sidebar {
    width: 100vw;
    max-width: 100vw;
    padding: 68px 12px 18px;
  }

  .editor {
    width: calc(100% - 24px);
    margin: 0 auto;
    padding-top: 56px;
  }

  .fullscreen-toggle {
    top: 10px;
    right: 0;
    width: 40px;
    height: 40px;
  }

  .title {
    font-size: clamp(2rem, 12vw, 3rem);
  }

  .story-editor {
    min-height: 46vh;
    font-size: 1.12rem;
    line-height: 1.55;
  }

  .format-toolbar {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }

  .publication-actions,
  .share-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .comments-box {
    padding: 12px;
  }

  .publication-actions button,
  .share-actions button {
    width: 100%;
    padding-inline: 10px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar .admin-code {
    max-width: none;
  }

  .board-fullscreen .editor {
    padding: 58px 14px 28px;
  }
}

/* Modern Twitter/X inspired interface */
:root {
  --bg: #f7f9f9;
  --panel: #ffffff;
  --text: #0f1419;
  --muted: #536471;
  --accent: #0f1419;
  --brand: #1d9bf0;
  --brand-soft: rgba(29, 155, 240, 0.1);
  --border: #eff3f4;
  --danger: #f4212e;
  --shadow: 0 16px 44px rgba(15, 20, 25, 0.08);
}

body {
  background:
    radial-gradient(circle at top left, rgba(29, 155, 240, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.sidebar-toggle,
.fullscreen-toggle {
  border-radius: 999px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(15, 20, 25, 0.08);
}

.sidebar-toggle:hover,
.fullscreen-toggle:hover {
  background: #e8f5fd;
}

.sidebar {
  width: 350px;
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: none;
}

.sidebar-header {
  border-bottom: 1px solid var(--border);
  margin: 0 -18px 16px;
  padding: 0 18px 16px 76px;
}

.sidebar-header p {
  color: var(--brand);
  letter-spacing: 0;
  text-transform: none;
}

.sidebar-header h2 {
  color: var(--text);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.search-panel {
  border-color: var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(15, 20, 25, 0.04);
}

.search-panel input,
.search-panel select,
.toolbar .admin-code {
  border-color: transparent;
  background: #eff3f4;
  color: var(--text);
}

.search-panel input:focus,
.search-panel select:focus,
.toolbar .admin-code:focus {
  border-color: var(--brand);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.clear-search,
.share-publication,
.copy-publication,
.share-actions button {
  border-color: transparent;
  background: var(--brand-soft);
  color: var(--brand);
}

.publication-list {
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  overflow: hidden;
}

.publication-item {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 16px;
  background: transparent;
}

.publication-item:last-child {
  border-bottom: 0;
}

.publication-item:hover {
  border-color: transparent;
  background: rgba(15, 20, 25, 0.03);
  transform: none;
}

.publication-item strong {
  color: var(--text);
  font-size: 0.96rem;
}

.publication-actions button,
.reply-comment,
.delete-comment {
  border-radius: 999px;
  font-weight: 800;
}

.delete-publication {
  border-color: transparent;
  background: rgba(244, 33, 46, 0.1);
  color: var(--danger);
}

.editor {
  width: min(780px, calc(100% - 32px));
  margin: 0 auto 0 max(380px, calc((100vw - 430px) / 2));
  padding: 32px 0 72px;
}

#pageForm,
.result,
.social-panel {
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.result,
.social-panel {
  margin-top: 18px;
}

.site-heading {
  border-bottom: 1px solid var(--border);
  padding-bottom: 22px;
}

.site-heading .yeshiva-title {
  display: grid;
  gap: 0;
  margin: 0;
  color: #ffffff;
  font-family: "aktiv-grotesk", Helvetica, Arial, sans-serif;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.42);
}

.site-heading .yeshiva-title span {
  color: #ffcc01;
  font-size: clamp(2.8rem, 8.6vw, 6.4rem);
  font-style: normal;
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.9;
}

.site-heading .yeshiva-title strong {
  color: #ffffff;
  font-size: clamp(2.8rem, 8.6vw, 6.4rem);
  font-weight: 900;
  letter-spacing: -0.065em;
  line-height: 0.9;
}

.site-heading {
  border-radius: 28px;
  padding: 28px 18px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.28), transparent 20rem),
    radial-gradient(circle at top left, rgba(29, 155, 240, 0.42), transparent 18rem),
    linear-gradient(135deg, rgba(0, 58, 148, 0.96), rgba(0, 102, 204, 0.9) 48%, rgba(0, 45, 117, 0.96));
  box-shadow: 0 18px 48px rgba(0, 75, 165, 0.28);
}

.site-tagline {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.site-tagline h1,
.site-tagline p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-family: "aktiv-grotesk", Helvetica, Arial, sans-serif;
  font-size: clamp(1.05rem, 2.2vw, 1.45rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.3;
}

.site-logo-link {
  justify-self: center;
  display: inline-flex;
  margin-top: 8px;
  border-radius: 999px;
  padding: 4px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.site-logo-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(15, 20, 25, 0.12);
}

.site-logo-link img {
  display: block;
  width: min(260px, 78vw);
  height: auto;
  border-radius: 999px;
}

.title {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.story-editor {
  min-height: 44vh;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  background: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.1rem;
  line-height: 1.58;
}

.story-editor:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.format-toolbar {
  border-radius: 999px;
  background: var(--text);
  box-shadow: 0 16px 34px rgba(15, 20, 25, 0.16);
}

.format-toolbar button {
  font-family: Arial, Helvetica, sans-serif;
}

.toolbar {
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

.toolbar input {
  border-radius: 999px;
  padding: 11px 14px;
  background: #eff3f4;
}

button {
  border-color: transparent;
  background: var(--brand);
  color: #ffffff;
  transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

button:hover {
  background: #1a8cd8;
}

button:active {
  transform: translateY(1px);
}

.comments-box {
  border-radius: 28px;
  box-shadow: none;
}

.comment-form {
  background: #ffffff;
}

.comment-form input,
.comment-form textarea {
  color: var(--text);
}

.comment-form button {
  justify-self: end;
  min-width: 150px;
}

.comment-item {
  background: #ffffff;
}

.comment-item:hover {
  background: rgba(15, 20, 25, 0.03);
}

.comment-body {
  font-size: 0.98rem;
}

.comment-actions {
  margin-top: 2px;
}

.reply-comment:hover {
  color: #1a8cd8;
}

.delete-comment:hover {
  color: #d91f2a;
}

.board-fullscreen .editor {
  background: var(--bg);
}

.board-fullscreen #pageForm,
.board-fullscreen .result,
.board-fullscreen .social-panel {
  width: min(940px, 100%);
  margin-inline: auto;
  box-shadow: none;
}

.board-fullscreen .fullscreen-toggle {
  display: grid;
  width: 46px;
  height: 46px;
  border-color: var(--border);
  background: var(--text);
  color: #ffffff;
  font-size: 1.8rem;
  line-height: 1;
}

.board-fullscreen .fullscreen-toggle:hover {
  background: #272c30;
}

@media (max-width: 900px) {
  .sidebar {
    width: min(350px, 88vw);
  }

  .editor,
  .sidebar-hidden .editor {
    width: calc(100% - 28px);
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .editor {
    padding-top: 58px;
  }

  #pageForm,
  .result,
  .social-panel {
    border-radius: 24px;
    padding: 16px;
  }

  .comments-box {
    padding: 0;
  }

  .comment-item {
    grid-template-columns: 38px 1fr;
    padding: 13px 14px;
  }

  .comment-avatar {
    width: 38px;
    height: 38px;
  }

  .featured-admin-panel header,
  .featured-admin-user {
    grid-template-columns: 1fr;
  }
}
