/* ===========================================================
   Neveshta — Codevorse Neobrutalism Design System
   Matches qr.codevorse.ir & neobrutalism.dev exactly.
   Sticky bottom footer, high-contrast borders, tactile press.
   =========================================================== */

/* ---- Design Tokens (Light Mode - codevorse) ---- */
:root {
  --bg: #f5f0ea;
  --text: #121212;
  --panel: #ffffff;
  --border: #121212;
  --border-w: 2.5px;

  --shadow: 4px 4px 0px #121212;
  --shadow-sm: 2px 2px 0px #121212;
  --shadow-lg: 6px 6px 0px #121212;

  --primary: #FFE600;
  --secondary: #FF5E97;
  --accent: #7CE8D5;
  --blue: #70B4FF;
  --green: #8AEEB4;
  --orange: #FFA940;
  --purple: #C89BFF;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --radius-pill: 99px;

  --font-fa: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-latin: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Design Tokens (Dark Mode - codevorse) ---- */
[data-theme="dark"], html[data-theme="dark"] {
  --bg: #101014;
  --text: #f4f4f6;
  --panel: #1b1b22;
  --border: #3d3d4a;

  --shadow: 4px 4px 0px #000000;
  --shadow-sm: 2px 2px 0px #000000;
  --shadow-lg: 6px 6px 0px #000000;

  --primary: #f0db29;
  --secondary: #e64c84;
  --accent: #52cbb7;
  --blue: #5597e6;
  --green: #68cc93;
  --orange: #e69230;
  --purple: #b07ef0;
}

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

html {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-fa);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html[lang="en"] body {
  font-family: var(--font-latin);
}

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-fa);
  font-weight: 900;
  line-height: 1.3;
  color: var(--text);
}

html[lang="en"] h1, html[lang="en"] h2, html[lang="en"] h3, html[lang="en"] h4 {
  font-family: var(--font-latin);
}

a {
  text-decoration: none;
  color: inherit;
}

/* Layout container: stretches so footer is always stuck to the bottom */
.app-content {
  flex: 1 0 auto;
  width: 100%;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- SVG Icon Base ---------- */
.svg-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  stroke-width: 2.2;
}

/* ---------- Floating Utility Buttons / Dock ---------- */
.floating-dock {
  position: fixed;
  top: 18px;
  inset-inline-end: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  padding: 4px 6px;
  box-shadow: var(--shadow-sm);
  z-index: 80;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.floating-dock:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
  transition: all 0.1s ease;
  user-select: none;
  box-sizing: border-box;
}

/* Perfect alignment between SVG icon and text */
.dock-btn .svg-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.dock-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 12.5px;
  font-weight: 800;
}

/* Specific optical baseline alignment for Persian vs Latin */
html[dir="rtl"] .dock-btn span {
  transform: translateY(-2.5px);
}

/* When site is in RTL, the lang toggle shows Latin 'EN' */
html[dir="rtl"] .dock-btn.lang-toggle-btn span {
  transform: translateY(0.8px);
  font-family: var(--font-latin);
}

html[dir="ltr"] .dock-btn span {
  transform: translateY(0px);
}

/* When site is in LTR, the lang toggle shows Persian 'فا' */
html[dir="ltr"] .dock-btn.lang-toggle-btn span {
  transform: translateY(-2.5px);
  font-family: var(--font-fa);
}

.dock-btn:hover {
  background: var(--primary);
  color: #121212;
  border-color: var(--border);
}

.dock-btn:active {
  transform: translate(1.5px, 1.5px);
}

.dock-btn.icon-only {
  padding: 0;
  width: 34px;
}

.dock-btn.dock-publish-btn {
  background: var(--primary);
  color: #121212 !important;
  border: 1.5px solid var(--border);
  box-shadow: 1px 1px 0px var(--border);
  padding: 0 13px;
}

.dock-btn.dock-publish-btn:hover {
  background: var(--secondary);
  color: #FFFFFF !important;
}

html[dir="rtl"] .dock-btn.dock-publish-btn span {
  transform: translateY(-2.5px);
}

html[dir="ltr"] .dock-btn.dock-publish-btn span {
  transform: translateY(0px);
}

.dock-sep {
  width: 1.5px;
  height: 18px;
  background: var(--border);
  opacity: 0.7;
}

/* ---------- Neobrutalism UI Building Blocks ---------- */
.n-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  background: var(--panel);
  color: var(--text);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.1s ease;
  user-select: none;
  line-height: 1;
}

.n-btn .svg-icon {
  display: block;
  flex-shrink: 0;
}

.n-btn span {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

html[dir="rtl"] .n-btn span {
  transform: translateY(-2px);
}

html[dir="ltr"] .n-btn span {
  transform: translateY(0px);
}

.n-btn:hover {
  background: var(--primary);
  color: #121212;
  transform: translate(-1.5px, -1.5px);
  box-shadow: var(--shadow-lg);
}

.n-btn:active {
  transform: translate(2.5px, 2.5px) !important;
  box-shadow: 1px 1px 0px var(--border) !important;
}

.n-btn.primary {
  background: var(--primary);
  color: #121212;
}

.n-btn.primary:hover {
  background: var(--secondary);
  color: #FFFFFF;
}

.n-btn.ghost {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}

.n-btn.ghost:hover {
  background: var(--panel);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}

.n-btn.small {
  padding: 6px 14px;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}

.n-btn.danger {
  background: var(--secondary);
  color: #FFFFFF;
}

.n-btn.danger:hover {
  background: #E11D48;
}

.n-card {
  background: var(--panel);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.n-input, .n-textarea {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  background: var(--panel);
  color: var(--text);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: all 0.1s ease;
}

.n-input:focus, .n-textarea:focus {
  border-color: var(--border);
  box-shadow: 4px 4px 0px var(--blue);
}

.n-input::placeholder {
  color: var(--text);
  opacity: 0.55;
}

/* ---------- Hero Section ---------- */
.hero {
  padding: 90px 0 25px;
  text-align: start;
}

.hero .brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #121212;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 16px;
  font-weight: 900;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.hero .brand-pill .brand-dot {
  width: 7px;
  height: 7px;
  background: #121212;
  border-radius: 50%;
}

.hero h1 {
  font-size: 38px;
  font-weight: 900;
  margin-bottom: 8px;
}

.hero p.tagline {
  font-size: 17.5px;
  font-weight: 700;
  opacity: 0.85;
}

/* ---------- Editor Canvas ---------- */
.editor-shell {
  padding: 85px 0 60px;
}

.title-input {
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 900;
  font-size: 36px;
  width: 100%;
  outline: none;
  color: var(--text);
  padding: 6px 0 12px;
  border-bottom: 3px solid var(--border);
  margin-bottom: 18px;
  line-height: 1.3;
  transition: border-color 0.15s ease;
}

.title-input:focus {
  border-bottom-color: var(--blue);
}

.title-input::placeholder {
  color: var(--text);
  opacity: 0.45;
  font-weight: 900;
}

/* ---------- Neobrutalism Select (neobrutalism.dev style) ---------- */
.lang-mode-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.custom-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.custom-select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--panel);
  color: var(--text);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  padding: 8px 36px 8px 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  outline: none;
  transition: all 0.1s ease;
}

[dir="rtl"] .custom-select-wrap select {
  padding: 8px 14px 8px 36px;
}

.custom-select-wrap select:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.custom-select-wrap select:focus {
  border-color: var(--border);
  box-shadow: 4px 4px 0px var(--primary);
}

.custom-select-wrap::after {
  content: '';
  position: absolute;
  inset-inline-end: 13px;
  width: 6px;
  height: 6px;
  border-inline-end: 2.5px solid var(--text);
  border-bottom: 2.5px solid var(--text);
  transform: rotate(45deg);
  pointer-events: none;
  margin-top: -3px;
}

/* ---------- Custom Neobrutalism Select Component (neobrutalism.dev/docs/select) ---------- */
.neo-select-wrap {
  position: relative;
  display: inline-block;
}

.neo-select-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 38px;
  min-width: 145px;
  padding: 0 14px;
  background: var(--panel);
  color: var(--text);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  outline: none;
  user-select: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.1s ease;
  box-sizing: border-box;
}

.neo-select-trigger:hover {
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.neo-select-trigger:focus,
.neo-select-trigger.active,
.neo-select-trigger[aria-expanded="true"] {
  border-color: var(--border);
  box-shadow: 3px 3px 0px var(--primary);
}

.neo-select-value {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 800;
  line-height: 1;
}

.neo-select-chevron {
  width: 15px;
  height: 15px;
  stroke-width: 2.5;
  flex-shrink: 0;
  opacity: 0.8;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.neo-select-trigger.active .neo-select-chevron,
.neo-select-trigger[aria-expanded="true"] .neo-select-chevron {
  transform: rotate(180deg);
}

.neo-select-content {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  min-width: 100%;
  background: var(--panel);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 5px;
  z-index: 100;
  overflow: hidden;
}

.neo-select-content.open {
  display: flex;
  flex-direction: column;
  gap: 3px;
  animation: neoSelectIn 0.12s ease-out;
}

@keyframes neoSelectIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.neo-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: background-color 0.1s ease, color 0.1s ease;
}

.neo-select-item:hover {
  background: var(--primary);
  color: #121212;
}

.neo-select-item.selected {
  font-weight: 800;
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .neo-select-item.selected {
  background: rgba(255, 255, 255, 0.08);
}

.neo-select-item.selected:hover {
  background: var(--primary);
  color: #121212;
}

.neo-select-item-check {
  display: none;
  width: 15px;
  height: 15px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.neo-select-item.selected .neo-select-item-check {
  display: inline-flex;
}

/* Bilingual Tabs (neobrutalism.dev tabs style) */
.lang-tabs {
  display: none;
  gap: 8px;
  margin-bottom: 18px;
}

.lang-tabs.active {
  display: flex;
}

.lang-tab {
  padding: 7px 18px;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: all 0.1s ease;
  text-decoration: none;
}

.lang-tab:hover {
  background: var(--primary);
  color: #121212;
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow);
}

.lang-tab.current {
  background: var(--blue);
  color: #FFFFFF;
}

[data-theme="dark"] .lang-tab.current {
  color: #101014;
}

.lang-tab:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0;
}

/* ---------- Sticky Toolbar ---------- */
.toolbar-wrap {
  position: sticky;
  top: 14px;
  z-index: 45;
  margin: 12px 0 20px;
}

.toolbar {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  background: var(--panel);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  box-shadow: var(--shadow);
}

.tb-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  box-shadow: 2px 2px 0px var(--border);
  cursor: pointer;
  transition: all 0.08s ease;
}

.tb-btn:hover {
  background: var(--primary);
  color: #121212;
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--border);
}

.tb-btn:active {
  transform: translate(2px, 2px) !important;
  box-shadow: 0px 0px 0px var(--border) !important;
}

.tb-sep {
  width: 2px;
  height: 22px;
  background: var(--border);
  margin: 0 3px;
  opacity: 0.6;
}

/* ---------- Content Editable ---------- */
.editable {
  min-height: 340px;
  font-size: 18px;
  line-height: 1.9;
  outline: none;
  color: var(--text);
  padding: 8px 0 36px;
}

.editable[contenteditable="true"]:empty::before {
  content: attr(data-placeholder);
  color: var(--text);
  opacity: 0.45;
  font-weight: 600;
  pointer-events: none;
}

.editable h3, .editable h4 {
  margin-top: 1.4em;
  margin-bottom: 0.4em;
  font-weight: 900;
}

.editable blockquote {
  margin: 24px 0;
  padding: 12px 22px;
  background: var(--bg);
  border: var(--border-w) solid var(--border);
  border-inline-start-width: 7px;
  border-inline-start-color: var(--primary);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-style: italic;
  box-shadow: var(--shadow-sm);
}

.editable pre {
  background: #181920;
  color: #F8FAFC;
  padding: 18px 20px;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14.5px;
  line-height: 1.6;
}

.editable img {
  max-width: 100%;
  height: auto;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 18px 0;
  display: block;
}

.editable ul, .editable ol {
  padding-inline-start: 1.7em;
  margin: 14px 0;
}

.editable li {
  margin-bottom: 6px;
}

.editable a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  font-weight: 800;
}

.editable .embed-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 24px 0;
}

.editable .embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Author & Meta Row ---------- */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 30px;
  padding-top: 18px;
  border-top: var(--border-w) dashed var(--border);
}

.meta-field-wrap {
  flex: 1 1 240px;
  position: relative;
  display: flex;
  align-items: center;
}

.meta-field-wrap .meta-icon {
  position: absolute;
  inset-inline-start: 13px;
  color: var(--text);
  pointer-events: none;
}

.meta-field-wrap .n-input {
  padding-inline-start: 38px;
}

/* ---------- Publish Action Button (In-flow, never overlaps footer) ---------- */
.publish-bar {
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 36px;
  margin-bottom: 24px;
  padding: 14px 20px;
  background: var(--panel);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.publish-bar .publish-info-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  opacity: 0.8;
  margin-inline-end: auto;
}

.publish-bar .publish-info-hint .svg-icon {
  width: 16px;
  height: 16px;
  color: var(--primary);
  flex-shrink: 0;
}

.publish-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  background: var(--primary);
  color: #121212;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 900;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.1s ease;
  user-select: none;
  line-height: 1;
}

.publish-btn .svg-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.publish-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

html[dir="rtl"] .publish-btn span {
  transform: translateY(-2.5px);
}

html[dir="ltr"] .publish-btn span {
  transform: translateY(0px);
}

.publish-btn:hover {
  background: var(--secondary);
  color: #FFFFFF;
  transform: translate(-1.5px, -1.5px);
  box-shadow: var(--shadow);
}

.publish-btn:active {
  transform: translate(2px, 2px) !important;
  box-shadow: 0px 0px 0px var(--border) !important;
}

.publish-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Reader Mode (View Page) ---------- */
.view-header {
  padding: 90px 0 20px;
}

.view-header h1 {
  font-size: 38px;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 14px;
}

.view-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 800;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.view-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  box-shadow: var(--shadow-sm);
}

.view-body {
  padding-bottom: 70px;
  font-size: 18.5px;
  line-height: 1.95;
  color: var(--text);
}

.view-body h3, .view-body h4 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  font-weight: 900;
}

.view-body blockquote {
  margin: 26px 0;
  padding: 12px 24px;
  border: var(--border-w) solid var(--border);
  border-inline-start-width: 8px;
  border-inline-start-color: var(--primary);
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-style: italic;
  box-shadow: var(--shadow-sm);
}

.view-body pre {
  background: #181920;
  color: #F8FAFC;
  padding: 18px 22px;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14.5px;
  line-height: 1.6;
}

.view-body img {
  max-width: 100%;
  height: auto;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 20px 0;
  display: block;
}

.view-body .embed-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 26px 0;
}

.view-body .embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.reader-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  margin-top: 30px;
  border-top: var(--border-w) solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 120;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  max-width: 480px;
  width: 100%;
  background: var(--panel);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 28px;
}

.modal-box .success-badge {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--green);
  color: #121212;
  border: var(--border-w) solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.modal-box h3 {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 8px;
}

.modal-box p.modal-desc {
  font-size: 13.5px;
  opacity: 0.8;
  font-weight: 700;
  margin-bottom: 14px;
  line-height: 1.5;
}

.link-share-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 10px 0 16px;
  box-shadow: var(--shadow-sm);
}

.link-share-box .link-text {
  flex: 1;
  font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 800;
  color: var(--text);
  word-break: break-all;
  user-select: all;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- Empty State (404) ---------- */
.empty-state {
  text-align: center;
  padding: 110px 20px;
}

.empty-state .empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  color: var(--text);
}

.empty-state h1 {
  font-size: 34px;
  font-weight: 900;
  margin-bottom: 10px;
}

.empty-state p {
  opacity: 0.8;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 24px;
}

/* ---------- Admin Panel ---------- */
.admin-shell {
  padding: 100px 0 50px;
}

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-topbar h1 {
  font-size: 30px;
  font-weight: 900;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  text-align: start;
  padding: 14px 12px;
  border-bottom: var(--border-w) solid var(--border);
  font-size: 14px;
}

.admin-table th {
  font-weight: 900;
  color: var(--text);
  background: var(--bg);
  font-size: 13px;
}

.admin-table tbody tr:hover {
  background: var(--bg);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  box-shadow: 1px 1px 0px var(--border);
}

.badge-info {
  background: var(--blue);
  color: #FFFFFF;
}

[data-theme="dark"] .badge-info {
  color: #101014;
}

.login-shell {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-shell .n-card {
  max-width: 400px;
  width: 100%;
  padding: 32px;
}

.login-shell h1 {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 20px;
}

.form-error {
  background: var(--secondary);
  color: #FFFFFF;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 16px;
  border: var(--border-w) solid var(--border);
  box-shadow: var(--shadow-sm);
}

/* ===========================================================
   Site Footer — Exactly matching qr.codevorse.ir
   Always sticky at the bottom!
   =========================================================== */
.site-footer {
  margin-top: auto;
  background: var(--panel);
  color: var(--text);
  border-top: var(--border-w) solid var(--border);
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.04);
  padding: 1.1rem 2rem;
  font-size: 0.92rem;
  font-weight: 700;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

[data-theme="dark"] .site-footer {
  background: var(--panel);
  border-top: var(--border-w) solid var(--border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
}

.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  direction: ltr !important;
  cursor: pointer;
}

.footer-brand-title {
  color: var(--text);
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: -0.4px;
}

[data-theme="dark"] .footer-brand-title {
  color: var(--primary);
}

.footer-brand-badge {
  background: var(--primary);
  color: #121212 !important;
  font-weight: 900;
  font-size: 0.88rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius);
  border: var(--border-w) solid var(--border);
  box-shadow: var(--shadow-sm);
  display: inline-block;
  transform: rotate(3deg);
  text-decoration: none;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.footer-brand:hover .footer-brand-badge {
  transform: rotate(0deg) scale(1.1);
  box-shadow: var(--shadow);
}

[data-theme="dark"] .footer-brand-badge {
  background: var(--primary);
  color: #121212 !important;
  border: var(--border-w) solid var(--border);
}

.footer-copyright {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text);
  opacity: 0.9;
}

.footer-badge-codevorse {
  background: var(--accent);
  color: #121212 !important;
  border: var(--border-w) solid var(--border);
  box-shadow: 2px 2px 0px var(--secondary);
  font-weight: 900;
  font-size: 0.84rem;
  padding: 0.18rem 0.6rem;
  border-radius: var(--radius);
  display: inline-block;
  transform: translateY(-1px);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.footer-badge-codevorse:hover {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0px var(--secondary);
}

.footer-badge-codevorse:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.footer-divider {
  opacity: 0.35;
  margin: 0 0.2rem;
}

@media(max-width: 768px) {
  .site-footer {
    padding: 1.2rem 1rem;
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.85rem;
  }
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--secondary); }

/* Responsive adjustments */
@media (max-width: 640px) {
  .hero {
    padding: 80px 0 20px;
  }
  .hero h1 {
    font-size: 30px;
  }
  .title-input {
    font-size: 26px;
  }
  .toolbar-wrap {
    top: 10px;
  }
  .toolbar {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 5px;
  }
  .toolbar::-webkit-scrollbar {
    display: none;
  }
  .tb-btn {
    width: 33px;
    height: 33px;
  }
  .publish-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
    text-align: center;
  }
  .publish-bar .publish-info-hint {
    margin-inline-end: 0;
    justify-content: center;
  }
  .publish-btn {
    width: 100%;
    justify-content: center;
  }
  .floating-dock {
    top: 12px;
    inset-inline-end: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
