/* ========================================
   nobodyreads.me — wireframe styles
   plain, minimal, no frameworks
   ======================================== */

/* ----- Reset & base ----- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg:      #fdfdfd;
  --text:    #2c2c2c;
  --muted:   #7a7a7a;
  --border:  #e0e0e0;
  --accent:  #555;
  --link:    #2c2c2c;
  --link-hover: #000;
  --max-width: 680px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Menlo', 'Consolas', monospace;

  /* Brand tokens + logo */
  --brand-ink:    #111111;
  --brand-accent: #2563EB;
  --brand-bg:     #ffffff;
  --brand-font:   "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
                  Consolas, "Liberation Mono", "Courier New", monospace;
  --logo-weight:  600;
  --logo-tracking: 0.02em;
}

:root[data-theme="dark"] {
  --bg-dark:   #0f1115;   /* deep graphite */
  --text-dark: #e6e6e6;   /* soft white */
  --muted-dark: #9ca3af;   /* muted text */
  --accent:    #2563EB;   /* same blue as light mode */

  --bg:      var(--bg-dark);
  --text:    var(--text-dark);
  --muted:   var(--muted-dark);
  --border:  #252a30;
  --link:    var(--text-dark);
  --link-hover: #ffffff;

  --brand-ink: var(--text-dark);
  --brand-bg:  var(--bg-dark);
}

html {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ----- Layout ----- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ----- Header ----- */
.site-header {
  padding: 1.75rem 0 2.25rem;
  border-bottom: 1px solid var(--border);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.site-logo {
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
}

/* Wordmark — "nobodyreads" in brand-ink, ".me" in brand-accent */
.wordmark {
  font-family: var(--brand-font);
  font-weight: var(--logo-weight);
  letter-spacing: var(--logo-tracking);
  line-height: 1;
  color: var(--brand-ink);
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
}

.wordmark .me {
  color: var(--brand-accent);
}

.wordmark--xl { font-size: clamp(28px, 6vw, 64px); }
.wordmark--md { font-size: clamp(18px, 3vw, 28px); }

.wordmark .dot { margin-right: -0.02em; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-auth a,
.auth-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  transition: color 0.15s;
}

.nav-auth a:hover,
.auth-link:hover {
  color: var(--text);
}

.auth-logout button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
}

.auth-logout button:hover {
  border-color: var(--text);
}

.theme-toggle {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--text);
}

.nav-toggle {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 14px;
  height: 2px;
  background: var(--text);
}

.site-nav {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 0;
  right: 0;
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s;
}

body.nav-open .site-nav {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  transition: color 0.15s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
}

.site-hero {
  padding-top: 2.5rem;
}

.hero-title {
  line-height: 1.1;
  margin: 0;
  font-weight: inherit;
}

.hero-tagline {
  color: var(--muted);
  font-size: 1rem;
  margin-top: 0.65rem;
  max-width: 36rem;
}

/* ----- Main ----- */
main {
  flex: 1;
  padding: 2rem 0;
}

/* ----- Post preview (index page) ----- */
.post-preview {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}

.post-preview:first-child {
  padding-top: 0;
}

.post-preview:last-child {
  border-bottom: none;
}

.post-date {
  display: block;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.post-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
}

.post-title a {
  color: var(--text);
  text-decoration: none;
}

.post-title a:hover {
  text-decoration: underline;
}

.post-excerpt {
  margin-top: 0.5rem;
  color: var(--accent);
  font-size: 0.9rem;
}

.read-more {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.read-more:hover {
  color: var(--text);
}

/* ----- Single post ----- */
.post-header {
  margin-bottom: 2rem;
}

.post-header .post-title {
  font-size: 1.6rem;
}

.post-body p {
  margin-bottom: 1.2rem;
}

.post-body h2 {
  font-size: 1.15rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.06);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.post-body pre {
  background: rgba(0, 0, 0, 0.06);
  padding: 1rem 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.2rem;
  font-size: 0.8rem;
  line-height: 1.6;
}

.post-body pre code {
  background: none;
  padding: 0;
}

.post-body blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 1.2rem;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

/* ----- About page ----- */
.about-content p {
  margin-bottom: 1.2rem;
}

.about-content a {
  color: var(--text);
}

/* ----- Footer ----- */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
}

.site-footer p {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--muted);
}

/* ----- Loading / error states ----- */
.loading {
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
}

.error {
  color: #b44;
  font-style: italic;
  font-size: 0.9rem;
}

/* ----- Platform: hero ----- */
.platform-hero {
  padding: 3rem 0 2.5rem;
}

.platform-hero-subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.platform-hero h2 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.platform-hero p {
  color: var(--accent);
  font-size: 1rem;
  max-width: 32rem;
  margin: 0 0 1.1rem;
}

.cta-button {
  display: inline-block;
  padding: 0.6rem 1.6rem;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border-radius: 4px;
  transition: opacity 0.15s;
}

.cta-button:hover {
  opacity: 0.85;
}

.ghost-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-mono);
}

.ghost-link:hover {
  color: var(--text);
}

/* ----- Platform: technical hero ----- */
.hero-technical {
  border-bottom: 1px solid var(--border);
  position: relative;
}

.hero-technical::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(800px 300px at 20% 0%, rgba(37, 99, 235, 0.08), transparent 60%),
    radial-gradient(700px 260px at 90% 20%, rgba(0, 0, 0, 0.06), transparent 60%);
  pointer-events: none;
}

::root[data-theme="dark"] .hero-technical::before {
  background:
    radial-gradient(800px 300px at 20% 0%, rgba(37, 99, 235, 0.18), transparent 60%),
    radial-gradient(700px 260px at 90% 20%, rgba(255, 255, 255, 0.06), transparent 60%);
}

.hero-technical-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-technical-copy h2 {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.hero-technical-panel {
  display: grid;
  gap: 1rem;
}

.hero-panel-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  background: rgba(0, 0, 0, 0.02);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

::root[data-theme="dark"] .hero-panel-box {
  background: rgba(255, 255, 255, 0.03);
}

.panel-label {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.panel-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.6rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.panel-row:last-child {
  margin-bottom: 0;
}

.panel-pill {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}

/* ----- Platform: manifesto ----- */
.platform-manifesto {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.manifesto-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(3, 1fr);
}

.manifesto-grid h3 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.manifesto-grid p {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ----- Platform: features ----- */
.platform-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.feature h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.feature p {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ----- Platform: steps ----- */
.platform-steps {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--border);
}

.platform-steps h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.platform-steps ol {
  display: grid;
  gap: 0.75rem;
  list-style: none;
  counter-reset: steps;
  margin: 0;
  padding: 0;
}

.platform-steps li {
  counter-increment: steps;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem 0.85rem 3.1rem;
  position: relative;
  background: rgba(0, 0, 0, 0.02);
  font-size: 0.9rem;
  color: var(--accent);
}

::root[data-theme="dark"] .platform-steps li {
  background: rgba(255, 255, 255, 0.03);
}

.platform-steps li::before {
  content: counter(steps);
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ----- Platform: CTA ----- */
.platform-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2.5rem 0;
}

.platform-cta h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.platform-cta p {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 32rem;
}

/* ----- Platform: auth forms ----- */
.auth-form {
  max-width: 360px;
  margin: 0 auto;
  padding: 2rem 0;
}

.auth-form h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.auth-form > p {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

.auth-form form {
  display: flex;
  flex-direction: column;
}

.auth-form label {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent);
  margin-bottom: 0.25rem;
  margin-top: 1rem;
}

.auth-form label:first-of-type {
  margin-top: 0;
}

.auth-form input {
  padding: 0.5rem 0.65rem;
  font-size: 0.9rem;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-form small {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.auth-form button {
  margin-top: 1.5rem;
  padding: 0.55rem 1rem;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.15s;
}

.auth-form button:hover {
  opacity: 0.85;
}

.auth-alt {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.auth-alt a {
  color: var(--text);
}

/* ----- Form errors ----- */
.form-errors {
  background: rgba(180, 68, 68, 0.08);
  border: 1px solid rgba(180, 68, 68, 0.35);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  list-style: none;
}

.form-errors li {
  font-size: 0.8rem;
  color: #b44;
  line-height: 1.5;
}

/* ----- Page body (about, uses, etc.) ----- */
.page-body p {
  margin-bottom: 1.2rem;
}

.page-body a {
  color: var(--text);
}

/* ----- Home intro ----- */
.home-intro {
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}

.home-intro p {
  margin-bottom: 1.2rem;
}

.home-intro a {
  color: var(--text);
}

/* ----- Responsive ----- */
@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  .site-header {
    padding: 1.5rem 0 1.75rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .post-header .post-title {
    font-size: 1.35rem;
  }

  .platform-features {
    grid-template-columns: 1fr;
  }

  .platform-hero h2 {
    font-size: 1.4rem;
  }

  .hero-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .platform-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (min-width: 640px) {
  :root {
    --max-width: 820px;
  }

  .site-nav {
    position: static;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0;
    border: none;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    background: transparent;
  }

  .nav-toggle {
    display: none;
  }

  .hero-title {
    font-size: 2.9rem;
  }

  .platform-steps ol {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  :root {
    --max-width: 980px;
  }

  .site-header {
    padding: 2.5rem 0 3rem;
  }

  .hero-title {
    font-size: 3.2rem;
  }
}

@media (max-width: 920px) {
  .hero-technical-inner {
    grid-template-columns: 1fr;
  }

  .manifesto-grid {
    grid-template-columns: 1fr;
  }

  .platform-features {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   Editor styles
   ======================================== */

/* ----- Editor header ----- */
.editor-header {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.editor-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.editor-logo {
  font-weight: 700;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
}

.editor-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.editor-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.editor-nav a:hover {
  color: var(--text);
}

/* ----- Editor list (dashboard) ----- */
.editor-list {
  padding: 2rem 0;
}

.editor-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.editor-list-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
}

.editor-list-section {
  margin-bottom: 2rem;
}

.editor-list-section h3 {
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.editor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.editor-table th {
  text-align: left;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.editor-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.editor-table tr:last-child td {
  border-bottom: none;
}

.editor-table td a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.editor-table td a:hover {
  text-decoration: underline;
}

.cell-slug {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.cell-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.cell-status {
  white-space: nowrap;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  border-radius: 999px;
  line-height: 1.4;
}

.badge-published {
  background: rgba(50, 160, 80, 0.12);
  color: #2a8a46;
}

:root[data-theme="dark"] .badge-published {
  background: rgba(50, 180, 80, 0.15);
  color: #5dce7a;
}

.badge-draft {
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted);
}

:root[data-theme="dark"] .badge-draft {
  background: rgba(255, 255, 255, 0.08);
}

.editor-empty {
  color: var(--muted);
  font-style: italic;
  padding: 2rem 0;
}

/* ----- Buttons ----- */
.btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, opacity 0.15s;
  line-height: 1.4;
}

.btn:hover {
  border-color: var(--text);
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-danger {
  color: #b44;
  border-color: rgba(180, 68, 68, 0.4);
}

.btn-danger:hover {
  border-color: #b44;
  background: rgba(180, 68, 68, 0.06);
}

/* ----- Editor main layout ----- */
.editor-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: calc(100vh - 50px); /* fill viewport minus header */
}

.editor-form {
  flex: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 1fr auto;
  min-height: 0;
  overflow: hidden;
}

/* Content is first in DOM so it is sent first in POST; place sidebar left, editor right */
.editor-form > input[type="hidden"] {
  grid-column: 1;
  grid-row: 1;
  width: 0;
  height: 0;
  overflow: hidden;
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.editor-form > .editor-split {
  grid-column: 2;
  grid-row: 1;
}
.editor-form > .editor-sidebar {
  grid-column: 1;
  grid-row: 1;
}

/* ----- Editor sidebar ----- */
.editor-sidebar {
  padding: 1.25rem;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.editor-sidebar .field {
  display: flex;
  flex-direction: column;
}

.editor-sidebar label {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--muted);
  margin-bottom: 0.2rem;
  margin-top: 0.7rem;
}

.editor-sidebar input[type="text"],
.editor-sidebar input[type="date"],
.editor-sidebar input[type="number"],
.editor-sidebar textarea,
.editor-sidebar select {
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text);
}

.editor-sidebar input:focus,
.editor-sidebar textarea:focus,
.editor-sidebar select:focus {
  outline: none;
  border-color: var(--accent);
}

.editor-sidebar select {
  cursor: pointer;
}

.editor-sidebar .hint {
  color: var(--muted);
  font-size: 0.7rem;
}

.editor-sidebar details {
  margin-top: 0.5rem;
}

.editor-sidebar summary {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--muted);
  cursor: pointer;
  margin-bottom: 0.25rem;
}

.field-row label {
  flex-direction: row;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.field-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--text);
}

.editor-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.editor-delete-form {
  display: contents;
}

/* ----- Editor split pane ----- */
.editor-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 0;
  overflow: hidden;
}

.editor-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.editor-pane-write {
  border-right: 1px solid var(--border);
}

/* ----- Toolbar ----- */
.editor-toolbar {
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.editor-toolbar button {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  line-height: 1.2;
}

.editor-toolbar button:hover {
  border-color: var(--text);
  background: rgba(0, 0, 0, 0.03);
}

:root[data-theme="dark"] .editor-toolbar button:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ----- Textarea ----- */
.editor-textarea {
  flex: 1;
  width: 100%;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  border: none;
  outline: none;
  resize: none;
  background: var(--bg);
  color: var(--text);
  tab-size: 2;
  min-height: 0;
}

/* ----- Preview pane ----- */
.editor-preview-label {
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.editor-preview {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  min-height: 0;
}

/* ----- Mobile tab switcher ----- */
.editor-tabs {
  display: none;
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.editor-tab {
  flex: 1;
  padding: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.editor-tab.active {
  color: var(--text);
  border-bottom-color: var(--text);
}

.hidden {
  display: none !important;
}

/* ----- Editor responsive ----- */
@media (max-width: 768px) {
  .editor-form {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .editor-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: none;
    padding: 1rem;
  }

  .editor-split {
    grid-template-columns: 1fr;
  }

  .editor-pane-write {
    border-right: none;
  }

  .editor-pane-preview {
    display: none;
  }

  .editor-tabs {
    display: flex;
  }

  /* When preview tab is active on mobile */
  .editor-pane-preview:not(.hidden) {
    display: flex;
  }

  .editor-table .cell-slug,
  .editor-table th:nth-child(2) {
    display: none;
  }
}

/* ========================================
   Settings styles
   ======================================== */

/* ----- Settings header ----- */
.settings-header {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
}

.settings-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ----- Settings layout ----- */
.settings-page {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 3rem;
  padding: 2rem 0;
  min-height: 50vh;
}

/* ----- Settings nav ----- */
.settings-nav {
  border-right: 1px solid var(--border);
  padding-right: 1.5rem;
}

.settings-nav-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.settings-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.settings-tab {
  display: block;
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--muted);
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.settings-tab:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.04);
}

:root[data-theme="dark"] .settings-tab:hover {
  background: rgba(255, 255, 255, 0.06);
}

.settings-tab.active {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
  font-weight: 600;
}

:root[data-theme="dark"] .settings-tab.active {
  background: rgba(255, 255, 255, 0.08);
}

/* ----- Settings content ----- */
.settings-content {
  max-width: 480px;
}

.settings-section {
  margin-bottom: 2.5rem;
}

.settings-section h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.settings-description {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
}

/* ----- Settings form fields ----- */
.settings-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.25rem;
}

.settings-field label {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.settings-field input[type="text"],
.settings-field input[type="email"],
.settings-field input[type="password"],
.settings-field textarea {
  padding: 0.5rem 0.65rem;
  font-size: 0.9rem;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  color: var(--text);
}

.settings-field input:focus,
.settings-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.settings-field textarea {
  resize: vertical;
  line-height: 1.6;
}

.settings-field small {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.settings-actions {
  margin-top: 1.5rem;
}

/* ----- Profile avatar ----- */
.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.profile-avatar .avatar-svg {
  border-radius: 50%;
  display: block;
}

.profile-avatar-label {
  font-weight: 600;
  font-size: 1rem;
}

.profile-avatar-hint {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

/* ----- Avatar color picker ----- */
.avatar-color-picker {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.avatar-color-picker input[type="color"] {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.avatar-color-picker input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.avatar-color-picker input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

.avatar-color-preview .avatar-svg {
  border-radius: 50%;
  display: block;
}

/* ----- Success message ----- */
.form-success {
  background: rgba(50, 160, 80, 0.08);
  border: 1px solid rgba(50, 160, 80, 0.35);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: #2a8a46;
}

:root[data-theme="dark"] .form-success {
  background: rgba(50, 180, 80, 0.12);
  color: #5dce7a;
}

/* ----- Settings info list ----- */
.settings-section-info h3 {
  font-size: 0.95rem;
  color: var(--muted);
}

.settings-info-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.25rem;
  margin-top: 1rem;
  font-size: 0.85rem;
}

.settings-info-list dt {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.settings-info-list dd {
  color: var(--text);
}

.settings-info-list dd a {
  color: var(--text);
}

/* ----- Appearance options ----- */
.appearance-options {
  border: none;
  padding: 0;
  margin: 0;
}

.appearance-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.appearance-option input[type="radio"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----- Settings responsive ----- */
@media (max-width: 640px) {
  .settings-page {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .settings-nav {
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
  }

  .settings-tabs {
    flex-direction: row;
    gap: 0.25rem;
  }

  .settings-tab {
    font-size: 0.8rem;
    padding: 0.35rem 0.55rem;
  }

  .settings-content {
    max-width: none;
  }

  .profile-avatar-section {
    flex-direction: column;
    text-align: center;
  }
}
