@import url('https://fonts.googleapis.com/css2?family=Tiny5&display=swap');

:root {
  --bg: #14150e;
  --surface: #1c1f15;
  --surface2: #262b1a;
  --accent: darkolivegreen;
  --accent-hover: #6b8735;
  --danger: #b33a3a;
  --success: #7a9d3f;
  --text: #e8e6d4;
  --text-muted: #93916f;
  --border: #3a3f28;
  --input-bg: #0c0d08;
  --radius: 0px;
  --shadow: 3px 3px 0 rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; }

body {
  font-family: 'Tiny5', 'Courier New', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  letter-spacing: .02em;
  line-height: 1.6;
}

img { image-rendering: pixelated; }

/* CRT scanline overlay, ported from https://codepen.io/ynef/pen/yvvyGv: a static repeating
   scanline texture with a stepped "roll" flicker, plus a single dark band continuously sweeping
   the screen like a CRT retrace beam. Ported as body pseudo-elements (no extra markup needed)
   and animated via `transform` rather than `top`/`background-position` snapping, so both stay
   GPU-composited instead of forcing layout/paint every frame. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 4px, rgba(0, 0, 0, .3) 4px, rgba(0, 0, 0, .3) 8px);
  z-index: 9999;
  animation: crt-roll 1.4s steps(60) infinite;
}

/* Two beams, half a cycle apart and offset by one scanline step, so as one exits at the top
   the other is already mid-screen — a single beam left a long visible gap where it only
   "spawned" at the top once per whole cycle. */
body::before {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: rgba(0, 0, 0, .3);
  opacity: .75;
  pointer-events: none;
  z-index: 10000;
  animation: crt-sweep 6s linear infinite;
}

html::before {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  top: -8px;
  height: 4px;
  background: rgba(0, 0, 0, .3);
  opacity: .75;
  pointer-events: none;
  z-index: 10000;
  animation: crt-sweep 6s linear infinite;
  animation-delay: -3s;
}

@keyframes crt-roll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(0, 8px, 0); }
}

@keyframes crt-sweep {
  0% { transform: translate3d(0, 100vh, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

/* Toggled from the nav profile dropdown; preference persisted client-side (localStorage), not
   server state, so it's a pure CSS kill-switch on the three pseudo-elements above. */
.crt-off body::after,
.crt-off body::before,
html.crt-off::before {
  display: none;
}

::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: var(--surface); border-left: 2px solid var(--border); }
::-webkit-scrollbar-thumb { background: var(--accent); border: 2px solid var(--border); }
::-webkit-scrollbar-thumb:hover { background: var(--accent-hover); }

a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
nav {
  background: var(--surface);
  border-bottom: 3px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: .06em;
  text-shadow: 2px 2px 0 #000;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0;
  border: 2px solid var(--border);
  background: var(--surface2);
}

.nav-username { font-weight: 600; font-size: 1.05rem; }

/* Plain-text nav items (not button-styled) — Compendium, the "More" trigger, etc. */
.nav-link {
  color: var(--text);
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.nav-link:hover { color: var(--accent-hover); text-decoration: none; }

/* Caret marking a nav item as a hover-opened dropdown, not a plain link. */
.nav-caret { font-size: .85rem; transition: none; }
.nav-menu.open .nav-caret, .nav-menu:hover .nav-caret { color: var(--accent-hover); }

/* Generic hoverable nav dropdown — reused for both the profile menu and the "More" menu. Opens
   on hover (CSS) or click (JS toggles .open, for touch/keyboard). `.nav-menu` has its own
   padding-bottom (not a margin on the dropdown) to bridge the gap down to the panel — a gap
   created via the dropdown's own margin sits outside .nav-menu's hoverable box, so the cursor
   drops out of :hover crossing it and the menu snaps shut before you can reach it. */
.nav-menu { position: relative; padding-bottom: .6rem; margin-bottom: -.6rem; }

.nav-menu-trigger {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .4rem;
  z-index: 200;
}
.nav-menu:hover .nav-dropdown,
.nav-menu.open .nav-dropdown {
  display: block;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  width: 100%;
  padding: .55rem .6rem;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--text);
  font-family: inherit;
  font-size: .85rem;
  text-align: left;
  cursor: pointer;
}
.nav-dropdown-item:hover { background: var(--surface2); text-decoration: none; }

.nav-dropdown-section {
  padding: .4rem .6rem 0;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}

.nav-dropdown-divider { height: 2px; background: var(--border); margin: .4rem 0; }

/* Layout */
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
}

h1 { font-size: 1.9rem; margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: .05em; text-shadow: 2px 2px 0 #000; }
h2 { font-size: 1.3rem; margin-bottom: 1rem; }
h3 { font-size: 1.1rem; margin-bottom: .5rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem 1.1rem;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  border: 2px solid #000;
  box-shadow: var(--shadow);
  transition: none;
}
.btn:active { box-shadow: none; transform: translate(3px, 3px); }
.btn:hover { text-decoration: none; }

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

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c03537; }

.btn-ghost {
  background: var(--surface);
  color: var(--text-muted);
  border: 2px solid var(--border);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }
.btn-ghost:active { transform: none; }

.btn-sm { padding: .35rem .7rem; font-size: .78rem; }

/* Cards */
.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
}

/* Server grid */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.server-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  text-align: center;
  transition: none;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}
.server-card:hover {
  border-color: var(--accent);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .6);
  transform: translate(-2px, -2px);
  text-decoration: none;
}

.server-icon {
  width: 64px;
  height: 64px;
  border-radius: 0;
  border: 2px solid var(--border);
  background: var(--surface2);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
}

.server-name { font-weight: 600; font-size: .95rem; }
.server-meta { font-size: .8rem; color: var(--text-muted); }

/* Sheet list */
.sheet-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: .75rem;
  align-items: start;
}

.sheet-item {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 100%;
  transition: none;
}
.sheet-item:hover { border-color: var(--accent); }

.sheet-info { flex: 1; }
.sheet-slot { font-size: .8rem; color: var(--text-muted); margin-bottom: .2rem; text-transform: uppercase; letter-spacing: .04em; }
.sheet-name { font-size: 1.05rem; font-weight: 600; }
.sheet-meta { font-size: .85rem; color: var(--text-muted); margin-top: .15rem; }

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.form-grid.thirds { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-grid.full { grid-template-columns: 1fr; }
.form-grid.search { grid-template-columns: 1fr 2fr auto; }

.form-group { display: flex; flex-direction: column; gap: .4rem; }
.form-group label { font-size: .85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

input, select, textarea {
  background: var(--input-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  padding: .6rem .8rem;
  font-size: .95rem;
  width: 100%;
  transition: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 100px; font-family: inherit; }

/* Ability scores */
.ability-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .75rem;
}

.ability-box {
  background: var(--input-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem .5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
}
.ability-box label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent-hover);
  text-transform: uppercase;
}
.ability-box input {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  padding: .3rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  border-radius: 0;
  width: 100%;
}
.ability-box input:focus { border-bottom-color: var(--accent); }
.ability-mod {
  font-size: .85rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Section headers */
.section {
  margin-top: 2rem;
}
.section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent-hover);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--border);
}

/* Alerts */
.alert {
  padding: .75rem 1rem;
  border: 2px solid var(--danger);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  font-weight: 500;
}
.alert-error { background: rgba(179, 58, 58, .15); color: #ff8080; }

/* Login page */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.login-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 0;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, .6);
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 420px;
  width: 100%;
}
.login-logo { font-size: 3rem; margin-bottom: 1rem; }
.login-card h1 { margin-bottom: .5rem; }
.login-card p { color: var(--text-muted); margin-bottom: 2rem; line-height: 1.5; }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb-sep { color: var(--border); }

/* Flex utils */
.flex { display: flex; }
.gap-sm { gap: .5rem; }
.gap-md { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--text-muted); font-size: .9rem; }

/* Guild sub-nav */
.guild-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}
.guild-tab {
  padding: .6rem 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}
.guild-tab:hover { color: var(--text); text-decoration: none; }
.guild-tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* Compendium category grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.category-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  color: var(--text);
  text-decoration: none;
  transition: none;
}
.category-card:hover { border-color: var(--accent); box-shadow: 5px 5px 0 rgba(0, 0, 0, .6); transform: translate(-2px, -2px); text-decoration: none; }
.category-card-title { font-weight: 700; font-size: 1.05rem; }

/* Badges */
.badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .15rem .5rem;
  border-radius: 0;
  vertical-align: middle;
  margin-left: .5rem;
}
.badge-homebrew { background: rgba(122, 157, 63, .18); color: var(--success); border: 2px solid var(--success); }

/* Stat grid (compendium entry detail) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem 1.5rem;
}
.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-hover); }
.stat-value { font-size: .95rem; }

.entry-body { line-height: 1.6; }
.entry-body p { margin-bottom: .75rem; }
.entry-body h3, .entry-body h4 { margin: 1rem 0 .5rem; color: var(--text); }
.entry-body ul { margin: 0 0 .75rem 1.25rem; }
.entry-body table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: .9rem; }
.entry-body th, .entry-body td { text-align: left; padding: .5rem .75rem; border-bottom: 2px solid var(--border); }
.entry-body th { color: var(--accent-hover); font-weight: 700; }
.mb-1 { margin-bottom: .5rem; }

/* Compendium pickers (sheet editor: race/class/spells/equipment search) */
.picker { position: relative; display: flex; align-items: center; gap: .5rem; }
.picker .picker-input { flex: 1; }
.tag-picker { position: relative; }

.picker-info {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--accent-hover);
  font-size: .8rem;
  font-weight: 700;
  cursor: help;
}

.picker-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 60;
  margin-top: .3rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 260px;
  overflow-y: auto;
  list-style: none;
  padding: .3rem;
}
.picker-suggestions li {
  padding: .5rem .65rem;
  border-radius: 0;
  cursor: pointer;
  font-size: .88rem;
}
.picker-suggestions li:hover { background: var(--surface2); }

.chip-list { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 0;
  padding: .3rem .5rem .3rem .8rem;
  font-size: .85rem;
  cursor: help;
}
.chip button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0 .15rem;
}
.chip button:hover { color: var(--danger); }

.ref-tooltip {
  position: absolute;
  z-index: 300;
  max-width: 320px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .6);
  padding: .75rem .9rem;
  font-size: .85rem;
  pointer-events: none;
}
.ref-tooltip-title { font-weight: 700; margin-bottom: .2rem; }
.ref-tooltip-subtitle { color: var(--accent-hover); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .45rem; }
.ref-tooltip-body { color: var(--text); line-height: 1.45; }

/* Notes tab — modeled after the Dungeoneer's Pack notes page: a borderless file-tree "directory"
   next to a chrome-free writing surface (no boxed cards around the sidebar or the note itself —
   just a single divider between them, like a real document/folder pane rather than a form). */
.notes-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  align-items: start;
  border-top: 2px solid var(--border);
}

.notes-sidebar {
  border-right: 2px solid var(--border);
  padding: 0 .75rem .75rem;
  min-height: 60vh;
}

.notes-sidebar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem .1rem;
  margin: 0 -.75rem .6rem;
  padding-left: .75rem;
  padding-right: .75rem;
  border-bottom: 2px solid var(--border);
}
.notes-sidebar-nav span { font-weight: 700; font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

.notes-sidebar-controls { display: flex; gap: .5rem; }
.notes-sidebar-controls i {
  cursor: pointer;
  font-size: .85rem;
  opacity: .7;
  font-style: normal;
}
.notes-sidebar-controls i:hover { opacity: 1; color: var(--accent-hover); }

.notes-section-label {
  font-weight: 700;
  font-size: .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .3rem .2rem;
  margin-top: .6rem;
}

.notes-tree { list-style: none; user-select: none; }
.notes-tree .notes-tree { margin-left: 1rem; margin-top: .1rem; }
.notes-tree-item { margin-bottom: .05rem; }

.notes-tree-note-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .3rem;
  border-left: 3px solid transparent;
}
.notes-tree-note {
  display: block;
  padding: .25rem .4rem;
  font-size: .85rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.notes-tree-note:hover { color: var(--accent-hover); text-decoration: none; }
.notes-tree-note.active { color: var(--accent-hover); }
.notes-tree-note-row:has(.notes-tree-note.active) { border-left-color: var(--accent); }

.notes-tree-folder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .3rem;
  padding: .25rem .4rem;
  border-left: 3px solid transparent;
}
.notes-tree-folder {
  font-weight: 700;
  font-size: .85rem;
  color: var(--text);
  cursor: pointer;
  flex: 1;
}
.notes-tree-folder:hover { color: var(--accent-hover); }
.notes-tree-folder-icon { display: inline-block; width: 1.1em; color: var(--accent); }

.notes-tree-row-controls { display: flex; gap: .2rem; opacity: 0; flex-shrink: 0; }
.notes-tree-note-row:hover .notes-tree-row-controls,
.notes-tree-folder-row:hover .notes-tree-row-controls { opacity: .6; }
.notes-tree-icon-btn { font-size: .7rem; cursor: pointer; font-style: normal; }
.notes-tree-icon-btn:hover { opacity: 1 !important; }

.notes-tree-folder-row[data-folded="1"] + .notes-tree { display: none; }

/* Drag-and-drop reparenting */
.notes-tree-folder-row, .notes-tree-note-row { cursor: grab; }
.notes-tree-folder-row.dragging, .notes-tree-note-row.dragging { opacity: .4; }
.notes-tree-folder-row.drag-over { background: var(--surface2); outline: 2px dashed var(--accent); outline-offset: -2px; }
.notes-sidebar.drag-over-root { background: var(--surface2); }

.notes-tree-rename-input {
  font-weight: 700;
  font-size: .85rem;
  border: none;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
  background: transparent;
  padding: 0 .1rem;
  flex: 1;
}

.notes-tree-note-owner { font-size: .7rem; color: var(--text-muted); display: block; }

/* Main pane: both the read view and the edit form are always in the DOM; a JS-toggled "editing"
   class on the wrapper picks which is visible — switching modes needs no page navigation/reload.
   No card/box around either — the note reads and edits as plain text on the page itself. */
.notes-content { padding-left: 1.5rem; }

.notes-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 2px solid var(--border);
}
.notes-name-input {
  font-size: 1.4rem;
  font-weight: 700;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  padding: .1rem .1rem;
  width: auto;
  flex: 1;
}
.notes-name-input:focus { border-bottom-color: var(--border); }

.notes-shared-toggle {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--text-muted);
  text-transform: none;
  font-weight: 400;
  white-space: nowrap;
}
.notes-shared-toggle input { width: auto; }

.notes-owner-label { font-size: .85rem; white-space: nowrap; }

.notes-view, .notes-folder-placeholder, .notes-empty {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}
.notes-folder-placeholder, .notes-empty { padding: 2rem 0; text-align: center; }
.notes-main[data-can-edit="1"] .notes-view { cursor: text; }
.notes-main[data-can-edit="1"] .notes-view:hover { outline: 2px dashed var(--border); outline-offset: 4px; }

#note-content {
  border: none;
  background: transparent;
  padding: 0;
  resize: vertical;
  min-height: 300px;
}
#note-content:focus { outline: none; border: none; }

.hidden { display: none !important; }

.notes-hint { font-size: .78rem; margin-bottom: .75rem; }

/* Wiki-links inside note content */
.wiki-link { border-bottom: 2px solid var(--accent-hover); }
.wiki-link-missing { border-bottom: 2px dashed var(--text-muted); color: var(--text-muted); }

/* Live [[ autocomplete dropdown inside the note editor */
.wiki-autocomplete {
  position: absolute;
  z-index: 60;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 220px;
  overflow-y: auto;
  list-style: none;
  padding: .3rem;
  min-width: 220px;
}
.wiki-autocomplete li { padding: .4rem .6rem; border-radius: 0; cursor: pointer; font-size: .85rem; }
.wiki-autocomplete li:hover, .wiki-autocomplete li.active { background: var(--surface2); }

/* Responsive */
@media (max-width: 700px) {
  .form-grid, .form-grid.thirds, .form-grid.search { grid-template-columns: 1fr; }
  .ability-grid { grid-template-columns: repeat(3, 1fr); }
  .notes-layout { grid-template-columns: 1fr; }
  nav { padding: 0 1rem; }
  .container { padding: 1.5rem 1rem; }
}
