/* ===========================================================
   Notestopin dashboard
   Layout: fixed library rail + note canvas
   =========================================================== */

.cloudExpiryTip {
  display: flex;
  align-items: center;
  gap: 21px;
  margin: 22px 28px 20px;
  padding: 20px 23px;
  border: 1px solid var(--red-line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
}
.cloudExpiryTip[hidden] { display: none; }
/* Cloud reminders belong to the notes list, including when account status refreshes mid-note. */
#notesView:has(> #grid[hidden]) > .cloudExpiryTip { display: none; }
.cloudExpiryTipIcon {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--red-wash);
  color: var(--red);
  font-size: 25px;
}
.cloudExpiryTipCopy { flex: 1; min-width: 0; }
.cloudExpiryTipEyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--red-deep);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.cloudExpiryTip h2 { margin: 0; font-size: 18px; line-height: 1.25; letter-spacing: -.02em; }
.cloudExpiryTip p { margin: 4px 0 0; color: var(--ink-3); font-size: 12px; line-height: 1.4; }
.cloudExpiryTipActions { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.cloudExpiryTipActions span { color: var(--red-deep); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cloudExpiryTipActions button {
  border: 0;
  border-radius: 9px;
  background: var(--red);
  color: var(--on-red);
  padding: 10px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.cloudExpiryTip.isRetention { flex-wrap: wrap; }
.cloudExpiryTip.isRetention .cloudExpiryTipActions { flex-basis: 100%; flex-direction: column; align-items: flex-start; gap: 10px; padding-inline-start: 63px; white-space: normal; }
.cloudRetentionButtons { display: flex; flex-wrap: wrap; gap: 8px; }
.cloudRetentionButtons[hidden], .cloudRetentionPlans[hidden] { display: none; }
.cloudRetentionButtons button { min-height: 40px; }
.cloudRetentionButtons button:not(#cloudRetentionPaid) { background: var(--red-wash); color: var(--red-deep); border: 1px solid var(--red-line); }
.cloudRetentionButtons button:disabled { cursor: wait; opacity: .6; }
.cloudRetentionButtons button span { color: inherit; font: inherit; }
#cloudRetentionStatus[data-error="true"] { color: var(--red-deep); }
@media (max-width: 760px) {
  .cloudExpiryTip { margin: 15px 15px 20px; padding: 15px; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
  .cloudExpiryTipActions { width: 100%; justify-content: space-between; padding-left: 54px; }
  .cloudExpiryTip h2 { font-size: 16px; }
  .cloudExpiryTip.isRetention .cloudExpiryTipActions { padding-inline-start: 0; }
}

:root{
  /* Channels. Ink, paper, shadow and red are bare triplets so the one dark block at the end of this
     file can repaint the whole page: every rgba() below mixes an alpha into a channel rather than
     naming a colour that would then have to be named again in dark. */
  --ink-rgb: 23,20,15;
  --canvas-rgb: 246,245,243;
  --paper-rgb: 255,255,255;
  --shadow-rgb: 23,20,15;
  --red-rgb: 230,0,35;

  /* Brand */
  --red: rgb(230,0,35);
  --red-deep: rgb(184,0,28);
  --red-wash: rgba(var(--red-rgb),0.09);
  --red-line: rgba(var(--red-rgb),0.22);
  /* Whatever sits on red stays white, in both themes. */
  --on-red: #ffffff;

  /* Surfaces */
  --canvas: #f6f5f3;
  --surface: #ffffff;
  --rail: #ffffff;
  --sunken: rgba(var(--ink-rgb),0.035);
  --hover: #f5f5f2;
  --glass: rgba(var(--paper-rgb),0.98);
  --veil: rgba(var(--paper-rgb),0.92);

  /* Links inside note text */
  --link-rgb: 0,132,255;
  --link: rgb(0, 132, 255);
  --link-deep: rgb(0, 105, 210);

  /* A tooltip inverts the page on purpose */
  --tip: #111111;
  --tip-ink: rgba(255,255,255,0.95);

  /* Chips that float over a Pin's photo. Light frosts white over the image;
     at night they frost with the page's navy instead of glaring. */
  --chip: rgba(255,255,255,0.92);
  --chip-soft: rgba(255,255,255,0.86);
  --chip-strong: rgba(255,255,255,0.94);
  --chip-line: rgba(255,255,255,0.55);
  --chip-line-soft: rgba(255,255,255,0.5);
  --chip-line-strong: rgba(255,255,255,0.95);
  --chip-hover: #ffffff;

  /* The knob of a switch, which reads as raised in both themes. */
  --knob: #ffffff;

  /* Ink */
  --ink: #17140f;
  --ink-2: rgba(var(--ink-rgb),0.74);
  --ink-3: rgba(var(--ink-rgb),0.54);
  --ink-4: rgba(var(--ink-rgb),0.38);

  /* Lines + elevation */
  --line: rgba(var(--ink-rgb),0.11);
  --line-soft: rgba(var(--ink-rgb),0.06);
  --sh-1: 0 1px 2px rgba(var(--shadow-rgb),0.05);
  --sh-2: 0 10px 28px rgba(var(--shadow-rgb),0.09);
  --sh-3: 0 28px 70px rgba(var(--shadow-rgb),0.16);

  /* Geometry */
  --r-xs: 8px;
  --r-sm: 11px;
  --r-md: 14px;
  --r-lg: 20px;
  --side-w: 268px;
  --pad-x: 26px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Legacy aliases kept so older rules below keep resolving */
  --bg: var(--canvas);
  --card: var(--surface);
  --txt: var(--ink);
  --mut: var(--ink-3);
  --bd: var(--line);
}

*{ box-sizing: border-box; }

[hidden]{ display:none !important; }

html{ scrollbar-gutter: stable; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial;
  font-size: 14px;
  line-height: 1.45;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea{ font-family: inherit; color: inherit; }

/* Icons never swallow clicks: every delegated handler reads the button itself. */
button svg, a svg, label svg{ pointer-events: none; }

.ico{ width: 18px; height: 18px; flex: 0 0 auto; display:block; }

::selection{ background: rgba(var(--red-rgb),0.16); }

:focus-visible{ outline: 2px solid rgba(var(--red-rgb),0.45); outline-offset: 2px; }

body.modalLock{ overflow: hidden; }

/* When a modal is open, freeze the background completely (no hover, no click). */
body.modalLock .app{
  pointer-events: none;
  user-select: none;
  filter: blur(10px);
  opacity: 0.55;
}

/* ---------------- Shell ---------------- */

.app{
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  min-height: 100vh;
}
.app.isMin{ --side-w: 74px; }

.scrim{
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(var(--shadow-rgb),0.32);
  backdrop-filter: blur(2px);
}

/* ---------------- Sidebar ---------------- */

.side{
  position: sticky;
  top: 0;
  z-index: 50;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px 14px;
  background: var(--rail);
  border-right: 1px solid var(--line-soft);
  min-width: 0;
}

.sideHead{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
}
.brand{
  display:flex;
  align-items:center;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  border-radius: var(--r-sm);
  padding: 2px;
  margin: -2px;
}
.brand:hover .brandKind{ color: var(--red-deep); }
/* The wordmark file already contains the logo mark, so the square icon is rail-only. */
.brandMark{
  width: 26px;
  height: 26px;
  display:none;
  flex: 0 0 auto;
  border-radius: 8px;
}
.brandTxt{ display:flex; flex-direction: column; gap: 1px; min-width: 0; }
.brandWord{
  height: 18px;
  width: auto;
  max-width: 100%;
  display:block;
  margin-left: -1px;
}
.brandKind{
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-4);
  transition: color 0.14s ease;
}

.iconBtn{
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display:grid;
  place-items:center;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.iconBtn:hover{ background: var(--sunken); color: var(--ink); }
.iconBtn:active{ transform: translateY(1px); }

.workspaceSwitch{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:4px;
  padding:4px;
  border:1px solid var(--line-soft);
  border-radius:var(--r-md);
  background:var(--sunken);
}
.workspaceTab{
  min-width:0;
  display:flex;
  align-items:center;
  gap:7px;
  padding:7px 8px;
  border:0;
  border-radius:10px;
  background:transparent;
  color:var(--ink-3);
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  text-align:start;
  transition:background .14s ease,color .14s ease,box-shadow .14s ease;
}
.workspaceTab .ico{ width:15px; height:15px; }
.workspaceTab:hover{ color:var(--ink); }
.workspaceTab[aria-selected="true"]{
  background:var(--surface);
  color:var(--red-deep);
  box-shadow:var(--sh-1);
}
.workspaceTabLabel{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.workspaceTabCount{
  margin-inline-start:auto;
  min-width:20px;
  padding:1px 5px;
  border-radius:999px;
  background:rgba(var(--ink-rgb),.06);
  color:var(--ink-4);
  font-size:10px;
  font-variant-numeric:tabular-nums;
  text-align:center;
}
.workspaceTab[aria-selected="true"] .workspaceTabCount{
  background:rgba(var(--red-rgb),.1);
  color:var(--red-deep);
}

/* Primary capture action: the whole product starts on Pinterest. */
.capture{
  display:flex;
  align-items:center;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-1);
  cursor: pointer;
  text-align: left;
  transition: box-shadow 0.16s var(--ease), transform 0.16s var(--ease), border-color 0.16s ease;
}
.capture:hover{ box-shadow: var(--sh-2); transform: translateY(-1px); border-color: var(--line); }
.capture:active{ transform: translateY(0); }
.captureIco{
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display:grid;
  place-items:center;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--red), var(--red-deep));
  color: var(--on-red);
  box-shadow: 0 6px 16px rgba(var(--red-rgb),0.28);
}
.captureTxt{ display:flex; flex-direction: column; min-width: 0; }
.captureT{ font-size: 13px; font-weight: 650; letter-spacing: -0.1px; }
.captureS{ font-size: 11.5px; font-weight: 500; color: var(--ink-4); }

.sideLbl{
  display:flex;
  align-items:center;
  gap: 6px;
  padding: 0 8px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.lblIco{ width: 13px; height: 13px; opacity: 0.7; }
.sideLblN{ margin-left: auto; letter-spacing: 0; font-weight: 650; }

.nav{ display:flex; flex-direction: column; gap: 1px; }

.navItem{
  position: relative;
  display:flex;
  align-items:center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  font-size: 13.3px;
  font-weight: 550;
  cursor: pointer;
  text-align: left;
  transition: background 0.13s ease, color 0.13s ease;
}
.navItem:hover{ background: var(--sunken); color: var(--ink); }
.navItem.on{ background: var(--red-wash); color: var(--red-deep); font-weight: 680; }
.navItem.on::before{
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 17px;
  border-radius: 0 3px 3px 0;
  background: var(--red);
}
.navIco{ opacity: 0.9; }
.navLbl{ flex: 1 1 auto; min-width: 0; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }
.navCount{
  flex: 0 0 auto;
  min-width: 24px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--sunken);
  color: var(--ink-4);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.navItem.on .navCount{ background: rgba(var(--red-rgb),0.14); color: var(--red-deep); }
.navItem.isEmptyCount .navCount{ opacity: 0.5; }

/* Tags */
.tagPanel{
  flex: 1 1 auto;
  min-height: 90px;
  display:flex;
  flex-direction: column;
  padding-top: 6px;
  border-top: 1px solid var(--line-soft);
}
.tagSearchWrap{ position: relative; display:flex; align-items:center; margin: 0 2px 8px; }
.tagSearchIco{
  position: absolute;
  left: 9px;
  width: 14px;
  height: 14px;
  color: var(--ink-4);
  pointer-events: none;
}
.tagSearch{
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--sunken);
  padding: 6px 10px 6px 29px;
  outline: none;
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.tagSearch::placeholder{ color: var(--ink-4); }
.tagSearch:focus{
  background: var(--surface);
  border-color: var(--red-line);
  box-shadow: 0 0 0 3px rgba(var(--red-rgb),0.09);
}

.tagBar{
  flex: 1 1 auto;
  min-height: 0;
  display:flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--ink-rgb),0.18) transparent;
  overscroll-behavior: contain;
}
.tagBar::-webkit-scrollbar{ width: 8px; }
.tagBar::-webkit-scrollbar-thumb{ background: rgba(var(--ink-rgb),0.14); border-radius: 999px; border: 2px solid var(--rail); }
.tagBar::-webkit-scrollbar-track{ background: transparent; }

.tagRow{
  display:flex;
  align-items:center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
  font-size: 12.8px;
  font-weight: 550;
  transition: background 0.13s ease, color 0.13s ease;
}
.tagRow:hover{ background: var(--sunken); color: var(--ink); }
.tagRow.on{ background: var(--red-wash); color: var(--red-deep); font-weight: 680; }
.tagRowName{ flex: 1 1 auto; min-width: 0; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }
.tagRowName .hash{ color: var(--ink-4); margin-right: 1px; }
.tagRow.on .tagRowName .hash{ color: rgba(var(--red-rgb),0.62); }
.tagRowCount{
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 650;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.tagRow.on .tagRowCount{ color: rgba(var(--red-rgb),0.72); }
.tagEmpty{ padding: 6px 10px; font-size: 12.3px; font-weight: 500; color: var(--ink-4); }

/* Footer */
.sideFoot{ display:flex; flex-direction: column; gap: 10px; }

.rateCta{
  display:flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--on-red);
  background: linear-gradient(140deg, var(--red), var(--red-deep));
  box-shadow: 0 10px 26px rgba(var(--red-rgb),0.26);
  transition: transform 0.16s var(--ease), box-shadow 0.16s ease;
}
.rateCta[hidden]{ display:none; }
.rateCta:hover{ transform: translateY(-1px); box-shadow: 0 14px 32px rgba(var(--red-rgb),0.34); }
.rateCta:active{ transform: translateY(0); }
.rateCtaStars{ font-size: 11.5px; letter-spacing: 2px; color: #ffe08a; }
.rateCtaTxt{ font-size: 12.3px; font-weight: 650; line-height: 1.3; }

.sideActs{ display:flex; flex-direction: column; gap: 1px; }

.sideBtn{
  display:flex;
  align-items:center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: background 0.13s ease, color 0.13s ease;
}
.sideBtn:hover{ background: var(--sunken); color: var(--ink); }
.sideBtn .ico{ opacity: 0.85; }
.sideBtnT{ flex: 1 1 auto; min-width: 0; overflow:hidden; text-overflow: ellipsis; white-space: nowrap; }

.exportWrap{ position: relative; display:flex; }
.exportCaret{ width: 13px; height: 13px; opacity: 0.5; }
#export[aria-expanded="true"]{ background: var(--sunken); color: var(--ink); }
#export[aria-expanded="true"] .exportCaret{ transform: rotate(180deg); }

.exportMenu{
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 200;
  min-width: 210px;
  padding: 6px;
  display:flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
}
.exportMenu[hidden]{ display:none; }
.exportMenuItem{
  border: none;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--r-xs);
  font-size: 12.8px;
  font-weight: 550;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.exportMenuItem:hover{ background: var(--sunken); color: var(--ink); }

.sideMeta{
  display:flex;
  align-items:center;
  gap: 7px;
  padding: 9px 10px 2px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-4);
  font-size: 11.3px;
  font-weight: 550;
  line-height: 1.35;
}
.metaIco{ width: 13px; height: 13px; opacity: 0.75; }
.sideMetaTxt{ min-width: 0; }

/* Collapsed rail (wide layouts only; narrow screens use the drawer instead) */
@media (min-width: 1081px){
  .app.isMin .side{ padding-left: 12px; padding-right: 12px; }
  .app.isMin .brandMark{ display:block; }
  .app.isMin .brandTxt,
  .app.isMin .workspaceTabLabel,
  .app.isMin .workspaceTabCount,
  .app.isMin .captureTxt,
  .app.isMin .navLbl,
  .app.isMin .navCount,
  .app.isMin .sideBtnT,
  .app.isMin .exportCaret,
  .app.isMin .tagPanel,
  .app.isMin .rateCta,
  .app.isMin .sideMetaTxt,
  .app.isMin .sideLbl{ display:none; }
  .app.isMin .sideHead{ flex-direction: column; gap: 10px; }
  .app.isMin .brand{ justify-content: center; }
  .app.isMin .workspaceSwitch{ grid-template-columns:1fr; padding:3px; }
  .app.isMin .workspaceTab{ justify-content:center; padding:7px 0; }
  .app.isMin .capture,
  .app.isMin .navItem,
  .app.isMin .sideBtn{ justify-content: center; padding-left: 0; padding-right: 0; }
  .app.isMin .capture{ padding: 6px; }
  .app.isMin .navItem.on::before{ left: -12px; }
  .app.isMin .nav{ padding-top: 8px; border-top: 1px solid var(--line-soft); }
  .app.isMin .sideFoot{ margin-top: auto; }
  .app.isMin .sideMeta{ justify-content: center; padding-left: 0; padding-right: 0; }
  .app.isMin .exportMenu{ left: calc(100% + 8px); bottom: 0; }
  .app.isMin .sideToggle .ico{ transform: scaleX(-1); }
}

/* ---------------- Main column ---------------- */

.main{ min-width: 0; display:flex; flex-direction: column; }

.top{
  position: sticky;
  top: 0;
  z-index: 20;
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 16px var(--pad-x) 14px;
  background: rgba(var(--canvas-rgb),0.82);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border-bottom: 1px solid var(--line-soft);
}
.menuBtn{ display:none; }
.topL{ min-width: 0; flex: 0 1 auto; }
.viewTitle{
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.35px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.viewSub{
  margin-top: 2px;
  font-size: 12.3px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topR{ margin-left: auto; display:flex; align-items:center; gap: 8px; min-width: 0; }

.searchWrap{ position: relative; display:flex; align-items:center; width: clamp(190px, 30vw, 360px); }
.searchIco{
  position: absolute;
  left: 12px;
  width: 15px;
  height: 15px;
  color: var(--ink-4);
  pointer-events: none;
}
.search{
  width: 100%;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 9px 34px 9px 34px;
  outline: none;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--sh-1);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.search::placeholder{ color: var(--ink-4); }
.search::-webkit-search-cancel-button{ -webkit-appearance: none; appearance: none; }
.search:focus{ border-color: var(--red-line); box-shadow: 0 0 0 3px rgba(var(--red-rgb),0.10); }
.kbd{
  position: absolute;
  right: 9px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--sunken);
  color: var(--ink-4);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 650;
  line-height: 16px;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.searchWrap:focus-within .kbd{ opacity: 0; }

.clearBtn{
  display:inline-flex;
  align-items:center;
  gap: 5px;
  padding: 8px 12px 8px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--sh-1);
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}
.clearBtn .ico{ width: 14px; height: 14px; }
.clearBtn:hover{ border-color: var(--red-line); color: var(--red-deep); background: var(--surface); }
.clearBtn:disabled{ opacity: 0.45; cursor: default; box-shadow: none; }
.clearBtn:disabled:hover{ border-color: var(--line); color: var(--ink-2); background: var(--surface); }

.selectionBar{
  position:sticky;
  top:calc(var(--pno-top-height, 70px) + 8px);
  z-index:19;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 10px 12px 10px 14px;
  border: 1px solid var(--red-line);
  border-radius: var(--r-md);
  background: var(--veil);
  box-shadow: var(--sh-1);
}
.selectionBar[hidden]{ display:none; }
.selectionSummary,
.selectionActions{ display:flex; align-items:center; gap: 8px; }
.selectionSummary{
  min-width: 0;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.selectionMark,
.cardSelectMark{
  width: 20px;
  height: 20px;
  display:grid;
  place-items:center;
  flex: 0 0 auto;
  border: 1.5px solid var(--red);
  border-radius: 7px;
  background: var(--red);
  color: var(--on-red);
}
.selectionMark::after,
.card.isSelected .cardSelectMark::after{
  content:"";
  width: 8px;
  height: 4px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-1px) rotate(-45deg);
}
.selectionBtn{
  min-height: 32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 650;
  cursor:pointer;
  white-space:nowrap;
}
.selectionBtn:hover{ border-color: var(--red-line); color: var(--red-deep); }
.selectionBtn.danger{ border-color: var(--red-line); color: var(--red-deep); }
.selectionBtn.danger:not(:disabled):hover{ background: var(--red); color: var(--on-red); }
.selectionBtn:disabled{ opacity: 0.42; cursor: default; }
.selectionBtn .ico{ width: 14px; height: 14px; }

/* Shared button (used by detail actions, empty state, feedback form) */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 7px;
  border: 1px solid transparent;
  background: var(--red);
  color: var(--on-red);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, box-shadow 0.14s ease, transform 0.14s var(--ease), color 0.14s ease, border-color 0.14s ease;
}
.btn:hover{ background: var(--red-deep); box-shadow: 0 8px 22px rgba(var(--red-rgb),0.26); }
.btn:active{ transform: translateY(1px); }
.btn .ico{ width: 16px; height: 16px; }
.btn.ghost{
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-2);
  box-shadow: var(--sh-1);
}
.btn.ghost:hover{ background: var(--surface); border-color: var(--line); color: var(--ink); box-shadow: var(--sh-2); }
.btn.danger{ background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn.danger:hover{ background: rgba(var(--red-rgb),0.08); border-color: var(--red-line); color: var(--red-deep); box-shadow: none; }

/* ---------------- Content ---------------- */

#notesView{ padding: 20px var(--pad-x) 56px; min-width: 0; }

.grid{
  position: relative;
  width: 100%;
}
.grid.isEmpty{ display:block; }

/* The browser's multi-column algorithm rebalances every card whenever another card is appended.
   That makes an infinite wall visibly reorder while someone scrolls. The dashboard therefore owns
   masonry placement: every loaded card gets an absolute, permanent slot and only new slots are
   added below the existing columns. A resize may deliberately repack the wall; scrolling cannot. */
.gridMasonry{
  position:relative;
  width:100%;
  min-height:1px;
  overflow-anchor:none;
}
.gridMasonrySlot{
  position:absolute;
  inset-block-start:0;
  min-width:0;
  overflow-anchor:none;
}
.gridMasonrySlot > .card{
  width:100%;
  margin:0;
}

.workspaceMerge{
  padding:8px 12px;
  font-size:12.5px;
  color:var(--red-deep);
  box-shadow:none;
}
.workspaceMerge:disabled{ opacity:.5; cursor:default; }
/* A thin strip above the wall, holding the one choice that belongs to the wall itself. */
.gridBar{
  display:flex;
  justify-content: flex-end;
  padding: 0 2px 10px;
}

.compactSwitch{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  padding: 4px 9px 4px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;
  transition: color 0.14s ease, border-color 0.14s ease;
}
.compactSwitch:hover{ color: var(--ink); border-color: var(--line); }
.compactSwitchIco{ width: 13px; height: 13px; }
.compactSwitch:has(.miniSwitch input:checked){ color: var(--red-deep); border-color: rgba(var(--red-rgb),0.32); }

.miniSwitch{ position:relative; width: 26px; height: 15px; flex: 0 0 auto; }
.miniSwitch input{ position:absolute; width:1px; height:1px; opacity:0; margin:0; }
.miniTrack{
  position:absolute;
  inset:0;
  border-radius: 999px;
  background: rgba(var(--ink-rgb),0.16);
  transition: background 0.16s ease;
}
.miniThumb{
  position:absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--knob);
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb),0.28);
  transition: transform 0.18s var(--ease);
}
.miniSwitch input:checked + .miniTrack{ background: var(--red); }
.miniSwitch input:checked + .miniTrack .miniThumb{ transform: translateX(11px); }
.miniSwitch input:focus-visible + .miniTrack{ outline: 2px solid rgba(var(--red-rgb),0.32); outline-offset: 2px; }

/* Compact view: the note text steps aside and the pins stand on their own, like Pinterest's own
   boards. Everything that lives on the photo (pin pill, select mark, hover actions) stays. */
.grid.compact .card{ break-inside: avoid; }
.grid.compact .card.hasImg .body{ display:none; }
/* A note whose pin never handed us a picture would be a blank tile, so it keeps its title. */
.grid.compact .card:not(.hasImg) .excerpt,
.grid.compact .card:not(.hasImg) .meta,
.grid.compact .card:not(.hasImg) .tags{ display:none; }

.gridSentinel{
  width: 100%;
  overflow-anchor:none;
}

.gridSentinel{ height: 1px; }
.gridSentinel.isLoading{ height:42px; position:relative; }
.gridPreparing{
  min-height:74px;
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  color:var(--ink-3);
  break-inside:avoid;
}
.gridPreparing span,
.gridSentinel.isLoading::before,
.gridSentinel.isLoading::after{
  width:9px;
  height:9px;
  border-radius:999px;
  background:color-mix(in srgb, var(--ink) 18%, transparent);
  animation:pno-grid-loading 1s ease-in-out infinite alternate;
}
.gridPreparing span:nth-child(2){ animation-delay:.16s; }
.gridPreparing span:nth-child(3){ animation-delay:.32s; }
.gridPreparing small{ margin-inline-start:5px; font-size:12px; font-weight:650; }
.gridSentinel.isLoading::before,
.gridSentinel.isLoading::after{ content:""; position:absolute; top:15px; left:calc(50% - 13px); }
.gridSentinel.isLoading::after{ left:calc(50% + 4px); animation-delay:.2s; }
@keyframes pno-grid-loading{ from{ opacity:.35; transform:translateY(1px); } to{ opacity:1; transform:translateY(-2px); } }

/* ---------------- Linked view: graph ---------------- */

.linksBar{
  display:flex;
  align-items:center;
  gap: 12px;
  flex-wrap: wrap;
  margin: -2px 0 14px;
}
.linksBar[hidden]{ display:none; }

.segs{
  display:inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.seg{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  height: 30px;
  padding: 0 13px 0 11px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font-size: 12.8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.seg .ico{ width: 15px; height: 15px; opacity: 0.8; }
.seg:hover{ color: var(--ink); }
.seg[aria-pressed="true"]{
  background: var(--red-wash);
  color: var(--red-deep);
  font-weight: 680;
}
.seg[aria-pressed="true"] .ico{ opacity: 1; }

.linksMeta{
  min-width: 0;
  font-size: 12.6px;
  font-weight: 520;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.linksMeta .lmSep{ margin: 0 7px; opacity: 0.4; }
.linksMeta .lmHit{ color: var(--red-deep); font-weight: 650; }

.graphTools{
  margin-left: auto;
  display:flex;
  align-items:center;
  gap: 5px;
}
.graphTools[hidden]{ display:none; }

.graphWrap{
  position: relative;
  height: clamp(520px, calc(100vh - 196px), 1000px);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background:
    radial-gradient(circle at 1px 1px, rgba(var(--ink-rgb),0.075) 1px, transparent 0) 0 0 / 22px 22px,
    var(--surface);
  box-shadow: var(--sh-1);
  overflow: hidden;
}
.graphWrap[hidden]{ display:none; }

.graphSvg{
  display:block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.graphSvg.isPanning{ cursor: grabbing; }
.graphSvg.isMarquee{ cursor: crosshair; }

.graphMarquee{
  position:absolute;
  z-index:4;
  border:1.5px solid rgba(var(--red-rgb),0.78);
  border-radius:5px;
  background:rgba(var(--red-rgb),0.09);
  box-shadow:0 0 0 1px rgba(var(--paper-rgb),0.72) inset;
  pointer-events:none;
}
.graphMarquee[hidden]{ display:none; }

#gArrow path{ fill: rgba(var(--ink-rgb),0.34); }
#gArrowOn path{ fill: var(--red); }

.gEdge{
  fill: none;
  stroke: rgba(var(--ink-rgb),0.26);
  stroke-width: 1.4;
  marker-end: url(#gArrow);
  transition: stroke 0.14s ease, opacity 0.14s ease;
}
.gEdge.isBoth{ marker-start: url(#gArrow); }
.gEdge.on{
  stroke: var(--red);
  stroke-width: 2;
  marker-end: url(#gArrowOn);
}
.gEdge.on.isBoth{ marker-start: url(#gArrowOn); }
.graphSvg.hasFocus .gEdge{ opacity: 0.18; }
.graphSvg.hasFocus .gEdge.on{ opacity: 1; }

.gNode{ cursor: pointer; }
.gDot{
  fill: var(--surface);
  stroke: var(--red);
  stroke-width: 2.2;
  transition: fill 0.14s ease, stroke 0.14s ease, stroke-width 0.14s ease;
}
.gNode.isGhost .gDot{
  stroke: rgba(var(--ink-rgb),0.32);
  stroke-dasharray: 3.4 3;
}
.gCore{
  fill: var(--red);
  opacity: 0.9;
  transition: opacity 0.14s ease, fill 0.14s ease;
}
.gNode.isGhost .gCore{ fill: rgba(var(--ink-rgb),0.34); opacity: 0.55; }
.gLbl{
  fill: var(--ink-2);
  font-family: inherit;
  /* Counter-scaled by the live zoom so labels stay readable at any zoom. */
  font-size: calc(11.6px / var(--gk, 1));
  font-weight: 580;
  text-anchor: middle;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: calc(3.6px / var(--gk, 1));
  stroke-linejoin: round;
  pointer-events: none;
}
.gNode.isGhost .gLbl{ fill: var(--ink-4); }

.gNode:hover .gDot,
.gNode.on .gDot{ fill: var(--red-wash); stroke-width: 3; }
.gNode.isSel .gDot{ fill: var(--red); stroke: var(--red-deep); }
.gNode.isSel .gCore{ fill: var(--surface); opacity: 1; }
.gNode.isGroupSel .gDot{
  fill:var(--red-wash);
  stroke:var(--red-deep);
  stroke-width:3;
}
.gNode.isGroupSel .gCore{ fill:var(--red-deep); opacity:1; }
.gNode.isGroupSel .gHit{
  fill:rgba(var(--red-rgb),0.08);
  stroke:rgba(var(--red-rgb),0.48);
  stroke-width:calc(2px / var(--gk, 1));
}
.gNode.isKb .gDot{ stroke: var(--red-deep); stroke-width: 3.4; }
.gNode.isKb .gHit{
  fill: transparent;
  stroke: rgba(var(--red-rgb),0.42);
  stroke-width: calc(2px / var(--gk, 1));
  stroke-dasharray: calc(3px / var(--gk, 1)) calc(3px / var(--gk, 1));
}
.gHit{ fill: transparent; stroke: none; }
.graphSvg:focus{ outline: none; }
.graphSvg:focus-visible{ outline: 2px solid rgba(var(--red-rgb),0.45); outline-offset: -3px; }

.graphSvg.hasFocus .gNode{ opacity: 0.26; }
.graphSvg.hasFocus .gNode.on{ opacity: 1; }
.graphSvg.hasFocus .gNode.isGroupSel{ opacity:1; }
.graphSvg.isFiltered .gNode:not(.isMatch) .gDot{ stroke: rgba(var(--ink-rgb),0.24); }
.graphSvg.isFiltered .gNode:not(.isMatch) .gCore{ fill: rgba(var(--ink-rgb),0.24); }
.graphSvg.isFiltered .gNode:not(.isMatch) .gLbl{ fill: var(--ink-4); }
.graphSvg.hideLabels .gLbl{ display:none; }

/* Labels that would sit on top of a busier node's label wait for attention. */
.gNode.noLbl .gLbl{ display:none; }
.gNode.noLbl:hover .gLbl,
.gNode.noLbl.on .gLbl,
.gNode.noLbl.isKb .gLbl,
.gNode.noLbl.isSel .gLbl,
.gNode.noLbl.isGroupSel .gLbl{ display:block; }
.graphSvg.hideLabels .gNode.noLbl:hover .gLbl,
.graphSvg.hideLabels .gNode.noLbl.on .gLbl,
.graphSvg.hideLabels .gNode.noLbl.isKb .gLbl,
.graphSvg.hideLabels .gNode.noLbl.isSel .gLbl,
.graphSvg.hideLabels .gNode.noLbl.isGroupSel .gLbl{ display:none; }

.graphLegend{
  position: absolute;
  left: 14px;
  bottom: 12px;
  display:flex;
  align-items:center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 7px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(var(--paper-rgb),0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11.4px;
  font-weight: 550;
  color: var(--ink-3);
  pointer-events: none;
}
.glItem{ display:inline-flex; align-items:center; gap: 6px; }
.glDot{
  width: 11px;
  height: 11px;
  border-radius: 999px;
  border: 2px solid var(--red);
  background: var(--surface);
}
.glDot.isGhost{ border-color: rgba(var(--ink-rgb),0.32); border-style: dashed; }
.glArrow{
  position: relative;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: rgba(var(--ink-rgb),0.3);
}
.glArrow::after{
  content: "";
  position: absolute;
  right: -1px;
  top: -3px;
  border-left: 6px solid rgba(var(--ink-rgb),0.34);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}
.glHint{ color: var(--ink-4); }

.graphTip{
  position: absolute;
  z-index: 5;
  width: min(268px, calc(100% - 20px));
  max-width: 268px;
  padding: 10px 12px 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-3);
  pointer-events: none;
}
.graphTip[hidden]{ display:none; }
.gtMedia{
  position:relative;
  height:132px;
  margin:-10px -12px 10px;
  overflow:hidden;
  border-radius:var(--r-md) var(--r-md) 10px 10px;
  background:linear-gradient(145deg, var(--red-wash), var(--sunken));
}
.gtMedia img,
.gtMedia video{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
}
.gtVideoBadge{
  position:absolute;
  left:8px;
  bottom:8px;
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:4px 8px 4px 5px;
  border:1px solid rgba(255,255,255,0.38);
  border-radius:999px;
  background:rgba(23,20,15,0.76);
  color:#fff;
  box-shadow:0 3px 12px rgba(var(--shadow-rgb),0.24);
  backdrop-filter:blur(7px);
  font-size:10.5px;
  font-weight:680;
}
.gtVideoBadge .ico{ width:14px; height:14px; }
.gtPin{
  font-size: 10.4px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.gtTitle{
  margin-top: 2px;
  font-size: 13.2px;
  font-weight: 650;
  letter-spacing: -0.1px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gtText{
  margin-top: 4px;
  font-size: 12.1px;
  font-weight: 460;
  color: var(--ink-2);
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gtMeta{
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--line-soft);
  display:flex;
  align-items:center;
  gap: 10px;
  font-size: 11.2px;
  font-weight: 600;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.gtMeta .ico{ width: 12px; height: 12px; opacity: 0.65; }
.gtMeta span{ display:inline-flex; align-items:center; gap: 4px; }

.graphEmpty{
  position: absolute;
  inset: 0;
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  gap: 6px;
  padding: 24px;
  text-align:center;
}
.graphEmpty[hidden]{ display:none; }

/* ---------------- Note card ---------------- */

.card{
  break-inside: avoid;
  margin: 0 0 18px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--sh-1);
  display:flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s ease;
}
.card:hover{ transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--line); }
.card:focus{ outline: none; box-shadow: 0 0 0 3px rgba(var(--red-rgb),0.18), var(--sh-2); }
.card.isSelectMode{ cursor: pointer; }
.card.isSelectMode .ov{ display:none; }
.card.isSelected{
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(var(--red-rgb),0.14), var(--sh-2);
}
.card.isSelected:hover{
  border-color: var(--red-deep);
  box-shadow: 0 0 0 3px rgba(var(--red-rgb),0.16), var(--sh-2);
}

.thumb{
  min-height: 96px;
  max-height: 520px;
  background: color-mix(in srgb, var(--surface) 88%, var(--ink) 12%);
  position: relative;
  overflow: hidden;
}
.thumb.videoOnly{ aspect-ratio: 2 / 3; }
.thumb.isMediaLoading::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:3;
  pointer-events:none;
  background:linear-gradient(100deg, transparent 20%, rgba(var(--paper-rgb),.5) 45%, transparent 70%);
  transform:translateX(-120%);
  animation:pno-media-skeleton 1.25s ease-in-out infinite;
}
@keyframes pno-media-skeleton{ to{ transform:translateX(120%); } }
.thumb img{
  position:absolute;
  inset:0;
  z-index:1;
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  opacity:0;
  transition:opacity .18s ease;
}
.thumb.isMediaLoaded img{ opacity:1; }
.pinMediaUnavailable,
.dImgUnavailable,
#modal .pno-media-unavailable{
  position:absolute;
  inset:0;
  z-index:2;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  padding:18px;
  text-align:center;
  color:var(--ink-3);
  background:
    radial-gradient(circle at 50% 38%, rgba(var(--red-rgb),.12), transparent 42%),
    linear-gradient(145deg, var(--surface), var(--sunken));
}
.thumb .pinMediaUnavailableIcon,
.dImgUnavailable .pinMediaUnavailableIcon,
#modal .pno-media-unavailable .pinMediaUnavailableIcon{
  position:static;
  inset:auto;
  width:58px;
  height:58px;
  object-fit:contain;
  opacity:.78;
  filter:drop-shadow(0 7px 15px rgba(var(--shadow-rgb),.12));
}
.pinMediaUnavailableMessage{
  max-width:24ch;
  font-size:12px;
  font-weight:650;
  line-height:1.4;
}
.thumb .pinMediaUnavailableMessage{
  opacity:0;
  transform:translateY(5px);
  transition:opacity .16s ease, transform .16s ease;
}
.card:hover .pinMediaUnavailableMessage,
.card:focus .pinMediaUnavailableMessage,
.card:focus-within .pinMediaUnavailableMessage{
  opacity:1;
  transform:translateY(0);
}
.thumb .cardVideo{
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease;
}
.card.isVideoPlaying .cardVideo{ opacity: 1; }
.card.isVideoPlaying .videoBadge{ opacity: 0; }

.videoBadge{
  position:absolute;
  left: 10px;
  bottom: 10px;
  z-index: 4;
  display:inline-flex;
  align-items:center;
  gap: 5px;
  padding: 5px 9px 5px 6px;
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: 999px;
  background: rgba(23,20,15,0.78);
  color: #fff;
  box-shadow: 0 4px 14px rgba(var(--shadow-rgb),0.22);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 650;
  pointer-events:none;
}
.videoBadge .ico{ width: 15px; height: 15px; }

.pinPill{
  position:absolute;
  top: 9px;
  left: 9px;
  z-index: 4;
  display:inline-flex;
  align-items:center;
  gap: 4px;
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  background: var(--chip-soft);
  border: 1px solid var(--chip-line-soft);
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(var(--shadow-rgb),0.12);
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.pinPill .ico{ width: 12px; height: 12px; opacity: 0.65; }
.card:hover .pinPill,
.card:focus-within .pinPill{ opacity: 1; transform: translateY(0); }

.cardSelectMark{
  position:absolute;
  top: 9px;
  right: 9px;
  z-index: 6;
  width: 24px;
  height: 24px;
  border: 2px solid var(--chip-line-strong);
  border-radius: 8px;
  background: var(--chip-strong);
  color: #fff;
  box-shadow: 0 3px 12px rgba(var(--shadow-rgb),0.22);
  padding:0;
  cursor:pointer;
  opacity:0;
  transform:translateY(-3px);
  transition:opacity 0.16s ease, transform 0.16s ease, background 0.14s ease;
}
.card:hover .cardSelectMark,
.card:focus-within .cardSelectMark,
.card.isSelectMode .cardSelectMark{ opacity:1; transform:translateY(0); }
.cardSelectMark:hover{ border-color: var(--chip-line-strong); background: var(--chip-hover); }
.card.isSelected .cardSelectMark{ background: var(--red); }

@media (hover: none){
  .card:not(.isSelectMode) .cardSelectMark{ opacity:0.88; transform:none; }
}

.ov{
  position:absolute;
  right: 9px;
  bottom: 9px;
  z-index: 5;
  display:flex;
  gap: 6px;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.card:hover .ov,
.card:focus-within .ov{ opacity: 1; transform: translateY(0); }

.ovBtn{
  width: 32px;
  height: 32px;
  display:grid;
  place-items:center;
  border-radius: 999px;
  border: 1px solid var(--chip-line);
  background: var(--chip);
  box-shadow: 0 6px 18px rgba(var(--shadow-rgb),0.18);
  backdrop-filter: blur(8px);
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, transform 0.14s var(--ease);
}
.ovBtn .ico{ width: 16px; height: 16px; }
.ovBtn:hover{ background: var(--chip-hover); color: var(--red-deep); transform: translateY(-1px); }
.ovBtnDanger{ color: var(--red-deep); }
.ovBtnDanger:hover,
.ovBtnDanger:focus-visible{
  border-color: rgba(var(--red-rgb),0.24);
  background: var(--red);
  color: var(--on-red);
}

.body{ padding: 12px 13px 13px; display:flex; flex-direction: column; gap: 7px; }
.title{
  font-size: 13.4px;
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.excerpt{
  color: var(--ink-3);
  font-size: 12.6px;
  font-weight: 450;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meta{
  display:flex;
  align-items:center;
  gap: 5px;
  font-size: 11.3px;
  font-weight: 550;
  color: var(--ink-4);
}
.meta .ico{ width: 12px; height: 12px; opacity: 0.7; }
.tags{
  display:flex;
  gap: 5px;
  flex-wrap: nowrap;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 84%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 84%, transparent 100%);
}
.tag{
  font-size: 11.3px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--sunken);
  border-radius: 999px;
  padding: 4px 8px;
  white-space: nowrap;
}
.tag .hash{ color: var(--red); opacity: 0.75; }

.cardBtns{ padding: 12px; display:flex; gap: 8px; border-top: 1px solid var(--line-soft); }
.cardBtns .btn{ padding: 8px 12px; font-size: 12.5px; }

/* ---------------- Empty state ---------------- */

.empty{
  width: 100%;
  max-width: 520px;
  margin: 44px auto 0;
  border: 1px solid var(--line-soft);
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 26px 24px 24px;
  box-shadow: var(--sh-2);
  break-inside: avoid;
  display:flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 7px;
}
.grid.isEmpty .empty{ column-span: all; }

.emptyIcon{
  width: 60px;
  height: 60px;
  margin-bottom: 4px;
  border-radius: 18px;
  display:grid;
  place-items:center;
  background: var(--red-wash);
  color: var(--red);
}
.emptyIcon .ico{ width: 30px; height: 30px; }
.emptyT{ font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.emptyM{ color: var(--ink-3); font-weight: 450; font-size: 13px; line-height: 1.5; max-width: 40ch; }
.emptyBtns{ display:flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------------- Note detail ---------------- */

.detail{
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-2);
  overflow: hidden;
  height: min(620px, calc(100vh - 168px));
  min-height: 420px;
  /* Keeps the detail header clear of the sticky top bar when scrolled into view. */
  scroll-margin-top: 96px;
}

.detailSimilar{
  margin-top: 22px;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}
.detailSimilar .simHead{
  display:flex;
  align-items:center;
  gap: 7px;
  padding: 0 2px 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-4);
}
.detailSimilar .simHead .ico{ width: 14px; height: 14px; }
.detailSimilar .grid{ padding: 0; }

.dWrap{ display:grid; grid-template-columns: minmax(0, 44%) minmax(0, 1fr); gap: 0; height: 100%; min-height: 0; }
.dLeft{ padding: 16px 18px 18px; display:flex; flex-direction: column; gap: 12px; min-width: 0; min-height: 0; overflow:hidden; }
.dRight{
  border-right: 1px solid var(--line-soft);
  background: var(--sunken);
  display:flex;
  align-items: stretch;
  justify-content: stretch;
  position: relative;
  overflow:hidden;
}
.dBg{
  position:absolute;
  inset: -24px;
  background-size: cover;
  background-position: center;
  filter: blur(20px);
  transform: scale(1.12);
  opacity: 0.9;
}
.dImg{
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  object-position: center;
  display:block;
  position: relative;
  z-index: 1;
}
.dVideo{
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: contain;
  display:block;
  position: relative;
  z-index: 1;
  background: #111;
}
.dVideoUnavailable{
  display:none;
  position:absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(23,20,15,0.82);
  color: #fff;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.4;
  text-align:center;
  backdrop-filter: blur(8px);
}
.dRight.videoUnavailable .dVideoUnavailable{ display:block; }
.dRight.isContain .dImg{ object-fit: contain; object-position: center; }
.dImgPh{
  width: 100%;
  min-height: 320px;
  display:grid;
  place-items:center;
  color: var(--ink-4);
  font-weight: 600;
  font-size: 13px;
}
.dRight.isMediaUnavailable{ aspect-ratio:auto; min-height:0; }
.dImgUnavailable{ position:absolute; }

.dHdr{ display:grid; grid-template-columns: 1fr auto; align-items:center; gap: 10px; }
.dHdrL{ display:flex; align-items:center; gap: 10px; min-width: 0; }
.dTitleCol{ min-width: 0; display:flex; flex-direction: column; gap: 1px; }
.dBack{
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor:pointer;
  display:grid;
  place-items:center;
  flex: 0 0 auto;
  box-shadow: var(--sh-1);
  transition: background 0.13s ease, color 0.13s ease, transform 0.13s ease;
}
.dBack svg{ display:block; width: 17px; height: 17px; }
.dBack:hover{ color: var(--red-deep); border-color: var(--red-line); }
.dBack:active{ transform: translateY(1px); }
.dTitle{
  font-size: 15px;
  font-weight: 680;
  letter-spacing: -0.2px;
  min-width: 0;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dMeta{ color: var(--ink-4); font-weight: 550; font-size: 11.8px; }
.dBtns{ display:flex; gap: 7px; flex-wrap: nowrap; justify-content: flex-end; align-items: center; }
.dBtns .btn{ padding: 8px 12px; font-size: 12.5px; }

.dTags{ display:flex; gap: 5px; flex-wrap: wrap; }
.dTag{
  font-size: 11.5px;
  font-weight: 600;
  color: var(--red-deep);
  background: var(--red-wash);
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}

.dNote{
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: none;
  padding: 14px 16px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 13.6px;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--ink-rgb),0.16) transparent;
}
.dNote::-webkit-scrollbar{ width: 8px; }
.dNote::-webkit-scrollbar-thumb{ background: rgba(var(--ink-rgb),0.14); border-radius: 999px; border: 2px solid var(--surface); }

/* Similar-note rows (compact list variant) */
.simSec{ display:flex; flex-direction: column; gap: 10px; }
.simList{ display:flex; flex-direction: column; gap: 8px; }
.simItem{
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-1);
  padding: 10px;
  display:flex;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.simItem:hover{ transform: translateY(-1px); box-shadow: var(--sh-2); }
.simThumb{
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow:hidden;
  background: var(--sunken);
  flex: 0 0 auto;
}
.simThumb img{ width:100%; height:100%; object-fit: cover; display:block; }
.simMain{ flex: 1 1 auto; min-width: 0; display:flex; flex-direction: column; gap: 3px; }
.simTop{ display:flex; align-items:center; justify-content: space-between; gap: 10px; }
.simTitle{ font-weight: 650; font-size: 12.8px; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; }
.simScore{
  font-size: 11px;
  color: var(--red-deep);
  font-weight: 650;
  background: var(--red-wash);
  padding: 3px 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}
.simTxt{ font-size: 12.4px; color: var(--ink-3); line-height: 1.4; max-height: 2.8em; overflow:hidden; }

/* ---------------- Responsive ---------------- */

@media (max-width: 1080px){
  :root{ --pad-x: 18px; }
  .app{ grid-template-columns: minmax(0, 1fr); }
  .menuBtn{ display:grid; }

  .side{
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: 282px;
    box-shadow: var(--sh-3);
    transform: translateX(-101%);
    transition: transform 0.22s var(--ease);
  }
  .app.navOpen .side{ transform: translateX(0); }
  .sideToggle{ display:none; }

  .topR{ flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 700px){
  .top{ flex-wrap: wrap; gap: 10px; }
  .topL{ flex: 1 1 auto; }
  .topR{ flex: 1 1 100%; margin-left: 0; }
  .searchWrap{ width: auto; flex: 1 1 auto; }
  .viewTitle{ font-size: 17px; }
  .selectionBar{ align-items:stretch; flex-direction:column; }
  .selectionActions{ flex-wrap:wrap; }
  .selectionBtn{ flex:1 1 auto; }
  .detail{ height: auto; min-height: 0; max-height: none; }
  .dWrap{ grid-template-columns: minmax(0, 1fr); grid-template-rows: 210px auto; }
  .dRight{ border-right: none; border-bottom: 1px solid var(--line-soft); }
  .dImg,.dImgPh{ min-height: 210px; }
  .dHdr{ grid-template-columns: 1fr; }
  .dBtns{ justify-content: flex-start; flex-wrap: wrap; }
  .dNote{ max-height: 46vh; }
}

@media (prefers-reduced-motion: reduce){
  *{ scroll-behavior: auto !important; }
  .card, .capture, .simItem, .btn, .rateCta, .side{ transition: none !important; }
  .card:hover, .capture:hover, .simItem:hover, .rateCta:hover{ transform: none !important; }
  .thumb.isMediaLoading::after,
  .gridPreparing span,
  .gridSentinel.isLoading::before,
  .gridSentinel.isLoading::after{ animation:none !important; }
}

/* Modal */
.modal{
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(var(--shadow-rgb),0.46);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display:none;
  align-items:center;
  justify-content: center;
  padding: 18px;
}
.modal.on{ display:flex; }

/* Branded destructive-action confirmation */
.deleteConfirmModal{
  position:fixed;
  inset:0;
  z-index:1000001;
  display:none;
  place-items:center;
  padding:20px;
  background:rgba(var(--shadow-rgb),0.46);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.deleteConfirmModal.on{ display:grid; }
.deleteConfirmSheet{
  width:min(430px, 100%);
  display:grid;
  grid-template-columns:48px minmax(0,1fr);
  gap:14px;
  padding:20px;
  border:1px solid rgba(var(--paper-rgb),0.7);
  border-radius:20px;
  background:var(--glass);
  box-shadow:0 36px 110px rgba(var(--shadow-rgb),0.30);
  transform:translateY(8px) scale(0.985);
  opacity:0;
  transition:transform 0.16s var(--ease), opacity 0.14s ease;
}
.deleteConfirmModal.on .deleteConfirmSheet{
  transform:translateY(0) scale(1);
  opacity:1;
}
.deleteConfirmIcon{
  width:48px;
  height:48px;
  display:grid;
  place-items:center;
  border-radius:15px;
  background:var(--red-wash);
  color:var(--red-deep);
}
.deleteConfirmIcon .ico{ width:22px; height:22px; }
.deleteConfirmCopy{ min-width:0; padding-top:2px; }
.deleteConfirmTitle{
  margin:0;
  color:var(--ink);
  font-size:17px;
  font-weight:720;
  line-height:1.3;
  letter-spacing:-0.25px;
  overflow-wrap:anywhere;
}
.deleteConfirmMessage{
  margin:6px 0 0;
  color:var(--ink-3);
  font-size:13px;
  font-weight:500;
  line-height:1.5;
  white-space:pre-line;
}
.deleteConfirmActions{
  grid-column:1 / -1;
  display:flex;
  justify-content:flex-end;
  gap:8px;
  padding-top:5px;
}
.deleteConfirmBtn{
  min-height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:8px 15px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--surface);
  color:var(--ink-2);
  font-size:13px;
  font-weight:680;
  cursor:pointer;
  transition:background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.14s var(--ease);
}
.deleteConfirmBtn:hover{ border-color:var(--line); background:var(--sunken); color:var(--ink); }
.deleteConfirmBtn:active{ transform:translateY(1px); }
.deleteConfirmBtn.danger,
.deleteConfirmBtn.primary{
  border-color:var(--red);
  background:var(--red);
  color: var(--on-red);
  box-shadow:0 8px 20px rgba(var(--red-rgb),0.22);
}
.deleteConfirmBtn.danger:hover,
.deleteConfirmBtn.primary:hover{ border-color:var(--red-deep); background:var(--red-deep); }
.deleteConfirmBtn .ico{ width:15px; height:15px; }

/* Workspace choice shared by Import and Export. */
.transferConfigModal{
  position:fixed;
  inset:0;
  z-index:1000001;
  display:none;
  place-items:center;
  padding:20px;
  background:rgba(var(--shadow-rgb),0.46);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.transferConfigModal.on{ display:grid; }
.transferConfigSheet{
  width:min(470px,100%);
  padding:20px;
  border:1px solid rgba(var(--paper-rgb),0.7);
  border-radius:20px;
  background:var(--glass);
  box-shadow:0 36px 110px rgba(var(--shadow-rgb),0.30);
}
.transferConfigHead{ display:grid; grid-template-columns:48px minmax(0,1fr); gap:14px; align-items:start; }
.transferConfigIcon{ width:48px; height:48px; display:grid; place-items:center; border-radius:15px; background:var(--red-wash); color:var(--red-deep); }
.transferConfigIcon .ico{ width:22px; height:22px; }
.transferConfigHead h2{ margin:2px 0 0; color:var(--ink); font-size:17px; line-height:1.3; letter-spacing:-.25px; }
.transferConfigHead p{ margin:6px 0 0; color:var(--ink-3); font-size:13px; font-weight:500; line-height:1.5; }
.transferWorkspaceOptions{ display:grid; gap:9px; margin-top:18px; }
.transferWorkspaceOption{ width:100%; min-height:66px; display:grid; grid-template-columns:38px minmax(0,1fr) 20px; align-items:center; gap:11px; padding:11px 13px; border:1px solid var(--line); border-radius:15px; background:var(--surface); color:var(--ink); text-align:start; cursor:pointer; }
.transferWorkspaceOption:hover{ border-color:var(--red-line); background:var(--veil); }
.transferWorkspaceOption[aria-checked="true"]{ border-color:var(--red); background:var(--red-wash-soft); box-shadow:0 0 0 3px rgba(var(--red-rgb),.08); }
.transferWorkspaceOption[hidden]{ display:none; }
.transferWorkspaceOption:disabled{ cursor:not-allowed; opacity:.52; border-color:var(--line); background:var(--sunken); box-shadow:none; }
.transferWorkspaceOption:disabled:hover{ border-color:var(--line); background:var(--sunken); }
.transferWorkspaceMark{ width:38px; height:38px; display:grid; place-items:center; border-radius:12px; background:var(--sunken); color:var(--ink-3); }
.transferWorkspaceOption[aria-checked="true"] .transferWorkspaceMark{ background:var(--red-wash); color:var(--red-deep); }
.transferWorkspaceMark .ico{ width:18px; height:18px; }
.transferWorkspaceCopy{ min-width:0; display:grid; gap:3px; }
.transferWorkspaceCopy strong{ font-size:13.5px; font-weight:720; }
.transferWorkspaceCopy small{ color:var(--ink-3); font-size:11.5px; font-weight:500; }
.transferWorkspaceRadio{ width:18px; height:18px; border:1.5px solid var(--line-strong); border-radius:50%; }
.transferWorkspaceOption[aria-checked="true"] .transferWorkspaceRadio{ border:5px solid var(--red); background:var(--surface); }
.transferWorkspaceOptions[data-mode="multiple"] .transferWorkspaceRadio{ display:grid; place-items:center; border-radius:5px; }
.transferWorkspaceOptions[data-mode="multiple"] .transferWorkspaceOption[aria-checked="true"] .transferWorkspaceRadio{ border:1.5px solid var(--red); background:var(--red); }
.transferWorkspaceOptions[data-mode="multiple"] .transferWorkspaceOption[aria-checked="true"] .transferWorkspaceRadio::after{ content:"\2713"; color:#fff; font-size:12px; font-weight:800; line-height:1; }
.transferConfigActions{ display:flex; justify-content:flex-end; gap:8px; padding-top:18px; }

@media (max-width: 480px){
  .deleteConfirmSheet{ grid-template-columns:40px minmax(0,1fr); padding:17px; border-radius:18px; }
  .deleteConfirmIcon{ width:40px; height:40px; border-radius:13px; }
  .deleteConfirmActions{ display:grid; grid-template-columns:1fr 1fr; }
  .transferConfigSheet{ padding:17px; border-radius:18px; }
  .transferConfigHead{ grid-template-columns:40px minmax(0,1fr); }
  .transferConfigIcon{ width:40px; height:40px; border-radius:13px; }
  .transferConfigActions{ display:grid; grid-template-columns:1fr 1fr; }
}

@media (prefers-reduced-motion: reduce){
  .deleteConfirmSheet{ transition:none; }
}
.sheet{
  width: min(760px, 100%);
  max-height: min(86vh, 960px);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: 0 40px 140px rgba(var(--shadow-rgb),0.35);
  overflow: hidden;
  display:flex;
  flex-direction: column;
}

/* -------- Note editor (match content.js full editor) -------- */
#modal .pno-modalSheet{
  width: min(1180px, calc(100vw - 40px));
  height: min(85vh, 900px);
  max-height: none;
  background: var(--glass);
  border: 1px solid rgba(var(--paper-rgb),0.22);
  border-radius: 20px;
  box-shadow: 0 60px 180px rgba(var(--shadow-rgb),0.40);
  overflow: hidden;
  display:flex;
  flex-direction: column;
}
#modal .pno-modalSheet, #modal .pno-modalSheet *{ box-sizing: border-box; }

#modal .pno-modal-main{
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  grid-template-areas: "media editor";
  direction: ltr;
}
#modal .pno-media-pane{
  grid-area: media;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 22px 18px;
  border-right: 1px solid var(--line-soft);
  background: linear-gradient(145deg, var(--sunken), var(--surface));
  direction: ltr;
}
#modal .pno-editor-pane{
  grid-area: editor;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--glass);
  direction: ltr;
}
#modal .pno-pin-card{
  width: min(100%, 360px);
  flex: 0 0 auto;
  overflow: hidden;
  margin: auto 0;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 18px 46px rgba(var(--shadow-rgb),0.13);
}
#modal .pno-media-stage{
  position: relative;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  background: transparent;
}
#modal .pno-media-stage.is-empty{
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  background: var(--sunken);
}
#modal .pno-media-stage.is-pinterest-unavailable{ aspect-ratio:4 / 5; }
#modal .pno-media-image,
#modal .pno-media-video{
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
}
#modal .pno-media-caption{
  display: block;
  padding: 13px 14px 14px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}
#modal .pno-media-head{
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
#modal .pno-media-title{
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13.2px;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
#modal .pno-media-open{
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 11.8px;
  font-weight: 650;
  cursor: pointer;
}
#modal .pno-media-open:hover{ border-color: var(--red-line); color: var(--red-deep); background: var(--red-wash); }
#modal .pno-media-description{
  margin-top: 9px;
  color: var(--ink-3);
  font-size: 12.4px;
  font-weight: 500;
  line-height: 1.45;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
#modal .pno-media-description[hidden]{ display: none; }
#modal .pno-media-reactions{
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-size: 12.2px;
  font-weight: 700;
}
#modal .pno-media-reactions[hidden]{ display: none; }
#modal .pno-media-heart{ color: var(--red); font-size: 15px; line-height: 1; }
#modal .pno-media-empty{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 24px;
  color: var(--ink-4);
  font-size: 12.5px;
  font-weight: 550;
  text-align: center;
}
#modal .pno-media-empty-icon{ font-size: 32px; line-height: 1; opacity: 0.72; }
#modal .pno-media-video-badge{
  position: absolute;
  top: 12px;
  left: 12px;
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(0,0,0,0.72);
  color: #fff;
  font-size: 11.5px;
  font-weight: 650;
  backdrop-filter: blur(8px);
}
[dir="rtl"] #modal .pno-modal-main{
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  grid-template-areas: "editor media";
}
[dir="rtl"] #modal .pno-media-pane{
  border-right: 0;
  border-left: 1px solid var(--line-soft);
  direction: rtl;
}
[dir="rtl"] #modal .pno-editor-pane{ direction: rtl; }
[dir="rtl"] #modal .pno-media-video-badge{ left: auto; right: 12px; }

#modal .pno-pop-h{
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
#modal .pno-hrow{ display:flex; align-items:center; justify-content: space-between; gap: 10px; }
#modal .pno-hL{ display:flex; flex-direction: column; gap: 7px; min-width: 0; }
#modal .pno-pop-title{
  font-size: 10.8px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-4);
}
#modal .pno-pop-sub{ display:flex; align-items:center; gap: 10px; min-width: 0; }
#modal .pno-thumb{ width: 34px; height: 34px; border-radius: 10px; object-fit: cover; background: var(--sunken); border: 1px solid var(--line-soft); flex: 0 0 auto; }
#modal .pno-subCol{ display:flex; flex-direction: column; gap: 1px; min-width: 0; }
#modal .pno-subText{ font-size: 13.4px; font-weight: 680; letter-spacing: -0.15px; color: var(--ink); white-space: nowrap; overflow:hidden; text-overflow: ellipsis; }
#modal .pno-subMeta{ font-size: 11.6px; font-weight: 550; color: var(--ink-4); white-space: nowrap; overflow:hidden; text-overflow: ellipsis; max-width: 100%; }
#modal .pno-pop-actions{ display:flex; gap:4px; }

#modal .pno-icbtn{
  width:32px;
  height:32px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-3);
  cursor:pointer;
  display:grid;
  place-items:center;
  padding: 0;
  transition: background 0.13s ease, color 0.13s ease;
}
#modal .pno-icbtn:hover{ background: var(--sunken); color: var(--ink); }
#modal .pno-icbtn.danger:hover{ background: rgba(var(--red-rgb),0.08); color: var(--red-deep); }
#modal .pno-icbtn.on{ background: var(--red-wash); color: var(--red-deep); }

#modal .pno-pop-b{ flex: 1 1 auto; overflow-y: hidden; overflow-x: hidden; display: flex; flex-direction: column; padding: 0; min-height: 0; }

#modal .pno-mdbar{
  display:flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items:center;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface);
  position: relative;
  z-index: 1;
}
#modal .pno-mdbtn{
  min-width: 30px;
  height: 30px;
  border-radius: var(--r-xs);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  padding: 0 4px;
  color: var(--ink-3);
  display: grid;
  place-items: center;
  transition: background 0.12s ease, color 0.12s ease;
}
#modal .pno-mdbtn.isTxt{
  font-size: 11.6px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0 7px;
}
#modal .pno-mdbtn .ico{ width: 17px; height: 17px; }
#modal .pno-mdbtn:hover{ background: var(--sunken); color: var(--ink); }
#modal .pno-mdsep{ width: 1px; height: 18px; background: var(--line); margin: 0 5px; }

#modal .pno-ta{
  flex: 1;
  min-height: 0;
  max-height: none;
  resize: none;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  padding: 12px 24px;
  font-size: 1.25em;
  line-height: 1.6;
  max-width: 100%;
  overflow-y: auto;
}
#modal .pno-ta:focus{ border:none; background: transparent; box-shadow:none; outline:none; }

#modal .pno-preview{
  flex: 1;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 12px 24px;
  font-size: 15px;
  line-height: 1.6;
  overflow-y: auto;
  color: rgba(var(--ink-rgb),0.86);
}

#modal .pno-tags{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  overflow:hidden;
  background: var(--surface);
  flex: 0 0 auto;
}
#modal .pno-tags-chips{
  display:flex;
  gap: 6px;
  align-items:center;
  overflow:auto;
  scrollbar-width: thin;
  flex: 1 1 auto;
  min-width: 0;
}
#modal .pno-chip{
  border: none;
  background: var(--red-wash);
  color: var(--red-deep);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.6px;
  font-weight: 620;
  cursor:pointer;
  white-space: nowrap;
}
#modal .pno-chip:hover{ background: rgba(var(--red-rgb),0.18); }
#modal .pno-tag-in{
  flex: 0 0 150px;
  max-width: 180px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--sunken);
  padding: 7px 12px;
  font-size: 12.4px;
  font-weight: 500;
  outline: none;
}
#modal .pno-tag-in:focus{
  border-color: var(--red-line);
  box-shadow: 0 0 0 3px rgba(var(--red-rgb),0.09);
  background: var(--surface);
}

#modal .pno-pop-f{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--line-soft);
  gap: 10px;
}
#modal .pno-status{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 16px;
  color: var(--red);
  font-size: 11.8px;
  font-weight: 650;
}
#modal .pno-status[data-state="saving"]::before{
  content: "";
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border: 1.5px solid rgba(var(--red-rgb),0.22);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: pno-status-spin 0.62s linear infinite;
}
@keyframes pno-status-spin{ to{ transform: rotate(360deg); } }
#modal .pno-fspacer{ flex: 1 1 auto; }
#modal .pno-saveClose{
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12.8px;
  font-weight: 600;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
#modal .pno-saveClose:hover{ background: var(--sunken); border-color: var(--red-line); color: var(--red-deep); }
#modal .pno-saveClose:disabled{ opacity: 0.55; cursor: wait; }
#modal .pno-save{
  border: none;
  background: var(--red);
  color: var(--on-red);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 12.8px;
  font-weight: 650;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background 0.14s ease, box-shadow 0.14s ease;
}
#modal .pno-save:hover{ background: var(--red-deep); box-shadow: 0 8px 20px rgba(var(--red-rgb),0.24); }
#modal .pno-save:active{ transform: translateY(1px); }
#modal .pno-save:disabled{ opacity: 0.55; cursor: wait; }

@media (max-width: 820px){
  #modal{ padding: 10px; }
  #modal .pno-modalSheet{ width: min(100%, 720px); height: min(94vh, 900px); }
  #modal .pno-modal-main,
  [dir="rtl"] #modal .pno-modal-main{
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(170px, 38vh) minmax(0, 1fr);
    grid-template-areas: "media" "editor";
  }
  #modal .pno-media-pane,
  [dir="rtl"] #modal .pno-media-pane{
    border-right: 0;
    border-left: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  #modal .pno-media-pane{ padding: 12px; }
  #modal .pno-pin-card{ width: min(100%, 320px); margin: 0; }
}

/* Action tooltip */
.pno-acttip{
  position: fixed;
  background: var(--tip);
  color: var(--tip-ink);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11.6px;
  font-weight: 550;
  white-space: nowrap;
  z-index: 9999999;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: none;
}
.pno-acttip.on{ opacity: 1; transform: translateY(0); }
.pno-acttip::after{ content: ""; position:absolute; left:50%; transform: translateX(-50%); width:0; height:0; }
.pno-acttip.above::after{ top:100%; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 5px solid var(--tip); }
.pno-acttip.below::after{ bottom:100%; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 5px solid var(--tip); }

/* Emoji picker */
.pno-emoji{
  position: fixed;
  width: 280px;
  max-width: calc(100vw - 20px);
  background: var(--glass);
  border: 1px solid rgba(var(--ink-rgb),0.10);
  border-radius: 16px;
  box-shadow: 0 30px 100px rgba(var(--shadow-rgb),0.28);
  z-index: 9999999;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 140ms ease, transform 140ms ease;
  overflow: hidden;
}
.pno-emoji.on{ opacity: 1; transform: translateY(0); }
.pno-emojiH{ display:flex; align-items:center; justify-content:space-between; padding: 10px 12px; border-bottom: 1px solid rgba(var(--ink-rgb),0.08); }
.pno-emojiT{ font-size: 12.5px; font-weight: 600; color: rgba(var(--ink-rgb),0.75); }
.pno-emojiX{ width: 30px; height: 30px; border-radius: 12px; border: 1px solid rgba(var(--ink-rgb),0.08); background: rgba(var(--ink-rgb),0.04); cursor:pointer; }
.pno-emojiX:hover{ background: var(--hover); }
.pno-emojiG{ display:grid; grid-template-columns: repeat(8, 1fr); gap: 6px; padding: 10px 12px 12px; }
.pno-emojiB{ border: none; background: rgba(var(--ink-rgb),0.03); border: 1px solid rgba(var(--ink-rgb),0.06); border-radius: 12px; height: 32px; cursor:pointer; font-size: 18px; }
.pno-emojiB:hover{ background: var(--hover); }

/* Slash palette (note editor) */
.pno-slash{
  position: fixed;
  z-index: 9999999;
  width: min(360px, calc(100vw - 20px));
  background: var(--glass);
  border: 1px solid rgba(var(--ink-rgb),0.10);
  border-radius: 16px;
  box-shadow: 0 30px 100px rgba(var(--shadow-rgb),0.26);
  overflow: hidden;
  display:none;
}
.pno-slash.on{ display:block; }
.pno-slashH{ padding: 10px 12px; border-bottom: 1px solid rgba(var(--ink-rgb),0.07); display:flex; align-items:center; justify-content: space-between; gap: 10px; }
.pno-slashT{ font-weight: 600; font-size: 12.5px; color: rgba(var(--ink-rgb),0.82); }
.pno-slashK{ font-size: 12px; color: rgba(var(--ink-rgb),0.55); font-weight: 600; }
.pno-slashB{ max-height: 280px; overflow:auto; padding: 10px; display:flex; flex-direction: column; gap: 8px; }
.pno-sHead{ padding: 4px 6px; font-size: 11.5px; font-weight: 600; color: rgba(var(--ink-rgb),0.55); }
.pno-sEmpty{ padding: 18px 10px; color: var(--ink-4); font-size: 12.4px; font-weight: 550; text-align:center; }
.pno-sRow{ border: 1px solid rgba(var(--ink-rgb),0.08); background: rgba(var(--ink-rgb),0.02); border-radius: 16px; padding: 10px; cursor:pointer; display:flex; gap: 10px; align-items:center; }
.pno-sRow:hover{ background: rgba(var(--ink-rgb),0.05); }
.pno-sRow.on{ border-color: rgba(var(--red-rgb),0.20); background: rgba(var(--red-rgb),0.10); }
.pno-sIco{ width: 38px; height: 38px; border-radius: 16px; background: radial-gradient(44px 44px at 35% 30%, rgba(var(--red-rgb),0.18), transparent), rgba(var(--ink-rgb),0.05); display:flex; align-items:center; justify-content: center; font-weight: 600; color: rgba(var(--ink-rgb),0.72); flex: 0 0 auto; }
.pno-sIco.hasThumb{ overflow:hidden; border-radius: 10px; background: var(--sunken); }
.pno-sThumb{ width:100%; height:100%; display:block; object-fit:cover; }
.pno-sTxt{ min-width: 0; display:flex; flex-direction: column; gap: 3px; }
.pno-sTop{ font-weight: 600; font-size: 12.8px; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; }
.pno-sSub{ font-size: 12.3px; color: rgba(var(--ink-rgb),0.58); font-weight: 600; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; }

/* Markdown preview elements */
.pno-gap{ height: 10px; }
.pno-p{ margin: 0 0 10px; }
.pno-h1,.pno-h2,.pno-h3,.pno-h4,.pno-h5,.pno-h6{ margin: 10px 0 8px; line-height: 1.2; }
.pno-h1{ font-size: 20px; }
.pno-h2{ font-size: 18px; }
.pno-h3{ font-size: 16px; }
.pno-ul,.pno-ol{ margin: 6px 0 10px !important; padding-left: 28px !important; color: rgba(var(--ink-rgb),0.86) !important; list-style-position: outside !important; text-indent: 0 !important; }
.pno-ul{ list-style: disc !important; list-style-type: disc !important; }
.pno-ol{ list-style: decimal !important; list-style-type: decimal !important; }
.pno-li{ margin: 4px 0 !important; padding: 0 !important; display: list-item !important; float: none !important; text-align: left !important; }
.pno-li::marker{ content: normal !important; color: inherit !important; }
.pno-task{ display:flex; align-items:flex-start; gap:8px; }
.pno-task-list{ padding-left: 0 !important; padding-inline-start: 0 !important; list-style: none !important; }
.pno-task-li{ list-style: none !important; }
.pno-md-check{ flex: 0 0 auto; margin-top: 3px; width: 18px; height: 18px; border-radius: 6px; border: 1px solid rgba(var(--ink-rgb),0.18); background: var(--glass); box-shadow: 0 1px 2px rgba(var(--shadow-rgb),0.06); cursor: pointer; -webkit-appearance: none; appearance: none; display: inline-block; background-repeat: no-repeat; background-position: center; background-size: 12px 12px; }
.pno-md-check:hover{ border-color: rgba(var(--ink-rgb),0.28); background: rgba(var(--ink-rgb),0.03); }
.pno-md-check:focus{ outline: none; border-color: rgba(var(--red-rgb),0.55); box-shadow: 0 0 0 3px rgba(var(--red-rgb),0.18), 0 1px 2px rgba(var(--shadow-rgb),0.08); }
.pno-md-check:checked{ background-color: var(--red); border-color: var(--red); background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2024%2024'%3E%3Cpath%20fill%3D'none'%20stroke%3D'white'%20stroke-width%3D'3'%20stroke-linecap%3D'round'%20stroke-linejoin%3D'round'%20d%3D'M20%206L9%2017l-5-5'%2F%3E%3C%2Fsvg%3E"); }
.pno-md-check:checked + .pno-taskT{ opacity: 0.72; text-decoration: line-through; }
.pno-taskT{ flex: 1; min-width: 0; }
.pno-bq{ margin: 12px 0 16px; padding: 12px 16px; background: rgba(var(--ink-rgb),0.03); border-left: 4px solid rgba(var(--red-rgb),0.7); border-radius: 4px; box-shadow: none; font-style: italic; color: rgba(var(--ink-rgb),0.75); }
.pno-q{ margin: 0 0 6px; }
.pno-q:last-child{ margin-bottom: 0; }
.pno-pre{ margin: 8px 0 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid rgba(var(--ink-rgb),0.08); background: rgba(var(--ink-rgb),0.03); overflow-x:auto; }
.pno-pre code{ background: transparent; padding: 0; }
.pno-mdlink{ color: var(--link); text-decoration: none; font-weight: 600; word-break: break-word; }
.pno-mdlink:hover{ text-decoration: underline; }
.pno-img{ display:block; max-width: 100%; height: auto; border-radius: 14px; margin: 8px 0 10px; border: 1px solid rgba(var(--ink-rgb),0.08); }
.pno-preview code{ background: rgba(var(--ink-rgb),0.06); padding: 1px 6px; border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12px; }
.pno-wikilink{ display:inline-flex; align-items:center; gap: 6px; max-width: min(100%, 360px); margin: 1px 2px; padding: 3px 9px 3px 5px; border: 1px solid rgba(var(--link-rgb),0.18); border-radius: 999px; background: rgba(var(--link-rgb),0.08); color: var(--link-deep); text-decoration: none; font-size: 0.92em; font-weight: 650; line-height: 1.35; vertical-align: -0.2em; }
.pno-wikilink:hover{ border-color: rgba(var(--link-rgb),0.30); background: rgba(var(--link-rgb),0.13); text-decoration: none; }
.pno-wikiIcon{ display:inline-flex; align-items:center; justify-content:center; width: 18px; height: 18px; flex: 0 0 auto; border-radius: 50%; background: rgba(var(--link-rgb),0.14); font-size: 11px; line-height: 1; }
.pno-wikiLabel{ min-width: 0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pno-hashtag{ color: rgba(var(--red-rgb),0.96); font-weight: 700; }

/* Note editor modal: match the in-page full editor styling from content.js */
#modal .sheet{
  width: min(980px, calc(100vw - 40px));
  height: min(85vh, 900px);
  max-height: none;
  border-radius: 20px;
  box-shadow: 0 60px 180px rgba(var(--shadow-rgb),0.40);
}

#modal .sheetB{
  padding: 0;
  gap: 0;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 0;
}

#modal .meta{
  padding: 10px 24px 6px;
  font-size: 12px;
  color: var(--mut);
  flex: 0 0 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#modal .tags{
  flex: 0 0 auto;
  padding: 10px 12px;
  border-top: 1px solid rgba(var(--ink-rgb),0.07);
  border-bottom: 1px solid rgba(var(--ink-rgb),0.07);
  background: var(--glass);
  overflow: hidden;
}
#modal .chips{
  display:flex;
  gap: 6px;
  align-items:center;
  overflow:auto;
  scrollbar-width: thin;
  flex: 1 1 auto;
  min-width: 0;
}
#modal .chip{ padding: 6px 10px; font-size: 12px; }
#modal .tagIn{ padding: 8px 10px; font-size: 12.5px; }

#modal .ta{
  flex: 1;
  min-height: 0;
  max-height: none;
  resize: none;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  padding: 12px 24px;
  font-size: 1.25em;
  line-height: 1.6;
  max-width: 100%;
  overflow-y: auto;
}
#modal .ta:focus{ border:none; background: transparent; box-shadow:none; outline:none; }

#modal .preview{
  flex: 1;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 12px 24px;
  font-size: 15px;
  line-height: 1.6;
  overflow-y: auto;
  color: rgba(var(--ink-rgb),0.86);
}
.sheetH{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.sheetHL{ display:flex; align-items:flex-start; gap: 11px; min-width: 0; }
.sheetIco{
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display:grid;
  place-items:center;
  border-radius: 11px;
  background: var(--red-wash);
  color: var(--red);
}
.sheetTitle{ font-size: 15.5px; font-weight: 700; letter-spacing: -0.2px; }
.sheetSub{ margin-top: 1px; font-size: 12.4px; font-weight: 450; color: var(--ink-3); line-height: 1.4; }
.sheetBtns{ display:flex; gap: 8px; flex-wrap: wrap; }
.sheetB{ padding: 16px; display:flex; flex-direction: column; gap: 10px; overflow:auto; }
.sheetF{ padding: 12px; display:flex; align-items:center; gap: 10px; border-top: 1px solid rgba(var(--ink-rgb),0.08); }
.status{ font-size: 12.5px; color: var(--mut); min-height: 16px; }
.spacer{ flex: 1 1 auto; }

.ta{
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(var(--ink-rgb),0.10);
  background: rgba(var(--ink-rgb),0.02);
  padding: 10px 12px;
  outline:none;
  font-size: 13.5px;
  line-height: 1.45;
}
.ta:focus{ border-color: rgba(var(--red-rgb),0.35); box-shadow: 0 0 0 4px rgba(var(--red-rgb),0.10); background: var(--surface); }

/* Slash palette (modal + page editor) */
.slash{
  position: fixed;
  z-index: 999999;
  width: min(420px, calc(100vw - 36px));
  background: var(--glass);
  border: 1px solid rgba(var(--ink-rgb),0.10);
  border-radius: 18px;
  box-shadow: 0 40px 140px rgba(var(--shadow-rgb),0.30);
  overflow: hidden;
  display:none;
}
.slash.on{ display:block; }
.slashH{ padding: 10px 12px; border-bottom: 1px solid rgba(var(--ink-rgb),0.07); display:flex; align-items:center; justify-content: space-between; gap: 10px; }
.slashT{ font-weight: 650; font-size: 12.5px; color: rgba(var(--ink-rgb),0.82); }
.slashK{ font-size: 12px; color: rgba(var(--ink-rgb),0.55); font-weight: 600; }
.slashB{ max-height: 320px; overflow:auto; padding: 10px; display:flex; flex-direction: column; gap: 8px; }
.sHead{ padding: 4px 6px; font-size: 11.5px; font-weight: 650; color: rgba(var(--ink-rgb),0.55); }
.sRow{ border: 1px solid rgba(var(--ink-rgb),0.08); background: rgba(var(--ink-rgb),0.02); border-radius: 16px; padding: 10px; cursor:pointer; display:flex; gap: 10px; align-items:center; }
.sRow:hover{ background: rgba(var(--ink-rgb),0.05); }
.sRow.on{ border-color: rgba(var(--red-rgb),0.20); background: rgba(var(--red-rgb),0.10); }
.sIco{ width: 38px; height: 38px; border-radius: 16px; background: radial-gradient(44px 44px at 35% 30%, rgba(var(--red-rgb),0.18), transparent), rgba(var(--ink-rgb),0.05); display:flex; align-items:center; justify-content: center; font-weight: 650; color: rgba(var(--ink-rgb),0.72); flex: 0 0 auto; }
.sTxt{ min-width: 0; display:flex; flex-direction: column; gap: 3px; }
.sTop{ font-weight: 650; font-size: 12.8px; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; }
.sSub{ font-size: 12.3px; color: rgba(var(--ink-rgb),0.58); font-weight: 600; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; }

.preview{
  display:none;
  width: 100%;
  min-height: 220px;
  border-radius: 14px;
  border: 1px solid rgba(var(--ink-rgb),0.10);
  background: var(--surface);
  padding: 10px 12px;
  font-size: 13.5px;
  line-height: 1.5;
  overflow:auto;
}
.preview.on{ display:block; }
.preview code{ background: rgba(var(--ink-rgb),0.06); padding: 1px 6px; border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 12px; }
.preview a{ color: var(--link); text-decoration: none; font-weight: 650; }
.preview a:hover{ text-decoration: underline; }
.preview .hash{ color: rgba(var(--red-rgb),0.96); font-weight: 650; }

.tags{ display:flex; align-items:center; gap: 10px; }
.chips{ display:flex; gap: 8px; flex-wrap: wrap; flex: 1 1 auto; }
.chip{ border:none; background: rgba(var(--red-rgb),0.12); color: rgba(var(--red-rgb),0.96); padding: 8px 10px; border-radius: 999px; font-weight: 650; cursor:pointer; }
.chip:hover{ background: rgba(var(--red-rgb),0.18); }
.tagIn{ flex: 0 0 170px; max-width: 220px; border-radius: 999px; border: 1px solid rgba(var(--ink-rgb),0.10); background: rgba(var(--ink-rgb),0.02); padding: 10px 12px; outline:none; }
.tagIn:focus{ border-color: rgba(var(--red-rgb),0.35); box-shadow: 0 0 0 4px rgba(var(--red-rgb),0.10); background: var(--surface); }

/* Feedback */
.fbCard{ max-width: 820px; margin: 0 auto; }
.fbSub{ margin-top: 4px; color: var(--ink-3); font-weight: 450; font-size: 13px; }

.fbForm{ display:flex; flex-direction: column; gap: 8px; }
.fbRow{ display:flex; flex-direction: column; gap: 10px; }
.fbRow.fb2{ display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.fbField{ display:flex; flex-direction: column; gap: 5px; }
.fbLbl{ font-weight: 620; font-size: 12.2px; color: var(--ink-2); }
.fbOpt{ font-weight: 500; color: var(--ink-4); }

.fbField input,
.fbField select,
.fbField textarea{
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 10px 12px;
  font-weight: 500;
  font-size: 13px;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
.fbField textarea{ min-height: 130px; resize: vertical; line-height: 1.45; }
.fbField input:focus,
.fbField select:focus,
.fbField textarea:focus{ box-shadow: 0 0 0 3px rgba(var(--red-rgb),0.09); border-color: var(--red-line); }

.fbErr{ min-height: 15px; font-size: 11.6px; font-weight: 600; color: var(--red-deep); }
.fbMsgMeta{ display:flex; align-items:flex-start; justify-content: space-between; gap: 10px; }
.fbCount{ font-size: 11.6px; font-weight: 600; color: var(--ink-4); white-space: nowrap; font-variant-numeric: tabular-nums; }

.fbActions{ display:flex; align-items:center; gap: 10px; margin-top: 2px; }
.fbStatus{ flex: 1 1 auto; min-height: 18px; font-size: 12.3px; font-weight: 550; color: var(--ink-3); }
.fbHp{ display:none; }

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

/* Locale direction. Keep the hierarchy while mirroring directional chrome. */
html[dir="rtl"] body{ direction: rtl; text-align: right; }
html[dir="rtl"] .side{ border-right: 0; border-left: 1px solid var(--line-soft); }
html[dir="rtl"] .sideLblN,
html[dir="rtl"] .topR,
html[dir="rtl"] .graphTools{ margin-left: 0; margin-right: auto; }
html[dir="rtl"] .navItem.on::before{ left: auto; right: -14px; }
html[dir="rtl"] .searchIco,
html[dir="rtl"] .tagSearchIco{ left: auto; right: 12px; }
html[dir="rtl"] .search,
html[dir="rtl"] .tagSearch{ padding-left: 12px; padding-right: 36px; }
html[dir="rtl"] .kbd{ right: auto; left: 9px; }
html[dir="rtl"] .ov{ right: auto; left: 9px; }
html[dir="rtl"] .pinPill,
html[dir="rtl"] .videoBadge{ left: auto; right: 9px; }
html[dir="rtl"] .cardSelectMark{ right: auto; left: 9px; }
html[dir="rtl"] .miniSwitch input:checked + .miniTrack .miniThumb{ transform: translateX(-11px); }
html[dir="rtl"] .gtVideoBadge{ left:auto; right:8px; }
html[dir="rtl"] .dRight{ border-right: 0; border-left: 1px solid var(--line-soft); }
html[dir="rtl"] .pno-ul,
html[dir="rtl"] .pno-ol{ padding-left: 0 !important; padding-right: 28px !important; }
html[dir="rtl"] .pno-task-list{ padding-right: 0 !important; }
html[dir="rtl"] .pno-bq{ border-left: 0; border-right: 4px solid rgba(var(--red-rgb),0.7); }
html[dir="rtl"] .sideBtn{ text-align: right; }

@media (max-width: 1080px){
  html[dir="rtl"] .side{ left: auto; right: 0; transform: translateX(105%); }
  html[dir="rtl"] .app.navOpen .side{ transform: translateX(0); }
  html[dir="rtl"] .topR{ margin-right: 0; }
  html[dir="rtl"] .dRight{ border-left: 0; }
}

/* ===========================================================
   Dark theme
   theme.js paints [data-theme="dark"] on <html> before first
   frame. Only the channels and named tokens flip here; every
   rule above resolves through them, so the dark page is the
   same product at night: a deep navy canvas, cards lifting in
   the same hue, shadows turning to black.
   =========================================================== */

:root[data-theme="dark"]{
  --ink-rgb: 233,238,244;
  --canvas-rgb: 12,21,34;
  --paper-rgb: 20,32,47;
  --shadow-rgb: 0,0,0;
  --red-rgb: 255,59,84;

  --red: rgb(255,59,84);
  --red-deep: rgb(255,141,156);
  --red-wash: rgba(var(--red-rgb),0.16);
  /* --on-red stays white: whatever sits on red keeps its contrast. */

  --canvas: #0c1522;
  --surface: #14202f;
  --rail: #14202f;
  --hover: #1a2738;

  --ink: #e9eef4;

  --link-rgb: 107,182,255;
  --link: rgb(107,182,255);
  --link-deep: rgb(143,200,255);

  /* The tooltip still inverts the page: light pill, dark text. */
  --tip: #e9eef4;
  --tip-ink: #0c1522;

  /* Over-photo chips frost with the navy canvas, and their rims turn to ink. */
  --chip: rgba(12,21,34,0.90);
  --chip-soft: rgba(12,21,34,0.85);
  --chip-strong: rgba(12,21,34,0.92);
  --chip-line: rgba(233,238,244,0.30);
  --chip-line-soft: rgba(233,238,244,0.24);
  --chip-line-strong: rgba(233,238,244,0.50);
  --chip-hover: #1a2738;

  /* A white knob would glare; it lifts just above the track instead. */
  --knob: #c6d0dc;

  /* Black shadows need more alpha than the warm light ones did. */
  --sh-1: 0 1px 2px rgba(var(--shadow-rgb),0.30);
  --sh-2: 0 10px 28px rgba(var(--shadow-rgb),0.40);
  --sh-3: 0 28px 70px rgba(var(--shadow-rgb),0.55);
}

/* The few whites above that stay literal sit on Pinterest's own
   imagery or on brand red; they are correct in both themes. */
