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

:root {
  --bg: #fff5fa;
  --surface: #fffafd;
  --border: #f0c6d8;
  --border-light: #f8dcea;
  --text: #1a1018;
  --text-muted: #70606a;
  --text-faint: #a890a0;
  --accent: #f07fa8;
  --accent-hover: #e05a90;
  --accent-light: #fff0f6;
  --link: #c85fa0;
  --link-hover: #0d3f72;
  --danger: #c0392b;
  --danger-bg: #fdf2f1;
  --warning: #a07000;
  --warning-bg: #fdf6e3;
  --code-bg: #fef0f5;
  --blockquote-bg: #f8eef3;
  --tab-active: #f07fa8;
  --nav-bg: #f5c0d8;
  --nav-link: #89c9a0;
  --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(240, 127, 168, 0.2);
  --shadow-sm: 0 2px 10px rgba(200, 80, 140, 0.08);
  --gradient-accent: linear-gradient(135deg, #f48fb1 0%, #e05a90 100%);
}
[data-theme="dark"] {
  --bg: #160a10;
  --surface: #210e18;
  --border: #3d1e2c;
  --border-light: #2c1220;
  --text: #f0e0ea;
  --text-muted: #9a7888;
  --text-faint: #624050;
  --accent: #f07fa8;
  --accent-hover: #e05a90;
  --accent-light: #280d1c;
  --link: #d070b8;
  --link-hover: #e090d0;
  --danger: #e05545;
  --danger-bg: #2a1018;
  --warning: #d4a82a;
  --warning-bg: #221800;
  --code-bg: #1c0a14;
  --blockquote-bg: #200c18;
  --nav-bg: #2a1020;
  --nav-link: #4aaf65;
  --shadow-pink: 0 4px 28px rgba(240, 127, 168, 0.12);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #160a10;
    --surface: #210e18;
    --border: #3d1e2c;
    --border-light: #2c1220;
    --text: #f0e0ea;
    --text-muted: #9a7888;
    --text-faint: #624050;
    --accent: #f07fa8;
    --accent-hover: #e05a90;
    --accent-light: #280d1c;
    --link: #d070b8;
    --link-hover: #e090d0;
    --danger: #e05545;
    --danger-bg: #2a1018;
    --warning: #d4a82a;
    --warning-bg: #221800;
    --code-bg: #1c0a14;
    --blockquote-bg: #200c18;
    --nav-bg: #2a1020;
    --nav-link: #4aaf65;
    --shadow-pink: 0 4px 28px rgba(240, 127, 168, 0.12);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  }
}

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

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

/* Fixed full-viewport layer for CONTAINER_OUTER_BACKGROUND_* metadata on the view page.
   #entry-outer itself stays in normal flow (inside #app's max-width column) so long
   pastes keep scrolling normally; this separate layer is what actually paints the
   background across the whole screen, independent of #app's max-width. */
#entry-outer-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* MODALS */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; z-index: 10000; align-items: center; justify-content: center; }
.modal-overlay.show { display: flex; }

/* NAV */
#topnav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 200;
}
#topnav-inner { max-width: var(--max-w); margin: 0 auto; display: flex; align-items: center; height: 42px; }
#topnav .brand {
  color: var(--topnav-text, #fff);
  font-weight: 900;
  font-size: 15px;
  margin-right: 20px;
  background: none;
  border: none;
  cursor: pointer;
}
#topnav a, #topnav button.nav-link { color: var(--topnav-text, #fff); font-size: 13px; font-weight: 600; text-decoration: none; padding: 0 10px; height: 42px; display: inline-flex; align-items: center; background: none; border: none; cursor: pointer; transition: color .15s; font-family: inherit; }
#topnav a:hover, #topnav button.nav-link:hover { color: var(--topnav-text, #fff); }
.nav-sep { color: var(--topnav-text, #fff); opacity: 0.5; margin: 0 2px; font-size: 12px; }
.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-username { color: var(--topnav-text, #fff); font-size: 13px; font-weight: 600; padding: 6px 12px; }
.nav-btn-register, .nav-btn-login, .nav-btn-logout, .nav-admin-btn { color: var(--topnav-text, #fff); font-size: 13px; font-weight: 600; background: none; border: none; cursor: pointer; padding: 6px 14px; height: 42px; display: inline-flex; align-items: center; transition: color .15s, background .15s; border-radius: 8px; font-family: inherit; }
.nav-btn-register:hover { background: rgba(255,255,255,0.15); color: var(--topnav-text, #fff); }
.nav-btn-login:hover { background: rgba(255,255,255,0.15); color: var(--topnav-text, #fff); }
.nav-btn-logout:hover { background: rgba(255,255,255,0.15); color: var(--topnav-text, #fff); }
.nav-admin-btn { background: rgba(255,255,255,0.22); border: 1px solid rgba(255,255,255,0.38); border-radius: 999px; height: auto; padding: 3px 9px; font-size: 11px; line-height: 1; text-transform: lowercase; }
.nav-admin-btn:hover { background: rgba(255,255,255,0.34); color: var(--topnav-text, #fff); }
#theme-toggle { color: var(--nav-link); font-size: 16px; background: none; border: none; cursor: pointer; padding: 0 8px; height: 42px; display: flex; align-items: center; }
#theme-toggle:hover { color: #fff; }


/* dark mode brand is handled by --accent color naturally */

/* LAYOUT */
#app { max-width: var(--max-w); margin: 0 auto; padding: 28px 16px 60px; }
.page-header { margin-bottom: 22px; }
.page-header h1 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-header p { color: var(--text-muted); font-size: 13.5px; }

/* EDITOR CARD */
.editor-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--bg); padding: 0 12px; }
.tab-btn { font-size: 13px; font-weight: 500; padding: 9px 14px; background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; color: var(--text-muted); margin-bottom: -1px; transition: color .12s, border-color .12s; font-family: inherit; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--tab-active); border-bottom-color: var(--tab-active); font-weight: 600; }
.pane { display: none; }
.pane.active { display: block; }
.pane.active.split-layout { display: flex; }
.editor-ta { width: 100%; min-height: 360px; padding: 16px; font-family: var(--mono); font-size: 13.5px; line-height: 1.65; border: none; outline: none; resize: vertical; background: var(--surface); color: var(--text); display: block; }
.editor-col { flex: 1; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.editor-ta.split { width: 100%; resize: none; min-height: 500px; }
.preview-col { flex: 1; display: flex; flex-direction: column; overflow: hidden; align-self: flex-start; }
.live-preview { padding: 16px; background: var(--surface); border: none; }
.preview-body { min-height: 200px; padding: 16px; overflow-y: auto; max-height: 600px; }
.meta-inner { padding: 16px; }
.meta-ta { width: 100%; min-height: 260px; padding: 12px; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; border: 1px solid var(--border); border-radius: var(--radius); outline: none; resize: vertical; background: var(--code-bg); color: var(--text); }
.meta-help { margin-top: 10px; font-size: 12px; color: var(--text-muted); line-height: 1; }
.meta-groups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.meta-pill { font-size: 11.5px; padding: 4px 12px; border-radius: 50px; border: 1.5px solid var(--border); color: var(--text-muted); background: var(--bg); cursor: pointer; font-family: var(--mono); font-weight: 600; transition: border-color .12s, color .12s, background .12s; }
.meta-pill:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* FIELDS */
.field-row { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border-light); align-items: center; flex-wrap: wrap; }
.field-row label { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; min-width: 80px; font-weight: 600; }
.field-prefix { font-size: 13px; color: var(--text-faint); }
.field-input { flex: 1; min-width: 120px; padding: 7px 12px; border: 1.5px solid var(--border); border-radius: 12px; font-size: 13.5px; font-family: var(--mono); background: var(--surface); color: var(--text); outline: none; transition: border-color .15s, box-shadow .15s; }
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(240, 127, 168, 0.15); }
.field-input.error { border-color: var(--danger); }
.field-hint { font-size: 12px; color: var(--text-faint); width: 100%; padding-left: 90px; }

/* BUTTONS */
.btn-row { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-light); flex-wrap: wrap; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 8px 20px; border-radius: var(--radius-pill); font-size: 13.5px; font-weight: 700; cursor: pointer; border: 1.5px solid transparent; transition: background .15s, color .15s; text-decoration: none; font-family: inherit; }
.btn-primary { background: #e05a90; color: #fff; border-color: transparent; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.btn-primary:hover { background: #c83878; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; border-color: transparent; }
.btn-danger:hover { opacity: .88; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 5px 14px; font-size: 12.5px; }

/* ALERTS */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13.5px; margin: 10px 16px; border-left: 3px solid; display: none; }
.alert.show { display: block; }
.alert-success { background: var(--accent-light); border-color: var(--accent); color: var(--accent-hover); }
.alert-error { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }

/* VIEW PAGE */
.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; }

/* ENTRY BOX — styled by metadata at runtime */
#entry-outer { }
#entry-inner { background: var(--surface); border-radius: var(--radius-lg); padding: 28px 32px; min-height: 80px; position: relative; }
#view-owner { font-size: 13px; color: #6C757D; font-family: inherit; display: flex; flex-direction: column; gap: 4px; }
#view-owner #view-date, #view-owner #view-views { color: #6C757D; font-size: 12px; }
.owner-link {
  background: none; border: none; padding: 0; cursor: pointer;
  color: #6C757D; font: inherit; font-size: 13px;
  text-decoration: underline; text-underline-offset: 2px;
  transition: color .15s;
}
.owner-link:hover { color: var(--accent); }

/* ── PROFILE EDIT SECTION (account page) ── */
.profile-edit-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
}
.profile-edit-section h2 { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: var(--text); }
.profile-edit-banner-preview {
  width: 100%;
  height: 90px;
  border-radius: var(--radius);
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  border: 1px solid var(--border);
  overflow: hidden;
}
.profile-edit-banner-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-edit-card { display: flex; gap: 28px; align-items: flex-start; }
.profile-edit-avatar-col { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; }
.profile-edit-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  background: var(--accent-light); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; overflow: hidden; flex-shrink: 0;
}
.profile-edit-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.profile-edit-avatar-hint { font-size: 11px; color: var(--text-faint); text-align: center; max-width: 88px; line-height: 1.4; }
.profile-edit-fields { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.profile-edit-actions { display: flex; gap: 10px; align-self: flex-start; flex-wrap: wrap; }
.profile-field { display: flex; flex-direction: column; gap: 5px; }
.profile-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.profile-label-hint { font-weight: 400; color: var(--text-faint); }
.profile-edit-bio-ta {
  font-family: var(--font); font-size: 14px; color: var(--text);
  background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; resize: vertical; min-height: 72px; width: 100%;
  transition: border-color .15s;
}
.profile-edit-bio-ta:focus { outline: none; border-color: var(--accent); }
.profile-edit-bio-hint { font-size: 11.5px; color: var(--text-faint); line-height: 1.5; margin: 2px 0 0; }
.profile-edit-bio-hint code { font-size: 11px; background: rgba(244, 143, 177, 0.18); padding: 1px 5px; border-radius: 4px; font-family: var(--mono); color: var(--link); border: none; }
.profile-edit-bio-preview { margin-top: 2px; padding: 10px 12px; background: var(--bg); border: 1px dashed var(--border-light); border-radius: var(--radius); }

/* ── PROFILE COLOR CUSTOMIZATION ── */
.profile-colors-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color .15s, background .15s;
}
.profile-colors-toggle:hover { border-color: var(--accent); background: var(--accent-light); }
.profile-colors-toggle-text { display: flex; flex-direction: column; gap: 3px; }
.profile-colors-toggle-arrow { font-size: 11px; color: var(--text-faint); flex-shrink: 0; }
.profile-colors-body { margin-top: 10px; display: flex; flex-direction: column; }
.profile-colors-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 4px;
}
.profile-color-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.profile-color-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.profile-color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
}
.profile-color-picker {
  width: 30px;
  height: 30px;
  border: 2px solid var(--border);
  border-radius: 50%;
  padding: 2px;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.profile-color-picker:hover { border-color: var(--accent); transform: scale(1.1); }
.profile-color-picker::-webkit-color-swatch-wrapper { padding: 0; border-radius: 50%; }
.profile-color-picker::-webkit-color-swatch { border: none; border-radius: 50%; }
.profile-color-text {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  padding: 5px 10px;
  height: 30px;
  font-family: var(--mono);
}

/* Mini profile preview card */
.profile-colors-preview {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.profile-colors-preview:hover { box-shadow: 0 4px 16px rgba(240, 127, 168, 0.15); }
.pcp-nav {
  padding: 7px 12px;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.01em;
  background: var(--nav-bg);
  color: #fff;
  transition: background .3s;
}
.pcp-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  transition: background .3s;
}
/* header box inside preview */
.pcp-header-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  transition: background .3s, border-color .3s;
}
/* paste card inside preview */
.pcp-card-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background .3s, border-color .3s;
}
.pcp-card-title { font-size: 11.5px; font-weight: 700; color: var(--text); }
.pcp-card-url   { font-size: 10px; color: var(--link); font-family: var(--mono); }
.pcp-pfp {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(240,127,168,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  border: 1.5px solid rgba(240,127,168,0.3);
  transition: background .3s, border-color .3s;
}
.pcp-meta { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.pcp-name {
  font-weight: 700;
  font-size: 12px;
  transition: color .3s;
}
.pcp-tag { font-size: 10px; color: var(--text-muted); }
.pcp-btn {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 50px;
  border: none;
  cursor: default;
  font-weight: 700;
  font-family: inherit;
  background: var(--accent);
  color: var(--accent-text, #fff);
  transition: background .3s;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .profile-colors-row { grid-template-columns: 1fr; }
}

/* ── PUBLIC PROFILE PAGE ── */
#profile-page { max-width: 900px; margin: 0 auto; }
.profile-header {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  overflow: hidden;
}
.profile-banner {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  transition: background .3s, border-color .3s;
}
.profile-banner-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-header-body { position: relative; padding: 60px 32px 28px; }
.profile-avatar-wrap { position: absolute; top: -52px; left: 32px; }
.profile-pfp {
  width: 104px; height: 104px; border-radius: 50%;
  object-fit: cover; border: 4px solid var(--surface); box-sizing: border-box;
  display: block; transition: border-color .3s;
}
.profile-pfp-placeholder {
  width: 104px; height: 104px; border-radius: 50%;
  background: var(--accent-light); border: 4px solid var(--surface); box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; transition: border-color .3s;
}
.profile-header-actions { position: absolute; top: 16px; right: 32px; display: flex; gap: 8px; }
.profile-meta { display: flex; flex-direction: column; gap: 6px; }
.profile-display-name { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.profile-username-row { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.profile-username-tag { font-size: 13.5px; color: var(--text-muted); font-weight: 500; display: inline-flex; align-items: center; }

.profile-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-light);
  color: var(--accent-hover);
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1;
  text-transform: lowercase;
  vertical-align: middle;
  box-shadow: var(--shadow-sm);
  transform: translateY(0.5px);
}
.profile-role-badge::before {
  margin-right: 3px;
  font-size: 8.5px;
}
.profile-admin-badge::before { content: "✦"; }
.profile-owner-badge {
  border-color: #f0a020;
  background: #fff7df;
  color: #a66000;
}
.profile-owner-badge::before { content: "♛"; }
[data-theme="dark"] .profile-owner-badge {
  border-color: #bb842d;
  background: #2a1b05;
  color: #f0bf68;
}

.profile-bio { font-size: 14px; color: var(--text); line-height: 1; margin: 4px 0 0; max-width: 520px; }
.profile-bio img { max-width: 100%; border-radius: var(--radius); }
.profile-back-btn { margin-top: 12px; align-self: flex-start; }

/* ── PROFILE FRIENDS PANEL ── */
.profile-friends-panel {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-friends-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.profile-friends-head h3 { font-size: 14px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 5px; }
.profile-friends-count { color: var(--text-muted); font-weight: 500; }
.profile-friends-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: none; overflow-y: visible; }
.profile-friends-empty { font-size: 13px; color: var(--text-muted); margin: 0; }
.friend-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border-light); border-radius: var(--radius-pill);
  padding: 5px 12px 5px 5px; cursor: pointer; font-family: inherit; text-align: left;
  transition: background .15s, border-color .15s;
}
.friend-chip:hover { background: var(--accent-light); border-color: var(--accent); }
.friend-chip-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.friend-chip-avatar-placeholder { display: flex; align-items: center; justify-content: center; background: var(--accent-light); font-size: 14px; }
.friend-chip-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }

/* MARKDOWN */
.md-body { color: var(--text); font-size: 15px; line-height: 1; }
.md-body h1 { font-size: 1.9em; font-weight: 700; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.md-body h2 { font-size: 1.5em; font-weight: 700; margin: 24px 0 10px; padding-bottom: 5px; border-bottom: 1px solid var(--border-light); }
.md-body h3 { font-size: 1.22em; font-weight: 600; margin: 20px 0 8px; }
.md-body h4 { font-size: 1.05em; font-weight: 600; margin: 16px 0 6px; }
.md-body h5, .md-body h6 { font-size: .95em; font-weight: 600; margin: 14px 0 5px; }
.md-body p { margin: 0 0 6px; }
.md-body p:last-child { margin-bottom: 0; }
.md-body p[style*="text-align:center"] + p[style*="text-align:center"],
.md-body p[style*="text-align:right"]  + p[style*="text-align:right"],
.md-body p[style*="text-align:left"]   + p[style*="text-align:left"]   { margin-top: -4px; }
.md-body a { color: var(--link); text-decoration: none; }
.md-body a:hover { color: var(--link-hover); }
.md-body strong { font-weight: 700; }
.md-body em { font-style: italic; }
.md-body del { text-decoration: line-through; opacity: .7; }
.md-body mark { background: #fff176; color: #333; padding: 1px 3px; border-radius: 2px; }
.md-body blockquote { border-left: 3px solid var(--border); margin: 0 0 14px; padding: 6px 16px; background: var(--blockquote-bg); color: var(--text-muted); border-radius: 0 var(--radius) var(--radius) 0; }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.md-body img { max-width: 100%; border-radius: var(--radius); }
.md-body img.float-left { float: left; margin: 4px 16px 8px 0; }
.md-body img.float-right { float: right; margin: 4px 0 8px 16px; }
.md-body .clear { clear: both; }

/* Spoiler */
.spoiler { background: var(--text); color: var(--text); border-radius: 3px; padding: 1px 4px; cursor: pointer; transition: background .2s, color .2s; user-select: none; }
.spoiler.revealed { background: var(--code-bg); color: var(--text); }

/* ── E2R BUTTON ── */
.e2r-btn {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  color: var(--text-muted); background: var(--bg); border: 1px solid var(--border-light);
  border-radius: var(--radius); padding: 3px 9px; cursor: pointer; margin-left: 4px;
  font-family: inherit; transition: border-color .15s, color .15s;
}
.e2r-btn:hover { color: var(--accent); border-color: var(--accent); }

/* HOW PAGE */
.editor-card.padded { padding: 24px 28px; }
.how-section { margin-bottom: 36px; }
.how-section:last-child { margin-bottom: 0; }
.how-section h2 { font-size: 17px; font-weight: 700; margin-bottom: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.ref-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ref-table th { background: var(--bg); padding: 8px 12px; text-align: left; border: 1px solid var(--border); font-weight: 600; font-size: 12.5px; color: var(--text-muted); }
.ref-table td { padding: 8px 12px; border: 1px solid var(--border-light); vertical-align: top; }
.ref-table td:first-child { font-family: var(--mono); font-size: 12px; background: var(--code-bg); white-space: pre-wrap; }
.meta-ref-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.meta-ref-table th { background: var(--bg); padding: 7px 12px; text-align: left; border: 1px solid var(--border); font-weight: 600; font-size: 12.5px; color: var(--text-muted); }
.meta-ref-table td { padding: 7px 12px; border: 1px solid var(--border-light); vertical-align: top; font-size: 12.5px; }
.meta-ref-table td:first-child { font-family: var(--mono); font-size: 12px; background: var(--code-bg); white-space: nowrap; }
.meta-ref-table td:nth-child(2) { color: var(--text-muted); font-size: 12px; }
.badge { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 12px; letter-spacing: .02em; }
.badge-group { background: var(--accent-light); color: var(--accent-hover); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(210px,1fr)); gap: 14px; margin-top: 16px; }
.feature-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 17px; }
.feature-card-stack { display: flex; flex-direction: column; gap: 14px; }
.feature-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.feature-card p { font-size: 13px; color: var(--text-muted); line-height: 1; }

/* ── LOGIN GATE OVERLAY ── */
#login-gate-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
#login-gate-overlay.hidden {
  display: none;
}
.login-gate-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 420px;
  width: calc(100% - 32px);
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
[data-theme="dark"] .login-gate-box {
  background: var(--surface);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .login-gate-box {
    background: var(--surface);
  }
}
.login-gate-box h2 {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.login-gate-box p {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1;
}
.login-gate-buttons {
  display: flex;
  gap: 10px;
  flex-direction: column;
}
.login-gate-buttons .btn {
  width: 100%;
  justify-content: center;
}

/* ── ACCOUNT DASHBOARD ── */
#account-page {
  max-width: 900px;
  margin: 0 auto;
}
.account-header {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
.account-header h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.account-info {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.8;
  margin: 16px 0 0 0;
}
.account-info strong {
  color: var(--text);
  font-weight: 600;
}
.pastes-section h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.pastes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.paste-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.paste-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(240, 127, 168, 0.15);
}
.paste-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.paste-card-url {
  font-size: 12px;
  color: var(--link);
  font-family: var(--mono);
  word-break: break-all;
}
.paste-card-date {
  font-size: 12px;
  color: var(--text-faint);
}
.paste-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  align-items: flex-start;
}
.paste-card-actions .btn {
  flex: 1;
  font-size: 12px;
  padding: 6px 10px;
}
.paste-card-action-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.paste-card-action-stack .btn { width: 100%; }
.forgot-edit-code-link {
  border: 0;
  background: transparent;
  color: var(--link);
  font: inherit;
  font-size: 10.8px;
  line-height: 1.1;
  text-align: center;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.forgot-edit-code-link:hover { color: var(--accent-hover); }
.forgot-edit-code-link:disabled {
  color: var(--text-faint);
  cursor: default;
  text-decoration: none;
}
.empty-pastes {
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
}
.empty-pastes p {
  margin: 0 0 16px;
  font-size: 14px;
}
.modal { background: var(--surface); border: 1.5px solid var(--border); border-radius: 22px; padding: 28px 30px; max-width: 420px; width: calc(100% - 32px); box-shadow: var(--shadow-pink), 0 2px 12px rgba(0,0,0,0.1); }
.modal h2 { font-size: 17px; font-weight: 800; margin-bottom: 10px; letter-spacing: -0.01em; }
.modal p { font-size: 13.5px; color: var(--text-muted); margin-bottom: 14px; line-height: 1; }
.modal .field-input { width: 100%; margin-bottom: 12px; display: block; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-err { font-size: 12.5px; color: var(--danger); margin-bottom: 8px; display: none; font-weight: 600; }
.modal-err.show { display: block; }
.modal-footer { font-size: 13px; color: var(--text-muted); margin-top: 16px; text-align: center; padding-top: 12px; border-top: 1px solid var(--border-light); }
.modal-link { background: none; border: none; color: var(--link); cursor: pointer; font-weight: 600; text-decoration: none; font-size: inherit; font-family: inherit; padding: 0; display: inline; }
.modal-link:hover { color: var(--accent); text-decoration: underline; }

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

/* FOOTNAV */
#footnav { text-align: center; padding: 20px 16px 10px; font-size: 13px; color: var(--text-faint); }
#footnav a, #footnav button.fnav-link { color: var(--text); text-decoration: none; padding: 2px 6px; background: none; border: none; cursor: pointer; font-size: 13px; font-family: inherit; }
#footnav a:hover, #footnav button.fnav-link:hover { color: var(--text); }
#footnav .sep { color: var(--text); }

/* TOAST */
#toast {
  position: fixed; bottom: 24px; right: 24px;
  background: linear-gradient(135deg, #2a0e1a, #3d1428);
  color: #ffd8ea;
  border: 1px solid rgba(240, 127, 168, 0.25);
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .22s, transform .22s;
  z-index: 700;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(240, 90, 144, 0.25);
  letter-spacing: 0.01em;
}
#toast.show { opacity: 1; transform: translateY(0); }

/* EDIT CODE NOTICE — plain text, left-aligned, sits above the entry card */
#editcode-banner {
  display: none;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 18px;
}
#editcode-banner.show { display: block; }
#editcode-val {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--accent-hover);
  cursor: pointer;
  text-decoration: underline dotted;
  text-decoration-color: var(--border);
}
#editcode-val:hover { color: var(--accent); }

@media (max-width: 600px) {
  #entry-inner { padding: 18px 16px; }
  .field-hint { padding-left: 0; }
  .field-row label { min-width: unset; width: 100%; }
  .profile-edit-card { flex-direction: column; align-items: stretch; }
  .profile-edit-avatar-col { flex-direction: row; align-items: center; gap: 14px; }
  .profile-edit-avatar-hint { max-width: none; text-align: left; }
  .profile-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .profile-banner { height: 130px; }
  .profile-header-body { padding: 50px 18px 20px; }
  .profile-avatar-wrap { left: 18px; top: -42px; }
  .profile-pfp, .profile-pfp-placeholder { width: 84px; height: 84px; border-width: 3px; font-size: 38px; }
  .profile-header-actions { top: 12px; right: 18px; }
}

/* INLINE METADATA PANEL */
.meta-inline-section {
  border-top: 1px solid var(--border-light);
}
.meta-inline-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  background: var(--bg);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: left;
  transition: color .12s, background .12s;
}
.meta-inline-toggle:hover { color: var(--accent); background: var(--bg); }
.meta-inline-toggle-label { flex: 1; }
.meta-inline-toggle-arrow { font-size: 11px; color: var(--text-faint); }
.meta-inline-body { padding: 12px 16px 14px; background: var(--surface); }

/* ===== next style block ===== */

span[style*="color"] a,
span[style*="color"] a:visited,
span[style*="color"] a:hover{
  color: inherit !important;
}

/* ===== next style block ===== */

.settings-row{
display:flex;
justify-content:space-between;
align-items:flex-start;
background:transparent;
border-top:1px solid transparent;
padding:18px 24px;
}
.actions-left{display:flex;align-items:center;gap:12px}
.settings-right{display:flex;gap:6px;position:relative}
.setting{padding:0;background:none;border: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;
background:var(--surface);
border:1.5px solid var(--border);
border-bottom:2.5px solid #f07fa8;
border-radius:12px 12px 6px 6px;
font:15px 'Nunito','Segoe UI',sans-serif;
font-weight:600;
color:var(--text-muted);
}
.field-input::placeholder{color:var(--text-faint)}
.field-input:focus{outline:none;border-color:#f07fa8;box-shadow: 0 0 0 3px rgba(240, 127, 168, 0.15);}
.settings-right::after{display:none;}
@media(max-width:700px){
.settings-row{flex-direction:column;gap:16px}
.settings-right{width:100%;flex-direction:column}
.settings-right::after{display:none}
.field-input{width:100%;border-bottom:1.5px solid var(--border);border-radius:12px}
}

/* ══════════════════════════════════════════════════
   WHAT PAGE — cutesy redesign
══════════════════════════════════════════════════ */

#what-page {
  max-width: 880px;
  margin: 0 auto;
}

/* Hero header */
.what-hero {
  text-align: center;
  padding: 38px 16px 30px;
}

.what-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #000;
  margin-bottom: 10px;
}

.what-pink {
  color: #FFBDE2;
}

.what-sub {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Feature grid */
.what-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

@media (max-width: 680px) {
  .what-grid { grid-template-columns: repeat(2, 1fr); }
  .what-title { font-size: 24px; }
}

@media (max-width: 420px) {
  .what-grid { grid-template-columns: 1fr; }
}

/* Feature cards */
.fc {
  border-radius: 22px;
  padding: 24px 20px 22px;
  border: 1.5px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fc:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(244, 143, 177, 0.25);
}

/* Pastel colour tints */
.fc-rose  { background: #fff0f5; border-color: #f9cfe0; }
.fc-lilac { background: #f6f0ff; border-color: #dcc5f8; }
.fc-peach { background: #fff5ee; border-color: #fcd4b6; }
.fc-sky   { background: #eef5ff; border-color: #bdd5fb; }
.fc-mint  { background: #eefff6; border-color: #b6f0d3; }

/* Dark mode — collapse pastels back to surface */
[data-theme="dark"] .fc-rose,
[data-theme="dark"] .fc-lilac,
[data-theme="dark"] .fc-peach,
[data-theme="dark"] .fc-sky,
[data-theme="dark"] .fc-mint {
  background: var(--surface);
  border-color: var(--border);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fc-rose,
  :root:not([data-theme="light"]) .fc-lilac,
  :root:not([data-theme="light"]) .fc-peach,
  :root:not([data-theme="light"]) .fc-sky,
  :root:not([data-theme="light"]) .fc-mint {
    background: var(--surface);
    border-color: var(--border);
  }
}

.fc-icon {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 14px;
  display: block;
}

.fc h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 7px;
  color: var(--text);
  letter-spacing: -0.01em;
}

.fc p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.fc code {
  font-size: 12px;
  background: rgba(244, 143, 177, 0.18);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--mono);
  color: var(--link);
  border: none;
}

/* Footer note */
.what-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
  padding-bottom: 12px;
}

/* ══════════════════════════════════════════════════
   HOW PAGE — cutesy redesign
══════════════════════════════════════════════════ */

#how-page {
  max-width: 880px;
  margin: 0 auto;
}

.how-hero {
  text-align: center;
  padding: 38px 16px 30px;
}

.how-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 10px;
}

.how-sub {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

.how-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 8px;
}

/* Section cards */
.how-section {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 22px;
  padding: 26px 28px;
  margin-bottom: 0;
  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-icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

/* Override old how-section h2 styles */
.how-section h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  padding: 0;
  border: none;
  letter-spacing: -0.01em;
}

/* Group label rows */
.how-group-label {
  font-size: 13px;
  font-weight: 600;
  margin: 22px 0 9px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.how-group-label:first-of-type { margin-top: 4px; }

/* Colored per-group badges */
.badge-page      { background: #fff0f5; color: #b83060; border: 1px solid #f9cfe0; }
.badge-option    { background: #fff5ee; color: #a04810; border: 1px solid #fcd4b6; }
.badge-access    { background: #eef5ff; color: #1848a8; border: 1px solid #bdd5fb; }
.badge-container { background: #fffbee; color: #806800; border: 1px solid #f0e090; }
.badge-content   { background: #feeeff; color: #880898; border: 1px solid #ecc0f0; }

/* Dark mode badge fallback */
[data-theme="dark"] .badge-page,
[data-theme="dark"] .badge-option,
[data-theme="dark"] .badge-access,
[data-theme="dark"] .badge-container,
[data-theme="dark"] .badge-content {
  background: var(--surface);
  border-color: var(--border);
  color: var(--accent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge-page,
  :root:not([data-theme="light"]) .badge-option,
  :root:not([data-theme="light"]) .badge-access,
  :root:not([data-theme="light"]) .badge-container,
  :root:not([data-theme="light"]) .badge-content {
    background: var(--surface);
    border-color: var(--border);
    color: var(--accent);
  }
}

/* Cute table overrides */
.ref-table,
.meta-ref-table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  margin-bottom: 0;
}

.ref-table th,
.meta-ref-table th {
  background: #fff0f5;
  color: #a83060;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 9px 14px;
  border-bottom: 1.5px solid var(--border);
  border-right: none;
  text-transform: uppercase;
}

[data-theme="dark"] .ref-table th,
[data-theme="dark"] .meta-ref-table th {
  background: #281820;
  color: var(--accent);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ref-table th,
  :root:not([data-theme="light"]) .meta-ref-table th {
    background: #281820;
    color: var(--accent);
  }
}

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

.ref-table tr:last-child td,
.meta-ref-table tr:last-child td {
  border-bottom: none;
}

.ref-table tr:hover td,
.meta-ref-table tr:hover td {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}

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

.meta-ref-table td:first-child {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--link);
  background: var(--code-bg);
  white-space: nowrap;
  border-right: 1px solid var(--border-light);
}

.meta-ref-table td:nth-child(2) {
  color: var(--text-muted);
  font-size: 12px;
}

/* Contacts section tint */
.how-contacts {
  background: #fff0f5;
  border-color: #f9cfe0;
}

[data-theme="dark"] .how-contacts {
  background: var(--surface);
  border-color: var(--border);
}

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

@media (max-width: 600px) {
  .how-section { padding: 18px 16px; border-radius: 14px; }
  .how-title { font-size: 24px; }
  .meta-ref-table td:first-child { white-space: normal; }
}


/* ══════════════════════════════════════════════════
   WHAT PAGE — INFO CARD
══════════════════════════════════════════════════ */

.dont-remove {
  position: fixed;
  z-index: 99;
  bottom: 0;
  margin-bottom: 5px;
  left: 0;
  margin-left: 5px;
}

.what-card-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px 16px 48px;
}

/* Scoped transition for card children — overrides paste.pink's bare * reset */
.what-card * {
  transition: 1s cubic-bezier(0.59, -0.43, 0.17, 1.16);
}

.what-card {
  width: 350px;
  border-radius: 8px;
  position: relative;
  background: #ffc0e2;
  transition: 0.3s ease-in-out;
}

.what-card-img {
  width: 100%;
  height: 200px;
  border-radius: 8px 8px 0 0;
  background: url("https://file.garden/Z0ycTKooXlCeCaIt/pastepink/test/Screen.png");
  background-size: 350px auto;
  background-repeat: no-repeat;
}

.what-card-img:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  background: linear-gradient(transparent, #ecf0f1 44%);
  border-radius: 0 0 8px 8px;
}

.what-card figcaption {
  height: auto;
  display: flex;
  align-items: left;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  overflow: visible;
  background: #fff;
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
  padding-bottom: 24px;
}

.what-card figcaption span { width: 100%; }

.what-card figcaption span:nth-child(1) {
  position: absolute;
  font-family: "Pacifico", cursive;
  font-size: 30px;
  top: -25px;
  opacity: 1;
  left: 10px;
  color: #000;
  text-shadow: 0 0 15px #FFCFE9;
}

.what-card figcaption span:nth-child(2) {
  filter: url("#outline");
  font-family: "Pacifico", cursive;
  font-size: 52px;
  overflow: visible;
  position: absolute;
  top: -42px;
  left: -107px;
  white-space: nowrap;
  color: #ffc0e2;
  z-index: 10;
  transform: rotate(-2deg);
  text-shadow: 0 0 15px #FFCFE9;
  transition: top 0.3s ease-in-out;
}

.what-card figcaption span:nth-child(3) {
  font-family: "Poppins", sans-serif;
  opacity: 1;
  padding: 80px 20px 20px 20px;
  height: auto;
  font-size: 0.75em;
  overflow-y: visible;
  cursor: text;
  line-height: 1.6;
}

/* Scrollbar inside the card text panel */
.what-card figcaption span:nth-child(3)::-webkit-scrollbar { width: 8px; }
.what-card figcaption span:nth-child(3)::-webkit-scrollbar-track { background: #fff; }
.what-card figcaption span:nth-child(3)::-webkit-scrollbar-thumb { background: #FFBDE2; border-radius: 25px; border-right: 3px white solid; }
.what-card figcaption span:nth-child(3)::-webkit-scrollbar-thumb:hover { background: #EAB0CF; border-radius: 25px; }

.what-card-btn {
  position: absolute;
  bottom: -10px;
  width: 130px;
  left: calc(50% - 65px);
  background: #FFBDE2;
  color: #fff;
  border: 0;
  height: 35px;
  border-radius: 4px;
  transform: rotate(1deg);
  cursor: pointer;
  pointer-events: auto;
  transition: 0.3s ease-in-out;
  overflow: hidden;
  z-index: 20;
  font-family: "Poppins", sans-serif;
}

.what-card-btn:focus { outline: 0; }

.what-card-btn:before {
  content: "more";
  position: absolute;
  top: 8px;
  left: 49px;
  opacity: 1;
  transition: 1s cubic-bezier(0.55, -0.62, 0.27, 1.2);
}

.what-card-btn:after {
  content: "back";
  opacity: 0;
  top: 8px;
  left: 0;
  position: absolute;
  transition: 1s cubic-bezier(0.55, -0.62, 0.27, 1.2);
}

.what-card:hover {
  transition: 0.3s ease-in-out;
}

.what-card:hover .what-card-btn {
  background: #FFADDA;
  transition: 0.3s ease-in-out;
}

.what-card:hover figcaption span:nth-child(2) {
  transition: top 0.3s ease-in-out;
}

/* — Open state — */
.what-card.open .what-card-img { height: 0; }

.what-card.open figcaption {
  height: 280px;
  border-radius: 8px;
}

.what-card.open figcaption span:nth-child(1) {
  top: -25px;
  opacity: 1;
}

.what-card.open figcaption span:nth-child(2) { top: -18px; }

.what-card.open figcaption span:nth-child(3) {
  height: 100%;
  opacity: 1;
  padding: 80px 20px 40px 20px;
}

.what-card.open .what-card-btn:before { opacity: 0; left: 100%; }
.what-card.open .what-card-btn:after  { opacity: 1; left: 47px; }

.what-card.open:hover figcaption span:nth-child(2) {
  top: -15px;
  transition: top 0.3s ease-in-out;
}

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

/* Scoped mark so it doesn't affect paste.pink's markdown marks */
.what-card mark {
  background: #FFBDE2;
  color: #ffffff;
  font-weight: 800;
}

.what-card code {
  font-size: 11.5px;
  background: rgba(255, 173, 218, 0.25);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--mono);
  color: var(--link);
  border: none;
}

@media screen and (max-width: 736px) {
  .what-card { width: 320px; }
  .what-card figcaption span:nth-child(2) { font-size: 40px; }
}

/* Dark mode — keep the card readable */
[data-theme="dark"] .what-card figcaption { background: #1e0e18; }
[data-theme="dark"] .what-card figcaption span:nth-child(1) { color: #f0d0e8; }
[data-theme="dark"] .what-card mark { background: #e05a90; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .what-card figcaption { background: #1e0e18; }
  :root:not([data-theme="light"]) .what-card figcaption span:nth-child(1) { color: #f0d0e8; }
  :root:not([data-theme="light"]) .what-card mark { background: #e05a90; }
}


/* ══════════════════════════════════════════════════
   MOBILE / RESPONSIVE ENHANCEMENTS
══════════════════════════════════════════════════ */

/* ── Nav: slim down on phones ──────────────────────────────────────
   The footnav already covers new · what · how · contacts,
   so on small screens keep only: brand | account (when logged in) | auth + theme */
@media (max-width: 600px) {
  #topnav button.nav-link:not(#nav-account-link),
  #topnav a.nav-link,
  .nav-sep { display: none !important; }

  /* Brand stays left, everything else pushed to the right */
  #topnav .brand { margin-right: auto; }

  /* Tighten auth buttons so they don't fall off-screen */
  .nav-actions { gap: 4px; }
  .nav-btn-register,
  .nav-btn-login,
  .nav-btn-logout,
  .nav-admin-btn { padding: 6px 8px; font-size: 12.5px; }
  .nav-username {
    padding: 4px 6px;
    font-size: 12px;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ── Editor: stack the split layout vertically on phones ─────────── */
@media (max-width: 640px) {
  .pane.active.split-layout { flex-direction: column; }
  .editor-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .editor-ta.split { min-height: 220px; resize: vertical; }
  .preview-col { align-self: stretch; width: 100%; }
}

/* ── How page tables: make each section card scrollable on narrow screens ── */
@media (max-width: 720px) {
  .how-section { overflow-x: auto; }
  .ref-table      { min-width: 520px; }
  .meta-ref-table { min-width: 560px; }
}

/* ── Toast: keep above the footnav + stretch to screen edges ─────── */
@media (max-width: 600px) {
  #toast {
    right: 12px;
    left: 12px;
    bottom: 64px;
    text-align: center;
  }
}

/* ── What card: prevent overflow on very small phones ───────────── */
@media (max-width: 380px) {
  .what-card { width: calc(100vw - 32px); max-width: 320px; }
  .what-card svg { width: 100%; }
}

/* ── Account / profile edit page ────────────────────────────────── */
@media (max-width: 520px) {
  .account-header       { padding: 20px; }
  .profile-edit-section { padding: 20px; }
  /* Single-column paste grid */
  .pastes-grid { grid-template-columns: 1fr; }
  /* Save / View Profile buttons span full width */
  .profile-edit-actions { align-self: stretch; flex-direction: column; }
  .profile-edit-actions .btn { width: 100%; justify-content: center; }
}

/* ── Modals: better tap targets on phones ───────────────────────── */
@media (max-width: 420px) {
  .modal { padding: 22px 18px; border-radius: 16px; }
  .modal-actions { flex-direction: column-reverse; gap: 6px; }
  .modal-actions .btn { width: 100%; justify-content: center; }
}

/* ── Extra breathing room on very narrow phones ──────────────────── */
@media (max-width: 380px) {
  #app { padding-left: 10px; padding-right: 10px; }
}

/* ── CHANGE USERNAME (account header) ────────────────────────────── */
.account-change-username-btn {
  background: none;
  border: none;
  color: var(--link);
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color .15s;
}
.account-change-username-btn:hover { color: var(--accent); }

.username-change-body { margin-top: 10px; }
.username-change-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
/* Override the global .field-input width set by .settings-row block */
.username-change-row .field-input {
  width: auto;
  flex: 1;
  min-width: 160px;
  height: 36px;
  padding: 0 12px;
  font-size: 13.5px;
  font-family: var(--mono);
  font-weight: 400;
  border-bottom-width: 1.5px;
  border-radius: 12px;
}
#username-change-err { margin-top: 8px; margin-bottom: 0; }

/* ══════════════════════════════════════════════════
   PASTE CATEGORIES
══════════════════════════════════════════════════ */

.pastes-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.pastes-section-head h2 { margin-bottom: 0; }

.add-category-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: 14px;
}
/* Override the global 210px width inside .field-input */
.add-category-form .field-input {
  flex: 1;
  min-width: 150px;
  width: auto;
  height: 34px;
  padding: 0 12px;
  font-size: 13.5px;
  font-family: var(--font);
  font-weight: 400;
  border-bottom-width: 1.5px;
  border-radius: 10px;
}

/* ── Category section ─────────────────────────── */
.category-section { margin-bottom: 28px; }

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px 9px 16px;
  background: linear-gradient(to right, rgba(240,127,168,.1), rgba(240,127,168,.02));
  border: 1.5px solid var(--border-light);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  margin-bottom: 14px;
}
.category-header-uncat {
  background: none;
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
  opacity: .75;
}
.category-header-readonly { cursor: default; }

.category-header-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.category-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.category-count {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.category-actions { display: flex; gap: 2px; flex-shrink: 0; }
.category-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1;
  color: var(--text-muted);
  font-family: inherit;
  transition: background .15s, color .15s;
}
.category-btn:hover { background: rgba(240,127,168,.14); color: var(--accent); }
.category-btn-delete:hover { color: var(--danger); background: rgba(220,60,60,.08); }

.category-rename-form {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: 12px;
}
.category-rename-form .field-input {
  flex: 1;
  min-width: 150px;
  width: auto;
  height: 34px;
  padding: 0 12px;
  font-size: 13.5px;
  font-family: var(--font);
  font-weight: 400;
  border-bottom-width: 1.5px;
  border-radius: 10px;
}

.category-empty-hint {
  font-size: 12.5px;
  color: var(--text-faint);
  font-style: italic;
  padding: 10px 4px 18px;
}

/* ── Profile category pill tabs ─────────────────── */
.profile-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.profile-cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 18px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.profile-cat-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(240,127,168,.07);
}
.profile-cat-pill.active {
  background: rgba(240,127,168,.12);
  border-color: var(--accent);
  color: var(--accent);
}
.profile-cat-body { animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Category dropdown on paste cards ────────── */
.paste-card-cat-select {
  margin-top: 4px;
  width: 100%;
  padding: 5px 24px 5px 9px;
  border: 1.5px solid var(--border-light);
  border-radius: 10px;
  background-color: var(--bg);
  color: var(--text-muted);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23f07fa8' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.paste-card-cat-select:hover { border-color: var(--border); }
.paste-card-cat-select:focus { border-color: var(--accent); }

@media (max-width: 600px) {
  .pastes-section-head { gap: 10px; }
  .add-category-form,
  .category-rename-form { gap: 6px; }
}

/* ── FRIEND REQUESTS (account page) ── */
.friend-requests-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
.friend-requests-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.friend-requests-head h2 { font-size: 18px; font-weight: 700; margin: 0; color: var(--text); }
#friend-requests-incoming, #friend-requests-outgoing { display: flex; flex-direction: column; gap: 8px; }
#friend-requests-outgoing { margin-top: 14px; }
#friend-requests-incoming h3, #friend-requests-outgoing h3 { font-size: 13px; color: var(--text-muted); margin: 0 0 2px; }
.friend-request-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg);
}
.friend-request-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  text-align: left;
}
.friend-request-profile span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.friend-request-profile strong { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-request-profile small { font-size: 12px; color: var(--text-muted); }
.friend-request-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.friend-request-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.profile-header-actions .btn:disabled { opacity: 0.65; cursor: default; }
@media (max-width: 560px) {
  .friend-request-card { align-items: flex-start; flex-direction: column; }
  .friend-request-actions { width: 100%; justify-content: flex-start; }
}


/* ADMIN */

.account-title { display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap; }
.admin-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent-light);
  color: var(--accent-hover);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  text-transform: lowercase;
}
.admin-chip:hover { background: var(--accent); color: #fff; }
.admin-page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.admin-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.admin-panel-head h2 { font-size: 17px; }
.admin-panel-head span { color: var(--text-muted); font-size: 12px; font-weight: 700; }
.admin-request-list { display: flex; flex-direction: column; gap: 10px; }
.admin-request-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg);
}
.admin-request-main { min-width: 0; }
.admin-request-title { font-weight: 800; margin-bottom: 4px; }
.admin-request-meta { color: var(--text-muted); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.admin-request-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-status { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--accent-light); color: var(--accent-hover); }
.admin-status-declined { background: var(--danger-bg); color: var(--danger); }
.admin-status-completed, .admin-status-approved { background: var(--blockquote-bg); color: var(--link); }
@media (max-width: 700px) {
  .admin-page-header, .admin-request-card { align-items: flex-start; flex-direction: column; }
  .admin-request-actions { justify-content: flex-start; }
}

/* Admin edit-code reset action */
.admin-new-edit-code {
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-muted);
}
.admin-new-edit-code code {
  font-family: var(--mono);
  font-weight: 800;
  color: var(--accent-hover);
  background: var(--accent-light);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  padding: 2px 7px;
}


/* Owner-visible edit-code reset results */
.owner-reset-code-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.owner-reset-code-panel-account { margin-bottom: 22px; }
.owner-reset-code-panel-profile {
  max-width: 560px;
  margin-top: 8px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg);
}
.owner-reset-code-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.owner-reset-code-head strong { font-size: 14px; color: var(--text); }
.owner-reset-code-head p { margin-top: 3px; color: var(--text-muted); font-size: 12px; line-height: 1.35; }
.owner-reset-code-head span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 900;
}
.owner-reset-code-list { display: flex; flex-direction: column; gap: 8px; }
.owner-reset-code-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--surface);
}
.owner-reset-code-main { min-width: 0; }
.owner-reset-code-title { font-size: 13px; font-weight: 800; color: var(--text); overflow-wrap: anywhere; }
.owner-reset-code-meta { margin-top: 3px; color: var(--text-muted); font-size: 11.5px; line-height: 1.35; overflow-wrap: anywhere; }
.owner-reset-code-value { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.owner-reset-code-value code {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 900;
  color: var(--accent-hover);
  background: var(--accent-light);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 4px 8px;
}

.owner-reset-code-done {
  font-size: 12px;
  padding-inline: 12px;
}
.owner-reset-code-done:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-bg);
}
@media (max-width: 640px) {
  .owner-reset-code-card { align-items: flex-start; flex-direction: column; }
  .owner-reset-code-value { justify-content: flex-start; }
}
