@import url('https://fonts.googleapis.com/css2?family=Aref+Ruqaa:wght@400;700&family=Aref+Ruqaa+Ink:wght@400;700&family=Lateef:wght@400;700&family=Marhey:wght@400;700&display=swap');
.ntf-dashboard-page {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

/* =========================================================
   NTF Hub identity lock.
   The dashboard chrome (panels, buttons, nav, dialogs, text)
   always stays dark navy + gold — this is the NTF Hub identity,
   not the visitor-facing theme. Only the phone preview below
   should shift with the selected public-page theme, via the
   --pv-* tokens defined per [data-theme] further down this file.
   ========================================================= */
.ntf-dashboard-page {
  --accent: #ffd166;
  --accent-2: #ffb703;
  --text: #f5f7fb;
  --muted: #aab7cf;
  --border: rgba(255, 255, 255, 0.14);
  --glow: rgba(255, 183, 3, 0.24);
}

.dash-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, var(--glow), transparent 28%),
    radial-gradient(
      circle at 86% 12%,
      rgba(56, 189, 248, 0.16),
      transparent 32%
    ),
    radial-gradient(
      circle at 50% 100%,
      rgba(255, 255, 255, 0.07),
      transparent 36%
    );
  opacity: 0.9;
}

.dash-shell {
  position: relative;
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 52px;
}

.dash-hero,
.dash-panel,
.dash-alert {
  border: 1px solid var(--border);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.1),
    rgba(255, 255, 255, 0.045)
  );
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.dash-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 22px;
  padding: 24px;
  border-radius: 32px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 800;
}

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

.hero-copy h1 {
  margin: 8px 0 12px;
  max-width: 820px;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -1px;
}

.hero-copy p {
  margin: 0;
  max-width: 780px;
  color: var(--muted);
  line-height: 1.9;
  font-size: 16px;
}

.hero-actions {
  min-width: 320px;
  display: grid;
  align-content: center;
  justify-items: stretch;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  border-radius: 999px;
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.075);
  font-weight: 900;
}

.status-pill.is-published {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

.status-pill.is-draft {
  border-color: rgba(250, 204, 21, 0.35);
  background: rgba(250, 204, 21, 0.1);
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-weight: 900;
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease;
}

.primary-btn {
  color: #06111f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 16px 42px var(--glow);
}

.primary-btn:hover:not(:disabled),
.ghost-btn:hover {
  transform: translateY(-1px);
}
.primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.ghost-btn {
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.075);
}

.primary-btn.compact {
  min-height: 42px;
  padding-inline: 16px;
}

.dash-alert {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: 22px;
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
}

.dash-alert.is-ok {
  color: var(--text);
  border-color: rgba(34, 197, 94, 0.28);
}
.dash-alert.is-error {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(127, 29, 29, 0.18);
}

.dash-layout {
  display: grid;
  grid-template-columns: 260px minmax(420px, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.dash-panel {
  border-radius: 30px;
  padding: 20px;
}

.dash-sidebar,
.preview-column {
  position: sticky;
  top: 18px;
}

.mini-profile {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
}

.mini-avatar {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #06111f;
  font-weight: 1000;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex: 0 0 auto;
}

.mini-profile strong,
.mini-profile span {
  display: block;
}
.mini-profile strong {
  color: var(--text);
}
.mini-profile span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  direction: ltr;
  text-align: right;
}

.dash-nav {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}
.dash-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 900;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.dash-nav a:hover,
.dash-nav a.is-active {
  color: var(--text);
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.075);
}

.dash-help {
  margin-top: 18px;
  padding: 14px;
  border-radius: 20px;
  color: var(--muted);
  line-height: 1.8;
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.2);
}
.dash-help strong {
  color: var(--text);
  display: block;
  margin-bottom: 4px;
}
.dash-help p {
  margin: 0;
}

.editor-column {
  display: grid;
  gap: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-kicker {
  display: inline-flex;
  color: var(--accent);
  font-weight: 1000;
  letter-spacing: 0.4px;
  font-size: 12px;
  text-transform: uppercase;
}

.panel-head h2 {
  margin: 4px 0 6px;
  font-size: 24px;
}
.panel-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}
.save-state {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.profile-form,
.link-dialog-card {
  display: grid;
  gap: 14px;
}

.profile-form label,
.link-dialog-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.profile-form input,
.profile-form textarea,
.link-dialog-card input,
.link-dialog-card textarea,
.link-dialog-card select {
  width: 100%;
  box-sizing: border-box;
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.075);
  border-radius: 18px;
  padding: 13px 14px;
  outline: none;
  font: inherit;
}

.profile-form textarea {
  min-height: 104px;
  resize: vertical;
}
.profile-form input:focus,
.profile-form textarea:focus,
.link-dialog-card input:focus,
.link-dialog-card select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--glow);
}

.theme-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.045);
}
.theme-section strong,
.theme-section span {
  display: block;
}
.theme-section span {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.theme-picker button {
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 5px;
  color: var(--text);
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
  font-weight: 900;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.theme-picker button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
}
.theme-picker i {
  width: 28px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: transform 0.18s ease;
}
.theme-picker button.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--glow);
}

.links-head {
  align-items: center;
}
.links-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
}
.links-toolbar span:first-child {
  color: var(--text);
  font-weight: 900;
}

.links-list {
  display: grid;
  gap: 12px;
}
.link-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.07);
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}
.link-card.is-disabled {
  opacity: 0.55;
}
.link-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #06111f;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 1000;
}
.link-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.link-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}
.link-card small {
  display: block;
  color: var(--muted);
  direction: ltr;
  text-align: right;
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 500px;
}
.link-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--text);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-weight: 1000;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.empty-links {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border-radius: 24px;
  border: 1px dashed var(--border);
  padding: 22px;
}
.empty-links strong {
  color: var(--text);
  font-size: 20px;
  display: block;
  margin-bottom: 6px;
}
.empty-links p {
  margin: 0;
  line-height: 1.8;
}

.phone-frame {
  height: 650px;
  min-height: 650px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 0, var(--glow), transparent 45%),
    rgba(0, 0, 0, 0.18);
}

.phone-top {
  position: absolute;
  top: 44px;
  width: 80px;
  height: 22px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  z-index: 3;
}

.public-preview {
  width: min(318px, calc(100% - 34px));
  height: 560px;
  max-height: 560px;
  box-sizing: border-box;
  padding: 48px 18px 22px;
  border-radius: 38px;
  border: 1px solid var(--pv-border);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.13),
    rgba(255, 255, 255, 0.055)
  );
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
  text-align: center;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: contain;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
}

.public-preview::-webkit-scrollbar {
  display: none;
}

.public-preview.is-dragging {
  cursor: grabbing;
}

.public-preview a,
.public-preview button {
  user-select: none;
}


.preview-avatar,
.preview-avatar-img {
  width: 92px;
  height: 92px;
  border-radius: 28px;
  margin: 0 auto 14px;
  border: 1px solid var(--pv-border);
}
.preview-avatar {
  display: grid;
  place-items: center;
  color: #06111f;
  font-size: 26px;
  font-weight: 1000;
  background: linear-gradient(135deg, var(--pv-accent), var(--pv-accent-2));
}
.preview-avatar-img {
  object-fit: cover;
  display: block;
}

.public-preview h3 {
  margin: 0;
  font-size: 24px;
}
.public-preview p {
  margin: 10px 0 18px;
  color: var(--pv-muted);
  line-height: 1.7;
}
.public-preview small {
  display: block;
  margin-top: 18px;
  color: var(--pv-muted);
}
.preview-links {
  display: grid;
  gap: 10px;
  text-align: right;
}
.preview-link {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--pv-text);
  text-decoration: none;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--pv-border);
  background: rgba(255, 255, 255, 0.075);
}
.preview-link i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #06111f;
  background: linear-gradient(135deg, var(--pv-accent), var(--pv-accent-2));
  font-style: normal;
  font-weight: 1000;
  flex: 0 0 auto;
}
.preview-link strong {
  display: block;
  font-size: 14px;
}
.preview-link span {
  display: block;
  color: var(--pv-muted);
  font-size: 12px;
  margin-top: 2px;
}

.link-dialog {
  width: min(560px, calc(100% - 28px));
  border: 0;
  padding: 0;
  background: transparent;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease, overlay 0.18s ease allow-discrete, display 0.18s ease allow-discrete;
}
.link-dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}
@starting-style {
  .link-dialog[open] {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}
.link-dialog::backdrop {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.18s ease allow-discrete;
}
.link-dialog[open]::backdrop {
  opacity: 1;
}
@starting-style {
  .link-dialog[open]::backdrop {
    opacity: 0;
  }
}
.link-dialog-card {
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 30px;
  background: #081426;
  padding: 22px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.dialog-head h2 {
  margin: 4px 0 0;
}
.close-btn {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 24px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.toggle-row {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  flex-direction: row;
}
.toggle-row input {
  width: auto;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

@media (max-width: 1240px) {
  .dash-layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }
  .preview-column {
    grid-column: 1 / -1;
    position: relative;
    top: auto;
  }
  .phone-frame {
    min-height: 560px;
  }
}

@media (max-width: 860px) {
  .dash-shell {
    width: min(100% - 18px, 1480px);
    padding-top: 10px;
  }
  .dash-hero {
    flex-direction: column;
    border-radius: 24px;
    padding: 18px;
  }
  .hero-actions {
    min-width: 0;
  }
  .dash-layout {
    grid-template-columns: 1fr;
  }
  .dash-sidebar {
    position: relative;
    top: auto;
  }
  .dash-nav {
    grid-template-columns: repeat(3, 1fr);
  }
  .dash-nav a {
    text-align: center;
    padding-inline: 8px;
  }
  .panel-head,
  .links-head {
    flex-direction: column;
    align-items: stretch;
  }
  .theme-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .link-card {
    grid-template-columns: 1fr;
  }
  .link-actions {
    justify-content: flex-start;
  }
  .links-toolbar {
    flex-direction: column;
  }
}

.certificate-picker small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.certificate-picker select {
  margin-top: 8px;
}

.is-hidden {
  display: none !important;
}

.preview-link.is-certificate {
  border-color: color-mix(in srgb, var(--pv-accent) 55%, transparent);
  background:
    radial-gradient(circle at 12% 20%, var(--pv-glow), transparent 30%),
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.14),
      rgba(255, 255, 255, 0.06)
    );
}

.preview-link.is-certificate i {
  font-size: 20px;
}

/* =========================================================
   NTF Links Dashboard natural page scroll fix
   الصفحة كاملة تسوي Scroll طبيعي، والأعمدة الجانبية تبقى Sticky.
   ========================================================= */

html,
body {
  min-height: 100%;
}

body.ntf-dashboard-page {
  overflow-x: hidden;
  overflow-y: auto;
}

.dash-shell {
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

.dash-layout {
  min-height: 0;
  overflow: visible;
}

.editor-column {
  min-height: 0;
  overflow: visible;
}

.links-panel {
  min-height: 0;
  height: auto;
  overflow: visible;
}

.links-list {
  display: grid;
  gap: 12px;
  overflow: visible;
  max-height: none;
}

.dash-sidebar,
.preview-column {
  position: sticky;
  top: 18px;
  align-self: start;
}

/* Optional: إذا رغبت لاحقًا بسكرول داخلي لقائمة الروابط فقط،
   أضف كلاس is-scrollable إلى links-panel من HTML أو JS. */
.links-panel.is-scrollable {
  display: flex;
  flex-direction: column;
  height: 700px;
  overflow: hidden;
}

.links-panel.is-scrollable .links-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-inline-end: 8px;
}

.links-panel.is-scrollable .links-list::-webkit-scrollbar {
  width: 8px;
}

.links-panel.is-scrollable .links-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.links-panel.is-scrollable .links-list::-webkit-scrollbar-thumb {
  background: rgba(250, 204, 21, 0.45);
  border-radius: 999px;
}

.links-panel.is-scrollable .links-list::-webkit-scrollbar-thumb:hover {
  background: rgba(250, 204, 21, 0.72);
}

@media (max-width: 1240px) {
  .dash-sidebar,
  .preview-column {
    position: relative;
    top: auto;
  }
}

@media (max-width: 860px) {
  body.ntf-dashboard-page {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .dash-shell,
  .dash-layout,
  .editor-column,
  .links-panel,
  .links-list {
    height: auto;
    max-height: none;
    overflow: visible;
  }
}

/* =========================================================
   NTF Links Dashboard polish
   Buttons, dialog form, and gold text hierarchy.
   ========================================================= */

:root {
  --ntf-gold-soft: rgba(255, 209, 102, 0.14);
  --ntf-gold-line: rgba(255, 209, 102, 0.34);
  --ntf-gold-strong: #ffd166;
}

/* Make key headings and labels match the NTF gold identity */
.panel-kicker,
.panel-head h2,
.hero-copy h1,
.dash-help strong,
.links-toolbar span:first-child,
.empty-links strong,
.dialog-head h2,
.profile-form label,
.link-dialog-card label,
.save-state,
.status-pill {
  color: var(--accent);
}

.hero-copy p,
.panel-head p,
.link-card p,
.link-card small,
.links-toolbar,
.dash-help p,
.empty-links p,
.certificate-picker small {
  color: color-mix(in srgb, var(--accent) 45%, var(--muted));
}

/* Publish button and add-link button */
.primary-btn,
.primary-btn.compact,
#publishBtn,
#addLinkBtn,
#saveLinkBtn {
  position: relative;
  overflow: hidden;
  color: #07111f;
  border: 1px solid rgba(255, 209, 102, 0.42);
  background: linear-gradient(
    135deg,
    #ffd166 0%,
    #ffb703 46%,
    color-mix(in srgb, var(--accent-2) 38%, #ffb703) 100%
  );
  box-shadow:
    0 14px 34px rgba(255, 183, 3, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.primary-btn::before,
#publishBtn::before,
#addLinkBtn::before,
#saveLinkBtn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.38) 35%,
    transparent 68%
  );
  transform: translateX(110%);
  transition: transform 0.55s ease;
  pointer-events: none;
}

.primary-btn:hover:not(:disabled),
#publishBtn:hover:not(:disabled),
#addLinkBtn:hover:not(:disabled),
#saveLinkBtn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow:
    0 18px 44px rgba(255, 183, 3, 0.3),
    0 0 0 4px rgba(255, 209, 102, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.primary-btn:hover:not(:disabled)::before,
#publishBtn:hover:not(:disabled)::before,
#addLinkBtn:hover:not(:disabled)::before,
#saveLinkBtn:hover:not(:disabled)::before {
  transform: translateX(-110%);
}

.primary-btn:disabled,
#publishBtn:disabled {
  opacity: 0.48;
  filter: grayscale(0.25);
  box-shadow: none;
}

/* Secondary actions remain dark but gold-accented */
.ghost-btn,
.close-btn,
.icon-btn {
  color: var(--accent);
  border-color: var(--ntf-gold-line);
  background: rgba(255, 209, 102, 0.08);
}

.ghost-btn:hover,
.close-btn:hover,
.icon-btn:hover {
  color: #07111f;
  border-color: rgba(255, 209, 102, 0.7);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

/* Link cards with cleaner gold emphasis */
.link-card {
  border-color: rgba(255, 209, 102, 0.16);
  background: linear-gradient(
    135deg,
    rgba(255, 209, 102, 0.08),
    rgba(255, 255, 255, 0.045)
  );
}

.link-card:hover {
  border-color: rgba(255, 209, 102, 0.45);
  background:
    radial-gradient(
      circle at 12% 20%,
      rgba(255, 209, 102, 0.12),
      transparent 28%
    ),
    rgba(255, 255, 255, 0.075);
}

.link-card h3 {
  color: var(--accent);
}

/* Dialog / add link form */
.link-dialog-card {
  color: var(--text);
  border: 1px solid rgba(255, 209, 102, 0.22);
  background:
    radial-gradient(
      circle at 18% 0%,
      rgba(255, 209, 102, 0.12),
      transparent 32%
    ),
    linear-gradient(180deg, rgba(10, 24, 47, 0.98), rgba(5, 13, 28, 0.98));
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(255, 209, 102, 0.06) inset;
}

.dialog-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 209, 102, 0.16);
}

.link-dialog-card input,
.link-dialog-card textarea,
.link-dialog-card select,
.profile-form input,
.profile-form textarea {
  color: var(--text);
  border-color: rgba(255, 209, 102, 0.18);
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.045)
  );
}

.link-dialog-card input::placeholder,
.link-dialog-card textarea::placeholder,
.profile-form input::placeholder,
.profile-form textarea::placeholder {
  color: color-mix(in srgb, var(--accent) 35%, var(--muted));
}

.link-dialog-card input:focus,
.link-dialog-card textarea:focus,
.link-dialog-card select:focus,
.profile-form input:focus,
.profile-form textarea:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px rgba(255, 209, 102, 0.12),
    0 16px 34px rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.09);
}

/* Certificate picker and form spacing */
.certificate-picker {
  padding: 12px;
  border: 1px solid rgba(255, 209, 102, 0.18);
  border-radius: 18px;
  background: rgba(255, 209, 102, 0.055);
}

.dialog-actions {
  padding-top: 12px;
  border-top: 1px solid rgba(255, 209, 102, 0.12);
}

/* Better visible dashboard status */
.dash-alert {
  color: color-mix(in srgb, var(--accent) 52%, var(--muted));
  border-color: rgba(255, 209, 102, 0.16);
  background: linear-gradient(
    135deg,
    rgba(255, 209, 102, 0.07),
    rgba(255, 255, 255, 0.04)
  );
}

.dash-alert.is-ok {
  color: var(--accent);
  border-color: rgba(255, 209, 102, 0.28);
}

/* Mobile: keep buttons full-width when inherited from home styles */
@media (max-width: 680px) {
  .dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dialog-actions .primary-btn,
  .dialog-actions .ghost-btn,
  #addLinkBtn,
  #publishBtn {
    width: 100%;
  }
}

/* =========================================================
   NTF Gold Text Pass
   Makes dashboard visual language more golden while keeping
   inputs and long descriptions readable.
   ========================================================= */

.ntf-dashboard-page {
  --text: #ffd166;
  --muted: #d6b96a;
  --accent: #ffd166;
  --accent-2: #ffb703;
}

/* Main titles, labels and navigation should feel NTF-gold. */
.dash-hero h1,
.panel-head h2,
.link-card h3,
.public-preview h3,
.mini-profile strong,
.dash-help strong,
.empty-links strong,
.dialog-head h2,
.profile-form label,
.link-dialog-card label,
.links-toolbar span:first-child,
.save-state,
.status-pill,
.dash-nav a.is-active,
.dash-nav a:hover {
  color: var(--accent);
}

/* Secondary text uses a calmer gold instead of plain white/gray. */
.hero-copy p,
.panel-head p,
.dash-help p,
.links-toolbar,
.link-card p,
.link-card small,
.public-preview p,
.public-preview small,
.preview-link span,
.empty-links p,
.certificate-picker small,
.mini-profile span,
.dash-alert,
.back-link,
.dash-nav a {
  color: var(--muted);
}

/* Buttons: gold background with dark readable text. */
.primary-btn,
#publishBtn,
#addLinkBtn,
#saveLinkBtn {
  color: #07101f;
  background: linear-gradient(135deg, #ffd166, #ffb703);
  border: 1px solid rgba(255, 209, 102, 0.65);
  box-shadow: 0 18px 44px rgba(255, 183, 3, 0.25);
}

.primary-btn:hover:not(:disabled),
#publishBtn:hover:not(:disabled),
#addLinkBtn:hover,
#saveLinkBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 54px rgba(255, 183, 3, 0.34);
}

.ghost-btn,
.icon-btn,
.close-btn {
  color: var(--accent);
  border-color: rgba(255, 209, 102, 0.26);
  background: rgba(255, 209, 102, 0.08);
}

.ghost-btn:hover,
.icon-btn:hover,
.close-btn:hover {
  color: #07101f;
  background: linear-gradient(135deg, #ffd166, #ffb703);
  border-color: rgba(255, 209, 102, 0.7);
}

/* Form values remain readable, but with gold borders/labels. */
.profile-form input,
.profile-form textarea,
.link-dialog-card input,
.link-dialog-card textarea,
.link-dialog-card select {
  color: #fff7df;
  border-color: rgba(255, 209, 102, 0.24);
  background: rgba(255, 209, 102, 0.065);
}

.profile-form input::placeholder,
.profile-form textarea::placeholder,
.link-dialog-card input::placeholder,
.link-dialog-card textarea::placeholder {
  color: rgba(255, 209, 102, 0.52);
}

/* Cards and link items get stronger gold accents. */
.link-card,
.theme-section,
.mini-profile,
.preview-link,
.certificate-picker,
.link-dialog-card {
  border-color: rgba(255, 209, 102, 0.2);
}

.link-icon,
.preview-link i,
.mini-avatar,
.preview-avatar {
  color: #07101f;
  background: linear-gradient(135deg, #ffd166, #ffb703);
}

.panel-kicker,
.back-link:hover,
.dash-alert.is-ok,
.status-pill.is-published,
.status-pill.is-draft {
  color: var(--accent);
}

/* =========================================================
   NTF Links Analytics MVP
   ========================================================= */
.analytics-panel {
  display: grid;
  gap: 18px;
}

.analytics-head .ghost-btn,
.ghost-btn.compact {
  min-height: 40px;
  padding-inline: 16px;
  color: var(--gold, #ffd166);
  border-color: rgba(255, 209, 102, 0.32);
  background: rgba(255, 209, 102, 0.08);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.analytics-card,
.analytics-box {
  border: 1px solid rgba(255, 209, 102, 0.22);
  background:
    radial-gradient(
      circle at 20% 0%,
      rgba(255, 209, 102, 0.1),
      transparent 34%
    ),
    rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  padding: 16px;
}

.analytics-card span,
.analytics-box h3 {
  display: block;
  margin: 0 0 8px;
  color: var(--gold, #ffd166);
  font-weight: 1000;
}

.analytics-card strong {
  display: block;
  color: var(--gold, #ffd166);
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.1;
}

.analytics-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}

.analytics-sections {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
}

.analytics-list {
  display: grid;
  gap: 8px;
}

.analytics-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.analytics-row strong {
  color: var(--text);
  font-size: 14px;
}

.analytics-row span {
  color: var(--gold, #ffd166);
  font-weight: 1000;
  direction: ltr;
}

.analytics-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  direction: ltr;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.analytics-empty {
  color: var(--muted);
  line-height: 1.8;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed var(--border);
}

@media (max-width: 1100px) {
  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .analytics-sections {
    grid-template-columns: 1fr;
  }
}

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

/* Keep the whole dashboard scrollable; side columns remain sticky from base CSS. */
body.ntf-dashboard-page {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.dash-shell,
.dash-layout,
.editor-column,
.links-panel {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* =========================================================
   NTF Links System Content Sections
   نوع محتوى من النظام + عناصر داخل كل نوع
   ========================================================= */
.content-panel {
  border-color: rgba(255, 209, 102, 0.24);
}

.content-list {
  display: grid;
  gap: 16px;
}

.content-section-card {
  border: 1px solid rgba(255, 209, 102, 0.22);
  border-radius: 26px;
  padding: 16px;
  background:
    radial-gradient(
      circle at 12% 0%,
      rgba(255, 209, 102, 0.09),
      transparent 30%
    ),
    rgba(255, 255, 255, 0.055);
  display: grid;
  gap: 14px;
}

.content-section-card.is-disabled {
  opacity: 0.55;
}

.content-section-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.content-section-title-wrap {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.section-title-input {
  width: 100%;
  border: 1px solid rgba(255, 209, 102, 0.22);
  background: rgba(255, 209, 102, 0.06);
  color: var(--accent);
  border-radius: 16px;
  padding: 11px 12px;
  font: inherit;
  font-weight: 1000;
  outline: none;
}

.section-title-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.12);
}

.section-icon,
.content-item-icon,
.content-type-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #07101f;
  background: linear-gradient(135deg, #ffd166, #ffb703);
  font-weight: 1000;
}

.section-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.section-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section-add-item {
  min-height: 36px;
  padding-inline: 14px;
}

.content-section-items {
  display: grid;
  gap: 10px;
}

.content-item-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  border-radius: 20px;
  border: 1px solid rgba(255, 209, 102, 0.15);
  background: rgba(255, 255, 255, 0.055);
}

.content-item-card.is-disabled {
  opacity: 0.55;
}

.content-item-card h4 {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 15px;
}

.content-item-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.content-item-card small {
  display: block;
  margin-top: 4px;
  color: rgba(255, 209, 102, 0.68);
  direction: ltr;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 520px;
}

.content-section-empty {
  border: 1px dashed rgba(255, 209, 102, 0.22);
  color: var(--muted);
  border-radius: 18px;
  padding: 14px;
  text-align: center;
  line-height: 1.7;
}

.content-type-dialog-card {
  width: min(720px, calc(100vw - 32px));
}

.dialog-head p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.content-types-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.content-type-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  text-align: right;
  border: 1px solid rgba(255, 209, 102, 0.18);
  border-radius: 22px;
  background: rgba(255, 209, 102, 0.06);
  color: var(--text);
  padding: 14px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.content-type-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 209, 102, 0.45);
  background: rgba(255, 209, 102, 0.1);
}

.content-type-card.is-existing {
  border-color: rgba(34, 197, 94, 0.34);
}

.content-type-card strong {
  display: block;
  color: var(--accent);
  margin-bottom: 4px;
}

.content-type-card small {
  display: block;
  color: var(--muted);
  line-height: 1.55;
}

.project-dialog textarea {
  min-height: 100px;
  resize: vertical;
}

.public-section-preview-title {
  margin: 12px 2px 4px;
  color: var(--pv-accent);
  font-weight: 1000;
  font-size: 13px;
  text-align: right;
}

.preview-link.is-project {
  border-color: rgba(255, 209, 102, 0.24);
  background:
    radial-gradient(
      circle at 12% 20%,
      rgba(255, 209, 102, 0.1),
      transparent 30%
    ),
    rgba(255, 255, 255, 0.075);
}

@media (max-width: 860px) {
  .content-section-head,
  .content-item-card,
  .content-type-card {
    grid-template-columns: 1fr;
  }

  .section-actions {
    justify-content: flex-start;
  }

  .content-types-grid {
    grid-template-columns: 1fr;
  }
}

/* Fix content type dialog clipping */
.content-type-dialog,
#contentTypeDialog {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.content-type-dialog .link-dialog-card,
#contentTypeDialog .link-dialog-card,
.content-type-dialog-card {
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.content-type-grid,
.system-content-grid,
.content-types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  min-width: 0;
}

.content-type-card,
.system-content-card {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

@media (max-width: 520px) {
  .content-type-grid,
  .system-content-grid,
  .content-types-grid {
    grid-template-columns: 1fr;
  }
}

/* بطاقات أنواع المحتوى */
.content-type-card,
.system-content-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;

  min-height: 150px; /* بدل ارتفاع ثابت صغير */
  height: auto;

  padding: 18px;
  text-align: right;
}

/* الأيقونة */
.content-type-card .type-icon,
.system-content-card .type-icon {
  font-size: 28px;
  margin-bottom: 12px;
}

/* العنوان */
.content-type-card h3,
.system-content-card h3 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 17px;
  line-height: 1.3;
}

/* الوصف */
.content-type-card p,
.system-content-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;

  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

/* Profile avatar editor */
.avatar-editor {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.055);
}

.avatar-drop {
  position: relative;
  width: 104px;
  height: 104px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 32px;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.avatar-drop-preview,
.avatar-drop-img {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.avatar-drop-preview {
  color: #06111f;
  font-size: 34px;
  font-weight: 1000;
}

.avatar-drop-img {
  object-fit: cover;
}

.avatar-drop-badge {
  position: absolute;
  inset-inline-end: 8px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #06111f;
  font-weight: 1000;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
}

.avatar-editor-copy {
  display: grid;
  gap: 8px;
}

.avatar-editor-copy strong {
  color: var(--text);
  font-size: 16px;
}

.avatar-editor-copy span {
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}

.avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.ghost-btn.danger {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(127, 29, 29, 0.16);
}

.mini-avatar.has-image {
  background-size: cover;
  background-position: center;
  color: transparent;
}

@media (max-width: 620px) {
  .avatar-editor {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .avatar-actions {
    justify-content: center;
  }
}

.preview-avatar[hidden],
.preview-avatar-img[hidden],
.avatar-drop-preview[hidden],
.avatar-drop-img[hidden] {
  display: none !important;
}

/* ===== Specialized preview cards per content type ===== */
.preview-link.is-music {
  background:
    radial-gradient(circle at 12% 22%, rgba(139, 92, 246, .16), transparent 32%),
    rgba(255,255,255,.08);
}
.preview-link.is-music i { border-radius: 999px; }
.preview-link.is-videos {
  align-items: end;
  min-height: 92px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,.24)),
    rgba(255,255,255,.08);
}
.preview-link.is-videos i { width: 40px; height: 40px; border-radius: 999px; }
.preview-link.is-content {
  display: block;
  border-inline-start: 3px solid var(--pv-accent);
}
.preview-link.is-content i { display: none; }
.preview-link.is-tools {
  border-style: dashed;
}
.preview-link.is-social i { border-radius: 999px; }

/* ===== Preview card frame consistency + content-type forms ===== */
.public-section-preview-title + .preview-link,
.preview-links .preview-link {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 26px rgba(0, 0, 0, 0.16);
}

.preview-link.is-certificates,
.preview-link.is-certificate,
.preview-link.is-ntf-certificate {
  border: 1px solid rgba(255, 209, 102, 0.46) !important;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 209, 102, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 209, 102, 0.13), rgba(255, 255, 255, 0.07)) !important;
  outline: 1px solid rgba(255, 209, 102, 0.12);
}

.preview-link.is-certificates i,
.preview-link.is-certificate i,
.preview-link.is-ntf-certificate i {
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 10px 22px rgba(255, 209, 102, 0.16);
}

.preview-link.is-projects,
.preview-link.is-project,
.preview-link.is-ntf-project {
  border-color: rgba(96, 165, 250, 0.32);
}

.preview-link.is-music,
.preview-link.is-ntf-music {
  border-color: rgba(167, 139, 250, 0.32);
}

.preview-link.is-videos,
.preview-link.is-video {
  border-color: rgba(248, 113, 113, 0.32);
}

.preview-link.is-content,
.preview-link.is-ntf-content {
  border-color: rgba(52, 211, 153, 0.32);
}

.preview-link.is-tools,
.preview-link.is-ntf-tool {
  border-color: rgba(251, 191, 36, 0.34);
}

.preview-link.is-social {
  border-color: rgba(125, 211, 252, 0.3);
}

/* ===== Cover image editor + preview ===== */
.cover-editor {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 18px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.055);
}

.cover-drop {
  position: relative;
  min-height: 128px;
  border: 1px dashed color-mix(in srgb, var(--accent), transparent 45%);
  border-radius: 22px 22px 4px 4px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 15%, color-mix(in srgb, var(--accent-2), transparent 62%), transparent 35%),
    linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.045));
  color: var(--text);
  cursor: pointer;
}

.cover-drop-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.cover-drop-img {
  width: 100%;
  height: 100%;
  min-height: 128px;
  object-fit: cover;
  display: block;
}

.cover-drop-badge {
  position: absolute;
  inset-inline-end: 10px;
  bottom: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06111f;
  font-weight: 1000;
  box-shadow: 0 12px 26px rgba(0,0,0,.25);
}

.cover-editor-copy {
  display: grid;
  align-content: center;
  gap: 8px;
}

.cover-editor-copy strong { color: var(--text); }
.cover-editor-copy span { color: var(--muted); line-height: 1.7; }
.cover-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.public-preview {
  padding-top: 48px;
}

.preview-cover {
  margin: -48px -18px 0;
  height: 148px;
  border-radius: 38px 38px 0 0;
  overflow: hidden;
  border-bottom: 1px solid var(--pv-border);
  background:
    radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--pv-accent-2), transparent 55%), transparent 40%),
    linear-gradient(135deg, rgba(255,255,255,.13), rgba(255,255,255,.045));
}

.preview-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-profile-head {
  position: relative;
  padding-top: 0;
}

.public-preview.has-cover .preview-profile-head {
  padding-top: 0;
}

.public-preview.has-cover .preview-avatar,
.public-preview.has-cover .preview-avatar-img {
  margin-top: -46px;
  border: 4px solid color-mix(in srgb, var(--card), #050816 38%);
  box-shadow: 0 16px 32px rgba(0,0,0,.28);
}

@media (max-width: 720px) {
  .cover-editor {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Drag & drop ordering with soft motion
   ترتيب الأقسام والعناصر بالسحب مع حركة ناعمة
   ========================================================= */
.content-list,
.content-section-items {
  user-select: none;
}

.content-section-head {
  grid-template-columns: auto auto 1fr auto;
}

.content-item-card {
  grid-template-columns: auto auto 1fr auto;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    opacity 180ms ease;
}

.content-section-card {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    opacity 180ms ease;
}

.drag-handle {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 209, 102, 0.2);
  border-radius: 13px;
  display: inline-grid;
  place-items: center;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  color: rgba(255, 209, 102, 0.82);
  background: rgba(255, 209, 102, 0.07);
  font-weight: 1000;
  line-height: 1;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.drag-handle:hover,
.drag-handle:focus-visible {
  color: var(--accent);
  border-color: rgba(255, 209, 102, 0.52);
  background: rgba(255, 209, 102, 0.14);
  transform: translateY(-1px);
  outline: none;
}

.drag-handle:active {
  cursor: grabbing;
  transform: scale(0.96);
}

.content-section-card.is-dragging,
.content-item-card.is-dragging {
  opacity: 0.48;
  transform: scale(0.985);
  pointer-events: none;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.content-section-card.is-drop-target,
.content-item-card.is-drop-target {
  border-color: rgba(255, 209, 102, 0.6);
  background: rgba(255, 209, 102, 0.085);
}

.content-section-card.is-drop-before,
.content-item-card.is-drop-before,
.content-section-card.is-drop-after,
.content-item-card.is-drop-after {
  position: relative;
}

.content-section-card.is-drop-before::before,
.content-section-card.is-drop-after::after,
.content-item-card.is-drop-before::before,
.content-item-card.is-drop-after::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 18px rgba(255, 209, 102, 0.38);
  pointer-events: none;
}

.content-section-card.is-drop-before::before,
.content-item-card.is-drop-before::before {
  top: -9px;
}

.content-section-card.is-drop-after::after,
.content-item-card.is-drop-after::after {
  bottom: -9px;
}

.content-list.is-reordering .content-section-card,
.content-list.is-reordering .content-item-card {
  animation: ntf-reorder-pop 260ms ease both;
}

.ntf-links-is-dragging-content {
  cursor: grabbing;
  -webkit-user-select: none;
  user-select: none;
}

.content-list.is-pointer-reordering {
  cursor: grabbing;
}

@keyframes ntf-reorder-pop {
  0% {
    transform: translateY(7px) scale(0.99);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 700px) {
  .content-section-head {
    grid-template-columns: auto auto 1fr;
  }

  .content-section-head .section-actions {
    grid-column: 1 / -1;
  }

  .content-item-card {
    grid-template-columns: auto auto 1fr;
  }

  .content-item-card .section-actions {
    grid-column: 1 / -1;
  }
}

/* =========================================================
   Deep public preview themes
   يجعل الثيمات ظاهرة في معاينة الجوال، وليس مجرد تغيير لون.
   ========================================================= */
.ntf-dashboard-page {
  --preview-bg: radial-gradient(circle at 18% 0%, rgba(139,92,246,.28), transparent 32%), linear-gradient(180deg, #050816 0%, #0a1024 48%, #03050d 100%);
  --preview-card-bg: linear-gradient(135deg, rgba(255,255,255,.095), rgba(255,255,255,.045));
  --preview-panel-bg: linear-gradient(180deg, rgba(12,18,42,.9), rgba(255,255,255,.045));
  --preview-cover-overlay: radial-gradient(circle at 20% 18%, rgba(250,204,21,.22), transparent 38%), linear-gradient(135deg, rgba(139,92,246,.24), rgba(0,0,0,.2));
  --preview-avatar-ring: color-mix(in srgb, var(--pv-card, rgba(9,14,33,.88)), #050816 36%);
  --preview-item-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 14px 28px rgba(0,0,0,.16);
}

.ntf-dashboard-page[data-theme="galaxy"] {
  --pv-text: #f8fafc;
  --pv-muted: #a8b3c7;
  --pv-accent: #facc15;
  --pv-accent-2: #8b5cf6;
  --pv-glow: rgba(139,92,246,.30);
  --pv-border: rgba(255,255,255,.15);
  --pv-card: rgba(9,14,33,.88);
  --preview-bg: radial-gradient(circle at 18% 0%, rgba(139,92,246,.28), transparent 32%), radial-gradient(circle at 88% 8%, rgba(250,204,21,.18), transparent 26%), linear-gradient(180deg, #050816 0%, #0a1024 48%, #03050d 100%);
  --preview-card-bg: linear-gradient(135deg, rgba(255,255,255,.095), rgba(255,255,255,.045));
  --preview-panel-bg: linear-gradient(180deg, rgba(12,18,42,.9), rgba(255,255,255,.045));
  --preview-cover-overlay: radial-gradient(circle at 20% 18%, rgba(250,204,21,.22), transparent 38%), linear-gradient(135deg, rgba(139,92,246,.24), rgba(0,0,0,.2));
}

.ntf-dashboard-page[data-theme="ocean"] {
  --pv-text: #f0f9ff;
  --pv-muted: #b8d5e8;
  --pv-accent: #22d3ee;
  --pv-accent-2: #0ea5e9;
  --pv-glow: rgba(34,211,238,.27);
  --pv-border: rgba(125,211,252,.24);
  --pv-card: rgba(4,30,49,.9);
  --preview-bg: radial-gradient(circle at 12% 8%, rgba(34,211,238,.26), transparent 30%), radial-gradient(circle at 92% 12%, rgba(14,165,233,.22), transparent 28%), linear-gradient(180deg, #031826 0%, #05263b 48%, #020b13 100%);
  --preview-card-bg: linear-gradient(135deg, rgba(14,165,233,.14), rgba(255,255,255,.045));
  --preview-panel-bg: linear-gradient(180deg, rgba(4,36,58,.92), rgba(14,165,233,.06));
  --preview-cover-overlay: radial-gradient(circle at 24% 18%, rgba(34,211,238,.32), transparent 36%), linear-gradient(135deg, rgba(14,165,233,.23), rgba(0,0,0,.18));
  --preview-avatar-ring: #041f31;
}

.ntf-dashboard-page[data-theme="forest"] {
  --pv-text: #f0fdf4;
  --pv-muted: #b6cdbc;
  --pv-accent: #86efac;
  --pv-accent-2: #22c55e;
  --pv-glow: rgba(34,197,94,.25);
  --pv-border: rgba(134,239,172,.24);
  --pv-card: rgba(4,28,17,.9);
  --preview-bg: radial-gradient(circle at 15% 5%, rgba(34,197,94,.24), transparent 30%), radial-gradient(circle at 90% 12%, rgba(134,239,172,.14), transparent 26%), linear-gradient(180deg, #04140d 0%, #082417 50%, #020b07 100%);
  --preview-card-bg: linear-gradient(135deg, rgba(34,197,94,.13), rgba(255,255,255,.04));
  --preview-panel-bg: linear-gradient(180deg, rgba(4,30,18,.92), rgba(34,197,94,.055));
  --preview-cover-overlay: radial-gradient(circle at 22% 18%, rgba(134,239,172,.26), transparent 38%), linear-gradient(135deg, rgba(34,197,94,.2), rgba(0,0,0,.2));
  --preview-avatar-ring: #052414;
}

.ntf-dashboard-page[data-theme="sunset"] {
  --pv-text: #fff7ed;
  --pv-muted: #f3c7aa;
  --pv-accent: #fb923c;
  --pv-accent-2: #f43f5e;
  --pv-glow: rgba(251,146,60,.25);
  --pv-border: rgba(253,186,116,.24);
  --pv-card: rgba(49,17,25,.92);
  --preview-bg: radial-gradient(circle at 14% 6%, rgba(244,63,94,.24), transparent 30%), radial-gradient(circle at 88% 12%, rgba(251,146,60,.23), transparent 28%), linear-gradient(180deg, #1f0b12 0%, #36111d 48%, #0e0509 100%);
  --preview-card-bg: linear-gradient(135deg, rgba(251,146,60,.14), rgba(255,255,255,.04));
  --preview-panel-bg: linear-gradient(180deg, rgba(56,19,29,.93), rgba(251,146,60,.055));
  --preview-cover-overlay: radial-gradient(circle at 22% 18%, rgba(251,146,60,.3), transparent 38%), linear-gradient(135deg, rgba(244,63,94,.22), rgba(0,0,0,.2));
  --preview-avatar-ring: #2f0f18;
}

.public-preview {
  background: var(--preview-bg);
  border-color: var(--pv-border);
  box-shadow: 0 30px 90px rgba(0,0,0,.38), 0 0 0 1px color-mix(in srgb, var(--pv-accent), transparent 82%);
}

.preview-cover {
  position: relative;
  background: var(--preview-cover-overlay), linear-gradient(135deg, color-mix(in srgb, var(--pv-accent-2), transparent 72%), color-mix(in srgb, var(--pv-accent), transparent 86%));
}

.preview-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: var(--preview-cover-overlay);
  mix-blend-mode: screen;
  opacity: .7;
}

.preview-cover img {
  position: relative;
  z-index: 0;
}

.preview-link,
.public-section-preview-title + .preview-link,
.preview-links .preview-link,
.preview-link.is-projects,
.preview-link.is-project,
.preview-link.is-ntf-project,
.preview-link.is-certificates,
.preview-link.is-certificate,
.preview-link.is-ntf-certificate,
.preview-link.is-music,
.preview-link.is-ntf-music,
.preview-link.is-videos,
.preview-link.is-video,
.preview-link.is-content,
.preview-link.is-ntf-content,
.preview-link.is-tools,
.preview-link.is-ntf-tool,
.preview-link.is-social {
  background: var(--preview-card-bg);
  box-shadow: var(--preview-item-shadow);
  border-color: var(--pv-border);
}

.public-preview.has-cover .preview-avatar,
.public-preview.has-cover .preview-avatar-img,
.preview-avatar,
.preview-avatar-img {
  border-color: var(--preview-avatar-ring);
  box-shadow: 0 16px 32px rgba(0,0,0,.28), 0 0 0 1px color-mix(in srgb, var(--pv-accent), transparent 70%);
}

.ntf-dashboard-page[data-theme="forest"] .preview-link {
  border-radius: 20px;
}

.ntf-dashboard-page[data-theme="sunset"] .public-preview {
  box-shadow: 0 30px 80px rgba(244,63,94,.12), 0 30px 90px rgba(0,0,0,.38);
}


/* Fix preview cover/avatar stacking: keep avatar above the cover overlay */
.public-preview.has-cover {
  overflow-x: hidden;
  overflow-y: auto;
}

.preview-cover {
  position: relative;
  z-index: 1;
}

.preview-cover::after {
  z-index: 2;
}

.preview-cover img {
  position: relative;
  z-index: 1;
}

.preview-profile-head {
  position: relative;
  z-index: 5;
}

.public-preview.has-cover .preview-avatar,
.public-preview.has-cover .preview-avatar-img {
  position: relative;
  z-index: 10;
}


/* Extra theme personalities: deeper than accent-only. */
.theme-picker button[data-theme="galaxy"] i { background: linear-gradient(90deg, #facc15, #8b5cf6); }
.theme-picker button[data-theme="ocean"] i { background: linear-gradient(90deg, #22d3ee, #0ea5e9); }
.theme-picker button[data-theme="forest"] i { background: linear-gradient(90deg, #86efac, #22c55e); }
.theme-picker button[data-theme="sunset"] i { background: linear-gradient(90deg, #fb923c, #f43f5e); }
.theme-picker button[data-theme="cyberpunk"] i { background: linear-gradient(90deg, #22d3ee, #ff2bd6); }
.theme-picker button[data-theme="aurora"] i { background: linear-gradient(90deg, #a78bfa, #34d399); }
.theme-picker button[data-theme="minimal"] i { background: linear-gradient(90deg, #f8fafc, #94a3b8); }
.theme-picker button[data-theme="crimson"] i { background: linear-gradient(90deg, #fb7185, #ef4444); }

.ntf-dashboard-page[data-theme="cyberpunk"] {
  --pv-text: #ecfeff;
  --pv-muted: #a5f3fc;
  --pv-accent: #22d3ee;
  --pv-accent-2: #ff2bd6;
  --pv-glow: rgba(255, 43, 214, .28);
  --pv-border: rgba(34, 211, 238, .32);
  --pv-card: rgba(4, 11, 30, .92);
  --preview-bg: linear-gradient(rgba(34,211,238,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,43,214,.045) 1px, transparent 1px), radial-gradient(circle at 16% 0%, rgba(255,43,214,.32), transparent 30%), radial-gradient(circle at 86% 10%, rgba(34,211,238,.30), transparent 28%), linear-gradient(180deg, #030614 0%, #09112f 52%, #02030a 100%);
  --preview-card-bg: linear-gradient(135deg, rgba(34,211,238,.13), rgba(255,43,214,.075));
  --preview-panel-bg: linear-gradient(180deg, rgba(5, 12, 34, .94), rgba(255,43,214,.055));
  --preview-cover-overlay: radial-gradient(circle at 22% 18%, rgba(255,43,214,.34), transparent 38%), linear-gradient(135deg, rgba(34,211,238,.24), rgba(0,0,0,.18));
  --preview-avatar-ring: #03111f;
  --preview-item-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 0 20px rgba(34,211,238,.14), 0 14px 28px rgba(0,0,0,.18);
}

.ntf-dashboard-page[data-theme="aurora"] {
  --pv-text: #f5f3ff;
  --pv-muted: #d8b4fe;
  --pv-accent: #a78bfa;
  --pv-accent-2: #34d399;
  --pv-glow: rgba(167,139,250,.28);
  --pv-border: rgba(216,180,254,.26);
  --pv-card: rgba(25, 16, 48, .9);
  --preview-bg: radial-gradient(circle at 18% 0%, rgba(167,139,250,.34), transparent 32%), radial-gradient(circle at 88% 10%, rgba(52,211,153,.22), transparent 28%), linear-gradient(180deg, #120a25 0%, #20113d 52%, #07140f 100%);
  --preview-card-bg: linear-gradient(135deg, rgba(167,139,250,.14), rgba(52,211,153,.07));
  --preview-panel-bg: linear-gradient(180deg, rgba(29, 18, 55, .92), rgba(52,211,153,.055));
  --preview-cover-overlay: radial-gradient(circle at 24% 18%, rgba(52,211,153,.24), transparent 36%), linear-gradient(135deg, rgba(167,139,250,.27), rgba(0,0,0,.16));
  --preview-avatar-ring: #1b1135;
}

.ntf-dashboard-page[data-theme="minimal"] {
  --pv-text: #0f172a;
  --pv-muted: #64748b;
  --pv-accent: #334155;
  --pv-accent-2: #94a3b8;
  --pv-glow: rgba(15, 23, 42, .10);
  --pv-border: rgba(15, 23, 42, .14);
  --pv-card: rgba(255,255,255,.92);
  --preview-bg: linear-gradient(180deg, #f8fafc 0%, #eef2f7 56%, #e2e8f0 100%);
  --preview-card-bg: rgba(255,255,255,.86);
  --preview-panel-bg: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.82));
  --preview-cover-overlay: linear-gradient(135deg, rgba(148,163,184,.26), rgba(255,255,255,.12));
  --preview-avatar-ring: #f8fafc;
  --preview-item-shadow: 0 10px 24px rgba(15,23,42,.08);
}

.ntf-dashboard-page[data-theme="crimson"] {
  --pv-text: #fff1f2;
  --pv-muted: #fecdd3;
  --pv-accent: #fb7185;
  --pv-accent-2: #ef4444;
  --pv-glow: rgba(239,68,68,.28);
  --pv-border: rgba(251,113,133,.28);
  --pv-card: rgba(42, 8, 16, .92);
  --preview-bg: radial-gradient(circle at 18% 4%, rgba(239,68,68,.30), transparent 30%), radial-gradient(circle at 84% 12%, rgba(251,113,133,.22), transparent 26%), linear-gradient(180deg, #19050a 0%, #310a13 50%, #080204 100%);
  --preview-card-bg: linear-gradient(135deg, rgba(251,113,133,.14), rgba(255,255,255,.035));
  --preview-panel-bg: linear-gradient(180deg, rgba(49, 10, 19, .94), rgba(239,68,68,.055));
  --preview-cover-overlay: radial-gradient(circle at 22% 18%, rgba(251,113,133,.32), transparent 38%), linear-gradient(135deg, rgba(239,68,68,.22), rgba(0,0,0,.22));
  --preview-avatar-ring: #260710;
}

.ntf-dashboard-page[data-theme="cyberpunk"] .preview-link {
  border-color: color-mix(in srgb, var(--pv-accent), transparent 58%);
  box-shadow: 0 0 0 1px rgba(255,43,214,.08), 0 0 22px rgba(34,211,238,.10), var(--preview-item-shadow);
}

.ntf-dashboard-page[data-theme="minimal"] .public-preview,
.ntf-dashboard-page[data-theme="minimal"] .preview-link {
  color: #0f172a;
}

.ntf-dashboard-page[data-theme="minimal"] .preview-username,
.ntf-dashboard-page[data-theme="minimal"] .preview-bio,
.ntf-dashboard-page[data-theme="minimal"] .preview-link span {
  color: #64748b;
}

@media (max-width: 760px) {
  .theme-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* NTF References */
.ntf-reference-picker {
  border: 1px solid rgba(255, 209, 102, 0.18);
  background: rgba(255, 209, 102, 0.055);
  border-radius: 16px;
  padding: 12px;
}

.ntf-reference-picker small {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.7;
}

.link-dialog-card input[readonly] {
  opacity: 0.78;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.045);
}

.preview-ntf-badge {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 209, 102, 0.32);
  background: rgba(255, 209, 102, 0.12);
  color: #ffd166;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.content-item-card small::before {
  content: "";
}

.preview-ntf-badge {
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
}

.preview-ntf-badge::after {
  content: "↗";
  margin-inline-start: 5px;
  font-size: 9px;
  opacity: 0.8;
}


/* Preview NTF source attribution */
.preview-ntf-badge {
  display: inline-flex !important;
  width: fit-content;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 209, 102, 0.36);
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.10);
  color: var(--accent, #ffd166);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}
.preview-ntf-badge::before { content: "◆"; font-size: 8px; }
.preview-ntf-badge.is-ntf-tool::before { content: "⚙"; }
.preview-ntf-badge.is-ntf-music::before { content: "♪"; }
.preview-ntf-badge.is-ntf-academy::before,
.preview-ntf-badge.is-ntf-certificate::before { content: "🎓"; }

/* Preview NTF attribution badge spacing fix */
.preview-ntf-badge {
  margin-top: 8px !important;
  margin-bottom: 10px !important;
  align-self: flex-start;
}

.preview-ntf-badge + h4,
.preview-ntf-badge + p,
.preview-ntf-badge + strong,
.preview-ntf-badge + span {
  margin-top: 0 !important;
}

.content-item-card .preview-ntf-badge {
  display: inline-flex !important;
}

/* =========================================================
   NTF Links Section Layout Picker + Preview Layouts
   ========================================================= */
.section-layout-control {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  max-width: 310px;
}

.section-layout-control span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.section-layout-control select {
  width: 100%;
  min-height: 38px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent), transparent 72%);
  background: rgba(255, 255, 255, .075);
  color: var(--text);
  padding: 0 12px;
  font-weight: 900;
  outline: none;
}

.section-layout-control small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.preview-section-group {
  display: grid;
  gap: 10px;
}

.preview-section-group + .preview-section-group {
  margin-top: 14px;
}

.preview-section-items {
  display: grid;
  gap: 10px;
}

.preview-section-group[data-layout="icon-grid"] .preview-section-items,
.preview-section-group[data-layout="grid"] .preview-section-items,
.preview-section-group[data-layout="album-grid"] .preview-section-items,
.preview-section-group[data-layout="badges"] .preview-section-items {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-section-group[data-layout="icon-grid"] .preview-link,
.preview-section-group[data-layout="badges"] .preview-link {
  min-height: 92px;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  padding: 12px 8px;
}

.preview-section-group[data-layout="icon-grid"] .preview-link i,
.preview-section-group[data-layout="badges"] .preview-link i {
  width: 42px;
  height: 42px;
  border-radius: 999px;
}

.preview-section-group[data-layout="icon-grid"] .preview-link span,
.preview-section-group[data-layout="badges"] .preview-link span,
.preview-section-group[data-layout="icon-grid"] .preview-ntf-badge,
.preview-section-group[data-layout="badges"] .preview-ntf-badge {
  display: none;
}

.preview-section-group[data-layout="minimal"] .preview-link,
.preview-section-group[data-layout="compact"] .preview-link {
  border-radius: 14px;
  background: transparent;
  padding-block: 9px;
}

.preview-section-group[data-layout="minimal"] .preview-link i,
.preview-section-group[data-layout="compact"] .preview-link i {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  font-size: 12px;
}

.preview-section-group[data-layout="showcase"] .preview-link:first-of-type,
.preview-section-group[data-layout="featured"] .preview-link:first-of-type,
.preview-section-group[data-layout="magazine"] .preview-link:first-of-type {
  min-height: 118px;
  align-items: end;
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--pv-accent), transparent 72%), transparent 46%),
    linear-gradient(135deg, rgba(255,255,255,.14), rgba(255,255,255,.055));
}

.preview-section-group[data-layout="timeline"] .preview-section-items {
  position: relative;
  padding-inline-start: 14px;
}

.preview-section-group[data-layout="timeline"] .preview-section-items::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  inset-inline-start: 2px;
  width: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pv-accent), transparent 62%);
}

.preview-section-group[data-layout="timeline"] .preview-link {
  position: relative;
}

.preview-section-group[data-layout="timeline"] .preview-link::before {
  content: "";
  position: absolute;
  inset-inline-start: -20px;
  top: 22px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--pv-accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--pv-accent), transparent 78%);
}

/* =========================================================
   NTF Links dashboard preview: real section layout language
   ========================================================= */
.public-section-preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.public-section-preview-title em {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 9px;
  font-weight: 900;
  color: var(--accent, #ffd166);
  border: 1px solid rgba(255, 209, 102, .32);
  background: rgba(255, 209, 102, .1);
  padding: 3px 7px;
  border-radius: 999px;
}

.preview-section-group[data-layout="grid"] .preview-section-items,
.preview-section-group[data-layout="album-grid"] .preview-section-items {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.preview-section-group[data-layout="grid"] .preview-link,
.preview-section-group[data-layout="album-grid"] .preview-link {
  grid-template-columns: 1fr;
  min-height: 142px;
  align-content: start;
  padding: 10px;
}

.preview-section-group[data-layout="grid"] .preview-link i,
.preview-section-group[data-layout="album-grid"] .preview-link i {
  width: 100%;
  height: 54px;
  border-radius: 14px;
}

.preview-section-group[data-layout="icon-grid"] .preview-section-items,
.preview-section-group[data-layout="badges"] .preview-section-items {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preview-section-group[data-layout="icon-grid"] .preview-link,
.preview-section-group[data-layout="badges"] .preview-link {
  aspect-ratio: 1 / 1;
  min-height: unset;
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  padding: 9px 7px;
}

.preview-section-group[data-layout="icon-grid"] .preview-link i,
.preview-section-group[data-layout="badges"] .preview-link i {
  width: 34px;
  height: 34px;
  margin: 0 auto;
}

.preview-section-group[data-layout="icon-grid"] .preview-link span,
.preview-section-group[data-layout="badges"] .preview-link span,
.preview-section-group[data-layout="icon-grid"] .preview-ntf-badge,
.preview-section-group[data-layout="badges"] .preview-ntf-badge {
  display: none;
}

.preview-section-group[data-layout="minimal"] .preview-link,
.preview-section-group[data-layout="compact"] .preview-link,
.preview-section-group[data-layout="list"] .preview-link {
  border-inline: 0;
  border-top: 0;
  border-radius: 0;
  background: transparent;
  padding: 9px 2px;
}

.preview-section-group[data-layout="showcase"] .preview-link:first-of-type,
.preview-section-group[data-layout="featured"] .preview-link:first-of-type,
.preview-section-group[data-layout="magazine"] .preview-link:first-of-type {
  min-height: 158px;
  grid-template-columns: 1fr;
  align-content: end;
  border-radius: 24px;
  background:
    linear-gradient(180deg, transparent, rgba(0,0,0,.42)),
    radial-gradient(circle at 15% 0%, rgba(255,209,102,.26), transparent 52%),
    radial-gradient(circle at 100% 25%, rgba(96,165,250,.22), transparent 48%),
    rgba(255,255,255,.08);
}

.preview-section-group[data-layout="showcase"] .preview-link:first-of-type i,
.preview-section-group[data-layout="featured"] .preview-link:first-of-type i,
.preview-section-group[data-layout="magazine"] .preview-link:first-of-type i {
  width: 58px;
  height: 58px;
  border-radius: 19px;
}

.preview-section-group[data-layout="timeline"] .preview-section-items {
  position: relative;
  padding-inline-start: 20px;
}

.preview-section-group[data-layout="timeline"] .preview-section-items::before {
  content: "";
  position: absolute;
  inset-inline-start: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent, #ffd166), rgba(255, 209, 102, .18));
}

.preview-section-group[data-layout="timeline"] .preview-link {
  position: relative;
}

.preview-section-group[data-layout="timeline"] .preview-link::before {
  content: "";
  position: absolute;
  inset-inline-start: -22px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent, #ffd166);
  box-shadow: 0 0 0 4px rgba(255, 209, 102, .17);
}

.preview-section-group[data-section-type="music"][data-layout="playlist"] .preview-link::after {
  content: "";
  grid-column: 2 / 3;
  width: 58%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent, #ffd166), rgba(255,255,255,.1));
  opacity: .55;
}

/* ===== Preview Layout Engine hardening: keep mini phone cards inside container ===== */
.preview-section-group,
.preview-section-items,
.preview-section-items > *,
.preview-link,
.preview-link > div {
  min-width: 0;
  box-sizing: border-box;
}

.preview-link {
  max-width: 100%;
  overflow: hidden;
}

.preview-link strong,
.preview-link span,
.preview-ntf-badge {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.preview-section-group[data-layout="grid"] .preview-section-items,
.preview-section-group[data-layout="album-grid"] .preview-section-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.preview-section-group[data-layout="grid"] .preview-link,
.preview-section-group[data-layout="album-grid"] .preview-link {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  min-height: 138px;
  padding: 9px;
  border-radius: 18px;
}

.preview-section-group[data-layout="grid"] .preview-link i,
.preview-section-group[data-layout="album-grid"] .preview-link i {
  width: 100%;
  height: 52px;
  border-radius: 14px;
}

.preview-section-group[data-layout="grid"] .preview-link strong,
.preview-section-group[data-layout="album-grid"] .preview-link strong {
  font-size: 12px;
  line-height: 1.35;
}

.preview-section-group[data-layout="grid"] .preview-link span,
.preview-section-group[data-layout="album-grid"] .preview-link span {
  font-size: 10px;
  line-height: 1.45;
}

.preview-section-group[data-layout="icon-grid"] .preview-section-items,
.preview-section-group[data-layout="badges"] .preview-section-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.preview-section-group[data-layout="icon-grid"] .preview-link,
.preview-section-group[data-layout="badges"] .preview-link {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  text-align: center;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 7px;
  border-radius: 18px;
}

.preview-section-group[data-layout="icon-grid"] .preview-link i,
.preview-section-group[data-layout="badges"] .preview-link i {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 12px;
}

.preview-section-group[data-layout="icon-grid"] .preview-link span,
.preview-section-group[data-layout="badges"] .preview-link span,
.preview-section-group[data-layout="icon-grid"] .preview-ntf-badge,
.preview-section-group[data-layout="badges"] .preview-ntf-badge {
  display: none !important;
}

.preview-section-group[data-layout="minimal"] .preview-link,
.preview-section-group[data-layout="compact"] .preview-link,
.preview-section-group[data-layout="list"] .preview-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  border-inline: 0;
  border-top: 0;
  border-radius: 0;
  background: transparent;
  padding: 8px 2px;
}

.preview-section-group[data-layout="showcase"] .preview-link:first-of-type,
.preview-section-group[data-layout="featured"] .preview-link:first-of-type,
.preview-section-group[data-layout="magazine"] .preview-link:first-of-type {
  display: grid;
  grid-template-columns: 1fr;
  align-content: end;
  min-height: 150px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, transparent, rgba(0,0,0,.42)),
    radial-gradient(circle at 15% 0%, rgba(255,209,102,.26), transparent 52%),
    radial-gradient(circle at 100% 25%, rgba(96,165,250,.22), transparent 48%),
    rgba(255,255,255,.08);
}

.preview-section-group[data-layout="showcase"] .preview-link:first-of-type i,
.preview-section-group[data-layout="featured"] .preview-link:first-of-type i,
.preview-section-group[data-layout="magazine"] .preview-link:first-of-type i {
  width: 56px;
  height: 56px;
  border-radius: 18px;
}

.preview-section-group[data-layout="timeline"] .preview-section-items {
  position: relative;
  padding-inline-start: 20px;
}

.preview-section-group[data-layout="timeline"] .preview-section-items::before {
  content: "";
  position: absolute;
  inset-inline-start: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent, #ffd166), rgba(255, 209, 102, .18));
}

.preview-section-group[data-layout="timeline"] .preview-link {
  position: relative;
}

.preview-section-group[data-layout="timeline"] .preview-link::before {
  content: "";
  position: absolute;
  inset-inline-start: -22px;
  top: 22px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent, #ffd166);
  box-shadow: 0 0 0 4px rgba(255, 209, 102, .17);
}

/* Link images in editor preview */
.preview-link-media {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.preview-link-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.preview-link.has-image > div {
  min-width: 0;
}

.preview-section-group[data-section-type="links"][data-layout="icon-grid"] .preview-link.has-image {
  position: relative;
  min-height: 106px;
  padding: 0;
  overflow: hidden;
  border-radius: 18px;
}

.preview-section-group[data-section-type="links"][data-layout="icon-grid"] .preview-link.has-image .preview-link-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: inherit;
}

.preview-section-group[data-section-type="links"][data-layout="icon-grid"] .preview-link.has-image .preview-link-media::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 62%;
  background: linear-gradient(to top, rgba(2, 8, 20, 0.86), transparent);
}

.preview-section-group[data-section-type="links"][data-layout="icon-grid"] .preview-link.has-image > div {
  position: absolute;
  inset: auto 8px 8px 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-section-group[data-section-type="links"][data-layout="icon-grid"] .preview-link.has-image strong {
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(7, 20, 39, 0.78);
  border: 1px solid rgba(255, 209, 102, 0.26);
  color: #fff;
  font-size: 11px;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  backdrop-filter: blur(8px);
}

.preview-section-group[data-section-type="links"][data-layout="icon-grid"] .preview-link.has-image span,
.preview-section-group[data-section-type="links"][data-layout="icon-grid"] .preview-link.has-image .preview-ntf-badge {
  display: none !important;
}


/* NTF Links fix: preview project showcase applies to every project card, and project images fill safely. */
.preview-section-group[data-section-type="projects"] .preview-link.has-image .preview-link-media img,
.preview-section-group[data-section-type="projects"] .preview-link.has-image i img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-section-group[data-section-type="projects"][data-layout="showcase"] .preview-section-items {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.preview-section-group[data-section-type="projects"][data-layout="showcase"] .preview-link {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  align-content: end;
  min-height: 150px;
  border-radius: 24px;
  padding: 14px;
  background:
    linear-gradient(180deg, transparent 0%, rgba(0,0,0,.42) 62%, rgba(0,0,0,.68) 100%),
    radial-gradient(circle at 15% 0%, rgba(255,209,102,.26), transparent 52%),
    radial-gradient(circle at 100% 25%, rgba(96,165,250,.22), transparent 48%),
    rgba(255,255,255,.08);
}

.preview-section-group[data-section-type="projects"][data-layout="showcase"] .preview-link i,
.preview-section-group[data-section-type="projects"][data-layout="showcase"] .preview-link .preview-link-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  opacity: .34;
  z-index: 0;
}

.preview-section-group[data-section-type="projects"][data-layout="showcase"] .preview-link > div {
  position: relative;
  z-index: 1;
}

/* ===== Item image uploader (links/projects/external content) ===== */
.item-image-field {
  display: grid;
  gap: 10px;
}

.item-image-field.is-hidden {
  display: none !important;
}

.item-image-drop {
  position: relative;
  width: 100%;
  min-height: 150px;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: pointer;
  color: var(--muted);
  border: 1px dashed color-mix(in srgb, var(--accent), transparent 42%);
  border-radius: 22px;
  background:
    radial-gradient(circle at 22% 18%, color-mix(in srgb, var(--accent), transparent 72%), transparent 36%),
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,.035));
}

.item-image-drop:hover {
  border-color: color-mix(in srgb, var(--accent), white 18%);
  background:
    radial-gradient(circle at 22% 18%, color-mix(in srgb, var(--accent), transparent 62%), transparent 36%),
    linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.05));
}

.item-image-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.item-image-placeholder {
  position: relative;
  z-index: 1;
  max-width: 240px;
  text-align: center;
  line-height: 1.7;
  font-weight: 900;
}

.item-image-drop b {
  position: absolute;
  inset-inline-end: 12px;
  bottom: 12px;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06111f;
  font-size: 16px;
  box-shadow: 0 14px 28px rgba(0,0,0,.28);
}

.item-image-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.item-image-preview[hidden],
.item-image-placeholder[hidden] {
  display: none !important;
}

/* =========================================================
   Safe dashboard section collapse
   طي آمن للأقسام بدون إعادة تحميل بيانات المستخدم
   ========================================================= */
.content-section-head {
  grid-template-columns: auto auto auto 1fr auto;
}

.section-collapse-btn {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 209, 102, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
  cursor: pointer;
  font-size: 18px;
  font-weight: 1000;
  transition:
    transform 220ms ease,
    background 220ms ease,
    border-color 220ms ease;
}

.section-collapse-btn:hover {
  background: rgba(255, 209, 102, 0.12);
  border-color: rgba(255, 209, 102, 0.42);
}

.content-section-card.is-collapsed .section-collapse-btn {
  transform: rotate(14deg);
}

.content-section-body {
  display: grid;
  grid-template-rows: 1fr;
  transition:
    grid-template-rows 260ms ease,
    opacity 220ms ease,
    transform 260ms ease;
  opacity: 1;
  transform: translateY(0);
}

.content-section-body-inner {
  min-height: 0;
  overflow: hidden;
}

.content-section-card.is-collapsed .content-section-body {
  grid-template-rows: 0fr;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.content-section-card.is-collapsed {
  gap: 0;
}

.content-section-card.is-collapsed .content-section-head {
  margin-bottom: 0;
}

@media (max-width: 720px) {
  .content-section-head {
    grid-template-columns: auto auto auto 1fr;
  }

  .content-section-head .section-actions {
    grid-column: 1 / -1;
  }
}


.music-source-fields {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 209, 102, 0.18);
  border-radius: 18px;
  background: rgba(255, 209, 102, 0.06);
}

.music-source-fields.is-hidden,
.music-audio-field.is-hidden,
#musicPlatformWrap.is-hidden {
  display: none !important;
}

.music-source-fields small {
  display: block;
  margin-top: 8px;
  color: rgba(225, 235, 255, 0.66);
  line-height: 1.6;
}

.music-audio-drop {
  min-height: 74px;
  font-weight: 900;
}

#musicAudioMeta.is-ok { color: #8df0b0; }
#musicAudioMeta.is-error { color: #ff8f8f; }


/* NTF Links Notes editor */
.note-fields {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(250, 204, 21, .18);
  border-radius: 22px;
  background: rgba(250, 204, 21, .055);
}
.note-fields textarea {
  width: 100%;
  resize: vertical;
  min-height: 150px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 18px;
  padding: 14px 16px;
  color: #1f2937;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0) 0 29px, rgba(17,24,39,.12) 30px),
    #fff7d6;
  line-height: 30px;
  font-family: "Aref Ruqaa Ink", "Aref Ruqaa", "Marhey", "Lateef", cursive;
  font-size: 18px;
  outline: none;
}
.note-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.preview-note-paper {
  position: relative;
  display: block;
  min-height: 120px;
  padding: 30px 18px 18px;
  color: var(--note-ink, #243042);
  text-decoration: none;
  border-radius: 4px 4px 18px 18px;
  box-shadow: 0 18px 34px rgba(0,0,0,.24);
  transform: rotate(-.7deg);
  overflow: hidden;
  --preview-note-hole-bg: #08111f;
  background:
    radial-gradient(circle at 14px 9px, var(--preview-note-hole-bg) 0 5.6px, rgba(31,41,55,.18) 5.8px 6.8px, transparent 7px) 0 0 / 28px 24px repeat-x,
    repeating-linear-gradient(to bottom, transparent 0 29px, rgba(37, 99, 235, .22) 30px),
    #fff7d6;
  font-family: "Aref Ruqaa Ink", "Aref Ruqaa", "Marhey", "Lateef", cursive;
}
.preview-note-paper:nth-child(even) { transform: rotate(.9deg); }
.preview-note-paper.is-yellow { background: radial-gradient(circle at 14px 9px, var(--preview-note-hole-bg, #08111f) 0 5.6px, rgba(31,41,55,.18) 5.8px 6.8px, transparent 7px) 0 0 / 28px 24px repeat-x, repeating-linear-gradient(to bottom, transparent 0 29px, rgba(37, 99, 235, .20) 30px), #fff2a8; }
.preview-note-paper.is-blue { background: radial-gradient(circle at 14px 9px, var(--preview-note-hole-bg, #08111f) 0 5.6px, rgba(31,41,55,.18) 5.8px 6.8px, transparent 7px) 0 0 / 28px 24px repeat-x, repeating-linear-gradient(to bottom, transparent 0 29px, rgba(37, 99, 235, .18) 30px), #dff3ff; }
.preview-note-paper.is-green { background: radial-gradient(circle at 14px 9px, var(--preview-note-hole-bg, #08111f) 0 5.6px, rgba(31,41,55,.18) 5.8px 6.8px, transparent 7px) 0 0 / 28px 24px repeat-x, repeating-linear-gradient(to bottom, transparent 0 29px, rgba(37, 99, 235, .18) 30px), #e3f8d7; }
.preview-note-paper.is-pink { background: radial-gradient(circle at 14px 9px, var(--preview-note-hole-bg, #08111f) 0 5.6px, rgba(31,41,55,.18) 5.8px 6.8px, transparent 7px) 0 0 / 28px 24px repeat-x, repeating-linear-gradient(to bottom, transparent 0 29px, rgba(37, 99, 235, .18) 30px), #ffe0ea; }
.preview-note-paper strong { display:block; font-size: 17px; margin-bottom: 8px; color: var(--note-ink, #172033); font-weight: var(--note-weight, 400); }
.preview-note-paper span { display:block; color: var(--note-ink, #334155); line-height: 1.8; white-space: pre-wrap; font-weight: var(--note-weight, 400); }
.preview-note-pin { position:absolute; top:10px; left:14px; font-size:18px; }
@media (max-width: 680px) { .note-options-grid { grid-template-columns: 1fr; } }

.preview-note-paper {
  cursor: pointer;
}
.preview-note-paper span {
  max-height: 150px;
  overflow: hidden;
}
.preview-note-open {
  position: relative;
  z-index: 2;
  display: inline-flex !important;
  margin-top: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .10);
  color: #1f2937 !important;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 900;
  font-style: normal;
}
.note-reader-open { overflow: hidden; }
.note-reader-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
.note-reader-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.note-reader-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 18, .74);
  backdrop-filter: blur(16px);
}
.note-reader-page {
  --note-paper: #fff7d6;
  --note-hole-bg: #08111f;
  position: relative;
  z-index: 1;
  width: min(760px, 94vw);
  max-height: min(780px, 90vh);
  overflow: auto;
  padding: 74px 56px 52px;
  color: var(--note-ink, #1f2937);
  border-radius: 8px 8px 30px 30px;
  box-shadow: 0 36px 100px rgba(0,0,0,.55), inset 0 0 0 1px rgba(31,41,55,.08);
  background:
    linear-gradient(90deg, transparent 0 76px, rgba(239, 68, 68, .25) 77px, transparent 78px),
    repeating-linear-gradient(to bottom, transparent 0 35px, rgba(37, 99, 235, .23) 36px),
    var(--note-paper);
  font-family: var(--note-font-family, "Aref Ruqaa Ink", "Aref Ruqaa", "Marhey", "Lateef", cursive);
  color: var(--note-ink, #1f2937);
  font-weight: var(--note-weight, 400);
}
.note-reader-page.note-paper--yellow { --note-paper: #fff2a8; }
.note-reader-page.note-paper--blue { --note-paper: #dff3ff; }
.note-reader-page.note-paper--green { --note-paper: #e3f8d7; }
.note-reader-page.note-paper--pink { --note-paper: #ffe0ea; }
.note-reader-page.note-paper--cream { --note-paper: #fff7d6; }
.note-reader-page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 46px;
  background: linear-gradient(to bottom, rgba(255,255,255,.52), rgba(255,255,255,0));
  pointer-events: none;
}
.note-reader-holes {
  position: absolute;
  top: 14px;
  right: 0;
  left: 0;
  width: 100%;
  height: 22px;
  background:
    radial-gradient(circle at 18px 11px, var(--note-hole-bg) 0 7.4px, rgba(31,41,55,.18) 7.8px 9px, transparent 9.2px) 0 0 / 36px 22px repeat-x;
  pointer-events: none;
}
.note-reader-close {
  position: absolute;
  top: 18px;
  left: 22px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, .13);
  color: #111827;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.note-reader-pin {
  position: absolute;
  top: 24px;
  left: 76px;
  z-index: 2;
  font-size: 28px;
  filter: drop-shadow(0 6px 6px rgba(0,0,0,.22));
}
.note-reader-body { position: relative; z-index: 2; }
.note-reader-body h2 {
  margin: 0 0 22px;
  color: var(--note-ink, #111827);
  font-weight: var(--note-weight, 400);
  font-size: clamp(30px, 5vw, 50px);
  line-height: 1.25;
}
.note-reader-body p {
  margin: 0;
  color: var(--note-ink, #334155);
  font-weight: var(--note-weight, 400);
  font-size: clamp(20px, 3vw, 28px);
  line-height: 36px;
  white-space: pre-wrap;
}
.note-reader-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}
.note-reader-tags span {
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .10);
  color: #334155;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  font-weight: 900;
}
@media (max-width: 640px) {
  .note-reader-modal { padding: 14px; }
  .note-reader-page { padding: 66px 26px 34px; }
  .note-reader-body p { line-height: 32px; }
}


/* Notes icon layout: three compact notes per row after reader modal was introduced */
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-section-items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-paper {
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 34px 14px 14px;
}
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-paper strong {
  font-size: 15px;
  margin-bottom: 6px;
}
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-paper span {
  font-size: 13px;
  line-height: 22px;
  max-height: 86px;
}
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-open {
  margin-top: 8px;
  font-size: 10px;
  padding: 4px 8px;
}
@media (max-width: 680px) {
  .preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-section-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Notes realism polish: sharper paper corners + typography color applies across every handwriting font */
.preview-note-paper {
  border-radius: 2px 2px 8px 8px !important;
  color: var(--note-ink, #243042) !important;
}
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-paper {
  border-radius: 2px 2px 7px 7px !important;
}
.preview-note-paper strong,
.preview-note-paper span {
  color: var(--note-ink, #172033) !important;
  font-family: var(--note-font-family, "Aref Ruqaa Ink", "Aref Ruqaa", "Marhey", "Lateef", cursive) !important;
  font-weight: var(--note-weight, 400) !important;
}
.note-reader-page {
  border-radius: 3px 3px 12px 12px !important;
  color: var(--note-ink, #1f2937) !important;
}
.note-reader-body h2,
.note-reader-body p {
  color: var(--note-ink, #111827) !important;
  font-family: var(--note-font-family, "Aref Ruqaa Ink", "Aref Ruqaa", "Marhey", "Lateef", cursive) !important;
  font-weight: var(--note-weight, 400) !important;
}


/* Notes typography hard fix: text color must follow the selected ink color for every handwriting font, including Ruqaa. */
.preview-note-paper,
.preview-note-paper strong,
.preview-note-paper span,
.note-reader-page,
.note-reader-body h2,
.note-reader-body p {
  color: var(--note-ink, currentColor) !important;
}
.preview-note-paper strong,
.preview-note-paper span,
.note-reader-body h2,
.note-reader-body p {
  font-family: var(--note-font-family, "Aref Ruqaa Ink", "Aref Ruqaa", "Marhey", "Lateef", cursive) !important;
  font-weight: var(--note-weight, 400) !important;
}

/* FINAL Notes typography override: selected ink color inherits into all note text, including Ruqaa fonts. */
.preview-note-paper[style],
.note-paper[style],
.note-reader-page[style] {
  color: var(--note-ink, inherit) !important;
}
.preview-note-paper[style] strong,
.preview-note-paper[style] span,
.preview-note-paper[style] .preview-note-open,
.note-paper[style] h3,
.note-paper[style] p,
.note-paper[style] .note-read-more,
.note-reader-page[style] .note-reader-body h2,
.note-reader-page[style] .note-reader-body p {
  color: inherit !important;
  font-family: var(--note-font-family, "Aref Ruqaa Ink", "Aref Ruqaa", "Marhey", "Lateef", cursive) !important;
  font-weight: var(--note-weight, 400) !important;
}

/* Notes mood/date fix */
.preview-note-mood {
  position: absolute;
  top: 28px;
  right: 14px;
  z-index: 3;
  font-style: normal;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 18px;
  line-height: 1;
}
.preview-note-date {
  display: block;
  margin: -3px 0 8px;
  color: rgba(31, 41, 55, .62) !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 11px;
  font-weight: 800 !important;
}
.note-reader-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -10px 0 18px;
  color: rgba(31, 41, 55, .68) !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 14px;
  font-weight: 800 !important;
}
.note-reader-mood {
  font-size: 24px;
  line-height: 1;
}
.preview-note-open,
.preview-note-paper[style] .preview-note-open {
  color: #1f2937 !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-weight: 900 !important;
}


/* Notes mood/date placement update: emoji top-left, Gregorian date at bottom. */
.preview-note-paper {
  display: flex !important;
  flex-direction: column !important;
  min-height: 150px;
  padding-top: 34px !important;
}
.preview-note-mood {
  top: 28px !important;
  left: 14px !important;
  right: auto !important;
  z-index: 6 !important;
}
.preview-note-pin {
  left: auto !important;
  right: 14px !important;
  z-index: 6 !important;
}
.preview-note-date {
  margin: auto 0 8px !important;
  padding-top: 12px;
  color: rgba(31, 41, 55, .62) !important;
  direction: ltr;
  text-align: right;
  unicode-bidi: plaintext;
}
.preview-note-open {
  align-self: flex-start;
}
.note-reader-page {
  position: relative;
  display: flex;
  flex-direction: column;
}
.note-reader-body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.note-reader-mood {
  position: absolute !important;
  top: 42px !important;
  left: 26px !important;
  right: auto !important;
  z-index: 8 !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
.note-reader-date,
.note-reader-meta time {
  display: block;
  margin-top: auto;
  padding-top: 18px;
  direction: ltr;
  text-align: right;
  unicode-bidi: plaintext;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
.note-reader-meta {
  display: block !important;
  margin: 0 0 14px !important;
}
.note-reader-meta .note-reader-mood + time,
.note-reader-meta .note-reader-date {
  margin-top: 0;
}

/* Notes top meta row: keep date + mood below the holes and above the title without overlap. */
.preview-note-paper {
  --note-hole-space: 30px;
  display: flex !important;
  flex-direction: column !important;
  padding-top: 44px !important;
}
.preview-note-topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0 0 10px;
  direction: ltr;
  line-height: 1;
  min-height: 22px;
}
.preview-note-date {
  position: static !important;
  display: inline-flex !important;
  margin: 0 !important;
  padding: 0 !important;
  color: rgba(31, 41, 55, .62) !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: left;
}
.preview-note-mood {
  position: static !important;
  display: inline-flex !important;
  margin: 0 !important;
  font-size: 20px !important;
  line-height: 1 !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
.preview-note-paper strong { margin-top: 0 !important; }
.preview-note-pin {
  top: 32px !important;
  right: 14px !important;
  left: auto !important;
  z-index: 6 !important;
}
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-paper {
  padding-top: 36px !important;
}
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-topbar {
  margin-bottom: 7px;
  min-height: 18px;
}
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-date {
  font-size: 10px !important;
}
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-mood {
  font-size: 17px !important;
}
.note-reader-page {
  padding-top: 86px !important;
}
.note-reader-body {
  position: relative !important;
  z-index: 2 !important;
  display: flex !important;
  flex-direction: column !important;
}
.note-reader-meta {
  position: relative !important;
  z-index: 5 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  width: 100% !important;
  min-height: 28px !important;
  margin: 0 0 18px !important;
  padding: 0 !important;
  direction: ltr !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
.note-reader-date,
.note-reader-meta time {
  position: static !important;
  display: inline-flex !important;
  margin: 0 !important;
  padding: 0 !important;
  color: rgba(31, 41, 55, .66) !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  direction: ltr !important;
  unicode-bidi: plaintext !important;
  text-align: left !important;
}
.note-reader-mood {
  position: static !important;
  display: inline-flex !important;
  margin: 0 !important;
  font-size: 26px !important;
  line-height: 1 !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
.note-reader-body h2 { margin-top: 0 !important; }
@media (max-width: 640px) {
  .note-reader-page { padding-top: 76px !important; }
}

/* Notes v2 enhancements: paper styles, notebook modal stack, real open motion */
.preview-note-paper,
.note-reader-page {
  background-blend-mode: normal;
  transition: transform .24s ease, box-shadow .24s ease, filter .24s ease;
}
.preview-note-paper::after,
.note-reader-page::after {
  content: "";
  position: absolute;
  inset: 12px 12px auto auto;
  width: 34px;
  height: 34px;
  border-radius: 0 3px 0 100%;
  background: linear-gradient(135deg, rgba(255,255,255,.52), rgba(0,0,0,.10));
  box-shadow: -3px 4px 8px rgba(0,0,0,.08);
  pointer-events: none;
  opacity: .72;
}
.preview-note-paper.note-style--grid,
.note-reader-page.note-style--grid {
  background-image:
    radial-gradient(circle at 14px 9px, var(--preview-note-hole-bg, #08111f) 0 5.6px, rgba(31,41,55,.18) 5.8px 6.8px, transparent 7px),
    linear-gradient(rgba(37,99,235,.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,.14) 1px, transparent 1px) !important;
  background-size: 28px 24px, 22px 22px, 22px 22px !important;
  background-position: 0 0, 0 44px, 0 44px !important;
}
.preview-note-paper.note-style--blank,
.note-reader-page.note-style--blank {
  background-image:
    radial-gradient(circle at 14px 9px, var(--preview-note-hole-bg, #08111f) 0 5.6px, rgba(31,41,55,.18) 5.8px 6.8px, transparent 7px) !important;
  background-size: 28px 24px !important;
}
.preview-note-paper.note-style--vintage,
.note-reader-page.note-style--vintage {
  filter: sepia(.08);
  background-image:
    radial-gradient(circle at 14px 9px, var(--preview-note-hole-bg, #08111f) 0 5.6px, rgba(31,41,55,.22) 5.8px 6.8px, transparent 7px),
    radial-gradient(circle at 22% 32%, rgba(120,73,22,.12), transparent 22%),
    radial-gradient(circle at 78% 64%, rgba(120,73,22,.10), transparent 18%),
    repeating-linear-gradient(to bottom, transparent 0 29px, rgba(116,77,28,.13) 30px) !important;
  background-size: 28px 24px, auto, auto, auto !important;
}
.preview-note-pin,
.note-reader-pin,
.note-pin { font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important; }
.note-reader-page {
  transform-origin: center 35%;
}
.note-reader-modal.is-open .note-reader-page {
  animation: ntfNoteOpen .28s cubic-bezier(.2,.82,.2,1) both;
}
@keyframes ntfNoteOpen {
  from { opacity: 0; transform: translateY(18px) scale(.92) rotate(-1.2deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}
.note-reader-page::before {
  box-shadow:
    10px 12px 0 -4px rgba(255,247,214,.82),
    20px 24px 0 -8px rgba(255,247,214,.55),
    0 24px 60px rgba(0,0,0,.28) !important;
}
.note-reader-nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 38px;
  height: 54px;
  border: 1px solid rgba(15,23,42,.14);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: #111827 !important;
  font: 800 30px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  cursor: pointer;
  z-index: 6;
  box-shadow: 0 12px 24px rgba(0,0,0,.18);
}
.note-reader-prev { right: -56px; }
.note-reader-next { left: -56px; }
@media (max-width: 760px) {
  .note-reader-prev { right: 14px; }
  .note-reader-next { left: 14px; }
  .note-reader-nav { top: auto; bottom: 14px; translate: 0; }
}


/* NTF Notes V2 REAL EXPERIENCE PATCH */
.preview-section-group[data-section-type="notes"] .preview-section-items {
  align-items: stretch;
}
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-section-items {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.note-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 16px;
}
.note-filter-row button {
  border: 1px solid rgba(245, 197, 66, .24);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.78);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  font-weight: 800;
}
.note-filter-row button.is-active,
.note-filter-row button:hover {
  background: rgba(245,197,66,.18);
  color: #f8d36d;
  border-color: rgba(245,197,66,.48);
}
.note-paper {
  cursor: pointer;
  isolation: isolate;
  padding-top: 54px !important;
  border-radius: 3px 3px 14px 14px !important;
}
.note-paper::before {
  background:
    radial-gradient(circle at 14px 8px, var(--note-hole-bg, #08111f) 0 6px, rgba(31,41,55,.24) 6.2px 7.3px, transparent 7.5px) 0 0 / 28px 18px repeat-x,
    linear-gradient(to bottom, rgba(255,255,255,.48), rgba(255,255,255,0)) !important;
  height: 30px !important;
  z-index: 3 !important;
}
.note-holes { display: none !important; }
.note-pin { top: 27px !important; left: 16px !important; z-index: 5 !important; }
.note-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  min-height: 24px;
  position: relative;
  z-index: 4;
}
.note-written-date {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif !important;
  font-size: 12px;
  font-weight: 800;
  color: rgba(15, 23, 42, .58) !important;
  direction: ltr;
}
.note-mood { font-size: 22px; line-height: 1; }
.note-read-more {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif !important;
  color: #0f172a !important;
  background: rgba(15,23,42,.08);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 999px;
  padding: 6px 11px;
  display: inline-flex !important;
  margin-top: 10px;
}
.note-paper.note-style--lined {
  background-image:
    linear-gradient(90deg, transparent 0 54px, rgba(239, 68, 68, .25) 55px, transparent 56px),
    repeating-linear-gradient(to bottom, transparent 0 30px, rgba(37,99,235,.24) 31px),
    linear-gradient(var(--note-paper), var(--note-paper)) !important;
}
.note-paper.note-style--grid {
  background-image:
    linear-gradient(rgba(37,99,235,.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,.15) 1px, transparent 1px),
    linear-gradient(var(--note-paper), var(--note-paper)) !important;
  background-size: 22px 22px, 22px 22px, auto !important;
  background-position: 0 44px, 0 44px, 0 0 !important;
}
.note-paper.note-style--blank {
  background-image: linear-gradient(var(--note-paper), var(--note-paper)) !important;
}
.note-paper.note-style--vintage {
  --note-paper: #f1dfb9;
  background-image:
    radial-gradient(circle at 20% 22%, rgba(120,73,22,.16), transparent 18%),
    radial-gradient(circle at 78% 70%, rgba(120,73,22,.12), transparent 20%),
    repeating-linear-gradient(to bottom, transparent 0 30px, rgba(116,77,28,.15) 31px),
    linear-gradient(var(--note-paper), var(--note-paper)) !important;
}
.note-reader-modal { perspective: 1200px; }
.note-reader-page {
  border-radius: 3px 3px 18px 18px !important;
  padding-top: 88px !important;
  overflow: visible !important;
  isolation: isolate;
}
.note-reader-page::before {
  content: "" !important;
  position: absolute !important;
  inset: 14px -18px -18px 18px !important;
  border-radius: 4px 4px 20px 20px !important;
  background: rgba(255,247,214,.62) !important;
  transform: rotate(1.8deg) !important;
  z-index: -2 !important;
  box-shadow: 12px 16px 0 rgba(255,247,214,.38), 0 30px 80px rgba(0,0,0,.36) !important;
}
.note-reader-page::after {
  z-index: 2 !important;
}
.note-reader-holes {
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  height: 22px;
  background: radial-gradient(circle at 14px 10px, var(--note-hole-bg, #08111f) 0 6.4px, rgba(31,41,55,.24) 6.8px 8px, transparent 8.2px) 0 0 / 30px 22px repeat-x !important;
  z-index: 4;
}
.note-reader-body { position: relative; z-index: 3; }
.note-reader-meta {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 14px !important;
  margin-bottom: 12px !important;
}
.note-reader-date {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif !important;
  color: rgba(15,23,42,.58) !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  direction: ltr;
}
.note-reader-mood { font-size: 30px !important; line-height: 1; }
.note-reader-nav {
  display: grid !important;
  place-items: center !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.92) !important;
  color: #0f172a !important;
  border: 1px solid rgba(15,23,42,.12) !important;
  box-shadow: 0 14px 28px rgba(0,0,0,.22) !important;
}
.note-reader-modal.is-open .note-reader-page {
  animation: ntfNoteBookOpen .38s cubic-bezier(.18,.9,.22,1.08) both !important;
}
@keyframes ntfNoteBookOpen {
  0% { opacity: 0; transform: translateY(28px) scale(.82) rotateX(10deg) rotate(14deg); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotateX(0) rotate(0); }
}
@media (max-width: 760px) {
  .preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-section-items { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 520px) {
  .preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-section-items { grid-template-columns: 1fr !important; }
}

.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-section-items {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}
.preview-note-paper {
  padding-top: 54px !important;
  border-radius: 3px 3px 14px 14px !important;
  cursor: pointer;
}
.preview-note-paper::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 30px;
  background:
    radial-gradient(circle at 14px 8px, var(--preview-note-hole-bg, #08111f) 0 6px, rgba(31,41,55,.24) 6.2px 7.3px, transparent 7.5px) 0 0 / 28px 18px repeat-x,
    linear-gradient(to bottom, rgba(255,255,255,.48), rgba(255,255,255,0)) !important;
  z-index: 3;
  pointer-events:none;
}
.preview-note-topbar {
  position: relative;
  z-index: 4;
}
.preview-note-open {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif !important;
}
.preview-note-paper.note-style--lined {
  background-image:
    linear-gradient(90deg, transparent 0 54px, rgba(239,68,68,.25) 55px, transparent 56px),
    repeating-linear-gradient(to bottom, transparent 0 30px, rgba(37,99,235,.24) 31px),
    linear-gradient(var(--note-paper, #fff7d6), var(--note-paper, #fff7d6)) !important;
}


/* NTF Notes public paper-style + clean notebook modal hard fix */
.note-paper,
.preview-note-paper,
.note-reader-page {
  position: relative;
  overflow: hidden;
  background-color: var(--note-paper, #fff7d6) !important;
  background-repeat: repeat !important;
  background-blend-mode: normal !important;
}

.note-paper.note-style--lined,
.preview-note-paper.note-style--lined,
.note-reader-page.note-style--lined,
.note-paper[data-note-paper-style="lined"],
.preview-note-paper[data-note-paper-style="lined"],
.note-reader-page[data-note-paper-style="lined"] {
  background-image:
    linear-gradient(90deg, transparent 0 52px, rgba(239, 68, 68, .22) 53px, transparent 54px),
    repeating-linear-gradient(to bottom, transparent 0 29px, rgba(37, 99, 235, .22) 30px, transparent 31px),
    linear-gradient(var(--note-paper, #fff7d6), var(--note-paper, #fff7d6)) !important;
  background-size: auto !important;
  background-position: 0 0 !important;
}

.note-paper.note-style--grid,
.preview-note-paper.note-style--grid,
.note-reader-page.note-style--grid,
.note-paper[data-note-paper-style="grid"],
.preview-note-paper[data-note-paper-style="grid"],
.note-reader-page[data-note-paper-style="grid"] {
  background-image:
    linear-gradient(rgba(37, 99, 235, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, .16) 1px, transparent 1px),
    linear-gradient(var(--note-paper, #fff7d6), var(--note-paper, #fff7d6)) !important;
  background-size: 22px 22px, 22px 22px, auto !important;
  background-position: 0 44px, 0 44px, 0 0 !important;
}

.note-paper.note-style--blank,
.preview-note-paper.note-style--blank,
.note-reader-page.note-style--blank,
.note-paper[data-note-paper-style="blank"],
.preview-note-paper[data-note-paper-style="blank"],
.note-reader-page[data-note-paper-style="blank"] {
  background-image: linear-gradient(var(--note-paper, #fffaf0), var(--note-paper, #fffaf0)) !important;
  background-size: auto !important;
  background-position: 0 0 !important;
}

.note-paper.note-style--vintage,
.preview-note-paper.note-style--vintage,
.note-reader-page.note-style--vintage,
.note-paper[data-note-paper-style="vintage"],
.preview-note-paper[data-note-paper-style="vintage"],
.note-reader-page[data-note-paper-style="vintage"] {
  --note-paper: #f1dfb9 !important;
  filter: sepia(.07) saturate(.95) !important;
  background-image:
    radial-gradient(circle at 18% 24%, rgba(120, 73, 22, .16), transparent 18%),
    radial-gradient(circle at 78% 70%, rgba(120, 73, 22, .12), transparent 20%),
    repeating-linear-gradient(to bottom, transparent 0 30px, rgba(116, 77, 28, .13) 31px, transparent 32px),
    linear-gradient(var(--note-paper), var(--note-paper)) !important;
  background-size: auto, auto, auto, auto !important;
  background-position: 0 0 !important;
}

.note-reader-modal .note-reader-page {
  overflow: visible !important;
  border-radius: 4px 4px 16px 16px !important;
  box-shadow: 0 36px 90px rgba(0,0,0,.46) !important;
  transform-origin: center bottom;
}

.note-reader-modal .note-reader-page::before {
  content: "" !important;
  position: absolute !important;
  inset: 18px 14px -14px 14px !important;
  border-radius: 5px 5px 18px 18px !important;
  background: color-mix(in srgb, var(--note-paper, #fff7d6) 88%, #000 0%) !important;
  transform: translate(10px, 12px) rotate(.7deg) !important;
  z-index: -2 !important;
  box-shadow: 10px 12px 0 color-mix(in srgb, var(--note-paper, #fff7d6) 70%, transparent), 0 30px 70px rgba(0,0,0,.30) !important;
  pointer-events: none !important;
}

.note-reader-modal .note-reader-page::after {
  content: "" !important;
  position: absolute !important;
  inset: 10px 8px auto auto !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 0 4px 0 100% !important;
  background: linear-gradient(135deg, rgba(255,255,255,.58), rgba(0,0,0,.09)) !important;
  box-shadow: -2px 3px 6px rgba(0,0,0,.08) !important;
  z-index: 2 !important;
  pointer-events: none !important;
}

.note-reader-holes {
  top: 18px !important;
  left: 0 !important;
  right: 0 !important;
  height: 24px !important;
  background: radial-gradient(circle at 14px 10px, var(--note-hole-bg, #08111f) 0 6px, rgba(31,41,55,.22) 6.4px 7.6px, transparent 7.8px) 0 0 / 30px 22px repeat-x !important;
  z-index: 4 !important;
}

.note-reader-body {
  position: relative !important;
  z-index: 5 !important;
  padding-top: 0 !important;
}

.note-reader-meta {
  margin: 0 0 12px !important;
}

.note-reader-page h2 {
  margin-top: 0 !important;
}

/* NTF Notes: final Firestore paper-style display + clean reader modal */
.preview-note-paper[data-note-paper-style],
.preview-note-paper.note-style--lined,
.preview-note-paper.note-style--grid,
.preview-note-paper.note-style--blank,
.preview-note-paper.note-style--vintage,
.note-reader-page[data-note-paper-style],
.note-reader-page.note-style--lined,
.note-reader-page.note-style--grid,
.note-reader-page.note-style--blank,
.note-reader-page.note-style--vintage {
  background-color: var(--note-paper, #fff7d6) !important;
  background-repeat: repeat !important;
  background-blend-mode: normal !important;
}
.preview-note-paper.note-style--grid,
.preview-note-paper[data-note-paper-style="grid"],
.note-reader-page.note-style--grid,
.note-reader-page[data-note-paper-style="grid"] {
  background-image:
    linear-gradient(rgba(37,99,235,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,.16) 1px, transparent 1px),
    linear-gradient(var(--note-paper, #fff7d6), var(--note-paper, #fff7d6)) !important;
  background-size: 22px 22px, 22px 22px, auto !important;
  background-position: 0 44px, 0 44px, 0 0 !important;
}
.preview-note-paper.note-style--blank,
.preview-note-paper[data-note-paper-style="blank"],
.note-reader-page.note-style--blank,
.note-reader-page[data-note-paper-style="blank"] {
  background-image: linear-gradient(var(--note-paper, #fffaf0), var(--note-paper, #fffaf0)) !important;
}
.preview-note-paper.note-style--vintage,
.preview-note-paper[data-note-paper-style="vintage"],
.note-reader-page.note-style--vintage,
.note-reader-page[data-note-paper-style="vintage"] {
  --note-paper: #f0ddb4 !important;
  background-image:
    radial-gradient(circle at 18% 24%, rgba(120,73,22,.15), transparent 18%),
    radial-gradient(circle at 78% 70%, rgba(120,73,22,.12), transparent 20%),
    repeating-linear-gradient(to bottom, transparent 0 29px, rgba(116,77,28,.13) 30px, transparent 31px),
    linear-gradient(var(--note-paper), var(--note-paper)) !important;
}
.note-reader-modal .note-reader-page::before,
.note-reader-modal .note-reader-page::after {
  box-shadow: none !important;
  transform: none !important;
}


/* NTF Notes hard fix: paper style must win over paper color, especially Vintage. */
.note-paper.note-style--vintage,
.preview-note-paper.note-style--vintage,
.note-reader-page.note-style--vintage,
.note-paper[data-note-paper-style="vintage"],
.preview-note-paper[data-note-paper-style="vintage"],
.note-reader-page[data-note-paper-style="vintage"] {
  --note-paper: #ead3a2 !important;
  background-color: #ead3a2 !important;
  background-image:
    radial-gradient(circle at 14% 18%, rgba(97, 59, 18, .22) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 72%, rgba(97, 59, 18, .16) 0 2px, transparent 4px),
    radial-gradient(circle at 35% 86%, rgba(97, 59, 18, .12) 0 1px, transparent 3px),
    repeating-linear-gradient(to bottom, transparent 0 29px, rgba(94, 63, 28, .16) 30px, transparent 31px),
    linear-gradient(135deg, rgba(255,255,255,.18), rgba(92,54,18,.10)),
    linear-gradient(#ead3a2, #ead3a2) !important;
  background-size: auto, auto, auto, auto, auto, auto !important;
  background-blend-mode: multiply, multiply, multiply, normal, multiply, normal !important;
  filter: sepia(.18) saturate(.92) contrast(.98) !important;
}

.note-paper.note-style--grid,
.preview-note-paper.note-style--grid,
.note-reader-page.note-style--grid,
.note-paper[data-note-paper-style="grid"],
.preview-note-paper[data-note-paper-style="grid"],
.note-reader-page[data-note-paper-style="grid"] {
  background-image:
    linear-gradient(rgba(37,99,235,.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,.18) 1px, transparent 1px),
    linear-gradient(var(--note-paper, #fff7d6), var(--note-paper, #fff7d6)) !important;
  background-size: 22px 22px, 22px 22px, auto !important;
  background-position: 0 48px, 0 48px, 0 0 !important;
}

.note-paper.note-style--blank,
.preview-note-paper.note-style--blank,
.note-reader-page.note-style--blank,
.note-paper[data-note-paper-style="blank"],
.preview-note-paper[data-note-paper-style="blank"],
.note-reader-page[data-note-paper-style="blank"] {
  background-image: linear-gradient(var(--note-paper, #fffaf0), var(--note-paper, #fffaf0)) !important;
}


/* NTF Notes reader modal - final clean layout fix
   Fixes messy stacked pages and buttons appearing in the middle. */
.note-reader-open {
  overflow: hidden !important;
}
.note-reader-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 26px !important;
  box-sizing: border-box !important;
  direction: rtl !important;
}
.note-reader-modal.is-open {
  display: flex !important;
}
.note-reader-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background:
    radial-gradient(circle at 50% 20%, rgba(245, 158, 11, .11), transparent 34%),
    rgba(2, 6, 23, .78) !important;
  backdrop-filter: blur(10px) !important;
  z-index: 0 !important;
}
.note-reader-page {
  position: relative !important;
  z-index: 1 !important;
  width: min(760px, calc(100vw - 52px)) !important;
  max-height: min(86vh, 860px) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 auto !important;
  padding: 76px 48px 34px !important;
  border-radius: 7px 7px 15px 15px !important;
  border: 1px solid rgba(65, 46, 19, .18) !important;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, .52),
    0 2px 0 rgba(255,255,255,.5) inset !important;
  transform: translateY(14px) scale(.97) !important;
  opacity: 0 !important;
  transition: transform .24s ease, opacity .24s ease !important;
}
.note-reader-modal.is-open .note-reader-page {
  transform: translateY(0) scale(1) !important;
  opacity: 1 !important;
}
/* Remove old random stacked-page effects from earlier versions. */
.note-reader-modal .note-reader-page::before,
.note-reader-modal .note-reader-page::after {
  content: none !important;
  display: none !important;
  box-shadow: none !important;
  transform: none !important;
  background: none !important;
  border: 0 !important;
}
.note-reader-holes {
  position: absolute !important;
  top: 13px !important;
  left: 22px !important;
  right: 22px !important;
  height: 28px !important;
  z-index: 2 !important;
  pointer-events: none !important;
  background:
    radial-gradient(circle at center, rgba(2,6,23,.88) 0 7px, rgba(15,23,42,.20) 7.5px, transparent 8.5px) 0 0 / 38px 24px repeat-x !important;
  opacity: .96 !important;
}
.note-reader-body {
  position: relative !important;
  z-index: 3 !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding-inline-end: 6px !important;
  color: var(--note-ink, currentColor) !important;
}
.note-reader-meta {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 18px !important;
  min-height: 34px !important;
  margin: 0 0 12px !important;
  padding: 0 !important;
  color: var(--note-ink, #374151) !important;
}
.note-reader-date,
.note-reader-meta time {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: .02em !important;
  opacity: .72 !important;
  color: inherit !important;
  white-space: nowrap !important;
}
.note-reader-mood {
  margin-inline-start: auto !important;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", system-ui, sans-serif !important;
  font-size: 30px !important;
  line-height: 1 !important;
  filter: drop-shadow(0 3px 7px rgba(0,0,0,.13)) !important;
}
.note-reader-page h2,
.note-reader-body h2 {
  margin: 0 0 16px !important;
  padding-bottom: 12px !important;
  border-bottom: 1px solid rgba(15,23,42,.14) !important;
  color: var(--note-ink, currentColor) !important;
  font-family: var(--note-font-family, inherit) !important;
  font-weight: var(--note-weight, 700) !important;
  line-height: 1.35 !important;
  font-size: clamp(26px, 4vw, 42px) !important;
}
.note-reader-body p,
#noteReaderContent,
#dashboardNoteReaderContent {
  margin: 0 !important;
  white-space: pre-wrap !important;
  color: var(--note-ink, currentColor) !important;
  font-family: var(--note-font-family, inherit) !important;
  font-weight: var(--note-weight, 400) !important;
  font-size: clamp(20px, 2.45vw, 30px) !important;
  line-height: 1.9 !important;
}
.note-reader-tags {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: 22px !important;
}
.note-reader-tags span {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  color: rgba(15, 23, 42, .72) !important;
  background: rgba(255,255,255,.46) !important;
  border: 1px solid rgba(15,23,42,.10) !important;
  border-radius: 999px !important;
  padding: 5px 10px !important;
}
.note-reader-close {
  position: absolute !important;
  top: 14px !important;
  inset-inline-end: 16px !important;
  z-index: 10 !important;
  width: 36px !important;
  height: 36px !important;
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
  border: 1px solid rgba(15,23,42,.16) !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.72) !important;
  color: #111827 !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 24px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-shadow: 0 10px 24px rgba(0,0,0,.14) !important;
}
.note-reader-pin {
  position: absolute !important;
  top: 52px !important;
  inset-inline-start: 22px !important;
  z-index: 4 !important;
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", system-ui, sans-serif !important;
  font-size: 30px !important;
  line-height: 1 !important;
  pointer-events: none !important;
}
.note-reader-nav {
  position: absolute !important;
  z-index: 10 !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 42px !important;
  height: 42px !important;
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
  border: 1px solid rgba(255,255,255,.24) !important;
  border-radius: 999px !important;
  background: rgba(15,23,42,.72) !important;
  color: #fff !important;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 34px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-shadow: 0 16px 38px rgba(0,0,0,.28) !important;
}
.note-reader-prev { right: max(16px, calc(50vw - 460px)) !important; left: auto !important; }
.note-reader-next { left: max(16px, calc(50vw - 460px)) !important; right: auto !important; }
.note-reader-nav:hover,
.note-reader-close:hover {
  transform: translateY(-50%) scale(1.04) !important;
}
.note-reader-close:hover { transform: scale(1.04) !important; }
@media (max-width: 760px) {
  .note-reader-modal { padding: 14px !important; align-items: stretch !important; }
  .note-reader-page {
    width: 100% !important;
    max-height: calc(100vh - 28px) !important;
    padding: 72px 22px 76px !important;
  }
  .note-reader-nav {
    top: auto !important;
    bottom: 18px !important;
    transform: none !important;
  }
  .note-reader-prev { right: 22px !important; }
  .note-reader-next { left: 22px !important; }
  .note-reader-nav:hover { transform: scale(1.04) !important; }
  .note-reader-page h2,
  .note-reader-body h2 { font-size: 27px !important; }
  .note-reader-body p,
  #noteReaderContent,
  #dashboardNoteReaderContent { font-size: 22px !important; line-height: 1.8 !important; }
}


/* NTF Notes: vintage paper final override
   Vintage/old paper must look like aged paper, not notebook paper. */
.note-paper.note-style--vintage,
.note-paper[data-note-paper-style="vintage"],
.preview-note-paper.note-style--vintage,
.preview-note-paper[data-note-paper-style="vintage"],
.note-reader-page.note-style--vintage,
.note-reader-page[data-note-paper-style="vintage"] {
  --note-paper-base: #ead8aa;
  --note-paper-edge: rgba(93, 58, 20, .18);
  background-color: #ead8aa !important;
  background-image:
    radial-gradient(circle at 14px 10px, var(--preview-note-hole-bg, #08111f) 0 5.8px, rgba(72, 45, 18, .20) 6.2px 7.3px, transparent 7.6px),
    radial-gradient(circle at 18% 24%, rgba(96, 61, 24, .10) 0 1.3px, transparent 1.7px),
    radial-gradient(circle at 72% 32%, rgba(96, 61, 24, .08) 0 1.5px, transparent 2px),
    radial-gradient(circle at 42% 72%, rgba(96, 61, 24, .07) 0 1.1px, transparent 1.7px),
    linear-gradient(115deg, rgba(255,255,255,.18), rgba(123, 83, 34, .07) 42%, rgba(83, 50, 20, .12)),
    radial-gradient(ellipse at center, rgba(255, 248, 219, .38) 0%, rgba(234, 216, 170, .24) 52%, rgba(118, 74, 28, .18) 100%) !important;
  background-size:
    28px 24px,
    74px 74px,
    92px 92px,
    64px 64px,
    100% 100%,
    100% 100% !important;
  background-position:
    0 0,
    0 0,
    12px 16px,
    28px 8px,
    0 0,
    0 0 !important;
  border-color: rgba(93, 58, 20, .24) !important;
  box-shadow:
    inset 0 0 42px rgba(92, 57, 21, .14),
    inset 0 1px 0 rgba(255,255,255,.35),
    0 16px 34px rgba(0,0,0,.18) !important;
}

/* The reader modal already has a separate holes layer, so remove hole texture from the page itself. */
.note-reader-page.note-style--vintage,
.note-reader-page[data-note-paper-style="vintage"] {
  background-image:
    radial-gradient(circle at 18% 24%, rgba(96, 61, 24, .10) 0 1.3px, transparent 1.7px),
    radial-gradient(circle at 72% 32%, rgba(96, 61, 24, .08) 0 1.5px, transparent 2px),
    radial-gradient(circle at 42% 72%, rgba(96, 61, 24, .07) 0 1.1px, transparent 1.7px),
    linear-gradient(115deg, rgba(255,255,255,.18), rgba(123, 83, 34, .07) 42%, rgba(83, 50, 20, .12)),
    radial-gradient(ellipse at center, rgba(255, 248, 219, .38) 0%, rgba(234, 216, 170, .24) 52%, rgba(118, 74, 28, .18) 100%) !important;
  background-size: 74px 74px, 92px 92px, 64px 64px, 100% 100%, 100% 100% !important;
  background-position: 0 0, 12px 16px, 28px 8px, 0 0, 0 0 !important;
}

/* Kill notebook/grid ruling on vintage paper even if older rules are loaded earlier. */
.note-paper.note-style--vintage::before,
.note-paper[data-note-paper-style="vintage"]::before,
.preview-note-paper.note-style--vintage::before,
.preview-note-paper[data-note-paper-style="vintage"]::before,
.note-reader-page.note-style--vintage::before,
.note-reader-page[data-note-paper-style="vintage"]::before,
.note-paper.note-style--vintage::after,
.note-paper[data-note-paper-style="vintage"]::after,
.preview-note-paper.note-style--vintage::after,
.preview-note-paper[data-note-paper-style="vintage"]::after,
.note-reader-page.note-style--vintage::after,
.note-reader-page[data-note-paper-style="vintage"]::after {
  background-image: none !important;
  background: none !important;
  opacity: 0 !important;
}

.note-paper.note-style--vintage .note-content,
.note-paper[data-note-paper-style="vintage"] .note-content,
.preview-note-paper.note-style--vintage .preview-note-content,
.preview-note-paper[data-note-paper-style="vintage"] .preview-note-content,
.note-reader-page.note-style--vintage .note-reader-body,
.note-reader-page[data-note-paper-style="vintage"] .note-reader-body {
  background-image: none !important;
}

/* =========================================================
   NTF Notes final modal/nav + vintage paper hard fix
   - Reader navigation buttons are fixed to the modal edges, never in the middle of the page.
   - Vintage/old paper has top perforation only; no repeated holes across the card.
   - Vintage paper has no notebook ruling/lines.
   ========================================================= */
.note-reader-modal.is-open .note-reader-nav,
.note-reader-modal .note-reader-nav {
  position: fixed !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  translate: none !important;
  z-index: 10020 !important;
  width: 46px !important;
  height: 46px !important;
  display: inline-grid !important;
  place-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255,255,255,.24) !important;
  background: rgba(8, 13, 30, .82) !important;
  color: #fff !important;
  font: 800 32px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  box-shadow: 0 18px 42px rgba(0,0,0,.34) !important;
}
.note-reader-modal.is-open .note-reader-prev,
.note-reader-modal .note-reader-prev {
  inset-inline-end: clamp(14px, 3.6vw, 54px) !important;
  inset-inline-start: auto !important;
  right: clamp(14px, 3.6vw, 54px) !important;
  left: auto !important;
}
.note-reader-modal.is-open .note-reader-next,
.note-reader-modal .note-reader-next {
  inset-inline-start: clamp(14px, 3.6vw, 54px) !important;
  inset-inline-end: auto !important;
  left: clamp(14px, 3.6vw, 54px) !important;
  right: auto !important;
}
.note-reader-modal.is-open .note-reader-nav:hover,
.note-reader-modal .note-reader-nav:hover {
  transform: translateY(-50%) scale(1.06) !important;
}

/* Keep the reader page centered and give desktop buttons enough breathing room. */
.note-reader-modal.is-open {
  padding-inline: clamp(76px, 10vw, 150px) !important;
}

/* Public/dashboard note cards: vintage paper should NOT contain repeated hole pattern or notebook lines. */
.note-paper.note-style--vintage,
.note-paper[data-note-paper-style="vintage"],
.preview-note-paper.note-style--vintage,
.preview-note-paper[data-note-paper-style="vintage"] {
  --note-paper: #ead7a9 !important;
  background-color: #ead7a9 !important;
  background-image:
    radial-gradient(circle at 18% 24%, rgba(95, 58, 20, .12) 0 1.4px, transparent 1.9px),
    radial-gradient(circle at 76% 32%, rgba(95, 58, 20, .09) 0 1.7px, transparent 2.2px),
    radial-gradient(circle at 42% 74%, rgba(95, 58, 20, .08) 0 1.2px, transparent 1.8px),
    linear-gradient(115deg, rgba(255,255,255,.20), rgba(120, 79, 32, .07) 45%, rgba(72, 45, 20, .13)),
    radial-gradient(ellipse at center, rgba(255, 246, 210, .40) 0%, rgba(234, 215, 169, .23) 56%, rgba(110, 70, 26, .18) 100%) !important;
  background-size: 78px 78px, 104px 104px, 68px 68px, 100% 100%, 100% 100% !important;
  background-position: 0 0, 14px 18px, 30px 10px, 0 0, 0 0 !important;
  border-color: rgba(91, 58, 24, .26) !important;
  box-shadow:
    inset 0 0 42px rgba(85, 52, 19, .15),
    inset 0 1px 0 rgba(255,255,255,.35),
    0 16px 34px rgba(0,0,0,.18) !important;
}

/* Restore a single top-only perforation layer for vintage cards.
   Earlier CSS disabled vintage pseudo-elements; this brings back only the top row. */
.note-paper.note-style--vintage::before,
.note-paper[data-note-paper-style="vintage"]::before,
.preview-note-paper.note-style--vintage::before,
.preview-note-paper[data-note-paper-style="vintage"]::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 0 auto 0 !important;
  height: 30px !important;
  opacity: 1 !important;
  pointer-events: none !important;
  z-index: 3 !important;
  background:
    radial-gradient(circle at 14px 8px, var(--note-hole-bg, var(--preview-note-hole-bg, #08111f)) 0 6px, rgba(72,45,18,.26) 6.2px 7.4px, transparent 7.6px) 0 0 / 28px 18px repeat-x,
    linear-gradient(to bottom, rgba(255,255,255,.30), rgba(255,255,255,0)) !important;
}
.note-paper.note-style--vintage::after,
.note-paper[data-note-paper-style="vintage"]::after,
.preview-note-paper.note-style--vintage::after,
.preview-note-paper[data-note-paper-style="vintage"]::after {
  background: none !important;
  opacity: 0 !important;
}

/* Reader modal vintage page: same old-paper look, but no page-level repeated holes.
   The modal uses .note-reader-holes as the single top perforation row. */
.note-reader-page.note-style--vintage,
.note-reader-page[data-note-paper-style="vintage"] {
  --note-paper: #ead7a9 !important;
  background-color: #ead7a9 !important;
  background-image:
    radial-gradient(circle at 18% 24%, rgba(95, 58, 20, .12) 0 1.4px, transparent 1.9px),
    radial-gradient(circle at 76% 32%, rgba(95, 58, 20, .09) 0 1.7px, transparent 2.2px),
    radial-gradient(circle at 42% 74%, rgba(95, 58, 20, .08) 0 1.2px, transparent 1.8px),
    linear-gradient(115deg, rgba(255,255,255,.20), rgba(120, 79, 32, .07) 45%, rgba(72, 45, 20, .13)),
    radial-gradient(ellipse at center, rgba(255, 246, 210, .40) 0%, rgba(234, 215, 169, .23) 56%, rgba(110, 70, 26, .18) 100%) !important;
  background-size: 78px 78px, 104px 104px, 68px 68px, 100% 100%, 100% 100% !important;
  background-position: 0 0, 14px 18px, 30px 10px, 0 0, 0 0 !important;
}
.note-reader-page.note-style--vintage::before,
.note-reader-page[data-note-paper-style="vintage"]::before,
.note-reader-page.note-style--vintage::after,
.note-reader-page[data-note-paper-style="vintage"]::after {
  background: none !important;
  opacity: 0 !important;
  box-shadow: none !important;
}
.note-reader-page.note-style--vintage .note-reader-body,
.note-reader-page[data-note-paper-style="vintage"] .note-reader-body,
.note-paper.note-style--vintage .note-content,
.note-paper[data-note-paper-style="vintage"] .note-content,
.note-paper.note-style--vintage p,
.note-paper[data-note-paper-style="vintage"] p,
.preview-note-paper.note-style--vintage .preview-note-content,
.preview-note-paper[data-note-paper-style="vintage"] .preview-note-content {
  background: none !important;
  background-image: none !important;
}
.note-reader-page.note-style--vintage .note-reader-holes,
.note-reader-page[data-note-paper-style="vintage"] .note-reader-holes,
.note-reader-holes {
  display: block !important;
  position: absolute !important;
  top: 12px !important;
  inset-inline: 0 !important;
  height: 18px !important;
  z-index: 4 !important;
  pointer-events: none !important;
  background: radial-gradient(circle at 14px 9px, var(--note-hole-bg, #08111f) 0 6px, rgba(72,45,18,.26) 6.2px 7.4px, transparent 7.6px) 0 0 / 28px 18px repeat-x !important;
}

@media (max-width: 760px) {
  .note-reader-modal.is-open {
    padding-inline: 14px !important;
    padding-bottom: 76px !important;
  }
  .note-reader-modal.is-open .note-reader-nav,
  .note-reader-modal .note-reader-nav {
    top: auto !important;
    bottom: 18px !important;
    transform: none !important;
    width: 44px !important;
    height: 44px !important;
  }
  .note-reader-modal.is-open .note-reader-prev,
  .note-reader-modal .note-reader-prev {
    right: auto !important;
    left: calc(50% + 10px) !important;
    inset-inline-start: calc(50% + 10px) !important;
    inset-inline-end: auto !important;
  }
  .note-reader-modal.is-open .note-reader-next,
  .note-reader-modal .note-reader-next {
    left: auto !important;
    right: calc(50% + 10px) !important;
    inset-inline-end: calc(50% + 10px) !important;
    inset-inline-start: auto !important;
  }
  .note-reader-modal.is-open .note-reader-nav:hover,
  .note-reader-modal .note-reader-nav:hover {
    transform: scale(1.04) !important;
  }
}



/* NTF Notes pinned state: masking-tape sticker instead of pin/clip icon */
.preview-note-pin,
.note-pin,
.note-reader-pin {
  position: absolute !important;
  display: block !important;
  width: 74px !important;
  height: 20px !important;
  border-radius: 4px 2px 5px 3px !important;
  background:
    linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,0) 28%, rgba(255,255,255,.16) 62%, rgba(255,255,255,0)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.12) 0 2px, rgba(118,76,20,.055) 2px 5px),
    linear-gradient(135deg, rgba(255,238,173,.92), rgba(226,188,104,.78)) !important;
  border: 1px solid rgba(126, 87, 28, .16) !important;
  box-shadow: 0 6px 12px rgba(50, 36, 12, .14), inset 0 1px 0 rgba(255,255,255,.28) !important;
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  text-indent: -9999px !important;
  overflow: visible !important;
  pointer-events: none !important;
  z-index: 30 !important;
  opacity: .92 !important;
  transform: rotate(14deg) !important;
  transform-origin: center !important;
}
.preview-note-pin::before,
.note-pin::before,
.note-reader-pin::before,
.preview-note-pin::after,
.note-pin::after,
.note-reader-pin::after {
  content: "" !important;
  position: absolute !important;
  top: 2px !important;
  bottom: 2px !important;
  width: 10px !important;
  border-radius: 3px !important;
  background: rgba(255,255,255,.16) !important;
  filter: blur(.2px) !important;
}
.preview-note-pin::before,
.note-pin::before,
.note-reader-pin::before { left: 7px !important; }
.preview-note-pin::after,
.note-pin::after,
.note-reader-pin::after { right: 8px !important; }
.preview-note-pin,
.note-pin {
  top: 18px !important;
  right: 18px !important;
  left: auto !important;
}
.note-reader-pin {
  top: 22px !important;
  right: 34px !important;
  left: auto !important;
}
.preview-note-paper.is-pinned,
.note-paper.is-pinned {
  overflow: visible !important;
}
.preview-note-paper.is-pinned:hover .preview-note-pin,
.note-paper.is-pinned:hover .note-pin {
  transform: rotate(14deg) translateY(-1px) !important;
}
.preview-note-paper.note-style--vintage .preview-note-pin,
.preview-note-paper[data-note-paper-style="vintage"] .preview-note-pin,
.note-paper.note-style--vintage .note-pin,
.note-paper[data-note-paper-style="vintage"] .note-pin,
.note-reader-page.note-style--vintage .note-reader-pin,
.note-reader-page[data-note-paper-style="vintage"] .note-reader-pin {
  background:
    linear-gradient(90deg, rgba(255,255,255,.12), rgba(255,255,255,0) 30%, rgba(255,255,255,.10) 64%, rgba(255,255,255,0)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 2px, rgba(92,57,17,.07) 2px 5px),
    linear-gradient(135deg, rgba(211,177,101,.86), rgba(166,126,59,.76)) !important;
  border-color: rgba(89, 56, 18, .20) !important;
}
.preview-note-pin[hidden],
.note-pin[hidden],
.note-reader-pin[hidden] {
  display: none !important;
}


/* FINAL FIX: pinned note masking tape must sit on the far top-right corner and protrude outside the paper.
   It must not cover the holes/date/content. */
.preview-note-paper.is-pinned,
.note-paper.is-pinned,
.note-reader-page.is-pinned {
  overflow: visible !important;
}

.preview-note-pin,
.note-pin,
.note-reader-pin {
  width: 86px !important;
  height: 19px !important;
  top: -12px !important;
  right: -14px !important;
  left: auto !important;
  bottom: auto !important;
  transform: rotate(14deg) !important;
  transform-origin: 70% 50% !important;
  z-index: 80 !important;
  border-radius: 3px 2px 4px 3px !important;
  box-shadow:
    0 7px 14px rgba(37, 25, 8, .20),
    0 2px 3px rgba(37, 25, 8, .12),
    inset 0 1px 0 rgba(255,255,255,.34) !important;
}

.note-reader-pin {
  top: -13px !important;
  right: -16px !important;
}

.preview-note-pin::before,
.note-pin::before,
.note-reader-pin::before,
.preview-note-pin::after,
.note-pin::after,
.note-reader-pin::after {
  top: 1px !important;
  bottom: 1px !important;
}

.preview-note-paper.is-pinned:hover .preview-note-pin,
.note-paper.is-pinned:hover .note-pin,
.note-reader-page.is-pinned:hover .note-reader-pin {
  transform: rotate(14deg) translateY(-1px) !important;
}

@media (max-width: 560px) {
  .preview-note-pin,
  .note-pin,
  .note-reader-pin {
    width: 74px !important;
    height: 17px !important;
    top: -10px !important;
    right: -10px !important;
  }
}

/* =========================================================
   Controls row fix
   إبقاء كل أزرار التحكم في صف مستقل كامل داخل كونتينر القسم/العنصر
   ========================================================= */
.content-section-head .section-actions,
.content-item-card .section-actions {
  grid-column: 1 / -1;
  width: 100%;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  padding-top: 2px;
  scrollbar-width: thin;
}

.content-section-head .section-actions > *,
.content-item-card .section-actions > * {
  flex: 0 0 auto;
}

.content-section-head .section-actions::-webkit-scrollbar,
.content-item-card .section-actions::-webkit-scrollbar {
  height: 5px;
}


/* =========================================================
   NTF Neon theme — real glow layer, not gradient-only
   ========================================================= */
.theme-picker button[data-theme="neon"] i {
  background: radial-gradient(circle, #ffffff 0 10%, #38f8ff 22%, #9b5cff 58%, #ff3df2 100%);
  box-shadow: 0 0 12px rgba(56,248,255,.9), 0 0 24px rgba(255,61,242,.48);
}

.ntf-dashboard-page[data-theme="neon"] {
  --pv-text: #f4fdff;
  --pv-muted: #9ee7f1;
  --pv-accent: #38f8ff;
  --pv-accent-2: #ff3df2;
  --pv-glow: rgba(56,248,255,.42);
  --pv-border: rgba(56,248,255,.42);
  --pv-card: rgba(5, 10, 25, .92);
  --preview-bg:
    linear-gradient(rgba(56,248,255,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155,92,255,.05) 1px, transparent 1px),
    radial-gradient(circle at 16% 8%, rgba(255,61,242,.34), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(56,248,255,.30), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(155,92,255,.22), transparent 36%),
    linear-gradient(180deg, #03040b 0%, #071126 48%, #02030a 100%);
  --preview-card-bg: linear-gradient(135deg, rgba(56,248,255,.13), rgba(255,61,242,.07));
  --preview-panel-bg: linear-gradient(180deg, rgba(5, 12, 30, .96), rgba(56,248,255,.045));
  --preview-cover-overlay:
    radial-gradient(circle at 18% 18%, rgba(56,248,255,.34), transparent 32%),
    radial-gradient(circle at 82% 28%, rgba(255,61,242,.26), transparent 34%),
    linear-gradient(135deg, rgba(155,92,255,.24), rgba(0,0,0,.22));
  --preview-avatar-ring: #040917;
  --preview-item-shadow:
    inset 0 1px 0 rgba(255,255,255,.14),
    inset 0 0 18px rgba(56,248,255,.07),
    0 0 18px rgba(56,248,255,.18),
    0 0 34px rgba(255,61,242,.08),
    0 18px 34px rgba(0,0,0,.30);
}

.ntf-dashboard-page[data-theme="neon"] .public-preview {
  position: relative;
  border-color: rgba(56,248,255,.48);
  box-shadow:
    0 0 0 1px rgba(56,248,255,.30),
    0 0 32px rgba(56,248,255,.24),
    0 0 72px rgba(255,61,242,.12),
    0 30px 90px rgba(0,0,0,.52);
}

.ntf-dashboard-page[data-theme="neon"] .public-preview::before {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent, rgba(56,248,255,.50), transparent) 0 0 / 100% 1px no-repeat,
    linear-gradient(180deg, transparent, rgba(255,61,242,.32), transparent) 100% 0 / 1px 100% no-repeat;
  filter: drop-shadow(0 0 8px rgba(56,248,255,.72));
  opacity: .85;
  z-index: 20;
}

.ntf-dashboard-page[data-theme="neon"] .preview-cover::after {
  opacity: .86;
  mix-blend-mode: screen;
}

.ntf-dashboard-page[data-theme="neon"] .preview-username,
.ntf-dashboard-page[data-theme="neon"] .public-section-preview-title,
.ntf-dashboard-page[data-theme="neon"] .preview-link strong {
  color: #f7feff;
  text-shadow: 0 0 8px rgba(56,248,255,.74), 0 0 18px rgba(56,248,255,.22);
}

.ntf-dashboard-page[data-theme="neon"] .preview-bio,
.ntf-dashboard-page[data-theme="neon"] .preview-link span {
  color: rgba(207, 250, 254, .78);
}

.ntf-dashboard-page[data-theme="neon"] .preview-avatar,
.ntf-dashboard-page[data-theme="neon"] .preview-avatar-img {
  box-shadow:
    0 0 0 3px rgba(3, 7, 18, .9),
    0 0 0 5px rgba(56,248,255,.58),
    0 0 24px rgba(56,248,255,.42),
    0 0 44px rgba(255,61,242,.18),
    0 18px 34px rgba(0,0,0,.36);
}

.ntf-dashboard-page[data-theme="neon"] .preview-link {
  position: relative;
  overflow: hidden;
  border-color: rgba(56,248,255,.42);
  box-shadow: var(--preview-item-shadow);
}

.ntf-dashboard-page[data-theme="neon"] .preview-link::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, transparent, rgba(56,248,255,.65), transparent) top left / 100% 1px no-repeat,
    linear-gradient(90deg, transparent, rgba(255,61,242,.36), transparent) bottom left / 100% 1px no-repeat;
  opacity: .86;
}

.ntf-dashboard-page[data-theme="neon"] .preview-link::after {
  content: "";
  position: absolute;
  inset: -45% auto -45% -40%;
  width: 34%;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.20), transparent);
  transform: skewX(-18deg);
  animation: ntfNeonSweep 4.8s ease-in-out infinite;
}

.ntf-dashboard-page[data-theme="neon"] .preview-link:hover {
  transform: translateY(-1px);
  border-color: rgba(56,248,255,.72);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    0 0 24px rgba(56,248,255,.30),
    0 0 42px rgba(255,61,242,.14),
    0 20px 38px rgba(0,0,0,.34);
}

.ntf-dashboard-page[data-theme="neon"] .theme-picker button.is-active {
  border-color: rgba(56,248,255,.72);
  box-shadow: 0 0 0 1px rgba(56,248,255,.28), 0 0 18px rgba(56,248,255,.24);
}

@keyframes ntfNeonSweep {
  0%, 48% { transform: translateX(0) skewX(-18deg); opacity: 0; }
  58% { opacity: .75; }
  82%, 100% { transform: translateX(430%) skewX(-18deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ntf-dashboard-page[data-theme="neon"] .preview-link::after {
    animation: none;
  }
}

/* =========================================================
   Note preview cards: keep everything inside the small card.
   The big protruding tape/overflow look stays only for the
   full-screen note reader modal (.note-reader-page); it must
   not leak into the compact preview grid cards.
   ========================================================= */
.preview-note-paper,
.preview-note-paper.is-pinned {
  overflow: hidden !important;
}
.preview-note-pin {
  width: 46px !important;
  height: 13px !important;
  top: 8px !important;
  right: 8px !important;
  left: auto !important;
  bottom: auto !important;
  transform: rotate(9deg) !important;
  transform-origin: center !important;
  z-index: 6 !important;
  box-shadow:
    0 3px 6px rgba(37, 25, 8, .18),
    inset 0 1px 0 rgba(255,255,255,.30) !important;
}
.preview-note-pin::before,
.preview-note-pin::after {
  top: 1px !important;
  bottom: 1px !important;
  width: 6px !important;
}
.preview-note-pin::before { left: 4px !important; }
.preview-note-pin::after { right: 4px !important; }
.preview-note-paper.is-pinned:hover .preview-note-pin {
  transform: rotate(9deg) translateY(0) !important;
}

/* Title/content always shrink-to-fit instead of overflowing the card,
   no matter how long the note text is. */
.preview-note-paper strong {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box !important;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.preview-note-paper span {
  display: -webkit-box !important;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden !important;
  max-height: none !important;
}
.preview-note-open {
  flex-shrink: 0;
}

/* Icons layout (3 tiny square notes per row): the card is a fixed-size
   square, so pin/emoji/date/text all need to shrink further to fit. */
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-pin {
  width: 32px !important;
  height: 9px !important;
  top: 5px !important;
  right: 5px !important;
}
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-pin::before,
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-pin::after {
  width: 4px !important;
}
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-mood {
  font-size: 13px !important;
}
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-date {
  font-size: 9px !important;
}
.preview-section-group[data-section-type="notes"][data-layout="icons"] .preview-note-paper span {
  -webkit-line-clamp: 2;
}

/* =========================================================
   QR code dialog
   ========================================================= */
.qr-code-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 8px 0 4px;
}
.qr-code-frame {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  min-height: 220px;
}
.qr-code-frame canvas {
  display: block;
  width: 220px;
  height: 220px;
}
.qr-code-url {
  direction: ltr;
  font-size: 13px;
  color: var(--pv-text-muted, rgba(255, 255, 255, .68));
  word-break: break-all;
  text-align: center;
  margin: 0;
}
.qr-code-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
