﻿:root {
  --bg: #f4ecd8;
  --panel: #fffcf0;
  --panel-border: #d7cbb5;
  --text: hsl(260, 5%, 11%);
  --muted: #6e6553;
  --button-bg: #004080;
  --button-text: #fffdf8;
  --editor-fg: #133ecb;
  --line-color: rgba(0, 43, 89, 0.1);
  --active-line-color: rgba(0, 43, 89, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100dvh;
  padding: 10px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: var(--panel);
}

.note-window {
  height: calc(100dvh - 20px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(80, 61, 20, 0.12);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.topbar h1 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 600;
}

.menu-wrap {
  position: relative;
}

.menu-btn {
  border: 1px solid #ccb982;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1;
  padding: 3px 8px 5px;
  cursor: pointer;
}

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 182px;
  background: #fff;
  border: 1px solid #d8ca9a;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(80, 61, 20, 0.15);
  padding: 6px;
  z-index: 20;
}

.menu[hidden] {
  display: none !important;
}

.palette-menu {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.swatch {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid #b6aa88;
  cursor: pointer;
  padding: 0;
}

.swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px #6d5b34;
}

.swatch-notes-sepia { background: #ebe3c7; }
.swatch-cream { background: #fff8de; }
.swatch-mint { background: #f4fff7; }
.swatch-sky { background: #f2f8ff; }
.swatch-peach { background: #fff4ee; }
.swatch-lavender { background: #f8f4ff; }
.swatch-lemon { background: #fffbdc; }
.swatch-rose { background: #fff0f2; }

.menu-divider {
  grid-column: 1 / -1;
  height: 1px;
  background: #e1d5b4;
  margin: 4px 0 2px;
}

.menu-action {
  grid-column: 1 / -1;
  border: 1px solid #ccb982;
  border-radius: 8px;
  background: #fff9e8;
  color: var(--text);
  font-size: 0.78rem;
  padding: 6px 8px;
  cursor: pointer;
  text-align: left;
}

.menu-action:hover {
  background: #fff3ce;
}

.missing-note {
  font-size: 0.82rem;
  color: #8a5a4f;
}

.note-text {
  width: 100%;
  flex: 1;
  min-height: 0;
  resize: none;
  border: none;
  border-radius: 8px;
  outline: none;
  background-color: transparent;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(1.45em - 1px),
    var(--active-line-color) calc(1.45em - 1px),
    var(--active-line-color) 1.45em
  );
  background-attachment: local;
  color: var(--editor-fg);
  font-size: 0.96rem;
  line-height: 1.45;
  padding: 2px;
}

.note-text:disabled {
  color: var(--muted);
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 12px;
  background: var(--button-bg);
  color: var(--button-text);
  font-size: 0.82rem;
  cursor: pointer;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.button:hover:not(:disabled) {
  filter: brightness(1.06);
}

.status {
  margin-left: auto;
  font-size: 0.76rem;
  color: var(--muted);
  min-height: 1em;
}
