.temporary-notes {
  position: relative;
  z-index: 40;
}

.temporary-notes summary {
  list-style: none;
}

.temporary-notes summary::-webkit-details-marker {
  display: none;
}

.temporary-notes-trigger {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 5px 9px 5px 6px;
  border: 1px dashed var(--portal-line-strong);
  border-radius: 999px;
  background: var(--portal-panel);
  color: var(--portal-soft);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 730;
  white-space: nowrap;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.temporary-notes-trigger:hover,
.temporary-notes[open] .temporary-notes-trigger {
  border-color: var(--portal-text);
  background: var(--portal-panel-strong);
  color: var(--portal-text);
}

.temporary-notes-kicker {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--portal-text);
  color: var(--portal-bg);
  font-size: 0.61rem;
  font-weight: 840;
  letter-spacing: 0.08em;
}

.temporary-notes-trigger > strong {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid var(--portal-line-strong);
  border-radius: 50%;
  font-size: 0.65rem;
}

.temporary-notes-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: min(430px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--portal-line-strong);
  border-radius: 18px;
  background: var(--portal-panel-strong);
  box-shadow: var(--portal-shadow);
  color: var(--portal-text);
}

.temporary-notes-panel::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 31px;
  width: 11px;
  height: 11px;
  border-top: 1px solid var(--portal-line-strong);
  border-left: 1px solid var(--portal-line-strong);
  background: var(--portal-panel-strong);
  transform: rotate(45deg);
}

.temporary-notes-panel header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--portal-line);
}

.temporary-notes-panel header div {
  display: grid;
  gap: 4px;
}

.temporary-notes-panel small,
.temporary-notes-panel header > span {
  color: var(--portal-muted);
  font-size: 0.67rem;
  font-weight: 720;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.temporary-notes-panel h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.temporary-notes-panel header > span {
  padding: 5px 8px;
  border: 1px dashed var(--portal-line-strong);
  border-radius: 999px;
  white-space: nowrap;
}

.temporary-notes-panel ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: temporary-note;
}

.temporary-notes-panel li {
  position: relative;
  display: grid;
  gap: 7px;
  padding: 18px 0 18px 42px;
  border-bottom: 1px solid var(--portal-line);
  counter-increment: temporary-note;
}

.temporary-notes-panel li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.temporary-notes-panel li::before {
  content: counter(temporary-note, decimal-leading-zero);
  position: absolute;
  top: 18px;
  left: 0;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--portal-line-strong);
  border-radius: 50%;
  color: var(--portal-muted);
  font-size: 0.65rem;
  font-weight: 760;
}

.temporary-notes-panel li strong {
  font-size: 0.86rem;
}

.temporary-notes-panel li p {
  margin: 0;
  color: var(--portal-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

@media (max-width: 780px) {
  .temporary-notes-label { display: none; }
  .temporary-notes-trigger { gap: 5px; padding-right: 6px; }
  .temporary-notes-panel {
    position: fixed;
    top: 70px;
    right: 16px;
    left: 16px;
    width: auto;
    max-height: calc(100vh - 88px);
    overflow-y: auto;
  }
  .temporary-notes-panel::before { right: 126px; }
  .temporary-notes-panel header > span { display: none; }
}
