/* Custom note maker ("add custom note making system with shapes") — the sheet
   that builds a note of your own: outline, fill, optional outline colour and
   weight, words, face and alignment. Every selector is `.pnm-` / #pw-note-maker
   so it cannot collide with editor.css or notes.css; the panel rides above the
   note gallery it was opened from. */

.pnm-wrap {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(10, 20, 35, 0.34);
}
.pnm-wrap[hidden] { display: none; }

.pnm-sheet {
  width: min(520px, 100%);
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #10213d;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 22px 60px rgba(11, 24, 45, 0.28), 0 2px 8px rgba(11, 24, 45, 0.1);
  overflow: hidden;
}
.pnm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 11px;
  border-bottom: 1px solid #eef2f8;
}
.pnm-head h2 { margin: 0; font-size: 16.5px; letter-spacing: -0.2px; }
.pnm-x {
  width: 30px; height: 30px; font-size: 19px; line-height: 1;
  color: #52627a; background: #f4f7fb; border: 1px solid #e3e9f2;
  border-radius: 9px; cursor: pointer;
}
.pnm-x:hover { background: #eaf0f9; color: #10213d; }

.pnm-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 14px 18px 6px;
  display: grid;
  gap: 10px;
}

/* The live specimen: the same fill / ink / outline / inset rules the page and
   the exported PDF use, so what is built here is what lands on the sheet. */
.pnm-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0 10px;
  background: #f7f9fc;
  border: 1px dashed #dde5f0;
  border-radius: 12px;
}
.pnm-preview {
  /* The same 120pt square a fresh note lands as (240px here at the sheet's
     4/3 px-per-pt), so the specimen is not merely "about right". */
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 35, 60, 0.18);
}
.pnm-preview span {
  display: block;
  width: 100%;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.3;
}

.pnm-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.pnm-row-top { align-items: flex-start; }
.pnm-lbl {
  flex: 0 0 54px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: #6b7a90;
}

.pnm-shapes { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pnm-shape {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  font: inherit;
  font-size: 12.5px;
  color: #35455e;
  background: #fff;
  border: 1px solid #dce4ef;
  border-radius: 9px;
  cursor: pointer;
}
.pnm-shape:hover { border-color: #b9cdf7; }
.pnm-shape.is-on {
  background: #eef4ff;
  border-color: #9db8f0;
  color: #2563eb;
  font-weight: 650;
}
/* The shape chips draw their outline in currentColor, so the pressed one
   shows the shape it means. */
.pnm-shape-ic {
  width: 18px;
  height: 11px;
  display: inline-block;
  background: currentColor;
  opacity: 0.85;
}
.pnm-ic-rounded { border-radius: 4px; }
.pnm-ic-square { border-radius: 1px; }
.pnm-ic-circle { border-radius: 50%; }
.pnm-ic-pill { border-radius: 999px; }

.pnm-colors { display: inline-flex; gap: 5px; }
.pnm-c {
  width: 20px; height: 20px; padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(15, 35, 60, 0.18);
  background: var(--c, #FFD500);
  cursor: pointer;
}
.pnm-c.is-on { outline: 2px solid #2563eb; outline-offset: 2px; }
.pnm-pick { display: inline-flex; }
.pnm-pick input[type=color],
.pnm-row input[type=color] {
  width: 30px; height: 26px; padding: 2px;
  border: 1px solid #dce4ef; border-radius: 7px; background: #fff;
  cursor: pointer;
}

.pnm-seg { display: inline-flex; gap: 4px; }
.pnm-b, .pnm-w {
  min-width: 28px; height: 27px; padding: 0 7px;
  font: inherit; font-size: 12.5px;
  color: #35455e; background: #fff;
  border: 1px solid #dce4ef; border-radius: 7px; cursor: pointer;
}
.pnm-b:hover, .pnm-w:hover { border-color: #b9cdf7; }
.pnm-b.is-on, .pnm-w.is-on {
  background: #eef4ff; border-color: #9db8f0; color: #2563eb; font-weight: 700;
}
.pnm-w.is-off { opacity: 0.4; }
.pnm-none {
  padding: 5px 9px; font: inherit; font-size: 12px;
  color: #52627a; background: #fff;
  border: 1px solid #dce4ef; border-radius: 8px; cursor: pointer;
}
.pnm-none:hover { border-color: #f0b4ae; color: #b3261e; }

.pnm-row select,
.pnm-row input[type=text],
.pnm-row textarea {
  font: inherit;
  font-size: 13px;
  color: #10213d;
  background: #fff;
  border: 1px solid #dce4ef;
  border-radius: 8px;
  padding: 6px 8px;
}
.pnm-row select { height: 29px; padding: 0 6px; }
.pnm-row textarea { flex: 1 1 220px; min-height: 62px; resize: vertical; line-height: 1.45; }
.pnm-row input[type=text] { flex: 1 1 160px; }

.pnm-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px 15px;
  border-top: 1px solid #eef2f8;
}
.pnm-error { margin: 0; font-size: 12.5px; color: #b3261e; }
.pnm-actions { display: inline-flex; gap: 8px; margin-left: auto; }
.pnm-btn {
  height: 34px; padding: 0 14px;
  font: inherit; font-size: 13px;
  color: #35455e; background: #fff;
  border: 1px solid #dce4ef; border-radius: 9px; cursor: pointer;
}
.pnm-btn:hover { border-color: #b9cdf7; }
.pnm-primary {
  color: #fff; background: #2563eb; border-color: #2563eb; font-weight: 650;
}
.pnm-primary:hover { background: #1d4ed8; border-color: #1d4ed8; }

/* "New note" tile at the head of the Custom tab. */
.pwn-new {
  grid-column: 1 / -1;
  align-self: start;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  color: #2563eb;
  background: #f5f8ff;
  border: 1.5px dashed #b9cdf7;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
}
.pwn-new:hover { background: #eef4ff; border-color: #9db8f0; }
.pwn-new small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 500;
  color: #52627a;
}

@media (max-width: 620px) {
  .pnm-wrap { padding: 8px; }
  .pnm-lbl { flex-basis: 100%; }
}
