:root {
  --bg-paper: #f7f3ec;
  --bg-card: rgba(255, 253, 249, 0.92);
  --ink-main: #2a2420;
  --ink-soft: #645a52;
  --ink-muted: #93877d;
  --border-warm: rgba(120, 95, 70, 0.15);
  --accent: #d96b43;
  --accent-hover: #c55831;
  --accent-soft: #ffece4;
  --shadow-paper: 0 10px 26px -12px rgba(72, 48, 28, 0.14), 0 2px 6px rgba(72, 48, 28, 0.06);
  --shadow-hover: 0 18px 34px -12px rgba(72, 48, 28, 0.22), 0 4px 12px rgba(72, 48, 28, 0.08);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* 5 Pastel Sticky Note Palettes */
  --note-coral-bg: #fff1ee;
  --note-coral-bd: #f4c2ba;
  --note-coral-tape: rgba(232, 128, 110, 0.28);

  --note-butter-bg: #fff9e4;
  --note-butter-bd: #eed78e;
  --note-butter-tape: rgba(226, 184, 68, 0.28);

  --note-mint-bg: #ecf8f1;
  --note-mint-bd: #a7dcbe;
  --note-mint-tape: rgba(88, 182, 130, 0.24);

  --note-sky-bg: #eef6ff;
  --note-sky-bd: #b5d5f7;
  --note-sky-tape: rgba(102, 160, 228, 0.26);

  --note-lavender-bg: #f4f0ff;
  --note-lavender-bd: #cec1f6;
  --note-lavender-tape: rgba(152, 128, 224, 0.25);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  color: var(--ink-main);
  background-color: var(--bg-paper);
  background-image: radial-gradient(rgba(125, 102, 80, 0.13) 1px, transparent 1px);
  background-size: 22px 22px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.ambient-glow {
  position: fixed;
  inset: 0 0 auto 0;
  height: 360px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(45% 80% at 15% 0%, rgba(255, 203, 182, 0.35), transparent 70%),
    radial-gradient(45% 80% at 55% 0%, rgba(255, 232, 165, 0.32), transparent 70%),
    radial-gradient(45% 80% at 88% 0%, rgba(183, 232, 206, 0.3), transparent 70%);
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1260px;
  margin: 0 auto;
  padding: 28px 22px 48px;
}

/* Buttons & Inputs */
button,
input,
textarea,
select {
  font-family: inherit;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 11px 22px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 18px -6px rgba(217, 107, 67, 0.55);
  transition: transform 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px -6px rgba(217, 107, 67, 0.6);
}

.btn-primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.btn-plus {
  font-size: 1.1rem;
  line-height: 1;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--border-warm);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-ghost:hover {
  background: #fff;
  color: var(--ink-main);
  border-color: rgba(120, 95, 70, 0.3);
}

.btn-admin.is-unlocked {
  background: #eaf8f0;
  border-color: #93d4b0;
  color: #1f6b45;
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid #f0b6b0;
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff0ee;
  color: #b43427;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-danger:hover {
  background: #ffe1dd;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* Doc Hero Card */
.doc-hero {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 26px 30px 24px;
  box-shadow: var(--shadow-paper);
}

.hero-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cat-emblem {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 16px;
  background: #fff3ea;
  border: 1px solid #ecc6b4;
  color: var(--accent);
  display: grid;
  place-items: center;
  padding: 7px;
  box-shadow: 0 4px 12px rgba(217, 107, 67, 0.12);
}

.cat-emblem svg {
  width: 100%;
  height: 100%;
}

.hero-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #ecf8f1;
  border: 1px solid #bae5cc;
  color: #216e47;
  font-size: 0.76rem;
  font-weight: 600;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ab46e;
  box-shadow: 0 0 0 3px rgba(42, 180, 110, 0.22);
}

.doc-tag {
  font-size: 0.76rem;
  color: var(--ink-muted);
  background: rgba(120, 95, 70, 0.08);
  padding: 2px 9px;
  border-radius: 999px;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.hero-intro {
  margin: 16px 0 18px;
  max-width: 860px;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.75;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--border-warm);
  font-size: 0.84rem;
}

.stat-label {
  color: var(--ink-soft);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--ink-main);
}

.stat-bug {
  background: rgba(255, 241, 238, 0.78);
  border-color: var(--note-coral-bd);
}

.stat-improve {
  background: rgba(255, 249, 228, 0.82);
  border-color: var(--note-butter-bd);
}

.stat-feature {
  background: rgba(236, 248, 241, 0.82);
  border-color: var(--note-mint-bd);
}

/* Toolbar */
.toolbar {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: rgba(255, 253, 249, 0.84);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px -8px rgba(72, 48, 28, 0.14);
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-tab:hover {
  background: rgba(120, 95, 70, 0.07);
  color: var(--ink-main);
}

.cat-tab.active {
  background: var(--ink-main);
  color: #fff;
}

.tab-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(120, 95, 70, 0.11);
}

.cat-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 11px;
  color: var(--ink-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.search-box input {
  width: 195px;
  border: 1px solid var(--border-warm);
  border-radius: 999px;
  padding: 7px 12px 7px 29px;
  background: #fff;
  color: var(--ink-main);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s ease, width 0.2s ease;
}

.search-box input:focus {
  border-color: var(--accent);
  width: 225px;
}

.select-pill {
  border: 1px solid var(--border-warm);
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.84rem;
  outline: none;
  cursor: pointer;
}

.segmented {
  display: inline-flex;
  background: rgba(120, 95, 70, 0.08);
  padding: 3px;
  border-radius: 999px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg-btn.active {
  background: #fff;
  color: var(--ink-main);
  box-shadow: 0 2px 6px rgba(72, 48, 28, 0.1);
}

/* Sticky Note Wall */
.board-main {
  margin-top: 26px;
}

.notes-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px 20px;
  align-items: start;
}

/* Sticky Note Card */
.note-card {
  --note-bg: var(--note-butter-bg);
  --note-bd: var(--note-butter-bd);
  --note-tape: var(--note-butter-tape);

  position: relative;
  display: flex;
  flex-direction: column;
  gap: 11px;
  background: var(--note-bg);
  border: 1px solid var(--note-bd);
  border-radius: 16px;
  padding: 22px 18px 15px;
  box-shadow:
    0 12px 24px -14px rgba(64, 42, 22, 0.25),
    0 3px 8px -2px rgba(64, 42, 22, 0.08);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}

.note-card[data-color="coral"] {
  --note-bg: var(--note-coral-bg);
  --note-bd: var(--note-coral-bd);
  --note-tape: var(--note-coral-tape);
}

.note-card[data-color="butter"] {
  --note-bg: var(--note-butter-bg);
  --note-bd: var(--note-butter-bd);
  --note-tape: var(--note-butter-tape);
}

.note-card[data-color="mint"] {
  --note-bg: var(--note-mint-bg);
  --note-bd: var(--note-mint-bd);
  --note-tape: var(--note-mint-tape);
}

.note-card[data-color="sky"] {
  --note-bg: var(--note-sky-bg);
  --note-bd: var(--note-sky-bd);
  --note-tape: var(--note-sky-tape);
}

.note-card[data-color="lavender"] {
  --note-bg: var(--note-lavender-bg);
  --note-bd: var(--note-lavender-bd);
  --note-tape: var(--note-lavender-tape);
}

/* Washi tape strip */
.note-card::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 68px;
  height: 18px;
  transform: translateX(-50%) rotate(-1.8deg);
  background: var(--note-tape);
  backdrop-filter: blur(2px);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.notes-wall .note-card:nth-child(6n + 1) { transform: rotate(-0.85deg); }
.notes-wall .note-card:nth-child(6n + 2) { transform: rotate(0.65deg); }
.notes-wall .note-card:nth-child(6n + 3) { transform: rotate(-0.4deg); }
.notes-wall .note-card:nth-child(6n + 4) { transform: rotate(0.85deg); }
.notes-wall .note-card:nth-child(6n + 5) { transform: rotate(-0.6deg); }
.notes-wall .note-card:nth-child(6n + 6) { transform: rotate(0.3deg); }

.notes-wall .note-card:nth-child(even)::before {
  transform: translateX(-50%) rotate(2.1deg);
}

.note-card:hover {
  transform: translateY(-4px) rotate(0deg) !important;
  box-shadow: var(--shadow-hover);
  z-index: 2;
}

.note-card:focus {
  outline: none;
}

.note-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.note-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.4;
}

.badge-bug {
  background: rgba(217, 78, 65, 0.12);
  color: #a83226;
}

.badge-improve {
  background: rgba(196, 134, 15, 0.14);
  color: #8a5b05;
}

.badge-feature {
  background: rgba(34, 139, 86, 0.13);
  color: #1c6b42;
}

.badge-pin {
  background: rgba(217, 107, 67, 0.16);
  color: #9f3e1d;
}

.badge-status-planned {
  background: rgba(59, 130, 246, 0.14);
  color: #1d57b8;
}

.badge-status-progress {
  background: rgba(139, 92, 246, 0.15);
  color: #5b2fc2;
}

.badge-status-done {
  background: rgba(22, 163, 74, 0.15);
  color: #166534;
}

.badge-status-wontfix {
  background: rgba(107, 114, 128, 0.15);
  color: #4b5563;
}

.badge-status-open {
  background: rgba(120, 95, 70, 0.1);
  color: var(--ink-soft);
}

.note-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
}

.note-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.42;
  color: var(--ink-main);
  word-break: break-word;
}

.note-body {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed rgba(120, 95, 70, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.note-author-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.author-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(42, 36, 32, 0.1);
  color: var(--ink-main);
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.author-name {
  color: var(--ink-soft);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 96px;
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.vote-btn,
.comment-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(120, 95, 70, 0.18);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.vote-btn:hover,
.comment-pill:hover {
  background: #fff;
  color: var(--ink-main);
}

.vote-btn.voted {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.vote-btn-lg {
  padding: 7px 15px;
  font-size: 0.88rem;
}

/* 3-Column Kanban View */
.notes-kanban {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.kanban-col {
  background: rgba(255, 253, 249, 0.75);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: 240px;
}

.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-warm);
}

.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.96rem;
}

.kanban-count {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(120, 95, 70, 0.1);
  color: var(--ink-soft);
}

.col-add-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-warm);
  background: #fff;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.col-add-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.kanban-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.kanban-empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--ink-muted);
  font-size: 0.86rem;
  border: 1px dashed rgba(120, 95, 70, 0.2);
  border-radius: 12px;
}

/* Empty & Loading */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  background: rgba(255, 253, 249, 0.75);
  border: 1px dashed var(--border-warm);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.empty-state h3 {
  margin: 0 0 6px;
}

.empty-state p {
  margin: 0 0 18px;
  color: var(--ink-soft);
}

/* Footer */
.site-footer {
  margin-top: 40px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(34, 26, 20, 0.45);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 18px;
  overflow-y: auto;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(100%, 560px);
  max-height: 90vh;
  overflow-y: auto;
  background: #fffdf9;
  border: 1px solid var(--border-warm);
  border-radius: 22px;
  padding: 24px 26px;
  box-shadow: 0 28px 60px -15px rgba(24, 15, 8, 0.35);
  animation: popIn 0.18s ease-out;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-detail {
  width: min(100%, 640px);
  padding-top: 28px;
}

.modal-detail[data-color="coral"] { background: var(--note-coral-bg); border-color: var(--note-coral-bd); }
.modal-detail[data-color="butter"] { background: var(--note-butter-bg); border-color: var(--note-butter-bd); }
.modal-detail[data-color="mint"] { background: var(--note-mint-bg); border-color: var(--note-mint-bd); }
.modal-detail[data-color="sky"] { background: var(--note-sky-bg); border-color: var(--note-sky-bd); }
.modal-detail[data-color="lavender"] { background: var(--note-lavender-bg); border-color: var(--note-lavender-bd); }

.detail-tape {
  position: absolute;
  top: 0;
  left: 50%;
  width: 96px;
  height: 14px;
  transform: translateX(-50%);
  background: rgba(120, 95, 70, 0.15);
  border-radius: 0 0 6px 6px;
}

.modal-admin {
  width: min(100%, 440px);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(120, 95, 70, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  cursor: pointer;
  flex-shrink: 0;
}

.modal-close:hover {
  background: #fff;
  color: var(--ink-main);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.char-counter {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 400;
}

.field-group input,
.field-group textarea {
  width: 100%;
  border: 1px solid rgba(120, 95, 70, 0.24);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink-main);
  font-size: 0.93rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.field-group input:focus,
.field-group textarea:focus {
  border-color: var(--accent);
}

.cat-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cat-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1.5px solid var(--border-warm);
  background: #fff;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-choice.active[data-cat="bug"] {
  background: var(--note-coral-bg);
  border-color: #df7768;
  color: #9e2d22;
}

.cat-choice.active[data-cat="improve"] {
  background: var(--note-butter-bg);
  border-color: #d3a735;
  color: #805304;
}

.cat-choice.active[data-cat="feature"] {
  background: var(--note-mint-bg);
  border-color: #4faa76;
  color: #18623c;
}

.color-picker,
.admin-color-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.12);
  cursor: pointer;
  position: relative;
  transition: transform 0.14s ease;
}

.color-swatch:hover {
  transform: scale(1.08);
}

.color-swatch.active {
  border-color: var(--ink-main);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink-main);
}

.swatch-coral { background: #ffd7cf; }
.swatch-butter { background: #fde9a6; }
.swatch-mint { background: #bfead1; }
.swatch-sky { background: #c5e0fd; }
.swatch-lavender { background: #dad0fc; }

.modal-footer {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Detail Modal Content */
.detail-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-title {
  margin: 0 0 8px;
  font-size: 1.32rem;
  line-height: 1.4;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.83rem;
  color: var(--ink-muted);
  margin-bottom: 16px;
}

.detail-content {
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(120, 95, 70, 0.14);
  border-radius: 14px;
  padding: 15px 16px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.96rem;
  line-height: 1.72;
  color: var(--ink-main);
}

.detail-actions {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Admin Bar */
.admin-controls {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(42, 36, 32, 0.25);
}

.admin-controls-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.admin-controls-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-field {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.admin-field select {
  border: 1px solid var(--border-warm);
  border-radius: 8px;
  padding: 4px 8px;
  background: #fff;
  font-size: 0.82rem;
}

.admin-color-dots .color-swatch {
  width: 22px;
  height: 22px;
}

.admin-desc {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

/* Comments */
.comments-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed rgba(120, 95, 70, 0.22);
}

.comments-heading {
  margin: 0 0 12px;
  font-size: 0.96rem;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.comment-item {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(120, 95, 70, 0.14);
  border-radius: 12px;
  padding: 10px 13px;
}

.comment-item.is-admin {
  background: rgba(255, 255, 255, 0.9);
  border-color: #9ed7b7;
}

.comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 0.8rem;
}

.comment-author-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-author {
  font-weight: 700;
  color: var(--ink-main);
}

.badge-official {
  background: #e3f6eb;
  color: #1b6941;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
}

.comment-time {
  color: var(--ink-muted);
}

.comment-delete-btn {
  border: none;
  background: transparent;
  color: #b43427;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0 4px;
}

.comment-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

.comments-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.comment-inputs input,
.comment-inputs textarea {
  width: 100%;
  border: 1px solid rgba(120, 95, 70, 0.22);
  border-radius: 10px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.88rem;
  outline: none;
}

.comment-inputs input:focus,
.comment-inputs textarea:focus {
  border-color: var(--accent);
  background: #fff;
}

.comment-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comment-admin-hint {
  font-size: 0.78rem;
  color: #1f6b45;
  font-weight: 600;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 90;
  background: #2a2420;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 980px) {
  .notes-kanban {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .page-shell {
    padding: 16px 14px 36px;
  }

  .doc-hero {
    padding: 20px 18px;
  }

  .search-box,
  .search-box input,
  .search-box input:focus {
    width: 100%;
  }

  .toolbar-controls {
    width: 100%;
  }

  .cat-picker {
    grid-template-columns: 1fr;
  }

  .modal-card {
    padding: 20px 18px;
  }
}
