@font-face {
  font-family: "Fredoka";
  font-style: normal;
  font-display: swap;
  font-weight: 300 700;
  src: url("/assets/fonts/fredoka-latin-wght-normal.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Pacifico";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/assets/fonts/pacifico-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url("/assets/fonts/poppins-latin-400-normal.woff2") format("woff2");
}

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

:root {
  color-scheme: light;
  --bg: #faf8fc;
  --surface: #fffdfd;
  --border: #ded5e7;
  --border-light: #f0ebf4;
  --text: #241d2b;
  --text-muted: #766e7e;
  --text-faint: #a49aaa;
  --accent: #ae98ca;
  --accent-hover: #8d72ad;
  --accent-light: #f2eef6;
  --link: #735c92;
  --link-hover: #5b4478;
  --danger: #c0392b;
  --danger-bg: #fdf2f1;
  --code-bg: #f4f0f6;
  --blockquote-bg: #f2edf5;
  --tab-active: #ae98ca;
  --nav-bg: #d4c9df;
  --nav-link: #756384;
  --topnav-text: #4f405d;
  --button-primary: #866aa7;
  --button-primary-hover: #74558f;
  --font: "Fredoka", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --radius: 10px;
  --radius-lg: 20px;
  --radius-pill: 50px;
  --max-w: 1150px;
  --shadow-pink: 0 4px 28px rgba(124, 96, 153, 0.12);
  --shadow-sm: 0 2px 10px rgba(92, 74, 115, 0.07);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #13091f;
  --surface: #1d102d;
  --border: #3b2852;
  --border-light: #2a1a3d;
  --text: #efe6ff;
  --text-muted: #a996c2;
  --text-faint: #6b5780;
  --accent: #b58cff;
  --accent-hover: #9f72e8;
  --accent-light: #241338;
  --link: #b48cff;
  --link-hover: #c9adff;
  --danger: #d85757;
  --danger-bg: #2a1724;
  --code-bg: #1a0f27;
  --blockquote-bg: #1f102d;
  --nav-bg: #25133a;
  --nav-link: #a58cff;
  --topnav-text: #efe6ff;
  --button-primary: #9f72e8;
  --button-primary-hover: #8456d6;
  --shadow-pink: 0 4px 28px rgba(181, 140, 255, 0.12);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #13091f;
    --surface: #1d102d;
    --border: #3b2852;
    --border-light: #2a1a3d;
    --text: #efe6ff;
    --text-muted: #a996c2;
    --text-faint: #6b5780;
    --accent: #b58cff;
    --accent-hover: #9f72e8;
    --accent-light: #241338;
    --link: #b48cff;
    --link-hover: #c9adff;
    --danger: #d85757;
    --danger-bg: #2a1724;
    --code-bg: #1a0f27;
    --blockquote-bg: #1f102d;
    --nav-bg: #25133a;
    --nav-link: #a58cff;
    --topnav-text: #efe6ff;
    --button-primary: #9f72e8;
    --button-primary-hover: #8456d6;
    --shadow-pink: 0 4px 28px rgba(181, 140, 255, 0.12);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  }
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1;
}

button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: rgba(142, 114, 173, 0.16); }
a { color: var(--link); }
[hidden] { display: none !important; }

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

#app, #topnav, #footnav, #toast { position: relative; z-index: 1; }

#metadata-page-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* Exact lavune.cc navigation */
#topnav {
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
}

#topnav-inner {
  max-width: var(--max-w);
  height: 42px;
  display: flex;
  align-items: center;
  margin: 0 auto;
}

#topnav .brand {
  display: inline-flex;
  align-items: center;
  margin-right: 20px;
  border: 0;
  background: none;
  color: var(--topnav-text, #fff);
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  text-decoration: none;
}

#topnav a,
#topnav button.nav-link {
  height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--topnav-text, #fff);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}

#topnav a:hover,
#topnav button.nav-link:hover { color: var(--topnav-text, #fff); }

#topnav a:focus-visible,
#topnav button:focus-visible {
  outline: 2px solid var(--topnav-text, #fff);
  outline-offset: -3px;
}

.nav-sep {
  margin: 0 2px;
  color: var(--topnav-text, #fff);
  font-size: 12px;
  opacity: 0.5;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-btn-register,
.nav-btn-login {
  height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--topnav-text, #fff);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.15s, background 0.15s;
}

.nav-btn-register:hover,
.nav-btn-login:hover { background: rgba(255, 255, 255, 0.15); color: var(--topnav-text, #fff); }

.nav-btn-login [data-auth-username] {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Accounts */
.auth-dialog {
  width: min(520px, calc(100vw - 24px));
  max-width: none;
  max-height: min(760px, calc(100dvh - 24px));
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 22px;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.auth-dialog::backdrop {
  background: rgba(34, 21, 48, 0.58);
  backdrop-filter: blur(3px);
}

.auth-card {
  position: relative;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 18px 60px rgba(33, 20, 48, 0.28);
}

.auth-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}

.auth-close:hover { background: var(--accent-light); color: var(--accent-hover); }
.auth-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.auth-header { padding-right: 28px; }
.auth-header h1 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 25px;
  line-height: 1.2;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.auth-header .auth-kicker {
  margin-bottom: 5px;
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 22px 0 18px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.auth-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.auth-tabs button.active { background: var(--surface); color: var(--accent-hover); }
.auth-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.auth-form { display: grid; gap: 8px; }
.auth-form label {
  margin-top: 5px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  outline: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
}

.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(142, 114, 173, 0.14); }
.auth-form small { margin: -2px 0 2px; color: var(--text-faint); font-size: 11.5px; line-height: 1.4; }
.auth-error {
  margin-top: 5px;
  padding: 9px 11px;
  border-left: 3px solid var(--danger);
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.4;
}

.auth-submit { width: 100%; margin-top: 8px; }
.auth-account-view .auth-header { margin-bottom: 20px; }
.auth-paste-state {
  padding: 24px 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.auth-paste-list {
  max-height: 390px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  list-style: none;
}

.auth-paste-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.auth-paste-details { min-width: 0; display: grid; gap: 4px; }
.auth-paste-title {
  overflow: hidden;
  color: var(--link);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-paste-title:hover { color: var(--link-hover); text-decoration: underline; }
.auth-paste-meta { overflow: hidden; color: var(--text-faint); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.auth-paste-actions { display: flex; flex: 0 0 auto; gap: 5px; }
.auth-account-logout { width: 100%; margin-top: 18px; }

#theme-toggle {
  height: 42px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--nav-link);
  cursor: pointer;
  font-size: 16px;
}

#theme-toggle:hover { color: #fff; }

/* Main lavune.cc column */
#app {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 28px 16px 60px;
}

.edit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13.5px;
}

/* Editor */
.editor-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.editor-view-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}

.editor-view-tab {
  height: 40px;
  flex: 0 0 auto;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.editor-view-tab:hover {
  background: rgba(142, 114, 173, 0.06);
  color: var(--text);
}

.editor-view-tab.active {
  border-bottom-color: var(--accent);
  background: var(--surface);
  color: var(--accent);
}

.editor-view-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.character-count {
  display: none;
  margin-left: auto;
  color: var(--text-faint);
  font-size: 11px;
  white-space: nowrap;
}

.character-count.is-near-limit { display: inline; color: var(--danger); }
.pane { display: none; }
.pane.active { display: block; }
.editor-col { display: flex; flex: 1; flex-direction: column; }

.editor-ta {
  width: 100%;
  min-height: 360px;
  display: block;
  padding: 14px 16px;
  border: 0;
  outline: 0;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  tab-size: 4;
}

.editor-ta.split { min-height: 500px; resize: none; }
.editor-ta::placeholder { color: var(--text-faint); opacity: 0.9; }
.editor-ta:focus { box-shadow: inset 0 0 0 2px rgba(142, 114, 173, 0.16); }

.full-preview-outer { width: 100%; background: transparent; }
.full-preview-inner {
  min-height: 500px;
  overflow-x: auto;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

/* Collapsible metadata editor */
.metadata-section { border-top: 1px solid var(--border-light); }

.metadata-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 0;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
}

.metadata-toggle:hover { color: var(--accent); }
.metadata-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.metadata-toggle > span:first-child { flex: 1; }
.metadata-toggle-arrow { color: var(--text-faint); transition: transform 0.15s ease; }
.metadata-toggle[aria-expanded="true"] .metadata-toggle-arrow { transform: rotate(90deg); }

.metadata-body { padding: 14px 16px 16px; background: var(--surface); }
.metadata-intro { margin-bottom: 10px; color: var(--text-muted); font-size: 12.5px; line-height: 1.5; }
.metadata-intro code { font-family: var(--mono); font-size: 12px; }
.metadata-groups { display: flex; gap: 6px; flex-wrap: wrap; }

.metadata-pill {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.025em;
}

.metadata-pill:hover { border-color: var(--accent); color: var(--accent); }
.metadata-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.metadata-input {
  width: 100%;
  min-height: 165px;
  margin-top: 10px;
  padding: 12px 13px;
  resize: vertical;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  outline: none;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
}

.metadata-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(142, 114, 173, 0.14); }
.metadata-input::placeholder { color: var(--text-faint); }
.metadata-help {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 11.5px;
  line-height: 1.4;
}

#metadata-character-count { white-space: nowrap; }

.preview-body.md-body {
  min-height: 0;
  max-height: none;
  overflow: visible;
  padding: 0;
  background: transparent;
}

/* The original lavune.cc settings row */
.settings-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 24px;
  border-top: 1px solid transparent;
  background: transparent;
}

.actions-left { display: flex; align-items: center; gap: 12px; }
.settings-right { display: flex; gap: 6px; position: relative; }
.setting { padding: 0; border: 0; background: none; box-shadow: none; }
.setting label, .field-prefix, .setting small { display: none; }
.field-inline { display: block; }

.field-input {
  width: 210px;
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-bottom: 2.5px solid var(--accent);
  border-radius: 12px 12px 6px 6px;
  outline: 0;
  background: var(--surface);
  color: var(--text-muted);
  font: 600 15px "Nunito", "Segoe UI", sans-serif;
}

.field-input::placeholder { color: var(--text-faint); }
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(142, 114, 173, 0.14); }

/* Buttons */
.btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 20px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-primary {
  border-color: transparent;
  background: var(--button-primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover { background: var(--button-primary-hover); }
.btn-secondary { border-color: var(--border); background: var(--surface); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); background: var(--bg); color: var(--accent); }
.btn-danger { border-color: transparent; background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.88; }
.btn:disabled { cursor: not-allowed; opacity: 0.5; }
.btn-sm { min-height: 30px; padding: 5px 14px; font-size: 12.5px; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Messages */
.alert {
  display: none;
  margin: 10px 16px;
  padding: 10px 14px;
  border-left: 3px solid;
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.4;
}

.alert:not([hidden]) { display: block; }
.alert-error { border-color: var(--danger); background: var(--danger-bg); color: var(--danger); }

/* Paste view */
#entry-inner {
  position: relative;
  min-height: 80px;
  padding: 28px 32px;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

#edit-code-banner {
  margin: 0 0 10px;
  text-align: left;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

#edit-code-copy {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: copy;
}

#edit-code-copy code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--accent-light);
  color: var(--accent-hover);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

#edit-code-copy:hover code,
#edit-code-copy:focus-visible code { color: var(--accent); }
#edit-code-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#edit-code-copy-status { margin-left: 5px; color: var(--text-faint); font-size: 11px; }

#safety-page-flag {
  width: fit-content;
  margin: 0 0 10px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--accent-light);
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

#safety-warning {
  max-width: 620px;
  margin: 28px auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

#safety-warning h1 { margin-bottom: 10px; font-size: 22px; line-height: 1.25; }
#safety-warning p { margin-bottom: 18px; color: var(--text-muted); line-height: 1.55; }

#paste-content.metadata-active a,
#preview-output.metadata-active a { color: var(--metadata-link-color, var(--link)); }

#paste-content.metadata-active li::marker,
#preview-output.metadata-active li::marker { color: var(--metadata-bullet-color, currentColor); }

.metadata-blur-media img:not(.metadata-media-revealed) {
  filter: blur(18px);
  cursor: pointer;
  user-select: none;
}

.metadata-blur-media img { transition: filter 0.18s ease; }

.view-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.view-actions { display: flex; gap: 6px; flex-wrap: wrap; }
#view-owner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #6c757d;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.25;
}

/* Rendered Markdown copied from the former lavune.cc frontend */
.md-body {
  min-width: 0;
  overflow-wrap: break-word;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  word-break: normal;
}

.md-body h1,
.md-body h2,
.md-body h3,
.md-body h4,
.md-body h5,
.md-body h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: inherit;
  font-weight: 500;
  line-height: 1.2;
}

.md-body h1 { font-size: 2.5rem; }
.md-body h2 { font-size: 2rem; }
.md-body h3 { font-size: 1.75rem; }
.md-body h4 { font-size: 1.5rem; }
.md-body h5 { font-size: 1.25rem; }
.md-body h6 { font-size: 1rem; }
.md-body p { margin: 0 0 1rem; }
.md-body p:last-child { margin-bottom: 0; }
.md-body a { color: var(--link); text-decoration: none; }
.md-body a:hover { color: var(--link-hover); text-decoration: underline; }
.md-body strong { font-weight: 700; }
.md-body em { font-style: italic; }
.md-body del { text-decoration: line-through; opacity: 0.7; }
.md-body ul, .md-body ol { margin: 0 0 1rem; padding-left: 2rem; }
.md-body ul ul, .md-body ul ol, .md-body ol ul, .md-body ol ol { margin-bottom: 0; }
.md-body blockquote {
  margin: 0 0 1rem;
  padding: 0.5rem 1rem;
  border-left: 3px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--blockquote-bg);
  color: var(--text-muted);
}

.md-body blockquote p:last-child { margin-bottom: 0; }
.md-body hr { margin: 1rem 0; border: 0; border-top: 1px solid var(--border); }
.md-body img { max-width: 100%; height: auto; border-radius: 0; }
.md-body code {
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--accent-hover);
  font-family: var(--mono);
  font-size: 87.5%;
}

.md-body pre {
  display: block;
  overflow: auto;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--code-bg);
  -webkit-overflow-scrolling: touch;
}

.md-body pre code { padding: 0; border-radius: 0; background: transparent; color: inherit; font-size: inherit; }
.md-body table { width: 100%; display: block; max-width: 100%; overflow-x: auto; margin-bottom: 1rem; border-collapse: collapse; }
.md-body th, .md-body td { padding: 0.45rem 0.65rem; border: 1px solid var(--border-light); vertical-align: top; }
.md-body th { background: var(--bg); font-weight: 600; }
.md-body input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.md-body .md-mark {
  padding: 0 0.12em;
  background: #ffe78c;
  color: #2d2335;
}

.md-body .md-spoiler {
  padding: 0 0.18em;
  border-radius: 3px;
  outline: none;
  background: var(--text);
  color: transparent;
  cursor: pointer;
  text-shadow: none;
}

.md-body .md-spoiler:hover,
.md-body .md-spoiler:focus-visible,
.md-body .md-spoiler.md-spoiler-revealed {
  background: var(--code-bg);
  color: inherit;
}

.md-body .md-underline { text-decoration-line: underline; }
.md-body .md-decoration-solid { text-decoration-style: solid; }
.md-body .md-decoration-double { text-decoration-style: double; }
.md-body .md-decoration-dotted { text-decoration-style: dotted; }
.md-body .md-decoration-dashed { text-decoration-style: dashed; }
.md-body .md-decoration-wavy { text-decoration-style: wavy; }
.md-body .md-decoration-line-through { text-decoration-line: line-through; }
.md-body .md-decoration-overline { text-decoration-line: overline; }
.md-body .md-decoration-both { text-decoration-line: underline line-through; }
.md-body .md-align-center { text-align: center; }
.md-body .md-align-right { text-align: right; }

.md-body .md-toc {
  margin: 0 0 1rem;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--code-bg);
}

.md-body .md-toc ul { margin: 0; padding: 0; list-style: none; }
.md-body .md-toc li { margin: 3px 0; }
.md-body .md-toc-depth-2 { padding-left: 1rem; }
.md-body .md-toc-depth-3 { padding-left: 2rem; }
.md-body .md-toc-depth-4 { padding-left: 3rem; }
.md-body .md-toc-depth-5 { padding-left: 4rem; }
.md-body .md-toc-depth-6 { padding-left: 5rem; }

.md-body .md-admonition {
  margin: 0 0 1rem;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  background: var(--accent-light);
}

.md-body .md-admonition-title { margin-bottom: 5px; font-weight: 700; }
.md-body .md-admonition-body > :last-child { margin-bottom: 0; }
.md-body .md-admonition-info { border-left-color: #4d91d9; }
.md-body .md-admonition-note { border-left-color: var(--accent); }
.md-body .md-admonition-warning { border-left-color: #d59430; }
.md-body .md-admonition-danger { border-left-color: var(--danger); }
.md-body .md-admonition-greentext { border-left-color: #5c9d65; color: #4c8b55; }

.md-body img.md-image-left { float: left; margin: 0 1rem 0.75rem 0; }
.md-body img.md-image-right { float: right; margin: 0 0 0.75rem 1rem; }
.md-body .md-float-clear { clear: both; }
.md-body::after { display: table; clear: both; content: ""; }
.empty-state { color: var(--text-muted); font-size: 13px; }

/* What page — isolated from the supplied reference */
#what-page, #how-page { max-width: 880px; margin: 0 auto; }
.what-card-wrap {
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 38px 16px;
}

.what-card,
.what-card * {
  filter: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.what-card {
  position: relative;
  width: 350px;
  max-width: 760px;
  overflow: hidden;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: 32px;
  background: var(--surface);
}

.what-card > svg {
  position: absolute;
  bottom: 0;
  width: 350px;
}

.what-card figcaption {
  position: relative;
  height: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  overflow: visible;
  padding: 30px;
  border-radius: 8px;
  background: var(--surface);
  font-family: "Poppins", sans-serif;
}

.what-card figcaption span { width: 100%; }
.what-card figcaption > span:nth-child(1) {
  position: absolute;
  top: -25px;
  left: 10px;
  color: var(--text);
  font-family: "Pacifico", cursive;
  font-size: 30px;
  opacity: 1;
}

.what-card figcaption > span:nth-child(2) {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 10;
  width: max-content;
  max-width: calc(100% - 24px);
  display: inline-block;
  overflow: visible;
  margin-bottom: 18px;
  color: var(--accent-hover);
  font-family: "Pacifico", "Fredoka", cursive;
  font-size: clamp(2rem, 6vw, 4.5rem);
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%) rotate(-2deg);
}

.what-card figcaption > span:nth-child(3) {
  height: auto;
  display: block;
  overflow-y: visible;
  padding: 100px 20px 20px;
  color: var(--text);
  cursor: text;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  line-height: 1.6;
  opacity: 1;
}

.how-hero {
  max-width: 430px;
  margin: 30px auto 22px;
  padding: 12px 16px 8px;
  text-align: center;
}

.how-title {
  margin: 0;
  color: var(--accent-hover);
  font-family: "Pacifico", "Fredoka", cursive;
  font-size: clamp(2.75rem, 7vw, 3.6rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
  transform: rotate(-1.5deg);
}

.how-sub {
  position: relative;
  width: fit-content;
  margin: 15px auto 4px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.055em;
  line-height: 1.2;
}

/* How page */
.how-body { display: flex; flex-direction: column; gap: 14px; padding-bottom: 8px; }
.how-section {
  overflow-x: auto;
  padding: 26px 28px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.how-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px dashed var(--border);
}

.how-section h2 { color: var(--text); font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.how-section p { color: var(--text-muted); font-size: 13.5px; line-height: 1.6; }
.metadata-reference-intro { margin-bottom: 16px; }
.metadata-reference-intro code {
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--accent-hover);
  font-family: var(--mono);
  font-size: 12px;
}

.metadata-reference-group {
  overflow: hidden;
  margin-top: 9px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
}

.metadata-reference-group h3 {
  margin: 0;
  padding: 10px 13px;
  border-bottom: 1px solid var(--border);
  background: var(--accent-light);
  color: var(--accent-hover);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.045em;
}

.metadata-reference-group .ref-table {
  border: 0;
  border-radius: 0;
}

.metadata-ref-table { min-width: 760px; }
.metadata-ref-table td:nth-child(2) {
  border-right: 1px solid var(--border-light);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 12px;
}

.metadata-ref-table th:first-child { width: 31%; }
.metadata-ref-table th:nth-child(2) { width: 27%; }
.ref-table {
  width: 100%;
  min-width: 520px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
}

.ref-table th {
  padding: 9px 14px;
  border-bottom: 1.5px solid var(--border);
  background: var(--accent-light);
  color: var(--link-hover);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

.ref-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  vertical-align: top;
}

.ref-table tr:last-child td { border-bottom: 0; }
.ref-table td:first-child {
  border-right: 1px solid var(--border-light);
  background: var(--code-bg);
  color: var(--link);
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
}

[data-theme="dark"] .how-contacts { border-color: var(--border); background: var(--surface); }
.how-contacts { border-color: var(--border); background: var(--accent-light); }
[data-theme="dark"] .ref-table th { background: #281b36; color: var(--accent); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .how-contacts { border-color: var(--border); background: var(--surface); }
  :root:not([data-theme="light"]) .ref-table th { background: #281b36; color: var(--accent); }
}

/* Original lavune.cc footer navigation */
#footnav {
  padding: 20px 16px 10px;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

#footnav a,
#footnav button.fnav-link {
  padding: 2px 6px;
  border: 0;
  background: none;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  text-decoration: none;
}

#footnav .sep { color: var(--text); }

/* Original lavune.cc toast treatment */
#toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 700;
  padding: 10px 20px;
  border: 1px solid rgba(181, 140, 255, 0.25);
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #211330, #342044);
  box-shadow: 0 4px 20px rgba(159, 114, 232, 0.25);
  color: #eadbff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.22s, transform 0.22s;
}

#toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 700px) {
  .settings-row { flex-direction: column; gap: 16px; }
  .settings-right { width: 100%; flex-direction: column; }
  .field-input { width: 100%; border-bottom: 1.5px solid var(--border); border-radius: 12px; }
}

@media (max-width: 600px) {
  #topnav button.nav-link,
  #topnav a.nav-link,
  .nav-sep { display: none !important; }
  #topnav .brand { margin-right: auto; }
  #topnav-inner { min-height: 50px; height: auto; }
  .nav-actions { gap: 4px; }
  .nav-btn-register, .nav-btn-login { min-height: 38px; padding: 6px 8px; font-size: 12.5px; }
  .nav-btn-login [data-auth-username] { max-width: 82px; }
  .auth-card { padding: 26px 18px 20px; }
  .auth-paste-item { align-items: stretch; flex-direction: column; }
  .auth-paste-actions .btn { flex: 1; }
  #app { padding: 18px 10px calc(82px + env(safe-area-inset-bottom)); }
  .editor-card { border-radius: 16px; }
  .editor-ta, .editor-ta.split { min-height: 50dvh; resize: vertical; }
  .full-preview-inner { min-height: 50dvh; padding: 18px 16px; border-radius: 14px; }
  .metadata-help { align-items: flex-start; flex-direction: column; gap: 4px; }
  .settings-row { padding: 16px; }
  .actions-left { width: 100%; }
  .actions-left .btn { flex: 1; }
  #entry-inner { overflow-x: hidden; padding: 18px 16px; }
  .view-footer { flex-direction: column; align-items: stretch; }
  .view-actions { width: 100%; }
  .view-actions .btn { flex: 1 1 30%; min-width: 92px; }
  .md-body { font-size: 15.5px; }
  .md-body h1 { font-size: 2rem; }
  .md-body h2 { font-size: 1.65rem; }
  .md-body h3 { font-size: 1.4rem; }
  .md-body ul, .md-body ol { padding-left: 1.35rem; }
  .how-section { padding: 18px 16px; border-radius: 14px; }
  .how-hero { margin: 16px auto 18px; padding: 8px 12px 6px; }
  .how-title { font-size: 2.7rem; }
  #toast { right: 12px; bottom: 64px; left: 12px; text-align: center; }
  #footnav { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
}

@media (max-width: 760px) {
  .what-card figcaption { padding: 22px; }
}

@media (max-width: 736px) {
  .what-card { width: 320px; }
}

@media (max-width: 380px) {
  .what-card { width: calc(100vw - 32px); max-width: 320px; }
  .what-card > svg { width: 100%; }
}

@media (max-width: 420px) {
  .view-actions .btn { flex: 1 1 100%; }
}
