:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-border: rgba(0, 0, 0, 0.1);
  --text: #070707;
  --muted: #4d4d4d;
  --accent: #00f5a0;
  --accent-strong: #00d48a;
  --accent-soft: rgba(0, 245, 160, 0.16);
  --success: #009f69;
  --danger: #d23131;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
  --font-display: "Segoe UI", "Aptos", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 360px;
  max-height: 580px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 245, 160, 0.55) #ffffff;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
}

body::-webkit-scrollbar {
  width: 8px;
}

body::-webkit-scrollbar-track {
  background: #ffffff;
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 245, 160, 0.78), rgba(0, 212, 138, 0.68));
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(0, 245, 160, 0.92), rgba(0, 212, 138, 0.8));
}

.popup {
  padding: 18px;
}

.popup__header,
.editor-shell,
.popup__actions,
.notes-panel,
.popup__footer {
  width: 100%;
}

.popup__header {
  margin-bottom: 14px;
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
  text-align: center;
}

.editor-shell {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.editor-shell__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--muted);
}

.editor-shell__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.save-status {
  color: var(--success);
  font-weight: 600;
}

.save-status.is-error {
  color: var(--danger);
}

.editor {
  min-height: 220px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 247, 247, 0.94));
  border: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.editor:focus {
  border-color: rgba(0, 245, 160, 0.5);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.editor:empty::before {
  content: attr(data-placeholder);
  color: #9f8d75;
}

.popup__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  margin-bottom: 14px;
}

.popup__footer {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.footer-link {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

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

.popup__footer-group {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 2px;
  margin-bottom: 2px;
}

.notes-panel {
  margin-top: 0;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 18px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.notes-list__row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.notes-list__item,
.notes-list__empty {
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.notes-list__item {
  flex: 1;
  text-align: left;
  cursor: pointer;
}

.notes-list__item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 13px;
}

.notes-list__item span,
.notes-list__empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.notes-list__item:hover {
  border-color: rgba(0, 245, 160, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.notes-list__link-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  cursor: pointer;
  transition: box-shadow 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.notes-list__link-button:hover {
  border-color: rgba(0, 245, 160, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
  transform: translateY(-1px);
}

.notes-list__link-button:active {
  transform: translateY(0);
}

.notes-list__link-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.ghost-button {
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #0d0d0d;
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(0, 245, 160, 0.18);
  text-shadow: 0 0 10px rgba(0, 245, 160, 0.18);
  border-radius: 999px;
  padding: 8px 12px;
  margin-top: 2px;
  margin-bottom: 2px;
  font: inherit;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.ghost-button--small {
  padding: 6px 10px;
  font-size: 12px;
}

.ghost-button:hover {
  background: #151515;
  box-shadow: inset 0 0 0 1px rgba(0, 245, 160, 0.42), 0 0 18px rgba(0, 245, 160, 0.14);
  transform: translateY(-1px);
}

.ghost-button:active {
  transform: translateY(0);
}

.ghost-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
